From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 22/28] x86: Enable generic board support
Date: Thu, 16 Feb 2012 06:49:09 -0800 [thread overview]
Message-ID: <1329403755-6396-23-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1329403755-6396-1-git-send-email-sjg@chromium.org>
This enables generic board support so that x86 boards can define
CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/x86/config.mk | 3 ---
arch/x86/include/asm/global_data.h | 7 +++++++
arch/x86/include/asm/u-boot.h | 11 +++++++++++
arch/x86/lib/Makefile | 4 +++-
common/board_r.c | 5 +++++
5 files changed, 26 insertions(+), 4 deletions(-)
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/global_data.h b/arch/x86/include/asm/global_data.h
index 908a02c..fe50856 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -23,6 +23,11 @@
#ifndef __ASM_GBL_DATA_H
#define __ASM_GBL_DATA_H
+
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified global_data */
+#include <asm-generic/global_data.h>
+#else
/*
* The following data structure is placed in some memory wich is
* available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -86,6 +91,8 @@ static inline gd_t *get_fs_gd_ptr(void)
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index dd42209..ef8b7d5 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -36,6 +36,13 @@
#ifndef _U_BOOT_H_
#define _U_BOOT_H_ 1
+#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 */
@@ -58,6 +65,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 51836da..a2083f4 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -30,7 +30,9 @@ SOBJS-$(CONFIG_SYS_PCI_BIOS) += bios_pci.o
SOBJS-$(CONFIG_SYS_X86_REALMODE) += realmode_switch.o
COBJS-$(CONFIG_SYS_PC_BIOS) += bios_setup.o
-COBJS-y += board.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 d63c138..807aec8 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -56,12 +56,15 @@ static int initr_reloc(void)
* Some of these functions are needed purely because the functions they
* call return void. If we change them to return 0, these stubs can go away.
*/
+#ifdef CONFIG_ARM
static int initr_caches(void)
{
+ /* TODO: sort out x86 code here */
/* Enable caches */
enable_caches();
return 0;
}
+#endif
static int initr_reloc_global_data(void)
{
@@ -232,11 +235,13 @@ static int initr_api(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)
--
1.7.7.3
next prev parent reply other threads:[~2012-02-16 14:49 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 14:48 [U-Boot] [PATCH v3 0/28] Create generic board init for ARM, x86, PPC Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 01/28] arm: Change board baud_rate to ulong Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 02/28] x86: " Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 03/28] arm: Only display frame buffer info if there is LCD/video support Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 04/28] x86: Remove compiler warning in sc520_timer.c Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 05/28] x86: Remove dead code in eNET Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 06/28] x86: Add initial memory barrier macros Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 07/28] ppc: " Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 08/28] Introduce generic global_data Simon Glass
2012-03-06 5:01 ` Mike Frysinger
2012-03-06 6:22 ` Simon Glass
2012-03-06 6:36 ` Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 09/28] Introduce generic u-boot.h file Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 10/28] Introduce generic link symbol file Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 11/28] arm: Use sections header to obtain link symbols Simon Glass
2012-03-06 5:03 ` Mike Frysinger
2012-03-06 6:24 ` Simon Glass
2012-03-06 16:17 ` Mike Frysinger
2012-03-08 6:39 ` Simon Glass
2012-03-11 1:54 ` Mike Frysinger
2012-03-15 3:05 ` Simon Glass
2012-02-16 14:48 ` [U-Boot] [PATCH v3 12/28] x86: Change stub example to use asm-generic/sections.h Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 13/28] Introduce a basic initcall implementation Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 14/28] Define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 15/28] Introduce generic pre-relocation board_f.c Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 16/28] Introduce generic post-relocation board_r.c Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 17/28] Add spl load feature Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 18/28] arm: Enable generic board support Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 19/28] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 20/28] x86: Use sections header to obtain link symbols Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 21/28] Add x86 fields to generic global_data Simon Glass
2012-02-16 14:49 ` Simon Glass [this message]
2012-02-16 14:49 ` [U-Boot] [PATCH v3 23/28] Add ppc fields to generic global data Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 24/28] Adjust board_f for ppc Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 25/28] Adjust board_r.c for PowerPC Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 26/28] ppc: Enable generic board board Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 27/28] tegra: Mark board init files for ARMv4t Simon Glass
2012-02-16 14:49 ` [U-Boot] [PATCH v3 28/28] tegra: Enable generic board for Seaboard Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329403755-6396-23-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox