From f8b9349cb8e1722bde2730bf23236e7310319314 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 14 Oct 2023 20:15:22 +0200 Subject: [PATCH] qualcommax: move generic image recipes target These recipes are generic and will be used for other subtargets, so lets move them to the target Makefile so they can reused. Signed-off-by: Robert Marko --- target/linux/qualcommax/image/Makefile | 18 +++++++++++ target/linux/qualcommax/image/ipq50xx.mk | 36 ++++++++++----------- target/linux/qualcommax/image/ipq60xx.mk | 41 +++++++----------------- target/linux/qualcommax/image/ipq807x.mk | 21 +----------- 4 files changed, 48 insertions(+), 68 deletions(-) diff --git a/target/linux/qualcommax/image/Makefile b/target/linux/qualcommax/image/Makefile index f59ad0c15..46cd192f4 100644 --- a/target/linux/qualcommax/image/Makefile +++ b/target/linux/qualcommax/image/Makefile @@ -12,6 +12,24 @@ define Device/Default IMAGE/sysupgrade.bin/squashfs := endef +define Device/FitImage + KERNEL_SUFFIX := -uImage.itb + KERNEL = kernel-bin | libdeflate-gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/FitImageLzma + KERNEL_SUFFIX := -uImage.itb + KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/UbiFit + KERNEL_IN_UBI := 1 + IMAGES += factory.ubi + IMAGE/factory.ubi := append-ubi +endef + include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/target/linux/qualcommax/image/ipq50xx.mk b/target/linux/qualcommax/image/ipq50xx.mk index 9f490fb9a..0404117e3 100644 --- a/target/linux/qualcommax/image/ipq50xx.mk +++ b/target/linux/qualcommax/image/ipq50xx.mk @@ -1,6 +1,7 @@ define Device/EmmcImage - IMAGES := factory.bin sysupgrade.bin + IMAGES += factory.bin recovery.bin IMAGE/factory.bin := append-kernel | pad-to 12288k | append-rootfs | append-metadata + IMAGE/recovery.bin := append-kernel | pad-to 6144k | append-rootfs | append-metadata IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata endef @@ -29,36 +30,35 @@ define Device/jdcloud_re-cs-03 endef TARGET_DEVICES += jdcloud_re-cs-03 -define Device/linksys_mx2000 +define Device/linksys_ipq50xx_mx_base $(call Device/FitImageLzma) DEVICE_VENDOR := Linksys - DEVICE_MODEL := MX2000 BLOCKSIZE := 128k PAGESIZE := 2048 KERNEL_SIZE := 8192k IMAGE_SIZE := 83968k - DEVICE_DTS_CONFIG := config@mp03.5-c1 + NAND_SIZE := 256m SOC := ipq5018 - UBINIZE_OPTS := -E 5 IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MX2000 - DEVICE_PACKAGES := ath11k-firmware-qcn6122 ipq-wifi-linksys_mx2000 + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | linksys-image type=$$$$(DEVICE_MODEL) +endef + +define Device/linksys_mx2000 + $(call Device/linksys_ipq50xx_mx_base) + DEVICE_MODEL := MX2000 + DEVICE_DTS_CONFIG := config@mp03.5-c1 + DEVICE_PACKAGES := ath11k-firmware-qcn6122 \ + ipq-wifi-linksys_mx2000 endef TARGET_DEVICES += linksys_mx2000 define Device/linksys_mx5500 - $(call Device/FitImageLzma) - DEVICE_VENDOR := Linksys + $(call Device/linksys_ipq50xx_mx_base) DEVICE_MODEL := MX5500 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 8192k - IMAGE_SIZE := 83968k DEVICE_DTS_CONFIG := config@mp03.1 - SOC := ipq5018 - UBINIZE_OPTS := -E 5 - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MX5500 - DEVICE_PACKAGES := kmod-ath11k-pci ath11k-firmware-qcn9074 ipq-wifi-linksys_mx5500 + DEVICE_PACKAGES := kmod-ath11k-pci \ + ath11k-firmware-qcn9074 \ + ipq-wifi-linksys_mx5500 endef TARGET_DEVICES += linksys_mx5500 diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 4f2e29b50..93ab50c91 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -1,24 +1,5 @@ -define Device/FitImage - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | libdeflate-gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitImageLzma - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/UbiFit - KERNEL_IN_UBI := 1 - IMAGES := factory.ubi sysupgrade.bin - IMAGE/factory.ubi := append-ubi - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata -endef - define Device/EmmcImage - IMAGES := factory.bin recovery.bin sysupgrade.bin + IMAGES += factory.bin recovery.bin IMAGE/factory.bin := append-kernel | pad-to 12288k | append-rootfs | append-metadata IMAGE/recovery.bin := append-kernel | pad-to 6144k | append-rootfs | append-metadata IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata @@ -36,29 +17,29 @@ define Device/cmiot_ax18 endef TARGET_DEVICES += cmiot_ax18 -define Device/glinet_gl-ax1800 +define Device/glinet_gl-common $(call Device/FitImage) $(call Device/UbiFit) DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-AX1800 BLOCKSIZE := 128k PAGESIZE := 2048 DEVICE_DTS_CONFIG := config@cp03-c1 SOC := ipq6000 +endef + +define Device/glinet_gl-ax1800 + $(call Device/glinet_gl-common) + DEVICE_MODEL := GL-AX1800 DEVICE_PACKAGES := ipq-wifi-glinet_gl-ax1800 + SUPPORTED_DEVICES += glinet,ax1800 endef TARGET_DEVICES += glinet_gl-ax1800 define Device/glinet_gl-axt1800 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := GL.iNet + $(call Device/glinet_gl-common) DEVICE_MODEL := GL-AXT1800 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@cp03-c1 - SOC := ipq6000 - DEVICE_PACKAGES := ipq-wifi-glinet_gl-axt1800 kmod-hwmon-gpiofan + DEVICE_PACKAGES := ipq-wifi-glinet_gl-axt1800 kmod-hwmon-pwmfan + SUPPORTED_DEVICES += glinet,axt1800 endef TARGET_DEVICES += glinet_gl-axt1800 diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index d2c544a5d..8994566ef 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -1,28 +1,9 @@ -define Device/FitImage - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | libdeflate-gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitImageLzma - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - define Device/EmmcImage - IMAGES += factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata endef -define Device/UbiFit - KERNEL_IN_UBI := 1 - IMAGES := factory.ubi sysupgrade.bin - IMAGE/factory.ubi := append-ubi - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata -endef - define Build/wax6xx-netgear-tar mkdir $@.tmp mv $@ $@.tmp/nand-ipq807x-apps.img