summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/config.mk3
-rw-r--r--arch/x86/cpu/coreboot/sdram.c1
-rw-r--r--arch/x86/cpu/u-boot.lds4
-rw-r--r--arch/x86/include/asm/config.h1
-rw-r--r--arch/x86/include/asm/sections.h27
-rw-r--r--arch/x86/include/asm/u-boot-x86.h9
-rw-r--r--arch/x86/include/asm/u-boot.h11
-rw-r--r--arch/x86/lib/Makefile3
-rw-r--r--arch/x86/lib/board.c3
-rw-r--r--arch/x86/lib/init_helpers.c3
-rw-r--r--arch/x86/lib/relocate.c9
11 files changed, 56 insertions, 18 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 23cacff..168dc24 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -36,6 +36,9 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86)
PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
PLATFORM_CPPFLAGS += -DREALMODE_BASE=0x7c0
+# Support generic board on x86
+__HAVE_ARCH_GENERIC_BOARD := y
+
PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions
diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index a8136a0..786009c 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -28,6 +28,7 @@
#include <asm/u-boot-x86.h>
#include <asm/global_data.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/arch/sysinfo.h>
#include <asm/arch/tables.h>
diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index ef5aa95..2d6911a 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -53,6 +53,7 @@ SECTIONS
. = ALIGN(4);
__data_end = .;
+ __init_end = .;
. = ALIGN(4);
.dynsym : { *(.dynsym*) }
@@ -64,9 +65,6 @@ SECTIONS
. = ALIGN(4);
_end = .;
- . = ALIGN(4);
-
- __end = .;
.bss __rel_dyn_start (OVERLAY) : {
__bss_start = .;
*(.bss)
diff --git a/arch/x86/include/asm/config.h b/arch/x86/include/asm/config.h
index 049c44e..3961b82 100644
--- a/arch/x86/include/asm/config.h
+++ b/arch/x86/include/asm/config.h
@@ -21,4 +21,5 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_SYS_GENERIC_BOARD
#endif
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
new file mode 100644
index 0000000..602df86
--- /dev/null
+++ b/arch/x86/include/asm/sections.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_X86_SECTIONS_H
+#define __ASM_X86_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 948615d..ae0c388 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -24,15 +24,6 @@
#ifndef _U_BOOT_I386_H_
#define _U_BOOT_I386_H_ 1
-/* Exports from the Linker Script */
-extern ulong __text_start;
-extern ulong __data_end;
-extern ulong __rel_dyn_start;
-extern ulong __rel_dyn_end;
-extern ulong __bss_start;
-extern ulong __bss_end;
-extern ulong _end;
-
/* cpu/.../cpu.c */
int x86_cpu_init_r(void);
int cpu_init_r(void);
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 2f45c7b..df759fa 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 /* !CONFIG_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 9b24dc5f..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/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 2441a66..452e5d8 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -38,6 +38,7 @@
#include <asm/u-boot-x86.h>
#include <asm/relocate.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/init_helpers.h>
#include <asm/init_wrappers.h>
@@ -219,7 +220,7 @@ static void do_init_loop(init_fnc_t **init_fnc_ptr)
void board_init_f(ulong boot_flags)
{
- gd->fdt_blob = gd->arch.new_fdt = NULL;
+ gd->fdt_blob = gd->new_fdt = NULL;
gd->flags = boot_flags;
do_init_loop(init_sequence_f);
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 414fdcc..af9dbc1 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -32,6 +32,7 @@
#include <spi.h>
#include <status_led.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/u-boot-x86.h>
#include <linux/compiler.h>
@@ -111,7 +112,7 @@ int calculate_relocation_address(void)
*/
if (gd->fdt_blob) {
dest_addr -= fdt_size;
- gd->arch.new_fdt = (void *)dest_addr;
+ gd->new_fdt = (void *)dest_addr;
dest_addr &= ~15;
}
#endif
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 3e370f2..f178db9 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -36,6 +36,7 @@
#include <malloc.h>
#include <asm/u-boot-x86.h>
#include <asm/relocate.h>
+#include <asm/sections.h>
#include <elf.h>
int copy_uboot_to_ram(void)
@@ -49,15 +50,15 @@ int copy_uboot_to_ram(void)
int copy_fdt_to_ram(void)
{
- if (gd->arch.new_fdt) {
+ if (gd->new_fdt) {
ulong fdt_size;
fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32);
- memcpy(gd->arch.new_fdt, gd->fdt_blob, fdt_size);
+ memcpy(gd->new_fdt, gd->fdt_blob, fdt_size);
debug("Relocated fdt from %p to %p, size %lx\n",
- gd->fdt_blob, gd->arch.new_fdt, fdt_size);
- gd->fdt_blob = gd->arch.new_fdt;
+ gd->fdt_blob, gd->new_fdt, fdt_size);
+ gd->fdt_blob = gd->new_fdt;
}
return 0;