[U-Boot] [PATCH] arm/omap3: limit chip select iteration based on board config

Grant Erickson marathon96 at gmail.com
Thu Dec 22 20:28:13 CET 2011


Only attempt to configure and add DRAM at chip select 1 if the board has configured more than one bank of DRAM.

This prevents boards that have CONFIG_NR_DRAM_BANKS set to 1 from getting an incorrect DRAM size.

Signed-off-by: Grant Erickson <marathon96 at gmail.com>
Cc: Tom Rini <trini at ti.com>
---
 arch/arm/cpu/armv7/omap3/sdrc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/sdrc.c b/arch/arm/cpu/armv7/omap3/sdrc.c
index a27b4b1..4c02214 100644
--- a/arch/arm/cpu/armv7/omap3/sdrc.c
+++ b/arch/arm/cpu/armv7/omap3/sdrc.c
@@ -213,6 +213,7 @@ int dram_init(void)
 	unsigned int size0 = 0, size1 = 0;
 
 	size0 = get_sdr_cs_size(CS0);
+#if CONFIG_NR_DRAM_BANKS > 1
 	/*
 	 * We always need to have cs_cfg point at where the second
 	 * bank would be, if present.  Failure to do so can lead to
@@ -223,6 +224,7 @@ int dram_init(void)
 	make_cs1_contiguous();
 	do_sdrc_init(CS1, NOT_EARLY);
 	size1 = get_sdr_cs_size(CS1);
+#endif
 
 	gd->ram_size = size0 + size1;
 
-- 
1.7.7.3



More information about the U-Boot mailing list