diff mbox

[U-Boot,v6,21/31] x86: Enable generic board support

Message ID 1362530405-10824-22-git-send-email-sjg@chromium.org
State Superseded, archived
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass March 6, 2013, 12:39 a.m. UTC
This enables generic board support so that x86 boards can define
CONFIG_SYS_GENERIC_BOARD.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v6: None
Changes in v5:
- Avoid setting up gd on x86 as it is already done

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/x86/config.mk            |  3 ---
 arch/x86/include/asm/u-boot.h | 11 +++++++++++
 arch/x86/lib/Makefile         |  3 +++
 common/board_r.c              |  2 ++
 4 files changed, 16 insertions(+), 3 deletions(-)

Comments

Simon Glass March 11, 2013, 5:36 p.m. UTC | #1
Hi,

On Tue, Mar 5, 2013 at 4:39 PM, Simon Glass <sjg@chromium.org> wrote:

> This enables generic board support so that x86 boards can define
> CONFIG_SYS_GENERIC_BOARD.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v6: None
> Changes in v5:
> - Avoid setting up gd on x86 as it is already done
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  arch/x86/config.mk            |  3 ---
>  arch/x86/include/asm/u-boot.h | 11 +++++++++++
>  arch/x86/lib/Makefile         |  3 +++
>  common/board_r.c              |  2 ++
>  4 files changed, 16 insertions(+), 3 deletions(-)
>

Unfortunately this patch is missing the __HAVE_ARCH_GENERIC_BOARD change,
so I will resend it as v9.

Regards,
Simon
diff mbox

Patch

diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 7be3036..23cacff 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -48,6 +48,3 @@  NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
 PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC))
 
 export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC))
-
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 2f45c7b..19c038a 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -39,6 +39,13 @@ 
 #include <config.h>
 #include <compiler.h>
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
+#ifndef __ASSEMBLY__
+
 typedef struct bd_info {
 	unsigned long	bi_memstart;	/* start of DRAM memory */
 	phys_size_t	bi_memsize;	/* size	 of DRAM memory in bytes */
@@ -60,6 +67,10 @@  typedef struct bd_info {
 	}bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
 
+#endif /* __ASSEMBLY__ */
+
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_I386
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9b24dc5..ee89354 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -25,7 +25,10 @@  include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(ARCH).o
 
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),)
 COBJS-y	+= board.o
+endif
+
 COBJS-y	+= bootm.o
 COBJS-y	+= cmd_boot.o
 COBJS-y	+= gcc.o
diff --git a/common/board_r.c b/common/board_r.c
index 29eccdf..230887d 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -509,11 +509,13 @@  static int show_model_r(void)
 #endif
 
 /* enable exceptions */
+#ifdef CONFIG_ARM
 static int initr_enable_interrupts(void)
 {
 	enable_interrupts();
 	return 0;
 }
+#endif
 
 #ifdef CONFIG_CMD_NET
 static int initr_ethaddr(void)