diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2011-08-17 18:41:40 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:34 -0700 |
commit | 7dc03234a1639185490543dde52267eea8289881 (patch) | |
tree | f26d79d1d8f004a7d47aab12a10521deb52ec9be /arch | |
parent | 9bb9d053a458323dc1f571c02ad50fafb53a70bb (diff) |
Fix device tree corruption problem.
The problem turned out to be due to inconsistent compile flag
settings when compiling the same include file in different .c
files.
BUG=chromium-os:19263
TEST=manual
Build and run coreboot on Alex. It used to crash before this
change in case gd was located at fixed address, it comes to the
u-boot prompt now.
Change-Id: Ia34284630b865ef715f1f6d0061620f1d6643b7b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/6206
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/ic/coreboot/sysinfo.h | 1 | ||||
-rw-r--r-- | arch/x86/lib/board.c | 22 |
2 files changed, 1 insertions, 22 deletions
diff --git a/arch/x86/include/asm/ic/coreboot/sysinfo.h b/arch/x86/include/asm/ic/coreboot/sysinfo.h index e02735346bd..3b324f5b997 100644 --- a/arch/x86/include/asm/ic/coreboot/sysinfo.h +++ b/arch/x86/include/asm/ic/coreboot/sysinfo.h @@ -30,6 +30,7 @@ #ifndef _COREBOOT_SYSINFO_H #define _COREBOOT_SYSINFO_H +#include <common.h> #include <compiler.h> #include <asm/ic/coreboot/tables.h> #ifdef CONFIG_OF_CONTROL diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 2acd7a725e0..30b5df35e28 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -56,17 +56,7 @@ */ #undef XTRN_DECLARE_GLOBAL_DATA_PTR #define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */ -#ifdef CONFIG_OF_CONTROL -/* - * Place it in the initialized data segment, we were started by a bootstrap - * which already intialized memory. - */ -static gd_t gd_before_relocation = { .env_buf = { 0x20 } }; -DECLARE_GLOBAL_DATA_PTR = &gd_before_relocation; -#else -/* place it at a fixed location */ DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); -#endif /* Exports from the Linker Script */ extern ulong __text_start; @@ -271,18 +261,6 @@ void board_init_f(ulong boot_flags) { init_fnc_t **init_fnc_ptr; - /* - * TODO(vbendeb): find the reason for the crash and fix it. Then the - * below two lines will be removed. - * - * This is a hack to work around the problem with the system crashing - * when the gd is located at a fixed address in memory. We use the - * structure located in the .data segment instead, and make it look as - * if it was initialized by the assembler startup code. - */ - memset(gd, 0, sizeof(*gd)); - gd->flags = boot_flags; - for (init_fnc_ptr = init_sequence_f; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0) hang(); |