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>
This commit is contained in:
Doug Anderson 2013-04-30 10:22:00 +00:00 committed by Tom Rini
parent a558ad7113
commit 5e5745465c
1 changed files with 4 additions and 0 deletions

View 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;