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

login
register
mail settings
Submitter Rogan Dawes
Date March 18, 2011, 8:09 a.m.
Message ID <1300435803-4940-4-git-send-email-rogan@dawes.za.net>
Download mbox | patch
Permalink /patch/87502/
State Rejected
Delegated to: Albert ARIBAUD
Headers show

Comments

Rogan Dawes - March 18, 2011, 8:09 a.m.
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(-)

Patch

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 ();