ipq40xx: Add support for Teltonika RUTX10
[openwrt/openwrt.git] / target / linux / ipq40xx / image / generic.mk
index da1d1c15d5fbf9bb14236f7ab372f06e1c7f5b35..0d7d7a30d223be108e2288b3e7424c84f3350b80 100644 (file)
@@ -46,6 +46,17 @@ 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/mkmylofw_32m
        $(eval device_id=$(word 1,$(1)))
        $(eval revision=$(word 2,$(1)))
@@ -252,10 +263,10 @@ endef
 TARGET_DEVICES += buffalo_wtr-m2133hp
 
 define Device/cellc_rtl30vw
-       KERNEL_SUFFIX := -fit-uImage.itb
+       KERNEL_SUFFIX := -fit-zImage.itb
        KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
-       KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048
-       KERNEL_NAME := Image
+       KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048
+       KERNEL_NAME := zImage
        KERNEL_IN_UBI :=
        IMAGES := nand-factory.bin nand-sysupgrade.bin
        IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey
@@ -308,6 +319,7 @@ define Device/compex_wpj428
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
        IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3
        DEVICE_PACKAGES := kmod-gpio-beeper
+       DEFAULT := n
 endef
 TARGET_DEVICES += compex_wpj428
 
@@ -327,6 +339,7 @@ define Device/devolo_magic-2-wifi-next
        IMAGES := sysupgrade.bin
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
        DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next
+       DEFAULT := n
 endef
 TARGET_DEVICES += devolo_magic-2-wifi-next
 
@@ -435,6 +448,7 @@ define Device/engenius_emr3500
        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_emr3500
+       DEFAULT := n
 endef
 TARGET_DEVICES += engenius_emr3500
 
@@ -495,7 +509,7 @@ endef
 TARGET_DEVICES += glinet_gl-ap1300
 
 define Device/glinet_gl-b1300
-       $(call Device/FitImage)
+       $(call Device/FitzImage)
        DEVICE_VENDOR := GL.iNet
        DEVICE_MODEL := GL-B1300
        BOARD_NAME := gl-b1300
@@ -507,7 +521,7 @@ endef
 TARGET_DEVICES += glinet_gl-b1300
 
 define Device/glinet_gl-s1300
-       $(call Device/FitImage)
+       $(call Device/FitzImage)
        DEVICE_VENDOR := GL.iNet
        DEVICE_MODEL := GL-S1300
        SOC := qcom-ipq4029
@@ -646,6 +660,64 @@ define Device/netgear_ex6150v2
 endef
 TARGET_DEVICES += netgear_ex6150v2
 
+define Device/netgear_orbi
+       $(call Device/DniImage)
+       SOC := qcom-ipq4019
+       DEVICE_VENDOR := NETGEAR
+       IMAGE/factory.img := append-kernel | pad-offset 128k 64 | \
+               append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \
+               append-rootfs | pad-rootfs | netgear-dni
+       IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \
+               sysupgrade-tar rootfs=$$$$@ | append-metadata
+       DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup
+endef
+
+define Device/netgear_rbx50
+       $(call Device/netgear_orbi)
+       NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4
+       KERNEL_SIZE := 3932160
+       ROOTFS_SIZE := 32243712
+       IMAGE_SIZE := 36175872
+endef
+
+define Device/netgear_rbr50
+       $(call Device/netgear_rbx50)
+       DEVICE_MODEL := RBR50
+       DEVICE_VARIANT := v1
+       NETGEAR_BOARD_ID := RBR50
+endef
+TARGET_DEVICES += netgear_rbr50
+
+define Device/netgear_rbs50
+       $(call Device/netgear_rbx50)
+       DEVICE_MODEL := RBS50
+       DEVICE_VARIANT := v1
+       NETGEAR_BOARD_ID := RBS50
+endef
+TARGET_DEVICES += netgear_rbs50
+
+define Device/netgear_srx60
+       $(call Device/netgear_orbi)
+       NETGEAR_HW_ID := 29765352+0+4096+512+2x2+2x2+4x4
+       KERNEL_SIZE := 3932160
+       ROOTFS_SIZE := 32243712
+       IMAGE_SIZE := 36175872
+endef
+
+define Device/netgear_srr60
+       $(call Device/netgear_srx60)
+       DEVICE_MODEL := SRR60
+       NETGEAR_BOARD_ID := SRR60
+endef
+TARGET_DEVICES += netgear_srr60
+
+define Device/netgear_srs60
+       $(call Device/netgear_srx60)
+       DEVICE_MODEL := SRS60
+       NETGEAR_BOARD_ID := SRS60
+endef
+TARGET_DEVICES += netgear_srs60
+
 define Device/netgear_wac510
        $(call Device/FitImage)
        $(call Device/UbiFit)
@@ -692,6 +764,32 @@ define Device/openmesh_a62
 endef
 TARGET_DEVICES += openmesh_a62
 
+define Device/p2w_r619ac
+       $(call Device/FitzImage)
+       $(call Device/UbiFit)
+       DEVICE_VENDOR := P&W
+       DEVICE_MODEL := R619AC
+       SOC := qcom-ipq4019
+       DEVICE_DTS_CONFIG := config@10
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       DEVICE_PACKAGES := ipq-wifi-p2w_r619ac
+endef
+
+define Device/p2w_r619ac-64m
+       $(call Device/p2w_r619ac)
+       DEVICE_VARIANT := 64M NAND
+       IMAGES += nand-factory.bin
+       IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
+endef
+TARGET_DEVICES += p2w_r619ac-64m
+
+define Device/p2w_r619ac-128m
+       $(call Device/p2w_r619ac)
+       DEVICE_VARIANT := 128M NAND
+endef
+TARGET_DEVICES += p2w_r619ac-128m
+
 define Device/plasmacloud_pa1200
        $(call Device/FitImageLzma)
        DEVICE_VENDOR := Plasma Cloud
@@ -720,7 +818,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
+       DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud_pa2200
 endef
 TARGET_DEVICES += plasmacloud_pa2200
 
@@ -736,6 +834,7 @@ define Device/qcom_ap-dk01.1-c1
        IMAGE_SIZE := 26624k
        $(call Device/FitImage)
        IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
+       DEFAULT := n
 endef
 TARGET_DEVICES += qcom_ap-dk01.1-c1
 
@@ -752,6 +851,7 @@ define Device/qcom_ap-dk04.1-c1
        BLOCKSIZE := 128k
        PAGESIZE := 2048
        BOARD_NAME := ap-dk04.1-c1
+       DEFAULT := n
 endef
 TARGET_DEVICES += qcom_ap-dk04.1-c1
 
@@ -766,6 +866,7 @@ define Device/qxwlan_e2600ac-c1
        IMAGE_SIZE := 31232k
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
        DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
+       DEFAULT := n
 endef
 TARGET_DEVICES += qxwlan_e2600ac-c1
 
@@ -783,6 +884,22 @@ define Device/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/unielec_u4019-32m
        $(call Device/FitImage)
        DEVICE_VENDOR := Unielec
@@ -793,6 +910,7 @@ define Device/unielec_u4019-32m
        KERNEL_SIZE := 4096k
        IMAGE_SIZE := 31232k
        IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
+       DEFAULT := n
 endef
 TARGET_DEVICES += unielec_u4019-32m