ramips: mt7621: drop custom uImage function
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
index 7050b90cbbe59ca7eba18c28f3f80c67edf1ebd3..d3b96f5f4be7e1acbf202ce076c14c80d88f9915 100644 (file)
@@ -7,21 +7,7 @@ include ./common-tp-link.mk
 DEFAULT_SOC := mt7621
 
 KERNEL_DTB += -d21
-DEVICE_VARS += UIMAGE_MAGIC ELECOM_HWNAME LINKSYS_HWNAME
-
-# The OEM webinterface expects an kernel with initramfs which has the uImage
-# header field ih_name.
-# We don't want to set the header name field for the kernel include in the
-# sysupgrade image as well, as this image shouldn't be accepted by the OEM
-# webinterface. It will soft-brick the board.
-define Build/custom-initramfs-uimage
-       mkimage -A $(LINUX_KARCH) \
-               -O linux -T kernel \
-               -C lzma -a $(KERNEL_LOADADDR) $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC),) \
-               -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-               -n '$(1)' -d $@ $@.new
-       mv $@.new $@
-endef
+DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME
 
 define Build/elecom-wrc-gs-factory
        $(eval product=$(word 1,$(1)))
@@ -105,7 +91,13 @@ define Build/ubnt-erx-factory-image
        fi
 endef
 
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
+
 define Device/adslr_g7
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := ADSLR
   DEVICE_MODEL := G7
@@ -114,6 +106,7 @@ endef
 TARGET_DEVICES += adslr_g7
 
 define Device/afoundry_ew1200
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := AFOUNDRY
   DEVICE_MODEL := EW1200
@@ -124,31 +117,35 @@ endef
 TARGET_DEVICES += afoundry_ew1200
 
 define Device/alfa-network_quad-e4g
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := ALFA Network
   DEVICE_MODEL := Quad-E4G
   DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools \
-       -wpad-basic
+       -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += alfa-network_quad-e4g
 
 define Device/asiarf_ap7621-001
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := AsiaRF
   DEVICE_MODEL := AP7621-001
-  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += asiarf_ap7621-001
 
 define Device/asiarf_ap7621-nv1
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := AsiaRF
   DEVICE_MODEL := AP7621-NV1
-  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += asiarf_ap7621-nv1
 
 define Device/asus_rt-ac57u
+  $(Device/dsa-migration)
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AC57U
   IMAGE_SIZE := 16064k
@@ -158,6 +155,7 @@ endef
 TARGET_DEVICES += asus_rt-ac57u
 
 define Device/asus_rt-ac65p
+  $(Device/dsa-migration)
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AC65P
   IMAGE_SIZE := 51200k
@@ -174,6 +172,7 @@ endef
 TARGET_DEVICES += asus_rt-ac65p
 
 define Device/asus_rt-ac85p
+  $(Device/dsa-migration)
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AC85P
   IMAGE_SIZE := 51200k
@@ -190,6 +189,7 @@ endef
 TARGET_DEVICES += asus_rt-ac85p
 
 define Device/buffalo_wsr-1166dhp
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
   IMAGE_SIZE := 15936k
@@ -201,6 +201,7 @@ endef
 TARGET_DEVICES += buffalo_wsr-1166dhp
 
 define Device/buffalo_wsr-2533dhpl
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 7936k
   DEVICE_VENDOR := Buffalo
@@ -213,6 +214,7 @@ endef
 TARGET_DEVICES += buffalo_wsr-2533dhpl
 
 define Device/buffalo_wsr-600dhp
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Buffalo
   DEVICE_MODEL := WSR-600DHP
@@ -222,6 +224,7 @@ endef
 TARGET_DEVICES += buffalo_wsr-600dhp
 
 define Device/dlink_dir-8xx-a1
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := D-Link
   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
@@ -234,6 +237,7 @@ define Device/dlink_dir-8xx-a1
 endef
 
 define Device/dlink_dir-xx60-a1
+  $(Device/dsa-migration)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   KERNEL_SIZE := 4096k
@@ -256,7 +260,22 @@ define Device/dlink_dir-1960-a1
 endef
 TARGET_DEVICES += dlink_dir-1960-a1
 
