From: Zhenfu Shi Date: Wed, 20 Aug 2025 04:00:26 +0000 (+1000) Subject: mediatek: filogic: support WAVLINK WL-WN586X3 Rev B X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F19785%2Fhead;p=thirdparty%2Fopenwrt.git mediatek: filogic: support WAVLINK WL-WN586X3 Rev B This commit adds support for the WAVLINK WL-WN586X3 Rev B, which swaps the 16MB NOR flash for an 128MB NAND flash chip, and uses UBI for data partition. This commit utilizes the previous submitted dtsi that includes common hardware for a few Wavlink routers. Hardware -------- - SOC: MediaTek MT7981B - RAM: 256MB DDR3 - Flash: 128MB SPI-NAND (ESMT F50L1G41LB) - Ethernet: 2x1Gb Lan 1x1Gb Wan - WiFi: MediaTek MT7981B 2x2 DBDC 802.11ax 2T2R (2.4/5) with 4 external and 1 internal antennae - LEDs: 2xLan 1x Wan 1x WIFI 1xSTATUS Installation ------------ Flashing over the vendor WebUI has been tested and unsuccessful (YMMV). The image need to be flashed via TFTP which can be activated over the onboard UART serial console: 1. Connect UART: TX->board RX, RX->board TX, GND->board GND. 2. Connect PC to router lan port. 3. Setup the tftp server on PC, set IP to 192.168.10.100. 4. Power on the device. Interrupt boot countdown at uboot boot menu and select 2. Upgrade firmware option. 5. Input the image name and start flashing. Sample uboot menu: ``` *** U-Boot Boot Menu *** 1. Startup system (Default) 2. Upgrade firmware 3. Upgrade ATF BL2 4. Upgrade ATF FIP 5. Upgrade single image 6. Load image 0. U-Boot console ``` NOTE: Do not use the intermediate image here which is for Rev A only: https://github.com/themaverickdm/firmware-misc/tree/main/wavlink/wl-wn586x3 MAC Addresses ------------- LAN: 80:3F:5D:xx:xx:x1 (hw, 0x44e, ASCII encoded) WAN: 80:3F:5D:xx:xx:x2 (hw, 0x460, ASCII encoded) 2G: 80:3F:5D:xx:xx:x3 (factory, 0x4, raw binary, also on label) 5G: 80:3F:5D:xx:xx:x3 (Same as 2G) Signed-off-by: Zhenfu Shi Link: https://github.com/openwrt/openwrt/pull/19785 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn586x3b.dts b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn586x3b.dts new file mode 100644 index 00000000000..10a4cf02a4e --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn586x3b.dts @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7981b-wavlink-wl-3port-128nand-common.dtsi" + +/ { + model = "WAVLINK WL-WN586X3 Rev B"; + compatible = "wavlink,wl-wn586x3b", "mediatek,mt7981b"; + + aliases { + label-mac-device = &wifi; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + serial0 = &uart0; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + }; + + led-1 { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_status_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + }; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index f2b773636cf..878b1367a09 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -214,7 +214,8 @@ wavlink,wl-wn551x3) ucidef_set_led_netdev "lan-2" "lan-2" "green:lan-2" "lan2" "link tx rx" ucidef_set_led_netdev "wan" "wan" "green:wan" "eth1" "link tx rx" ;; -wavlink,wl-wn586x3) +wavlink,wl-wn586x3|\ +wavlink,wl-wn586x3b) ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx" ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index c5709f74f4d..22db184e91b 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -145,7 +145,8 @@ mediatek_setup_interfaces() ;; tplink,tl-xdr6086|\ wavlink,wl-wn551x3|\ - wavlink,wl-wn586x3) + wavlink,wl-wn586x3|\ + wavlink,wl-wn586x3b) ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 ;; tplink,archer-ax80-v1) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 434ae115761..1374f8f1f86 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -2053,6 +2053,25 @@ define Device/wavlink_wl-wn586x3 endef TARGET_DEVICES += wavlink_wl-wn586x3 +define Device/wavlink_wl-wn586x3b + DEVICE_VENDOR := WAVLINK + DEVICE_MODEL := WL-WN586X3B + DEVICE_DTS := mt7981b-wavlink-wl-wn586x3b + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_INITRAMFS_SUFFIX := .itb + KERNEL_IN_UBI := 1 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + IMAGES := factory.bin initramfs-kernel.bin sysupgrade.bin + IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += wavlink_wl-wn586x3b + define Device/wavlink_wl-wn573hx3 DEVICE_VENDOR := WAVLINK DEVICE_MODEL := WL-WN573HX3