[openwrt/openwrt] mediatek: filogic: Add support for Wavlink WL-WN551X3

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 8 03:23:54 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1a235a7f0b6c71d09a3111d518421f889ba80f15

commit 1a235a7f0b6c71d09a3111d518421f889ba80f15
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Thu Jul 24 10:04:42 2025 -0400

    mediatek: filogic: Add support for Wavlink WL-WN551X3
    
    Hardware
    --------
    - SOC: MediaTek MT7981B
    - RAM: 256MB DDR3
    - FLASH: 128MB SPI-NAND WinBond W25N01GVZEIG
    - NETWORK: 2x1Gb Lan 1x1Gb Wan
    - WIFI: MediaTek MT7981B 2x2 DBDC 802.11ax 2T2R (2.4/5)
    - LEDs: 3x WAN/LAN (green) 2x STATUS (red/blue)
    - USB: 1x XHCI
    
    Installation via Webinterface
    -----------------------------
    
    1. Rename OpenWrt sysupgrade bin to wavlink_wl-wn551X3-squashfs-sysupgrade.bin
       The uppercase chars 551X3 are essential and checked by web interface.
    2. Logon to webinterface
    3. Go to network configuration -> mode selection
    4. Choose mode "LAN bridge/access point"
    5. Save configuration (maybe network reconfig needed)
    6. Go to system upgrade
    7. Choose local upgrade and provide renamed sysupgrade file
    8. Start upgrade and wait for completion
    9. Logon to OpenWrt (network config is preserved during upgrade)
    
    Boot initramfs via TFTP & console
    ---------------------------------
    
    1. Connect switch to network via LAN1 or LAN2
    2. Power on switch
    3. Press ESC until prompt reached "MT7981>"
    4. Set own IP "setenv ipaddr 192.168.x.y"
    5. Set TFTP IP "setenv serverip 192.168.a.b"
    6. Set memory address "setenv loadaddr 0x46000000"
    7. Download image "tftpboot openwrt-mediatek-filogic-wavlink_wl-wn551x3-initramfs.itb"
    8. Boot image "bootm"
    
    Notes
    -----
    
    - The red/blue LEDs give a background illumination to the top of the
      case. The red LED is totally disabled to avoid noisy blinking.
    
    - Aside from the design and the different LED colors & placements
      the hardware and partitioning  matches the WAVLINK WL-WN586X3 Rev B.
      Therefor a common DTSI was prepared.
    
    MAC Addresses (same as stock)
    -----------------------------
    
    LAN   : 80:3F:5D:xx:xx:B1 (hw, 0x44e(text))
    WAN   : 80:3F:5D:xx:xx:B2 (hw, 0x460(text))
    2.4GHz: 80:3F:5D:xx:xx:B1 (Factory, 0x4 (hex))
    5GHz  : driver auto generated
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/19515
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mt7981b-wavlink-wl-3port-128nand-common.dtsi   | 210 +++++++++++++++++++++
 .../mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts    |  63 +++++++
 .../filogic/base-files/etc/board.d/01_leds         |   5 +
 .../filogic/base-files/etc/board.d/02_network      |   1 +
 target/linux/mediatek/image/filogic.mk             |  18 ++
 5 files changed, 297 insertions(+)

diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi b/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi
new file mode 100644
index 0000000000..f796a00810
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi
@@ -0,0 +1,210 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include "mt7981b.dtsi"
+
+/ {
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 11 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&pio {
+	spi0_flash_pins: spi0-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+
+		conf-pu {
+			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+			drive-strength = <8>;
+			bias-pull-up = <103>;
+		};
+
+		conf-pd {
+			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+			drive-strength = <8>;
+			bias-pull-down = <103>;
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		compatible = "spi-nand";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "bl2";
+				reg = <0x0 0x100000>;
+				read-only;
+			};
+
+			partition at 100000 {
+				label = "u-boot-env";
+				reg = <0x100000 0x80000>;
+				read-only;
+			};
+
+			factory: partition at 180000 {
+				label = "factory";
+				reg = <0x180000 0x200000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+					
+					eeprom_factory: eeprom at 0 {
+						reg = <0x0 0x1000>;
+					};					
+
+					macaddr_factory_4: macaddr at 4 {
+						reg = <0x4 0x6>;
+					};
+				};
+			};
+
+			partition at 380000 {
+				label = "fip";
+				reg = <0x380000 0x200000>;
+				read-only;
+			};
+
+			partition at 580000 {
+				label = "ubi";
+				reg = <0x580000 0x4000000>;
+			};
+
+			partition at 4580000 {
+				label = "hw";
+				reg = <0x4580000 0x80000>;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_hw_44e: macaddr at 44e {
+						compatible = "mac-base";
+						reg = <0x44e 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+		};
+	};
+};
+
+&eth {
+	status = "okay";
+
+	gmac0: mac at 0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+
+		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_hw_44e 0>;
+
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	gmac1: mac at 1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+
+		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&macaddr_hw_44e 1>;
+	};
+};
+
+&mdio_bus {
+	switch: switch at 1f {
+		compatible = "mediatek,mt7531";
+		reg = <31>;
+		reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&pio>;
+		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
+
+&switch {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port at 1 {
+			reg = <1>;
+			label = "lan2";
+		};
+
+		port at 2 {
+			reg = <2>;
+			label = "lan1";
+		};
+
+		port at 6 {
+			reg = <6>;
+			ethernet = <&gmac0>;
+			phy-mode = "2500base-x";
+
+			fixed-link {
+				speed = <2500>;
+				full-duplex;
+				pause;
+			};
+		};
+	};
+};
+
+&wifi {
+	status = "okay";
+	nvmem-cells = <&eeprom_factory 0>;
+	nvmem-cell-names = "eeprom";
+};
diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts
new file mode 100644
index 0000000000..0387c73dd1
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include "mt7981b-wavlink-wl-3port-128nand-common.dtsi"
+
+/ {
+	model = "WAVLINK WL-WN551X3";
+	compatible = "wavlink,wl-wn551x3", "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_status_blue: led-0 {
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-1 {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 8 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "none";
+		};
+
+		led-2 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <1>;
+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+		};
+
+		led-3 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <2>;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+		};
+
+		led-4 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WAN;
+			gpios = <&pio 25 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&usb_phy {
+        status = "okay";
+};
+
+&xhci {
+        status = "okay";
+};
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 6d4c7903bc..62a0161286 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
@@ -206,6 +206,11 @@ tplink,re6000xd)
 	ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx"
 	ucidef_set_led_netdev "eth1" "lan-3" "blue:lan-2" "eth1" "link tx rx"
 	;;
+wavlink,wl-wn551x3)
+        ucidef_set_led_netdev "lan-1" "lan-1" "green:lan-1" "lan1" "link tx rx"
+        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)
 	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"
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 802df4608c..1f9d3c551c 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
@@ -139,6 +139,7 @@ mediatek_setup_interfaces()
 		ucidef_set_interfaces_lan_wan "port1 port3 port4 port5 port6" "port2"
 		;;
 	tplink,tl-xdr6086|\
+	wavlink,wl-wn551x3|\
 	wavlink,wl-wn586x3)
 		ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
 		;;
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index e9e74efa1f..2e03bb8e7e 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1972,6 +1972,24 @@ define Device/unielec_u7981-01-nand
 endef
 TARGET_DEVICES += unielec_u7981-01-nand
 
+define Device/wavlink_wl-wn551x3
+  DEVICE_VENDOR := WAVLINK
+  DEVICE_MODEL := WL-WN551X3
+  DEVICE_DTS := mt7981b-wavlink-wl-wn551x3
+  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-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += wavlink_wl-wn551x3
+
 define Device/wavlink_wl-wn586x3
   DEVICE_VENDOR := WAVLINK
   DEVICE_MODEL := WL-WN586X3




More information about the lede-commits mailing list