[U-Boot] [PATCH v2 2/2] km_arm: enable SDRAM window size fixup

Gerlando Falauto gerlando.falauto at keymile.com
Fri Jul 6 13:50:17 CEST 2012


Size of the SDRAM chips might differ between any two (otherwise
identical) instances of the same board.

So change board_early_init_f() to use km_sdram_bs_set(), in order to
fixup the window size register at runtime, according to the detected
SDRAM size.

Signed-off-by: Gerlando Falauto <gerlando.falauto at keymile.com>
Cc: Valentin Longchamp <valentin.longchamp at keymile.com>
Cc: Holger Brunck <holger.brunck at keymile.com>
---
changes for v2:
- rebase to current u-boot-marvell.git master branch

 board/keymile/km_arm/km_arm.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 2b2ca39..24cf6c7 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -241,6 +241,17 @@ int misc_init_r(void)
 	return 0;
 }
 
+static void dram_size_fixup(void)
+{
+	u32 size;
+
+	/* probe currently equipped RAM size */
+	size = get_ram_size((void *)kw_sdram_bar(0), kw_sdram_bs(0));
+
+	/* fixup SDRAM window size accordingly */
+	kw_sdram_bs_set(0, size);
+}
+
 int board_early_init_f(void)
 {
 #if defined(CONFIG_SOFT_I2C)
@@ -251,6 +262,7 @@ int board_early_init_f(void)
 	writel(tmp & (~KM_KIRKWOOD_SOFT_I2C_GPIOS) , KW_GPIO0_BASE + 4);
 #endif
 
+	dram_size_fixup();
 	kirkwood_mpp_conf(kwmpp_config, NULL);
 	return 0;
 }
-- 
1.7.1



More information about the U-Boot mailing list