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 <i0ntempest@i0ntempest.com>
Link: https://github.com/openwrt/openwrt/pull/19785
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Zhenfu Shi 2025-08-20 14:00:26 +10:00 committed by Hauke Mehrtens
parent f29bc8736a
commit 41106141b8
4 changed files with 80 additions and 2 deletions

View File

@ -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>;
};
};
};

View 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"

View 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)

View 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