+define Device/dlink_dir-2640-a1
+  $(Device/dlink_dir-xx60-a1)
+  DEVICE_MODEL := DIR-2640
+  DEVICE_VARIANT := A1
+endef
+TARGET_DEVICES += dlink_dir-2640-a1
+
+define Device/dlink_dir-2660-a1
+  $(Device/dlink_dir-xx60-a1)
+  DEVICE_MODEL := DIR-2660
+  DEVICE_VARIANT := A1
+endef
+TARGET_DEVICES += dlink_dir-2660-a1
+
 define Device/dlink_dir-860l-b1
+  $(Device/dsa-migration)
   $(Device/seama)
   BLOCKSIZE := 64k
   SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
@@ -295,6 +314,7 @@ endef
 TARGET_DEVICES += dlink_dir-882-a1
 
 define Device/d-team_newifi-d2
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := Newifi
@@ -305,7 +325,8 @@ endef
 TARGET_DEVICES += d-team_newifi-d2
 
 define Device/d-team_pbr-m1
-  IMAGE_SIZE := 16064k
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 32448k
   DEVICE_VENDOR := PandoraBox
   DEVICE_MODEL := PBR-M1
   DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
@@ -315,6 +336,7 @@ endef
 TARGET_DEVICES += d-team_pbr-m1
 
 define Device/edimax_ra21s
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Edimax
@@ -329,6 +351,7 @@ endef
 TARGET_DEVICES += edimax_ra21s
 
 define Device/edimax_re23s
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 15680k
   DEVICE_VENDOR := Edimax
@@ -347,6 +370,7 @@ endef
 TARGET_DEVICES += edimax_re23s
 
 define Device/edimax_rg21s
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Edimax
@@ -359,6 +383,7 @@ endef
 TARGET_DEVICES += edimax_rg21s
 
 define Device/elecom_wrc-1167ghbk2-s
+  $(Device/dsa-migration)
   IMAGE_SIZE := 15488k
   DEVICE_VENDOR := ELECOM
   DEVICE_MODEL := WRC-1167GHBK2-S
@@ -370,6 +395,7 @@ endef
 TARGET_DEVICES += elecom_wrc-1167ghbk2-s
 
 define Device/elecom_wrc-gs
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := ELECOM
   IMAGES += factory.bin
@@ -419,6 +445,7 @@ endef
 TARGET_DEVICES += elecom_wrc-2533gst2
 
 define Device/firefly_firewrt
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Firefly
   DEVICE_MODEL := FireWRT
@@ -428,6 +455,7 @@ endef
 TARGET_DEVICES += firefly_firewrt
 
 define Device/gehua_ghl-r-001
+  $(Device/dsa-migration)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := GeHua
   DEVICE_MODEL := GHL-R-001
@@ -437,22 +465,25 @@ endef
 TARGET_DEVICES += gehua_ghl-r-001
 
 define Device/gnubee_gb-pc1
+  $(Device/dsa-migration)
   DEVICE_VENDOR := GnuBee
   DEVICE_MODEL := Personal Cloud One
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-wolfssl
   IMAGE_SIZE := 32448k
 endef
 TARGET_DEVICES += gnubee_gb-pc1
 
 define Device/gnubee_gb-pc2
+  $(Device/dsa-migration)
   DEVICE_VENDOR := GnuBee
   DEVICE_MODEL := Personal Cloud Two
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-wolfssl
   IMAGE_SIZE := 32448k
 endef
 TARGET_DEVICES += gnubee_gb-pc2
 
 define Device/hiwifi_hc5962
+  $(Device/dsa-migration)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   KERNEL_SIZE := 4096k
@@ -469,6 +500,7 @@ endef
 TARGET_DEVICES += hiwifi_hc5962
 
 define Device/iodata_wn-ax1167gr
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 15552k
   KERNEL_INITRAMFS := $$(KERNEL) | \
@@ -480,6 +512,7 @@ endef
 TARGET_DEVICES += iodata_wn-ax1167gr
 
 define Device/iodata_nand
+  $(Device/dsa-migration)
   DEVICE_VENDOR := I-O DATA
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -491,37 +524,41 @@ define Device/iodata_nand
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 
+# The OEM webinterface expects an kernel with initramfs which has the uImage
+# header field ih_name.
+# We don't want to set the header name field for the kernel include in the
+# sysupgrade image as well, as this image shouldn't be accepted by the OEM
+# webinterface. It will soft-brick the board.
+
 define Device/iodata_wn-ax1167gr2
   $(Device/iodata_nand)
-  UIMAGE_MAGIC := 0x434f4d42
   DEVICE_MODEL := WN-AX1167GR2
   KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
-       custom-initramfs-uimage 3.10(XBC.1)b10 | iodata-mstc-header
+       uImage lzma -M 0x434f4d42 -n '3.10(XBC.1)b10' | iodata-mstc-header
   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
 endef
 TARGET_DEVICES += iodata_wn-ax1167gr2
 
 define Device/iodata_wn-ax2033gr
   $(Device/iodata_nand)
-  UIMAGE_MAGIC := 0x434f4d42
   DEVICE_MODEL := WN-AX2033GR
   KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
-       custom-initramfs-uimage 3.10(VST.1)C10 | iodata-mstc-header
+       uImage lzma -M 0x434f4d42 -n '3.10(VST.1)C10' | iodata-mstc-header
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware
 endef
 TARGET_DEVICES += iodata_wn-ax2033gr
 
 define Device/iodata_wn-dx1167r
   $(Device/iodata_nand)
-  UIMAGE_MAGIC := 0x434f4d43
   DEVICE_MODEL := WN-DX1167R
   KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
-       custom-initramfs-uimage 3.10(XIK.1)b10 | iodata-mstc-header
+       uImage lzma -M 0x434f4d43 -n '3.10(XIK.1)b10' | iodata-mstc-header
   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
 endef
 TARGET_DEVICES += iodata_wn-dx1167r
 
 define Device/iodata_wn-gx300gr
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 7616k
   DEVICE_VENDOR := I-O DATA
@@ -531,6 +568,7 @@ endef
 TARGET_DEVICES += iodata_wn-gx300gr
 
 define Device/iodata_wnpr2600g
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := I-O DATA
   DEVICE_MODEL := WNPR2600G
@@ -543,6 +581,7 @@ endef
 TARGET_DEVICES += iodata_wnpr2600g
 
 define Device/iptime_a6ns-m
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16128k
   UIMAGE_NAME := a6nm
   DEVICE_VENDOR := ipTIME
@@ -553,6 +592,7 @@ endef
 TARGET_DEVICES += iptime_a6ns-m
 
 define Device/iptime_a8004t
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16128k
   UIMAGE_NAME := a8004t
   DEVICE_VENDOR := ipTIME
@@ -562,6 +602,7 @@ endef
 TARGET_DEVICES += iptime_a8004t
 
 define Device/jcg_jhr-ac876m
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | jcg-header 89.1
@@ -574,6 +615,7 @@ endef
 TARGET_DEVICES += jcg_jhr-ac876m
 
 define Device/lenovo_newifi-d1
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := Newifi
@@ -585,6 +627,7 @@ endef
 TARGET_DEVICES += lenovo_newifi-d1
 
 define Device/linksys_ea7xxx
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -608,6 +651,15 @@ define Device/linksys_ea7300-v1
 endef
 TARGET_DEVICES += linksys_ea7300-v1
 
+define Device/linksys_ea7300-v2
+  $(Device/linksys_ea7xxx)
+  DEVICE_MODEL := EA7300
+  DEVICE_VARIANT := v2
+  LINKSYS_HWNAME := EA7300v2
+  DEVICE_PACKAGES += kmod-mt7603
+endef
+TARGET_DEVICES += linksys_ea7300-v2
+
 define Device/linksys_ea7500-v2
   $(Device/linksys_ea7xxx)
   DEVICE_MODEL := EA7500
@@ -617,6 +669,7 @@ endef
 TARGET_DEVICES += linksys_ea7500-v2
 
 define Device/linksys_re6500
+  $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := RE6500
@@ -626,30 +679,33 @@ endef
 TARGET_DEVICES += linksys_re6500
 
 define Device/mediatek_ap-mt7621a-v60
+  $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Mediatek
   DEVICE_MODEL := AP-MT7621A-V60 EVB
-  DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 -wpad-basic
+  DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += mediatek_ap-mt7621a-v60
 
 define Device/mediatek_mt7621-eval-board
+  $(Device/dsa-migration)
   BLOCKSIZE := 64k
   IMAGE_SIZE := 15104k
   DEVICE_VENDOR := MediaTek
   DEVICE_MODEL := MT7621 EVB
-  DEVICE_PACKAGES := -wpad-basic
+  DEVICE_PACKAGES := -wpad-basic-wolfssl
   SUPPORTED_DEVICES += mt7621
 endef
 TARGET_DEVICES += mediatek_mt7621-eval-board
 
 define Device/MikroTik
+  $(Device/dsa-migration)
   DEVICE_VENDOR := MikroTik
   BLOCKSIZE := 64k
   IMAGE_SIZE := 16128k
   DEVICE_PACKAGES := kmod-usb3
-  LOADER_TYPE := elf
-  KERNEL := $(KERNEL_DTB) | loader-kernel
+  KERNEL_NAME := vmlinuz
+  KERNEL := kernel-bin | append-dtb-elf
   IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \
        pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | \
        check-size
@@ -658,15 +714,22 @@ endef
 define Device/mikrotik_routerboard-750gr3
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD 750Gr3
-  DEVICE_PACKAGES += kmod-gpio-beeper -wpad-basic
+  DEVICE_PACKAGES += -wpad-basic-wolfssl
   SUPPORTED_DEVICES += mikrotik,rb750gr3
 endef
 TARGET_DEVICES += mikrotik_routerboard-750gr3
 
+define Device/mikrotik_routerboard-760igs
+  $(Device/MikroTik)
+  DEVICE_MODEL := RouterBOARD 760iGS
+  DEVICE_PACKAGES += kmod-sfp -wpad-basic-wolfssl
+endef
+TARGET_DEVICES += mikrotik_routerboard-760igs
+
 define Device/mikrotik_routerboard-m11g
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD M11G
-  DEVICE_PACKAGES := -wpad-basic
+  DEVICE_PACKAGES := -wpad-basic-wolfssl
   SUPPORTED_DEVICES += mikrotik,rbm11g
 endef
 TARGET_DEVICES += mikrotik_routerboard-m11g
@@ -674,12 +737,13 @@ TARGET_DEVICES += mikrotik_routerboard-m11g
 define Device/mikrotik_routerboard-m33g
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD M33G
-  DEVICE_PACKAGES := -wpad-basic
+  DEVICE_PACKAGES := -wpad-basic-wolfssl
   SUPPORTED_DEVICES += mikrotik,rbm33g
 endef
 TARGET_DEVICES += mikrotik_routerboard-m33g
 
 define Device/mqmaker_witi
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := MQmaker
   DEVICE_MODEL := WiTi
@@ -690,6 +754,7 @@ endef
 TARGET_DEVICES += mqmaker_witi
 
 define Device/mtc_wr1201
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := MTC
   DEVICE_MODEL := Wireless Router WR1201
@@ -700,6 +765,7 @@ endef
 TARGET_DEVICES += mtc_wr1201
 
 define Device/netgear_ex6150
+  $(Device/dsa-migration)
   DEVICE_VENDOR := NETGEAR
   DEVICE_MODEL := EX6150
   DEVICE_PACKAGES := kmod-mt76x2
@@ -711,6 +777,7 @@ endef
 TARGET_DEVICES += netgear_ex6150
 
 define Device/netgear_sercomm_nand
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -833,6 +900,7 @@ endef
 TARGET_DEVICES += netgear_wac124
 
 define Device/netgear_wndr3700-v5
+  $(Device/dsa-migration)
   $(Device/netgear_sercomm_nor)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 15232k
@@ -850,6 +918,7 @@ endef
 TARGET_DEVICES += netgear_wndr3700-v5
 
 define Device/netis_wf2881
+  $(Device/dsa-migration)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   FILESYSTEMS := squashfs
@@ -869,6 +938,7 @@ endef
 TARGET_DEVICES += netis_wf2881
 
 define Device/phicomm_k2p
+  $(Device/dsa-migration)
   IMAGE_SIZE := 15744k
   DEVICE_VENDOR := Phicomm
   DEVICE_MODEL := K2P
@@ -880,16 +950,18 @@ endef
 TARGET_DEVICES += phicomm_k2p
 
 define Device/planex_vr500
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 65216k
   DEVICE_VENDOR := Planex
   DEVICE_MODEL := VR500
-  DEVICE_PACKAGES := kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
   SUPPORTED_DEVICES += vr500
 endef
 TARGET_DEVICES += planex_vr500
 
 define Device/samknows_whitebox-v8
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := SamKnows
   DEVICE_MODEL := Whitebox 8
@@ -900,6 +972,7 @@ endef
 TARGET_DEVICES += samknows_whitebox-v8
 
 define Device/storylink_sap-g3200u3
+  $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := STORYLiNK
   DEVICE_MODEL := SAP-G3200U3
@@ -909,6 +982,7 @@ endef
 TARGET_DEVICES += storylink_sap-g3200u3
 
 define Device/telco-electronics_x1
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Telco Electronics
   DEVICE_MODEL := X1
@@ -917,16 +991,18 @@ endef
 TARGET_DEVICES += telco-electronics_x1
 
 define Device/thunder_timecloud
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Thunder
   DEVICE_MODEL := Timecloud
-  DEVICE_PACKAGES := kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
   SUPPORTED_DEVICES += timecloud
 endef
 TARGET_DEVICES += thunder_timecloud
 
 define Device/totolink_a7000r
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   UIMAGE_NAME := C8340R1C-9999
   DEVICE_VENDOR := TOTOLINK
@@ -935,7 +1011,18 @@ define Device/totolink_a7000r
 endef
 TARGET_DEVICES += totolink_a7000r
 
+define Device/totolink_x5000r
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 16064k
+  UIMAGE_NAME := C8343R-9999
+  DEVICE_VENDOR := TOTOLINK
+  DEVICE_MODEL := X5000R
+  DEVICE_PACKAGES := kmod-mt7915e
+endef
+TARGET_DEVICES += totolink_x5000r
+
 define Device/tplink_re350-v1
+  $(Device/dsa-migration)
   $(Device/tplink-safeloader)
   DEVICE_MODEL := RE350
   DEVICE_VARIANT := v1
@@ -947,6 +1034,7 @@ endef
 TARGET_DEVICES += tplink_re350-v1
 
 define Device/tplink_re500-v1
+  $(Device/dsa-migration)
   $(Device/tplink-safeloader)
   DEVICE_MODEL := RE500
   DEVICE_VARIANT := v1
@@ -957,6 +1045,7 @@ endef
 TARGET_DEVICES += tplink_re500-v1
 
 define Device/tplink_re650-v1
+  $(Device/dsa-migration)
   $(Device/tplink-safeloader)
   DEVICE_MODEL := RE650
   DEVICE_VARIANT := v1
@@ -967,6 +1056,7 @@ endef
 TARGET_DEVICES += tplink_re650-v1
 
 define Device/ubnt_edgerouter_common
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := Ubiquiti
   IMAGE_SIZE := 256768k
@@ -975,7 +1065,7 @@ define Device/ubnt_edgerouter_common
   KERNEL_INITRAMFS := $$(KERNEL) | \
        ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES += -wpad-basic
+  DEVICE_PACKAGES += -wpad-basic-wolfssl
 endef
 
 define Device/ubnt_edgerouter-x
@@ -994,6 +1084,7 @@ endef
 TARGET_DEVICES += ubnt_edgerouter-x-sfp
 
 define Device/ubnt_unifi-nanohd
+  $(Device/dsa-migration)
   DEVICE_VENDOR := Ubiquiti
   DEVICE_MODEL := UniFi nanoHD
   DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware
@@ -1002,26 +1093,40 @@ endef
 TARGET_DEVICES += ubnt_unifi-nanohd
 
 define Device/unielec_u7621-06-16m
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7621-06
   DEVICE_VARIANT := 16M
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
   SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m
 endef
 TARGET_DEVICES += unielec_u7621-06-16m
 
 define Device/unielec_u7621-06-64m
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 65216k
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7621-06
   DEVICE_VARIANT := 64M
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
   SUPPORTED_DEVICES += unielec,u7621-06-512m-64m
 endef
 TARGET_DEVICES += unielec_u7621-06-64m
 
+define Device/wavlink_wl-wn531a6
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Wavlink
+  DEVICE_MODEL := WL-WN531A6
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-usb3
+  IMAGE_SIZE := 15040k
+endef
+TARGET_DEVICES += wavlink_wl-wn531a6
+
 define Device/wevo_11acnas
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   UIMAGE_NAME := 11AC-NAS-Router(0.0.0)
   DEVICE_VENDOR := WeVO
@@ -1033,6 +1138,7 @@ endef
 TARGET_DEVICES += wevo_11acnas
 
 define Device/wevo_w2914ns-v2
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   UIMAGE_NAME := W2914NS-V2(0.0.0)
   DEVICE_VENDOR := WeVO
