summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Dolcini <francesco.dolcini@toradex.com>2022-09-06 17:12:17 +0200
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2022-09-07 11:53:14 +0200
commitf83407fb55f8747e9120fc502d8e06821d588dd4 (patch)
treed5d090ef2100acd7f270d76e189b0d836129e88f
parentec4644888505f69ba82f676129a7f2d237cd470e (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. Upstream-Status: Submitted [https://lore.kernel.org/u-boot/20220907095105.21630-1-francesco.dolcini@toradex.com/] Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support") Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
-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 df0d622c0f..3a2b02c74a 100644
--- a/board/toradex/verdin-imx8mp/verdin-imx8mp.c
+++ b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
@@ -129,6 +129,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)
{