[U-Boot] [PATCH 1/3] x86: Fix DRAM bank size init with generic board

Simon Glass sjg at chromium.org
Mon Apr 15 23:22:49 CEST 2013


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 <sjg at chromium.org>
---
 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 786009c..b4fe6c9 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 7698891..32d5215 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? */
-- 
1.8.1.3



More information about the U-Boot mailing list