summaryrefslogtreecommitdiffstats
path: root/common/fdt_support.c
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2013-04-30 10:22:00 +0000
committerTom Rini <trini@ti.com>2013-05-17 14:43:29 -0400
commit5e5745465c94605720295fab942eacbdd215db90 (patch)
tree416a39058e351b5ea42fd871152b448460704043 /common/fdt_support.c
parenta558ad71132fa6061ff950b9d3a12b0dad01b129 (diff)
downloadtalos-obmc-uboot-5e5745465c94605720295fab942eacbdd215db90.tar.gz
talos-obmc-uboot-5e5745465c94605720295fab942eacbdd215db90.zip
fdt_support: Use CONFIG_NR_DRAM_BANKS if defined
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>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r--common/fdt_support.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 812acb401c..416100e394 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -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;
OpenPOWER on IntegriCloud