ipq40xx: add RT-AC2200 alternative name to RT-AC42U/RT-ACRH17
[openwrt/openwrt.git] / target / linux / ipq40xx / image / generic.mk
index c24eb285234558cf1d6cd1023fae30371078ef77..5eac14e0aedcd8fc7f7fcbe274fcdcae8df04a2b 100644 (file)
@@ -46,6 +46,21 @@ define Build/append-rootfshdr
        dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL)
 endef
 
+define Build/append-rutx-metadata
+       echo \
+               '{ \
+                       "device_code": [".*"], \
+                       "hwver": [".*"], \
+                       "batch": [".*"], \
+                       "serial": [".*"], \
+                       "supported_devices":["teltonika,rutx"] \
+               }' | fwtool -I - $@
+endef
+
+define Build/copy-file
+       cat "$(1)" > "$@"
+endef
+
 define Build/mkmylofw_32m
        $(eval device_id=$(word 1,$(1)))
        $(eval revision=$(word 2,$(1)))
@@ -81,6 +96,16 @@ define Build/qsdk-ipq-factory-nand-askey
        @mv $@.new $@
 endef
 
+define Build/qsdk-ipq-app-gpt
+       cp $@ $@.tmp 2>/dev/null || true
+       ptgen -g -o $@.tmp -a 1 -l 1024 \
+                       -t 0x2e -N 0:HLOS -r -p 32M \
+                       -t 0x83 -N rootfs -r -p 128M \
+                               -N rootfs_data -p 512M
+       cat $@.tmp >> $@
+       rm $@.tmp
+endef
+
 define Build/SenaoFW
        -$(STAGING_DIR_HOST)/bin/mksenaofw \
                -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \
@@ -175,14 +200,44 @@ define Device/asus_map-ac2200
 endef
 TARGET_DEVICES += asus_map-ac2200
 
+# WARNING: this is an initramfs image that gets you half of the way there
+#          you need to delete the jffs2 ubi volume and sysupgrade to the final image
+# to get a "trx" you can flash via web UI for ac42u/ac58u:
+# - change call Device/FitImageLzma to Device/FitImage
+# - add the following below UIMAGE_NAME
+#   UIMAGE_MAGIC := 0x27051956
+#   IMAGES += factory.trx
+#   IMAGE/factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none
+define Device/asus_rt-ac42u
+       $(call Device/FitImageLzma)
+       DEVICE_VENDOR := ASUS
+       DEVICE_MODEL := RT-AC42U
+       DEVICE_ALT0_VENDOR := ASUS
+       DEVICE_ALT0_MODEL := RT-ACRH17
+       DEVICE_ALT1_VENDOR := ASUS
+       DEVICE_ALT1_MODEL := RT-AC2200
+       SOC := qcom-ipq4019
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       IMAGE_SIZE := 20439364
+       FILESYSTEMS := squashfs
+#      RT-AC82U is nowhere to be found online
+#      Rather, this device is a/k/a RT-AC42U
+#      But we'll go with what the vendor firmware has...
+       UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U')
+       DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-asus_rt-ac42u kmod-usb-ledtrig-usbport
+endef
+TARGET_DEVICES += asus_rt-ac42u
+
 define Device/asus_rt-ac58u
        $(call Device/FitImageLzma)
        DEVICE_VENDOR := ASUS
        DEVICE_MODEL := RT-AC58U
+       DEVICE_ALT0_VENDOR := ASUS
+       DEVICE_ALT0_MODEL := RT-ACRH13
        SOC := qcom-ipq4018
        BLOCKSIZE := 128k
        PAGESIZE := 2048
-       DTB_SIZE := 65536
        IMAGE_SIZE := 20439364
        FILESYSTEMS := squashfs
 #      Someone - in their infinite wisdom - decided to put the firmware
@@ -216,6 +271,8 @@ define Device/avm_fritzbox-7530
        $(call Device/FitImageLzma)
        DEVICE_VENDOR := AVM
        DEVICE_MODEL := FRITZ!Box 7530
+       DEVICE_ALT0_VENDOR := AVM
+       DEVICE_ALT0_MODEL := FRITZ!Box 7520
        SOC := qcom-ipq4019
        DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand
 endef
