aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRamon Fried <ramon.fried@gmail.com>2018-08-14 00:35:42 +0300
committerTom Rini <trini@konsulko.com>2018-08-16 16:45:02 -0400
commit6b6f216f9234c33881af05116057c902cb411a62 (patch)
tree0a9e9ca56ca296521b0800b7ece025a4dde04348 /common
parent0bdea7c4301ace5c61120eeeccab4b5c8ee79536 (diff)
downloadu-boot-6b6f216f9234c33881af05116057c902cb411a62.zip
u-boot-6b6f216f9234c33881af05116057c902cb411a62.tar.gz
u-boot-6b6f216f9234c33881af05116057c902cb411a62.tar.bz2
fdt_support: Use CONFIG_NR_DRAM_BANKS if necessary
If CONFIG_NR_DRAM_BANKS is bigger than the default value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS. Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS if defined"") Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Diffstat (limited to 'common')
-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 34d2bd5..d84f5db 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -409,7 +409,11 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf;
}
+#if CONFIG_NR_DRAM_BANKS > 4
+#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;