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

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@gmail.com Cc: Tom Rini trini@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;

On 12/22/2011 12:28 PM, Grant Erickson wrote:
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@gmail.com Cc: Tom Rini trini@ti.com
OK, what problem (and on what board) are you seeing? Many boards only have CS0 populated with DRAM but when we try and configure CS1 the mem_ok() call fails and we don't try and use it, so we don't get a wrong amount of memory. Thanks!
participants (2)
-
Grant Erickson
-
Tom Rini