summaryrefslogtreecommitdiff
path: root/board/toradex
diff options
context:
space:
mode:
authorFrancesco Dolcini <francesco.dolcini@toradex.com>2022-09-07 11:51:05 +0200
committerStefano Babic <sbabic@denx.de>2022-10-20 17:35:51 +0200
commit5a16797105b3c80821f498252dcfbdf0dbc593d5 (patch)
tree66d6aa21c9fa05150015e24d9a8f8a48c4ea15f9 /board/toradex
parent6a64bcfae058b19a4275fc1963954f399951bce1 (diff)
ARM: imx8mp: verdin-imx8mp: Add memory size detection
Add RAM auto-sizing, without this change memory size for all SKU is set to 8GB and the system will crash on SKU with less memory as soon as the non existent memory addresses are accessed. Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support") Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r--board/toradex/verdin-imx8mp/verdin-imx8mp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/board/toradex/verdin-imx8mp/verdin-imx8mp.c b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
index 06f665b92c..9c2e44a122 100644
--- a/board/toradex/verdin-imx8mp/verdin-imx8mp.c
+++ b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
@@ -118,6 +118,16 @@ int board_late_init(void)
return 0;
}
+int board_phys_sdram_size(phys_size_t *size)
+{
+ if (!size)
+ return -EINVAL;
+
+ *size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE + PHYS_SDRAM_2_SIZE);
+
+ return 0;
+}
+
#if IS_ENABLED(CONFIG_OF_LIBFDT) && IS_ENABLED(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *blob, struct bd_info *bd)
{