diff mbox series

[04/16] ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC

Message ID 1485554036-29320-5-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit c995f3a3c5263c2e424064fac81f169846b6d25e
Headers show
Series ARM: uniphier: UniPhier SoC updates for v2017.03 (3rd round) | expand

Commit Message

Masahiro Yamada Jan. 27, 2017, 9:53 p.m. UTC
For LD20 SoC, the last 64 byte of each DRAM bank is used for the
dynamic training of DRAM PHY.  The regions must be reserved in DT to
prevent the kernel from using them.  Now gd->bd->bi_dram reflects
the actual memory banks.  Just use it instead of getting access to
the board parameters.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

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

-- 
2.7.4

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

Patch

diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index 43fe6a5..e55e1f8 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -246,22 +246,15 @@  void dram_init_banksize(void)
  */
 int ft_board_setup(void *fdt, bd_t *bd)
 {
-	const struct uniphier_board_data *param;
 	unsigned long rsv_addr;
 	const unsigned long rsv_size = 64;
-	int ch, ret;
+	int i, ret;
 
 	if (uniphier_get_soc_id() != UNIPHIER_LD20_ID)
 		return 0;
 
-	param = uniphier_get_board_param();
-	if (!param) {
-		printf("failed to get board parameter\n");
-		return -ENODEV;
-	}
-
-	for (ch = 0; ch < param->dram_nr_ch; ch++) {
-		rsv_addr = param->dram_ch[ch].base + param->dram_ch[ch].size;
+	for (i = 0; i < ARRAY_SIZE(gd->bd->bi_dram); i++) {
+		rsv_addr = gd->bd->bi_dram[i].start + gd->bd->bi_dram[i].size;
 		rsv_addr -= rsv_size;
 
 		ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size);