ramips: add support for GL.iNet microuter-N300
[openwrt/openwrt.git] / target / linux / ramips / image / mt76x8.mk
index dbd80a60531988d18d82544adc623495ce8ed23a..37cac84229d070cc73c0e9893534b76411288d21 100644 (file)
@@ -2,8 +2,9 @@
 # MT76x8 Profiles
 #
 
+DEFAULT_SOC := mt7628an
+
 define Device/alfa-network_awusfree1
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := ALFA Network
   DEVICE_MODEL := AWUSFREE1
@@ -12,18 +13,15 @@ endef
 TARGET_DEVICES += alfa-network_awusfree1
 
 define Device/buffalo_wcr-1166ds
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7936k
   BUFFALO_TAG_PLATFORM := MTK
   BUFFALO_TAG_VERSION := 9.99
   BUFFALO_TAG_MINOR := 9.99
   IMAGES += factory.bin
   IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
-  IMAGE/factory.bin := \
-       trx -M 0x746f435c | pad-rootfs | append-metadata | \
+  IMAGE/factory.bin := trx -M 0x746f435c | pad-rootfs | append-metadata | \
        buffalo-enc WCR-1166DS $$(BUFFALO_TAG_VERSION) -l | \
-       buffalo-tag-dhp WCR-1166DS JP JP | buffalo-enc-tag -l | \
-       buffalo-dhp-image
+       buffalo-tag-dhp WCR-1166DS JP JP | buffalo-enc-tag -l | buffalo-dhp-image
   DEVICE_VENDOR := Buffalo
   DEVICE_MODEL := WCR-1166DS
   DEVICE_PACKAGES := kmod-mt76x2
@@ -32,12 +30,11 @@ endef
 TARGET_DEVICES += buffalo_wcr-1166ds
 
 define Device/cudy_wr1000
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   IMAGES += factory.bin
-  IMAGE/factory.bin := \
-        $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 92.122
-  JCG_MAXSIZE := 8060928
+  IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
+       jcg-header 92.122
+  JCG_MAXSIZE := 7872k
   DEVICE_VENDOR := Cudy
   DEVICE_MODEL := WR1000
   DEVICE_PACKAGES := kmod-mt76x2
@@ -46,7 +43,6 @@ endef
 TARGET_DEVICES += cudy_wr1000
 
 define Device/d-team_pbr-d1
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := PandoraBox
   DEVICE_MODEL := PBR-D1
@@ -56,7 +52,6 @@ endef
 TARGET_DEVICES += d-team_pbr-d1
 
 define Device/duzun_dm06
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := DuZun
   DEVICE_MODEL := DM06
@@ -66,7 +61,6 @@ endef
 TARGET_DEVICES += duzun_dm06
 
 define Device/glinet_gl-mt300n-v2
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := GL-MT300N
@@ -76,8 +70,15 @@ define Device/glinet_gl-mt300n-v2
 endef
 TARGET_DEVICES += glinet_gl-mt300n-v2
 
+define Device/glinet_microuter-n300
+  IMAGE_SIZE := 16064k
+  DEVICE_VENDOR := GL.iNet
+  DEVICE_MODEL := microuter-N300
+  SUPPORTED_DEVICES += microuter-n300
+endef
+TARGET_DEVICES += glinet_microuter-n300
+
 define Device/glinet_vixmini
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := VIXMINI
@@ -86,7 +87,6 @@ endef
 TARGET_DEVICES += glinet_vixmini
 
 define Device/hilink_hlk-7628n
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := HILINK
   DEVICE_MODEL := HLK-7628N
@@ -94,7 +94,6 @@ endef
 TARGET_DEVICES += hilink_hlk-7628n
 
 define Device/hiwifi_hc5661a
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 15808k
   DEVICE_VENDOR := HiWiFi
   DEVICE_MODEL := HC5661A
@@ -103,7 +102,6 @@ endef
 TARGET_DEVICES += hiwifi_hc5661a
 
 define Device/hiwifi_hc5761a
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 15808k
   DEVICE_VENDOR := HiWiFi
   DEVICE_MODEL := HC5761A
@@ -112,7 +110,6 @@ endef
 TARGET_DEVICES += hiwifi_hc5761a
 
 define Device/hiwifi_hc5861b
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 15808k
   DEVICE_VENDOR := HiWiFi
   DEVICE_MODEL := HC5861B
@@ -121,7 +118,6 @@ endef
 TARGET_DEVICES += hiwifi_hc5861b
 
 define Device/iptime_a3
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7936k
   UIMAGE_NAME := a3
   DEVICE_VENDOR := ipTIME
@@ -131,7 +127,6 @@ endef
 TARGET_DEVICES += iptime_a3
 
 define Device/iptime_a604m
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7936k
   UIMAGE_NAME := a604m
   DEVICE_VENDOR := ipTIME
