summaryrefslogtreecommitdiff
path: root/arch/arm/mach-uniphier/dram_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-uniphier/dram_init.c')
-rw-r--r--arch/arm/mach-uniphier/dram_init.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index 13821a9288..5f9d90fe6d 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -248,12 +248,7 @@ int dram_init(void)
max_size = (1ULL << 32) - dram_map[i].base;
- if (dram_map[i].size > max_size) {
- gd->ram_size += max_size;
- break;
- }
-
- gd->ram_size += dram_map[i].size;
+ gd->ram_size = min(dram_map[i].size, max_size);
if (!valid_bank_found)
gd->ram_base = dram_map[i].base;