]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 27 Jan 2017 21:53:44 +0000 (06:53 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 29 Jan 2017 11:59:08 +0000 (20:59 +0900)
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

index b78ca720132557cd32484b1e83954b7f1970d83b..881062d9b697e6e371d537cfeeed189a9e736ff8 100644 (file)
@@ -248,22 +248,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);