@@ -141,7 +136,6 @@ endef
 TARGET_DEVICES += iptime_a604m
 
 define Device/mediatek_linkit-smart-7688
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := MediaTek
   DEVICE_MODEL := LinkIt Smart 7688
@@ -151,7 +145,6 @@ endef
 TARGET_DEVICES += mediatek_linkit-smart-7688
 
 define Device/mediatek_mt7628an-eval-board
-  MTK_SOC := mt7628an
   BLOCKSIZE := 64k
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := MediaTek
@@ -162,7 +155,6 @@ endef
 TARGET_DEVICES += mediatek_mt7628an-eval-board
 
 define Device/mercury_mac1200r-v2
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7936k
   DEVICE_VENDOR := Mercury
   DEVICE_MODEL := MAC1200R
@@ -174,7 +166,6 @@ endef
 TARGET_DEVICES += mercury_mac1200r-v2
 
 define Device/netgear_r6120
-  MTK_SOC := mt7628an
   BLOCKSIZE := 64k
   IMAGE_SIZE := 15744k
   DEVICE_VENDOR := NETGEAR
@@ -184,15 +175,17 @@ define Device/netgear_r6120
   SERCOMM_HWVER := A001
   SERCOMM_SWVER := 0x0040
   IMAGES += factory.img
-  IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs
-  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
-  IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | pad-to $$$$(BLOCKSIZE) | \
-       sercom-footer | pad-to 128 | zip R6120.bin | sercom-seal
+  IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | \
+       pad-rootfs
+  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
+       check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | \
+       pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip R6120.bin | \
+       sercom-seal
 endef
 TARGET_DEVICES += netgear_r6120
 
 define Device/onion_omega2
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Onion
   DEVICE_MODEL := Omega2
@@ -202,7 +195,6 @@ endef
 TARGET_DEVICES += onion_omega2
 
 define Device/onion_omega2p
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := Onion
   DEVICE_MODEL := Omega2+
@@ -212,7 +204,6 @@ endef
 TARGET_DEVICES += onion_omega2p
 
 define Device/rakwireless_rak633
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Rakwireless
   DEVICE_MODEL := RAK633
@@ -221,7 +212,6 @@ endef
 TARGET_DEVICES += rakwireless_rak633
 
 define Device/skylab_skw92a
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Skylab
   DEVICE_MODEL := SKW92A
@@ -230,7 +220,6 @@ endef
 TARGET_DEVICES += skylab_skw92a
 
 define Device/tama_w06
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 15040k
   DEVICE_VENDOR := Tama
   DEVICE_MODEL := W06
@@ -239,7 +228,6 @@ endef
 TARGET_DEVICES += tama_w06
 
 define Device/totolink_lr1200
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := TOTOLINK
   DEVICE_MODEL := LR1200
@@ -248,7 +236,6 @@ endef
 TARGET_DEVICES += totolink_lr1200
 
 define Device/tplink
-  MTK_SOC := mt7628an
   DEVICE_VENDOR := TP-Link
   TPLINK_FLASHLAYOUT :=
   TPLINK_HWID :=
@@ -263,7 +250,21 @@ define Device/tplink
   IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
        check-size $$$$(IMAGE_SIZE)
 endef
-DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD
+DEVICE_VARS += TPLINK_HVERSION
+
+define Device/tplink-safeloader
+  DEVICE_VENDOR := TP-Link
+  TPLINK_BOARD_ID :=
+  TPLINK_HWID := 0x0
+  TPLINK_HWREV := 0
+  TPLINK_HEADER_VERSION := 1
+  KERNEL := $(KERNEL_DTB) | tplink-v1-header -e -O
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
+       append-metadata | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
 
 define Device/tplink_archer-c20-v4
   $(Device/tplink)
@@ -280,6 +281,21 @@ define Device/tplink_archer-c20-v4
 endef
 TARGET_DEVICES += tplink_archer-c20-v4
 
+define Device/tplink_archer-c20-v5
+  $(Device/tplink)
+  IMAGE_SIZE := 7616k
+  DEVICE_MODEL := Archer C20
+  DEVICE_VARIANT := v5
+  TPLINK_FLASHLAYOUT := 8MSUmtk
+  TPLINK_HWID := 0xc200005
+  TPLINK_HWREV := 0x1
+  TPLINK_HWREVADD := 0x5
+  TPLINK_HVERSION := 3
+  DEVICE_PACKAGES := kmod-mt76x0e
+  IMAGES := sysupgrade.bin
+endef
+TARGET_DEVICES += tplink_archer-c20-v5
+
 define Device/tplink_archer-c50-v3
   $(Device/tplink)
   IMAGE_SIZE := 7808k
