[PATCH] board: samsung: exynos-mobile: prohibit memory overwrite access beyond DDR low region
Kaustabh Chakraborty
kauschluss at disroot.org
Sat Jun 13 09:35:59 CEST 2026
With commit a3075db94d49 ("lmb: Reinstate access to memory above
ram_top"), the memory region beyond 0x100000000 is now accessible for
allocation. This breaks booting in devices like at least in some
variants of the Samsung Galaxy J6, where only CPU0 is able to appear
online.
Similar to some other boards, limit the memory to the DDR low region.
This also appears to re-implement the logic which was reverted. The
lmb_arch_add_memory() takes over the lmb initialization for the board.
Signed-off-by: Kaustabh Chakraborty <kauschluss at disroot.org>
---
This one's a critical fix, would be nice to have it pulled in by v2026.07.
---
board/samsung/exynos-mobile/exynos-mobile.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/board/samsung/exynos-mobile/exynos-mobile.c b/board/samsung/exynos-mobile/exynos-mobile.c
index 6b2b1523663..f1f6cf683dd 100644
--- a/board/samsung/exynos-mobile/exynos-mobile.c
+++ b/board/samsung/exynos-mobile/exynos-mobile.c
@@ -353,6 +353,31 @@ int dram_init_banksize(void)
return 0;
}
+void lmb_arch_add_memory(void)
+{
+ u64 ddr_low_top = 1ULL << 32;
+ unsigned int i;
+
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+ u64 start = gd->bd->bi_dram[i].start;
+ u64 size = gd->bd->bi_dram[i].size;
+
+ if (!size)
+ continue;
+
+ lmb_add(start, size);
+
+ /* Limit memory used by U-Boot to the DDR low region */
+ if (start >= ddr_low_top)
+ lmb_alloc_mem(LMB_MEM_ALLOC_ADDR, 0, &start, size,
+ LMB_NOOVERWRITE);
+ else if (start + size > ddr_low_top)
+ lmb_alloc_mem(LMB_MEM_ALLOC_ADDR, 0, &ddr_low_top,
+ start + size - ddr_low_top,
+ LMB_NOOVERWRITE);
+ }
+}
+
int board_init(void)
{
return 0;
---
base-commit: 7e47c37adf53f3010a6bf151df32df04a3c9ab91
change-id: 20260613-j6lte-lmb-a9f7a49c8ba1
Best regards,
--
Kaustabh Chakraborty <kauschluss at disroot.org>
More information about the U-Boot
mailing list