[openwrt/openwrt] imx: venice: add dt overlay support
LEDE Commits
lede-commits at lists.infradead.org
Wed Jun 25 12:02:40 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/fa34d9c5112fe27c126900d741786d1ac1039f5f
commit fa34d9c5112fe27c126900d741786d1ac1039f5f
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Jun 19 14:32:11 2025 -0700
imx: venice: add dt overlay support
Enable DT overlay support:
- add dt-overlay to board features
- add DEVICE_DTS_OVERLAYS
- update the boot script to resize before applying each overlay
Signed-off-by: Tim Harvey <tharvey at gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/19218
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/imx/cortexa53/target.mk | 1 +
target/linux/imx/image/bootscript-gateworks_venice | 2 +-
target/linux/imx/image/cortexa53.mk | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/target/linux/imx/cortexa53/target.mk b/target/linux/imx/cortexa53/target.mk
index b9b32d1829..cf1791b92c 100644
--- a/target/linux/imx/cortexa53/target.mk
+++ b/target/linux/imx/cortexa53/target.mk
@@ -2,6 +2,7 @@ ARCH:=aarch64
BOARDNAME:=NXP i.MX with Cortex-A53 (ARM64)
CPU_TYPE:=cortex-a53
KERNELNAME:=Image dtbs
+FEATURES+=dt-overlay
define Target/Description
Build firmware images for NXP i.MX (Cortex-A53) based boards.
diff --git a/target/linux/imx/image/bootscript-gateworks_venice b/target/linux/imx/image/bootscript-gateworks_venice
index 062947f27b..3f87bae50b 100644
--- a/target/linux/imx/image/bootscript-gateworks_venice
+++ b/target/linux/imx/image/bootscript-gateworks_venice
@@ -29,7 +29,7 @@ echo "loading DTB..."
setenv fdt_addr
setenv fdt_list $fdt_file $fdt_file1 $fdt_file2 $fdt_file3 $fdt_file4 $fdt_file5
setenv load_fdt 'echo Loading $fdt...; load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${fdt} && setenv fdt_addr ${fdt_addr_r}'
-setenv apply_overlays 'fdt addr $fdt_addr_r && fdt resize && for fdt in "$fdt_overlays"; do load ${devtype} ${devnum}:${distro_bootpart} $loadaddr $prefix/$fdt && fdt apply $loadaddr && echo applied $prefix/$fdt; done'
+setenv apply_overlays 'fdt addr $fdt_addr_r && for fdt in "$fdt_overlays"; do load ${devtype} ${devnum}:${distro_bootpart} $loadaddr $prefix/$fdt && fdt resize $filesize && fdt apply $loadaddr && echo applied $prefix/$fdt; done'
for fdt in ${fdt_list}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${fdt}; then run load_fdt; fi; done
if test -z "$fdt_addr"; then echo "Warning: Using bootloader DTB"; setenv fdt_addr $fdtcontroladdr; fi
if test -n "$fdt_overlays"; then echo "Applying overlays"; run apply_overlays; fi
diff --git a/target/linux/imx/image/cortexa53.mk b/target/linux/imx/image/cortexa53.mk
index ec3623e8e7..e618e3ee0a 100644
--- a/target/linux/imx/image/cortexa53.mk
+++ b/target/linux/imx/image/cortexa53.mk
@@ -8,6 +8,7 @@ define Build/boot-img-ext4
rm -fR $@.boot
mkdir -p $@.boot
$(foreach dts,$(DEVICE_DTS), $(CP) $(KDIR)/image-$(dts).dtb $@.boot/$(dts).dtb;)
+ $(foreach dtbo,$(DEVICE_DTS_OVERLAY), $(CP) $(KDIR)/image-$(dtbo).dtbo $@.boot/$(dtbo).dtbo;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
make_ext4fs -J -L kernel -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M \
@@ -64,6 +65,7 @@ define Device/gateworks_venice
BOOT_SCRIPT := gateworks_venice
PARTITION_OFFSET := 16M
DEVICE_DTS := $(basename $(notdir $(wildcard $(DTS_DIR)/freescale/imx8m*-venice*.dts)))
+ DEVICE_DTS_OVERLAY := $(basename $(notdir $(wildcard $(DTS_DIR)/freescale/imx8m*-venice*.dtso)))
DEVICE_PACKAGES := \
kmod-hwmon-gsc kmod-rtc-ds1672 kmod-eeprom-at24 \
kmod-gpio-button-hotplug kmod-leds-gpio kmod-pps-gpio \
More information about the lede-commits
mailing list