diff mbox

ARM: uniphier: skip memreserve of unused DRAM bank of LD20

Message ID 1487578412-10087-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 87c3308cbf969f2370a647c6beea26898f0767f8
Headers show

Commit Message

Masahiro Yamada Feb. 20, 2017, 8:13 a.m. UTC
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 <yamada.masahiro@socionext.com>

---

 arch/arm/mach-uniphier/dram_init.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Masahiro Yamada Feb. 22, 2017, 11:34 p.m. UTC | #1
2017-02-20 17:13 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> 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 <yamada.masahiro@socionext.com>


Applied to u-boot-uniphier.

-- 
Best Regards
Masahiro Yamada
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index d121a3b..4b7b867 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -263,6 +263,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;