]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mach-snapdragon: allocate memory for DT overlays
authorAntony Kurniawan Soemardi <linux@smankusors.com>
Tue, 17 Feb 2026 08:51:34 +0000 (08:51 +0000)
committerCasey Connolly <casey.connolly@linaro.org>
Mon, 27 Apr 2026 10:33:30 +0000 (12:33 +0200)
Allocate a 1 MiB LMB region for fdtoverlay_addr_r when
CONFIG_OF_LIBFDT_OVERLAY is enabled, allowing runtime application of
DT overlays on Snapdragon platforms.

This is useful for Android-based boot flows where the final DT passed
to the kernel must contain modified /firmware/android/fstab entries.
One use case is redirecting system and vendor partitions to microSD
storage instead of internal eMMC without rebuilding the base DTB.

The allocation is conditional on CONFIG_OF_LIBFDT_OVERLAY and has no
effect on boards that do not enable overlay support.

Signed-off-by: Antony Kurniawan Soemardi <linux@smankusors.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://patch.msgid.link/20260217-qcom-fdt-overlay-v1-1-d0fa0e70d738@smankusors.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
arch/arm/mach-snapdragon/board.c

index 5fb3240acc5a6dd23d93515029a596b5f77ebfa3..829a0109ac7807d692e127178f76d8822d5da5e2 100644 (file)
@@ -555,6 +555,11 @@ int board_late_init(void)
        fdt_status |= !lmb_alloc(SZ_2M, &addr) ?
                env_set_hex("fdt_addr_r", addr) : 1;
 
+       if (IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY)) {
+               status |= !lmb_alloc(SZ_1M, &addr) ?
+                       env_set_hex("fdtoverlay_addr_r", addr) : 1;
+       }
+
        if (status || fdt_status)
                log_warning("%s: Failed to set run time variables\n", __func__);