diff mbox series

[v2,1/3] rpi: fix dram bank initialization

Message ID 20191205175315.9225-1-matthias.bgg@kernel.org
State Accepted
Commit e19cfcc07ac5da8b3a04e21875ec542d994865d4
Delegated to: Matthias Brugger
Headers show
Series [v2,1/3] rpi: fix dram bank initialization | expand

Commit Message

Matthias Brugger Dec. 5, 2019, 5:53 p.m. UTC
From: Matthias Brugger <mbrugger@suse.com>

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>
---

Changes in v2: None

 board/raspberrypi/rpi/rpi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 5f120ea9c2..e19610f40f 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -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