]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rpi: fix dram bank initialization
authorMatthias Brugger <mbrugger@suse.com>
Thu, 5 Dec 2019 17:53:13 +0000 (18:53 +0100)
committerMatthias Brugger <mbrugger@suse.com>
Wed, 11 Dec 2019 09:14:12 +0000 (10:14 +0100)
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")
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
board/raspberrypi/rpi/rpi.c

index 5f120ea9c282fdd3cd02bf657b99d1c87ad20b79..e19610f40f8452ffa08c32a94f0e710bf9b744f4 100644 (file)
@@ -275,8 +275,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