[U-Boot] [PATCH 3/7] Allow setting CONFIG_NR_DRAM_BANKS to a larger value

rogan at dawes.za.net
2011-03-18T08:09:59Z

From: Rogan Dawes <rogan@dawes.za.net>

This allows us to match the exact behaviour of the vendor U-boot in the kernel boot logs
---
arch/arm/cpu/arm926ejs/orion5x/dram.c | 2 +-
common/memsize.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c
index 2ae8f48..f5840ac 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/dram.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c
@@ -44,7 +44,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank)
u32 enable = 0x01 & winregs[bank].size;

if ((!enable) || (bank > BANK3))
- return 0;
+ return -1;

result = winregs[bank].base;
return result;
diff --git a/common/memsize.c b/common/memsize.c
index 6c275c9..85eca54 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -46,6 +46,9 @@ long get_ram_size(volatile long *base, long maxsize)
long size;
int i = 0;

+ if (base == -1)
+ return 0;
+
for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
addr = base + cnt; /* pointer arith! */
sync ();
--
1.7.1