[U-Boot] [PATCH 07/11] Allow setting CONFIG_NR_DRAM_BANKS to a larger value

rogan at dawes.za.net rogan at dawes.za.net
Fri Mar 18 09:04:56 CET 2011


From: rogan at dawes.za.net <rogan at 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 90b0a9c..e677ce4 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



More information about the U-Boot mailing list