From 7cbe34170e3d8471c1ebacde33a2372c92433be4 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 11 Mar 2023 03:56:35 +0000 Subject: mediatek: add support for the GL.iNet GL-MT3000 The MT-3000 is a pocket-sized Wi-Fi 6 router based on MediaTek MT7981. Specification: - SoC: MediaTek MT7981B - CPU: 2x 1.3 GHz Cortex-A53 - Flash: 256 MiB Macronix SPI NAND - RAM: 512 MiB Nanya DDR4 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN) - Ethernet: - 1x 10/100/1000 Mbps built-in PHY (LAN) - 1x 10/100/1000/2500 Mbps MaxLinear GPY211 PHY (WAN) - USB 3.0 port - Buttons: 1 button, 1 switch - LEDs: 1x light-blue, 1x warm-white - Serial console: internal 4-pin header, 115200 8n1 - PWM controlled fan with tacho - Power: 5 VDC, 3 A (USB Type-C) Signed-off-by: Daniel Golle --- target/linux/mediatek/image/filogic.mk | 47 +++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'target/linux/mediatek/image') diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 821827e3ca..dcd048046c 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -36,6 +36,36 @@ define Build/mt7986-gpt rm $@.tmp endef +metadata_gl_json = \ + '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \ + "metadata_version": "1.1", \ + "compat_version": "$(call json_quote,$(compat_version))", \ + $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \ + $(if $(filter-out 1.0,$(compat_version)),"new_supported_devices": \ + [$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma) \ + "supported_devices": ["$(call json_quote,$(legacy_supported_message))"]$(comma)) \ + $(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \ + "version": { \ + "release": "$(call json_quote,$(VERSION_NUMBER))", \ + "date": "$(shell TZ='Asia/Chongqing' date '+%Y%m%d%H%M%S')", \ + "dist": "$(call json_quote,$(VERSION_DIST))", \ + "version": "$(call json_quote,$(VERSION_NUMBER))", \ + "revision": "$(call json_quote,$(REVISION))", \ + "target": "$(call json_quote,$(TARGETID))", \ + "board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \ + }, \ + "upgrade_control":"$(shell python3 $(TOPDIR)/make_gl_metadata.py)", \ + "release_note":"$(shell sed ':a;N;s/\n/\\n/g;s/\r/\\r/g;ta' $(TOPDIR)/gl_release_note)" \ + }' + +define Build/append-gl-metadata + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + [ ! -s "$(BUILD_KEY)" -o ! -s "$@" ] || { \ + usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\ + fwtool -S "$@.sig" "$@" ;\ + } +endef + define Device/asus_tuf-ax4200 DEVICE_VENDOR := ASUS DEVICE_MODEL := TUF-AX4200 @@ -52,7 +82,6 @@ define Device/asus_tuf-ax4200 endef TARGET_DEVICES += asus_tuf-ax4200 - define Device/bananapi_bpi-r3 DEVICE_VENDOR := Bananapi DEVICE_MODEL := BPi-R3 @@ -119,6 +148,22 @@ define Device/cudy_wr3000-v1 endef TARGET_DEVICES += cudy_wr3000-v1 +define Device/glinet_gl-mt3000 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT3000 + DEVICE_DTS := mt7981b-glinet-gl-mt3000 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += glinet,mt3000-snand + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 246272k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata +endef +TARGET_DEVICES += glinet_gl-mt3000 + define Device/mediatek_mt7986a-rfb-nand DEVICE_VENDOR := MediaTek DEVICE_MODEL := MT7986 rfba AP (NAND) -- cgit v1.2.3