rpi: fix dram bank initialization 03/220203/1
authorMatthias Brugger <mbrugger@suse.com>
Thu, 5 Dec 2019 17:53:13 +0000 (18:53 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 16 Dec 2019 04:27:55 +0000 (13:27 +0900)
To update the dram bank information from device-tree we use
fdtdec_decode_ram_size() which expectes the the size-cells and
address-cells to be defined in the memory node. For normal system RAM
these values are defined in the root node. When the values differ from
the default values defined in the spec, we can end up with wrong RAM
bank information.

Switch to the "standard" way to update the RAM bank information to
avoid this.

Fixes: 9de5b89e4c ("rpi4: enable dram bank initialization")
Change-Id: I5c6148bf322d46aaff7e425b9ba9e3f84eef6f09
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
board/raspberrypi/rpi/rpi.c

index cdad09842cc69a1247ad28c1a07888add39de002..673ae8e37a8bec2b30c3a909eb7b74cfcebb7833 100644 (file)
@@ -302,8 +302,13 @@ int dram_init(void)
 #ifdef CONFIG_BCM2711
 int dram_init_banksize(void)
 {
-       return fdtdec_decode_ram_size(gd->fdt_blob, NULL, 0, NULL,
-                                    (phys_size_t *)&gd->ram_size, gd->bd);
+       int ret;
+
+       ret = fdtdec_setup_memory_banksize();
+       if (ret)
+               return ret;
+
+       return fdtdec_setup_mem_size_base();
 }
 #endif
 #endif