summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <[email protected]>2026-06-17 10:48:22 +0300
committerTom Rini <[email protected]>2026-06-24 18:13:24 -0600
commitd19d9e1c064b6c782959d1da7bddf1e9da1c55d4 (patch)
tree59661c3226d9b8c11be4cee020e261edbdcd4976
parent0943f107ce4adb47d4b01c06e046dce130a1de50 (diff)
rpi: Add a local get_effective_memsize()
We are about to change the place we call dram_init_banksize(). The goal is to have all the information we need to pick a proper relocation address in gd->dram[]. However, the RPI boards, and specifically the tested rpi4, seems to hang if we relocate anywhere above the address returned from bcm2835_mbox_call_prop(). So store that address and return it on get_effective_memsize() which is used to calculate ram_top. Reviewed-by: Simon Glass <[email protected]> Tested-by: Simon Glass <[email protected]> # rpi, rpi4 Signed-off-by: Ilias Apalodimas <[email protected]> Tested-by: Christophe Leroy (CS GROUP) <[email protected]>
-rw-r--r--board/raspberrypi/rpi/rpi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 885c660a289..1da5df92351 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -39,6 +39,8 @@ DECLARE_GLOBAL_DATA_PTR;
*/
unsigned long __section(".data") fw_dtb_pointer;
+static phys_addr_t discovered_ram_size;
+
/* TODO([email protected]): Move these to the msg.c file */
struct msg_get_arm_mem {
struct bcm2835_mbox_hdr hdr;
@@ -335,10 +337,16 @@ int dram_init(void)
* the u-boot's memory setup.
*/
gd->ram_size &= ~MMU_SECTION_SIZE;
+ discovered_ram_size = gd->ram_size;
return 0;
}
+phys_size_t get_effective_memsize(void)
+{
+ return discovered_ram_size;
+}
+
#ifdef CONFIG_OF_BOARD
int dram_init_banksize(void)
{