From 8b42dfc3b6a2c9204be2fb1079d235daa1b733fc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Apr 2013 11:22:49 +0000 Subject: [PATCH 1/3] x86: Fix DRAM bank size init with generic board The intention of the memory init code is that it should work the same with CONFIG_SYS_GENERIC_BOARD and without. This is tricky because dram_init() is called prior to relocation with generic board (matching other archs) and after relocation without generic board. Adjust the init sequence so that dram_init() is not called in the generic board case, which seems like the easiest fix for now. Also ensure that relocation addresses are still calculated. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/sdram.c | 7 ++++++- common/board_f.c | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c index 786009c746d..b4fe6c91cfa 100644 --- a/arch/x86/cpu/coreboot/sdram.c +++ b/arch/x86/cpu/coreboot/sdram.c @@ -113,7 +113,7 @@ int dram_init_f(void) return 0; } -int dram_init(void) +int dram_init_banksize(void) { int i, j; @@ -132,3 +132,8 @@ int dram_init(void) } return 0; } + +int dram_init(void) +{ + return dram_init_banksize(); +} diff --git a/common/board_f.c b/common/board_f.c index 769889123b4..32d52150977 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -856,8 +856,7 @@ static init_fnc_t init_sequence_f[] = { #endif #ifdef CONFIG_X86 dram_init_f, /* configure available RAM banks */ - /* x86 would prefer that this happens after relocation */ - dram_init, + calculate_relocation_address, #endif announce_dram_init, /* TODO: unify all these dram functions? */ From 7525c2dac76bd739b8a1673e020031dc4a4934c4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Apr 2013 11:25:20 +0000 Subject: [PATCH 2/3] x86: Allow setup code to manage its own global data Currently x86 has its own means of managing the global data and board data (bd_t), and this code resides in start.S. With generic board, we need to ensure that we leave this alone - i.e. don't clear it as we do on other archs. This fixes a problem where the memory init data is cleared which causes the video driver to operate very slowly. Signed-off-by: Simon Glass --- common/board_f.c | 2 +- common/board_r.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 32d52150977..00ca81126c7 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -755,7 +755,7 @@ static int mark_bootstage(void) static init_fnc_t init_sequence_f[] = { #if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ - !defined(CONFIG_MPC86xx) + !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) zero_global_data, #endif setup_fdt, diff --git a/common/board_r.c b/common/board_r.c index 9605f80a0cb..2b17fa6cfed 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -721,9 +721,6 @@ init_fnc_t init_sequence_r[] = { */ #ifdef CONFIG_CLOCKS set_cpu_clk_info, /* Setup clock information */ -#endif -#ifdef CONFIG_X86 - init_bd_struct_r, #endif initr_reloc_global_data, initr_serial, From 617c246f3c123d4a2d4dba9d08a4a2dd324cb407 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Apr 2013 11:25:21 +0000 Subject: [PATCH 3/3] x86: config: Init PCI before SPI Since the ICH SPI controller uses PCI, we must ensure that PCI is available before it is inited. This fixes the current "ICH SPI: Cannot find device" message on boot. Signed-off-by: Simon Glass --- include/configs/coreboot.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h index a4aa8f74535..5bacc77bb50 100644 --- a/include/configs/coreboot.h +++ b/include/configs/coreboot.h @@ -41,6 +41,7 @@ #define CONFIG_INTEL_CORE_ARCH /* Sandy bridge and ivy bridge chipsets. */ #define CONFIG_ZBOOT_32 #define CONFIG_PHYSMEM +#define CONFIG_SYS_EARLY_PCI_INIT #define CONFIG_LMB #define CONFIG_OF_LIBFDT