@@ -1045,6 +1151,7 @@ endef
 TARGET_DEVICES += wevo_w2914ns-v2
 
 define Device/winstars_ws-wn583a6
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Winstars
@@ -1057,6 +1164,7 @@ endef
 TARGET_DEVICES += winstars_ws-wn583a6
 
 define Device/xiaomi-ac2100
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -1079,6 +1187,7 @@ endef
 TARGET_DEVICES += xiaomi_mi-router-ac2100
 
 define Device/xiaomi_mir3g
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -1099,19 +1208,18 @@ endef
 TARGET_DEVICES += xiaomi_mir3g
 
 define Device/xiaomi_mir3g-v2
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 14848k
   DEVICE_VENDOR := Xiaomi
   DEVICE_MODEL := Mi Router 3G
   DEVICE_VARIANT := v2
-  DEVICE_ALT0_VENDOR := Xiaomi
-  DEVICE_ALT0_MODEL := Mi Router 4A
-  DEVICE_ALT0_VARIANT := Gigabit Edition
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
 endef
 TARGET_DEVICES += xiaomi_mir3g-v2
 
 define Device/xiaomi_mir3p
+  $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -1129,6 +1237,17 @@ define Device/xiaomi_mir3p
 endef
 TARGET_DEVICES += xiaomi_mir3p
 
+define Device/xiaomi_mi-router-4a-gigabit
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  IMAGE_SIZE := 14848k
+  DEVICE_VENDOR := Xiaomi
+  DEVICE_MODEL := Mi Router 4A
+  DEVICE_VARIANT := Gigabit Edition
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
+endef
+TARGET_DEVICES += xiaomi_mi-router-4a-gigabit
+
 define Device/xiaomi_redmi-router-ac2100
   $(Device/xiaomi-ac2100)
   DEVICE_MODEL := Redmi Router AC2100
@@ -1136,23 +1255,26 @@ endef
 TARGET_DEVICES += xiaomi_redmi-router-ac2100
 
 define Device/xiaoyu_xy-c5
+  $(Device/dsa-migration)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := XiaoYu
   DEVICE_MODEL := XY-C5
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 -wpad-basic
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += xiaoyu_xy-c5
 
 define Device/xzwifi_creativebox-v1
+  $(Device/dsa-migration)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := CreativeBox
   DEVICE_MODEL := v1
   DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
-       kmod-usb3 -wpad-basic
+       kmod-usb3 -wpad-basic-wolfssl
 endef
 TARGET_DEVICES += xzwifi_creativebox-v1
 
 define Device/youhua_wr1200js
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := YouHua
   DEVICE_MODEL := WR1200JS
@@ -1162,6 +1284,7 @@ endef
 TARGET_DEVICES += youhua_wr1200js
 
 define Device/youku_yk-l2
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Youku
   DEVICE_MODEL := YK-L2
@@ -1171,6 +1294,7 @@ endef
 TARGET_DEVICES += youku_yk-l2
 
 define Device/zbtlink_zbt-we1326
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WE1326
@@ -1180,6 +1304,7 @@ endef
 TARGET_DEVICES += zbtlink_zbt-we1326
 
 define Device/zbtlink_zbt-we3526
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WE3526
@@ -1189,6 +1314,7 @@ endef
 TARGET_DEVICES += zbtlink_zbt-we3526
 
 define Device/zbtlink_zbt-wg2626
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WG2626
@@ -1199,6 +1325,8 @@ endef
 TARGET_DEVICES += zbtlink_zbt-wg2626
 
 define Device/zbtlink_zbt-wg3526-16m
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WG3526
@@ -1210,6 +1338,8 @@ endef
 TARGET_DEVICES += zbtlink_zbt-wg3526-16m
 
 define Device/zbtlink_zbt-wg3526-32m
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WG3526
@@ -1221,6 +1351,7 @@ endef
 TARGET_DEVICES += zbtlink_zbt-wg3526-32m
 
 define Device/zio_freezio
+  $(Device/dsa-migration)
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := ZIO
   DEVICE_MODEL := FREEZIO
@@ -1230,6 +1361,7 @@ endef
 TARGET_DEVICES += zio_freezio
 
 define Device/zyxel_wap6805
+  $(Device/dsa-migration)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   KERNEL_SIZE := 4096k