]> git.sur5r.net Git - u-boot/commitdiff
fdt_support: Use CONFIG_NR_DRAM_BANKS if defined
authorDoug Anderson <dianders@chromium.org>
Tue, 30 Apr 2013 10:22:00 +0000 (10:22 +0000)
committerTom Rini <trini@ti.com>
Fri, 17 May 2013 18:43:29 +0000 (14:43 -0400)
It appears that there are some cases where we have more than 4 banks
of memory.  Use CONFIG_NR_DRAM_BANKS if it's defined to handle this.
This will take up a little extra stack space (64 bytes extra if we go
up to 8 banks), but that seems OK.

Signed-off-by: Doug Anderson <dianders@chromium.org>
common/fdt_support.c

index 812acb401c176f81976fceb05e637fec024dc91c..416100e394dc92d3c61f143aa807681b1a5c84ce 100644 (file)
@@ -387,7 +387,11 @@ static void write_cell(u8 *addr, u64 val, int size)
        }
 }
 
+#ifdef CONFIG_NR_DRAM_BANKS
+#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
+#else
 #define MEMORY_BANKS_MAX 4
+#endif
 int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
        int err, nodeoffset;