@@ -311,6 +327,16 @@ define Device/tplink_archer-c50-v4
 endef
 TARGET_DEVICES += tplink_archer-c50-v4
 
+define Device/tplink_re305-v1
+  $(Device/tplink-safeloader)
+  IMAGE_SIZE := 6016k
+  DEVICE_MODEL := RE305
+  DEVICE_VARIANT := v1
+  DEVICE_PACKAGES := kmod-mt76x2
+  TPLINK_BOARD_ID := RE305-V1
+endef
+TARGET_DEVICES += tplink_re305-v1
+
 define Device/tplink_tl-mr3020-v3
   $(Device/tplink)
   IMAGE_SIZE := 7808k
@@ -380,7 +406,6 @@ endef
 TARGET_DEVICES += tplink_tl-wr840n-v4
 
 define Device/tplink_tl-wr840n-v5
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 3904k
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := TL-WR840N
@@ -450,12 +475,12 @@ define Device/tplink_tl-wr902ac-v3
   TPLINK_HWREV := 0x89
   TPLINK_HWREVADD := 0x1
   TPLINK_HVERSION := 3
-  DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci \
+       kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += tplink_tl-wr902ac-v3
 
 define Device/unielec_u7628-01-16m
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7628-01
@@ -466,29 +491,26 @@ endef
 TARGET_DEVICES += unielec_u7628-01-16m
 
 define Device/vocore_vocore2
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := VoCore
   DEVICE_MODEL := VoCore2
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
-    kmod-sdhci-mt7620
+       kmod-sdhci-mt7620
   SUPPORTED_DEVICES += vocore2
 endef
 TARGET_DEVICES += vocore_vocore2
 
 define Device/vocore_vocore2-lite
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := VoCore
   DEVICE_MODEL := VoCore2-Lite
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
-    kmod-sdhci-mt7620
+       kmod-sdhci-mt7620
   SUPPORTED_DEVICES += vocore2lite
 endef
 TARGET_DEVICES += vocore_vocore2-lite
 
 define Device/wavlink_wl-wn570ha1
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Wavlink
   DEVICE_MODEL := WL-WN570HA1
@@ -497,7 +519,6 @@ endef
 TARGET_DEVICES += wavlink_wl-wn570ha1
 
 define Device/wavlink_wl-wn575a3
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Wavlink
   DEVICE_MODEL := WL-WN575A3
@@ -507,7 +528,6 @@ endef
 TARGET_DEVICES += wavlink_wl-wn575a3
 
 define Device/widora_neo-16m
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Widora
   DEVICE_MODEL := Widora-NEO
@@ -518,7 +538,6 @@ endef
 TARGET_DEVICES += widora_neo-16m
 
 define Device/widora_neo-32m
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := Widora
   DEVICE_MODEL := Widora-NEO
@@ -528,7 +547,6 @@ endef
 TARGET_DEVICES += widora_neo-32m
 
 define Device/wiznet_wizfi630s
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := WIZnet
   DEVICE_MODEL := WizFi630S
@@ -536,7 +554,6 @@ endef
 TARGET_DEVICES += wiznet_wizfi630s
 
 define Device/wrtnode_wrtnode2p
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := WRTnode
   DEVICE_MODEL := WRTnode 2P
@@ -546,7 +563,6 @@ endef
 TARGET_DEVICES += wrtnode_wrtnode2p
 
 define Device/wrtnode_wrtnode2r
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := WRTnode
   DEVICE_MODEL := WRTnode 2R
@@ -556,7 +572,6 @@ endef
 TARGET_DEVICES += wrtnode_wrtnode2r
 
 define Device/xiaomi_mir4a-100m
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 14976k
   DEVICE_VENDOR := Xiaomi
   DEVICE_MODEL := Mi Router 4A
@@ -566,7 +581,6 @@ endef
 TARGET_DEVICES += xiaomi_mir4a-100m
 
 define Device/xiaomi_miwifi-nano
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Xiaomi
   DEVICE_MODEL := MiWiFi Nano
@@ -576,7 +590,6 @@ endef
 TARGET_DEVICES += xiaomi_miwifi-nano
 
 define Device/zbtlink_zbt-we1226
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WE1226
@@ -584,12 +597,12 @@ endef
 TARGET_DEVICES += zbtlink_zbt-we1226
 
 define Device/zyxel_keenetic-extra-ii
-  MTK_SOC := mt7628an
   IMAGE_SIZE := 14912k
   BLOCKSIZE := 64k
   DEVICE_VENDOR := ZyXEL
   DEVICE_MODEL := Keenetic Extra II
-  DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci \
+       kmod-usb-ledtrig-usbport
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \
        check-size $$$$(IMAGE_SIZE) | zyimage -d 6162 -v "ZyXEL Keenetic Extra II"