include: configs: omap5: Add support for FDT overlay
authorSinthu Raja <sinthu.raja@ti.com>
Tue, 11 Feb 2025 09:49:31 +0000 (15:19 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 21 Feb 2025 01:12:08 +0000 (19:12 -0600)
As AM57x uses overlays for display and camera interfaces, add support to
load DT overlay files to MMC boot.

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
include/configs/ti_omap5_common.h
include/env/ti/mmc.h

index ef97711..39102f1 100644 (file)
                "if test $fdtfile = undefined; then " \
                        "echo WARNING: Could not determine device tree to use; fi; \0"
 
+#define GET_OVERLAY_MMC_TI_ARGS \
+       "get_overlay_mmc=" \
+               "fdt address ${fdtaddr};" \
+               "fdt resize 0x100000;" \
+               "for overlay in $name_overlays;" \
+               "do;" \
+                       "load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&" \
+                       "fdt apply ${dtboaddr};" \
+               "done;\0" \
+
 #define BOOT_TARGET_DEVICES(func) \
        func(TI_MMC, ti_mmc, na) \
        func(MMC, mmc, 0) \
        "get_fit_config=setenv name_fit_config ${fdtfile}\0" \
        DEFAULT_COMMON_BOOT_TI_ARGS \
        DEFAULT_FDT_TI_ARGS \
+       GET_OVERLAY_MMC_TI_ARGS \
        DFUARGS \
        NETARGS \
        NANDARGS \
index d07189b..dbb0e35 100644 (file)
@@ -44,6 +44,7 @@
        "mmcloados=" \
                "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
                        "if run loadfdt; then " \
+                               "run get_overlay_mmc;" \
                                "bootz ${loadaddr} - ${fdtaddr}; " \
                        "else " \
                                "if test ${boot_fdt} = try; then " \