From: Christian Lamparter Date: Thu, 8 Jun 2023 16:12:05 +0000 (+0200) Subject: apm821xx: switch over from DTB_SIZE to DEVICE_DTC_FLAGS X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a5fc132aa3e43c8cc3a3beac3479b003e1a8f16a;p=openwrt%2Fstaging%2Fmans0n.git apm821xx: switch over from DTB_SIZE to DEVICE_DTC_FLAGS DEVICE_DTC_FLAGS is more flexible and can be used in place of APM821xx own DTB_SIZE. Signed-off-by: Christian Lamparter --- diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index f4701e9f26..03799bcc10 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -3,14 +3,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += DTB_SIZE - define Build/boot-img $(RM) -rf $@.bootdir mkdir -p $@.bootdir/boot $(CP) $@.scr $@.bootdir/boot/boot.scr - $(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB) + $(CP) $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.bootdir/boot/$(DEVICE_DTB) $(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage genext2fs --block-size $(BLOCKSIZE:%k=%Ki) \ @@ -28,12 +26,8 @@ define Build/boot-script $@.scr endef -define Build/dtb - $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE)) -endef - define Build/export-dtb - cp $(IMAGE_KERNEL).dtb $@ + cp $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@ endef define Build/MuImage-initramfs @@ -58,15 +52,15 @@ define Build/MuImage-initramfs # part of the legacy multi image. Since we need to put the # device tree stuff into part 3. - -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \ - -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \ - -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new + -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi -C $(1) \ + -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) -n '$(BOARD_NAME) initramfs' \ + -d $@:$@.fakerd:$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.new mv $@.new $@ rm -rf $@.fakerd endef define Build/prepend-dtb - cat "$@.dtb.uimage" "$@" > "$@.new" + cat "$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb" "$@" > "$@.new" mv "$@.new" "$@" endef diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index 2b8abfc22f..9ecc2320fd 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -6,15 +6,6 @@ define Build/create-uImage-dtb -d "$@.dtb" "$@.dtb.uimage" endef -define Build/MerakiAdd-dtb - $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb) - ( \ - dd if=$@.dtb bs=$(DTB_SIZE) conv=sync; \ - cat $@ ; \ - ) > $@.new - @mv $@.new $@ -endef - define Build/meraki-header -$(STAGING_DIR_HOST)/bin/mkmerakifw \ -B $(BOARD_NAME) -s \ @@ -30,10 +21,10 @@ define Device/meraki_mr24 DEVICE_PACKAGES := kmod-spi-gpio -swconfig BOARD_NAME := mr24 IMAGES := sysupgrade.bin - DTB_SIZE := 64512 + DEVICE_DTC_FLAGS := --space 64512 IMAGE_SIZE := 8191k - KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | meraki-header - KERNEL_INITRAMFS := kernel-bin | lzma | dtb | MuImage-initramfs lzma + KERNEL := kernel-bin | lzma | uImage lzma | prepend-dtb | meraki-header + KERNEL_INITRAMFS := kernel-bin | lzma | MuImage-initramfs lzma IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += mr24 @@ -49,9 +40,9 @@ define Device/meraki_mx60 kmod-usb-storage block-mount BLOCKSIZE := 128k IMAGES := sysupgrade.bin - DTB_SIZE := 20480 + DEVICE_DTC_FLAGS := --space 20480 IMAGE_SIZE := 1021m - KERNEL := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip + KERNEL := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 DEVICE_COMPAT_VERSION := 2.0 @@ -66,11 +57,11 @@ define Device/netgear_wndap6x0 SUBPAGESIZE := 256 PAGESIZE := 512 BLOCKSIZE := 16k - DTB_SIZE := 32768 + DEVICE_DTC_FLAGS := --space 32768 IMAGE_SIZE := 27392k IMAGES := sysupgrade.bin factory.img KERNEL_SIZE := 6080k - KERNEL := dtb | kernel-bin | libdeflate-gzip | MuImage-initramfs gzip + KERNEL := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi UBINIZE_OPTS := -E 5 @@ -105,7 +96,7 @@ define Device/netgear_wndr4700 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k - DTB_SIZE := 131008 + DEVICE_DTC_FLAGS := --space 131008 IMAGE_SIZE := 24960k IMAGES := factory.img sysupgrade.bin ARTIFACTS := device-tree.dtb @@ -113,8 +104,8 @@ define Device/netgear_wndr4700 # append a fake/empty rootfs to fool netgear's uboot # CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg() KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ - append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb - KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip + append-uImage-fakehdr filesystem | create-uImage-dtb | prepend-dtb + KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ netgear-dni | check-size IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata diff --git a/target/linux/apm821xx/image/sata.mk b/target/linux/apm821xx/image/sata.mk index 510f450d87..dfb553c089 100644 --- a/target/linux/apm821xx/image/sata.mk +++ b/target/linux/apm821xx/image/sata.mk @@ -12,9 +12,9 @@ define Device/wd_mybooklive kmod-usb-storage kmod-fs-vfat wpad-basic-mbedtls SUPPORTED_DEVICES += mbl wd,mybooklive-duo BLOCKSIZE := 1k - DTB_SIZE := 16384 - KERNEL := kernel-bin | dtb | libdeflate-gzip | uImage gzip - KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip + DEVICE_DTC_FLAGS := --pad 4096 + KERNEL := kernel-bin | libdeflate-gzip | uImage gzip + KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGES := factory.img.gz sysupgrade.img.gz ARTIFACTS := apollo3g.dtb DEVICE_DTB := apollo3g.dtb