ipq40xx: Select correct board-2.bin for EnGenius EMD1
[openwrt/openwrt.git] / target / linux / ipq40xx / image / generic.mk
index 9cd50e23ffb632eadf87ffcb47bfd2bc23cdd2a6..b1a3bac29165a7dfd0e9d80c0bdd32ceec9b39b2 100644 (file)
@@ -35,7 +35,7 @@ define Device/DniImage
        IMAGES += factory.img
        IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
        IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \
-               append-rootfs | pad-rootfs | append-metadata | check-size
+               append-rootfs | pad-rootfs | check-size | append-metadata
 endef
 
 define Build/append-rootfshdr
@@ -62,6 +62,16 @@ define Build/mkmylofw_32m
        @mv $@.new $@
 endef
 
+define Build/wac5xx-netgear-tar
+       mkdir $@.tmp
+       mv $@ $@.tmp/wac5xx-ubifs-root.img
+       md5sum $@.tmp/wac5xx-ubifs-root.img > $@.tmp/wac5xx-ubifs-root.md5sum
+       echo "WAC505 WAC510" > $@.tmp/metadata.txt
+       echo "WAC505_V9.9.9.9" > $@.tmp/version
+       tar -C $@.tmp/ -cf $@ .
+       rm -rf $@.tmp
+endef
+
 define Build/qsdk-ipq-factory-nand-askey
        $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\
                askey_kernel $(IMAGE_KERNEL) \
@@ -96,7 +106,7 @@ define Device/8dev_habanero-dvk
        IMAGE_SIZE := 30976k
        SOC := qcom-ipq4019
        DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk
-       IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size
+       IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata
 endef
 TARGET_DEVICES += 8dev_habanero-dvk
 
@@ -121,8 +131,7 @@ define Device/alfa-network_ap120c-ac
        DEVICE_VENDOR := ALFA Network
        DEVICE_MODEL := AP120C-AC
        SOC := qcom-ipq4018
-       DEVICE_PACKAGES := kmod-usb-acm \
-               kmod-tpm-i2c-atmel uboot-envtools
+       DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel
        BLOCKSIZE := 128k
        PAGESIZE := 2048
        IMAGE_SIZE := 65536k
@@ -141,7 +150,6 @@ endef
 define Device/aruba_ap-303
        $(call Device/aruba_glenmorangie)
        DEVICE_MODEL := AP-303
-       DEVICE_PACKAGES += uboot-envtools
 endef
 TARGET_DEVICES += aruba_ap-303
 
@@ -154,7 +162,7 @@ TARGET_DEVICES += aruba_ap-303h
 define Device/aruba_ap-365
        $(call Device/aruba_glenmorangie)
        DEVICE_MODEL := AP-365
-       DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools
+       DEVICE_PACKAGES += kmod-hwmon-ad7418
 endef
 TARGET_DEVICES += aruba_ap-365
 
@@ -199,7 +207,7 @@ define Device/avm_fritzbox-4040
        UBOOT_PARTITION_SIZE := 524288
        IMAGES += eva.bin
        IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
-       IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size
+       IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
        DEVICE_PACKAGES := fritz-tffs fritz-caldata
 endef
 TARGET_DEVICES += avm_fritzbox-4040
@@ -237,7 +245,7 @@ define Device/buffalo_wtr-m2133hp
        DEVICE_VENDOR := Buffalo
        DEVICE_MODEL := WTR-M2133HP
        SOC := qcom-ipq4019
-       DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
+       DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
        BLOCKSIZE := 128k
        PAGESIZE := 2048
 endef
@@ -318,7 +326,7 @@ define Device/devolo_magic-2-wifi-next
        IMAGE_SIZE := 26624k
        IMAGES := sysupgrade.bin
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
-       DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools
+       DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next
 endef
 TARGET_DEVICES += devolo_magic-2-wifi-next
 
@@ -357,7 +365,8 @@ define Device/edgecore_ecw5211
        SOC := qcom-ipq4018
        BLOCKSIZE := 128k
        PAGESIZE := 2048
-       DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools
+       DEVICE_DTS_CONFIG := config@ap.dk01.1-c2
+       DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm
 endef
 TARGET_DEVICES += edgecore_ecw5211
 
@@ -410,6 +419,7 @@ define Device/engenius_emd1
        IMAGES += factory.bin
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
        IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
+       DEVICE_PACKAGES := ipq-wifi-engenius_emd1
 endef
 TARGET_DEVICES += engenius_emd1
 
@@ -541,7 +551,6 @@ define Device/linksys_ea6350v3
        UBINIZE_OPTS := -E 5
        IMAGES += factory.bin
        IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3
-       DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += linksys_ea6350v3
 
@@ -557,7 +566,7 @@ define Device/linksys_ea8300
        UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
        IMAGES += factory.bin
        IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300
-       DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_ea8300
 
@@ -573,7 +582,7 @@ define Device/linksys_mr8300
        UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
        IMAGES += factory.bin
        IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300
-       DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_mr8300
 
@@ -582,7 +591,7 @@ define Device/luma_wrtq-329acn
        DEVICE_VENDOR := Luma Home
        DEVICE_MODEL := WRTQ-329ACN
        SOC := qcom-ipq4018
-       DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools
+       DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio
        IMAGE_SIZE := 76632k
        BLOCKSIZE := 128k
        PAGESIZE := 2048
@@ -636,6 +645,21 @@ define Device/netgear_ex6150v2
 endef
 TARGET_DEVICES += netgear_ex6150v2
 
+define Device/netgear_wac510
+       $(call Device/FitImage)
+       $(call Device/UbiFit)
+       DEVICE_VENDOR := Netgear
+       DEVICE_MODEL := WAC510
+       SOC := qcom-ipq4018
+       DEVICE_DTS_CONFIG := config@5
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       IMAGES += nand-factory.tar
+       IMAGE/nand-factory.tar := append-ubi | wac5xx-netgear-tar
+       DEVICE_PACKAGES := uboot-envtools
+endef
+TARGET_DEVICES += netgear_wac510
+
 define Device/openmesh_a42
        $(call Device/FitImageLzma)
        DEVICE_VENDOR := OpenMesh
@@ -648,7 +672,6 @@ define Device/openmesh_a42
        IMAGES += factory.bin
        IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-       DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += openmesh_a42
 
@@ -664,7 +687,7 @@ define Device/openmesh_a62
        IMAGES += factory.bin
        IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct
 endef
 TARGET_DEVICES += openmesh_a62
 
@@ -680,7 +703,7 @@ define Device/plasmacloud_pa1200
        IMAGES += factory.bin
        IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-       DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200
+       DEVICE_PACKAGES := ipq-wifi-plasmacloud-pa1200
 endef
 TARGET_DEVICES += plasmacloud_pa1200
 
@@ -696,7 +719,7 @@ define Device/plasmacloud_pa2200
        IMAGES += factory.bin
        IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200
 endef
 TARGET_DEVICES += plasmacloud_pa2200
 
@@ -790,7 +813,7 @@ define Device/zyxel_nbg6617
 #      this minimum-size. However, the larger image can be flashed both ways.
        IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
-       DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
+       DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += zyxel_nbg6617
 
@@ -801,9 +824,7 @@ define Device/zyxel_wre6606
        DEVICE_DTS_CONFIG := config@4
        SOC := qcom-ipq4018
        IMAGE_SIZE := 13184k
-       IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size
+       IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
        DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
 endef
 TARGET_DEVICES += zyxel_wre6606
-
-$(eval $(call BuildImage))