@@ -472,13 +529,16 @@ define Device/ezviz_cs-w3-wd1200g-eup
        DEVICE_VENDOR := EZVIZ
        DEVICE_MODEL := CS-W3-WD1200G
        DEVICE_VARIANT := EUP
-       DEVICE_DTS_CONFIG := config@4
        IMAGE_SIZE := 14848k
+       KERNEL_SIZE = 6m
        SOC := qcom-ipq4018
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
                append-metadata
        DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
                ipq-wifi-ezviz_cs-w3-wd1200g-eup
+       DEVICE_COMPAT_VERSION := 2.0
+       DEVICE_COMPAT_MESSAGE := uboot's bootcmd has to be updated (see wiki). \
+               Upgrade via sysupgrade mechanism is not possible.
 endef
 TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup
 
@@ -509,6 +569,24 @@ define Device/glinet_gl-b1300
 endef
 TARGET_DEVICES += glinet_gl-b1300
 
+define Device/glinet_gl-b2200
+       $(call Device/FitzImage)
+       DEVICE_VENDOR := GL.iNet
+       DEVICE_MODEL := GL-B2200
+       SOC := qcom-ipq4019
+       DEVICE_DTS_CONFIG := config@ap.dk04.1-c3
+       KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+       IMAGES := emmc.img.gz sysupgrade.bin
+       IMAGE/emmc.img.gz := qsdk-ipq-app-gpt |\
+               pad-to 1024k | append-kernel |\
+               pad-to 33792k | append-rootfs |\
+               append-metadata | gzip
+       IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-glinet_gl-b2200 \
+               kmod-fs-ext4 kmod-mmc kmod-spi-dev mkf2fs e2fsprogs kmod-fs-f2fs
+endef
+TARGET_DEVICES += glinet_gl-b2200
+
 define Device/glinet_gl-s1300
        $(call Device/FitzImage)
        DEVICE_VENDOR := GL.iNet
@@ -854,7 +932,7 @@ define Device/qxwlan_e2600ac-c1
        KERNEL_SIZE := 4096k
        IMAGE_SIZE := 31232k
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
-       DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
+       DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac-c1
        DEFAULT := n
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
@@ -869,10 +947,39 @@ define Device/qxwlan_e2600ac-c2
        KERNEL_INSTALL := 1
        BLOCKSIZE := 128k
        PAGESIZE := 2048
-       DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
+       DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac-c2
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c2
 
+define Device/teltonika_rutx10
+       $(call Device/FitImage)
+       $(call Device/UbiFit)
+       DEVICE_VENDOR := Teltonika
+       DEVICE_MODEL := RUTX10
+       SOC := qcom-ipq4018
+       DEVICE_DTS_CONFIG := config@5
+       KERNEL_INSTALL := 1
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       FILESYSTEMS := squashfs
+       IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand | append-rutx-metadata
+       DEVICE_PACKAGES := ipq-wifi-teltonika_rutx kmod-bluetooth
+endef
+TARGET_DEVICES += teltonika_rutx10
+
+define Device/tel_x1pro
+       $(call Device/FitImage)
+       DEVICE_VENDOR := Telco
+       DEVICE_MODEL := X1 Pro
+       SOC := qcom-ipq4019
+       KERNEL_SIZE := 4096k
+       IMAGE_SIZE := 31232k
+       IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
+       DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+       DEFAULT := n
+endef
+TARGET_DEVICES += tel_x1pro
+
 define Device/unielec_u4019-32m
        $(call Device/FitImage)
        DEVICE_VENDOR := Unielec
@@ -887,6 +994,19 @@ define Device/unielec_u4019-32m
 endef
 TARGET_DEVICES += unielec_u4019-32m
 
+define Device/zte_mf286d
+       $(call Device/FitzImage)
+       DEVICE_VENDOR := ZTE
+       DEVICE_MODEL := MF286D
+       SOC := qcom-ipq4019
+       DEVICE_DTS_CONFIG := config@ap.dk04.1-c1
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       KERNEL_IN_UBI := 1
+       DEVICE_PACKAGES := ipq-wifi-zte_mf286d kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+endef
+TARGET_DEVICES += zte_mf286d
+
 define Device/zyxel_nbg6617
        $(call Device/FitImageLzma)
        DEVICE_VENDOR := ZyXEL