summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorFrancesco Dolcini <francesco.dolcini@toradex.com>2022-09-07 12:13:50 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2022-09-24 15:25:40 +0200
commit277738bc350d05c2cecacf937daf92253eb38fe4 (patch)
treece3a8969e763588dd25024b4bc2f47f76f5321e8 /recipes-bsp
parente8c4680c6c80c8f02a582d8680c6b988786a1b31 (diff)
u-boot-toradex_2022.07: Fix verdin-imx8mp memory size
Add patch to properly size the memory on Verdin iMX8M Plus. Related-to: ELB-4711 Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> (cherry picked from commit 6931dff87db18d38a14414fe35ef49805bcf5238)
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex/0001-ARM-imx8mp-verdin-imx8mp-Add-memory-size-detection.patch40
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex_2022.07.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-toradex/0001-ARM-imx8mp-verdin-imx8mp-Add-memory-size-detection.patch b/recipes-bsp/u-boot/u-boot-toradex/0001-ARM-imx8mp-verdin-imx8mp-Add-memory-size-detection.patch
new file mode 100644
index 0000000..b3adb66
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-toradex/0001-ARM-imx8mp-verdin-imx8mp-Add-memory-size-detection.patch
@@ -0,0 +1,40 @@
+From dea2132a615a744f7f00ebbc551c53867c7537dc Mon Sep 17 00:00:00 2001
+From: Francesco Dolcini <francesco.dolcini@toradex.com>
+Date: Tue, 6 Sep 2022 17:12:17 +0200
+Subject: [PATCH] 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>
+---
+ board/toradex/verdin-imx8mp/verdin-imx8mp.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/board/toradex/verdin-imx8mp/verdin-imx8mp.c b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
+index e3c1a1201daa..743e00bf9c46 100644
+--- a/board/toradex/verdin-imx8mp/verdin-imx8mp.c
++++ b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
+@@ -121,6 +121,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)
+ {
+--
+2.25.1
+
diff --git a/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb b/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb
index 51473a5..f3943ad 100644
--- a/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb
@@ -23,6 +23,7 @@ TDX_PATCHES = " \
file://0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch \
file://0012-toradex-common-Improve-product-serial-print-during-b.patch \
file://0013-configs-colibri-imx7-Enable-bootd-command.patch \
+ file://0001-ARM-imx8mp-verdin-imx8mp-Add-memory-size-detection.patch \
"
# patches which are not (yet) in the latest master
TDX_PATCHES:use-head-next = " \