]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: support WAVLINK WL-WN586X3 Rev B 19785/head
authorZhenfu Shi <i0ntempest@i0ntempest.com>
Wed, 20 Aug 2025 04:00:26 +0000 (14:00 +1000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Aug 2025 13:50:46 +0000 (15:50 +0200)
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 <i0ntempest@i0ntempest.com>
Link: https://github.com/openwrt/openwrt/pull/19785
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-wavlink-wl-wn586x3b.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/image/filogic.mk

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 (file)
index 0000000..10a4cf0
--- /dev/null
@@ -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 = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
+                       gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+               };
+
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN;
+                       gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy1tpt";
+               };
+
+               led_status_blue: led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+               };
+
+               led-3 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <1>;
+                       gpios = <&pio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               led-4 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_LAN;
+                       function-enumerator = <2>;
+                       gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+               };
+
+       };
+};
index f2b773636cfb208bb1541aba491e6469f676cb5f..878b1367a09cc6ae1e1735636684689e72d2b4b3 100644 (file)
@@ -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"
index c5709f74f4d013401778a4f4183232c6b22cf48c..22db184e91b73aca7e1c2976e3167d05bfd121d2 100644 (file)
@@ -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)
index 434ae115761ba2cda9508f66c678684cdc6c84b2..1374f8f1f86ec2e3ebd25820f1cc3ce303e6e02e 100644 (file)
@@ -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