From 87c3308cbf969f2370a647c6beea26898f0767f8 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 20 Feb 2017 17:13:32 +0900 Subject: [PATCH] ARM: uniphier: skip memreserve of unused DRAM bank of LD20 Now the "for" loop here iterates on the detected memory banks. It must skip unused DRAM banks. Fixes: c995f3a3c526 ("ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC") Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/dram_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index df0e73a941..b9b0cd65bd 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -256,6 +256,9 @@ int ft_board_setup(void *fdt, bd_t *bd) return 0; for (i = 0; i < ARRAY_SIZE(gd->bd->bi_dram); i++) { + if (!gd->bd->bi_dram[i].size) + continue; + rsv_addr = gd->bd->bi_dram[i].start + gd->bd->bi_dram[i].size; rsv_addr -= rsv_size; -- 2.39.5