]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: add Huasifei WH3000 Pro NAND support 22694/head
authorFil Dunsky <filipp.dunsky@gmail.com>
Mon, 30 Mar 2026 14:07:28 +0000 (17:07 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 6 Apr 2026 20:39:41 +0000 (22:39 +0200)
This commit adds support for Huasifei WH3000 Pro NAND version.
There is an eMMC already supported in OpenWrt. The only difference is NAND chip.
This commit adds common .dtsi and separate .dts
for eMMC and nand versions.

**Huasifei WH3000 Pro NAND**
Portable Wi-Fi 6 travel router based on MediaTek MT7981A SoC. MT7981B+MT7976CN+RTL8221B Dual Core 1.3GHZ with 5G modems module and PWM Fan.

**Specifications**
SoC: Filogic 820 MT7981A (1.3GHz)
RAM: DDR4 1GB
Flash: 256mb Winbond SPI NAND
WiFi: 2.4GHz and 5GHz with 3 antennas
Ethernet:
1x WAN (10/100/1000M)
1x LAN (10/100/1000/2500M)
USB: 1x USB 3.0 port
Two buttons: reset and mode (BTN_0)
LEDS: blue, red, blue+red=pink
UART: 3.3V, TX, RX, GND / 115200 8N1
M.2 (WWAN) slot

**Installation via U-Boot rescue**
1. Set static IP 192.168.1.2 on your computer and default route as 192.168.1.1
2. Connect to the WAN port and hold the reset button while booting the device.
3. Wait for the LED to blink 5 times, and release the reset button.
4. Open U-boot web page on your browser at http://192.168.1.1
5. Select the OpenWRT sysupgrade image, upload it, and start the upgrade.
6. Wait for the router to flash the new firmware.
7. Wait for the router to reboot itself.

**Installation via sysupgrade**
Just flash sysupgrade file via [LuCI upgrade page](http://192.168.1.1/cgi-bin/luci/admin/system/flash) without saving the settings.

**Installation via SSH**
Upload the file to the router `/tmp` directory, `ssh root@192.168.1.1` and issue a command:
```
sysupgrade -n /tmp/openwrt-mediatek-filogic-huasifei_wh3000-pro-nand-squashfs-sysupgrade.bin
```

Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22694
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-emmc.dts [new file with mode: 0644]
target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-nand.dts [new file with mode: 0644]
target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dtsi [moved from target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dts with 67% similarity]
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-emmc.dts b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-emmc.dts
new file mode 100644 (file)
index 0000000..a52930c
--- /dev/null
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "mt7981b-huasifei-wh3000-pro.dtsi"
+
+/ {
+       model = "Huasifei WH3000 Pro eMMC";
+       compatible = "huasifei,wh3000-pro-emmc", "mediatek,mt7981";
+};
+
+&chosen {
+       bootargs-append = " root=PARTLABEL=rootfs rootwait";
+};
+
+&mmc0 {
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       max-frequency = <52000000>;
+       non-removable;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc0_pins_default>;
+       pinctrl-1 = <&mmc0_pins_uhs>;
+       vmmc-supply = <&reg_3p3v>;
+       status = "okay";
+
+       card@0 {
+               compatible = "mmc-card";
+               reg = <0>;
+
+               block {
+                       compatible = "block-device";
+
+                       partitions {
+                               block-partition-factory {
+                                       partname = "factory";
+
+                                       nvmem-layout {
+                                               compatible = "fixed-layout";
+                                               #address-cells = <1>;
+                                               #size-cells = <1>;
+
+                                               eeprom_factory_0: eeprom@0 {
+                                                       reg = <0x0 0x1000>;
+                                               };
+
+                                               macaddr_factory_4: macaddr@4 {
+                                                       compatible = "mac-base";
+                                                       reg = <0x4 0x6>;
+                                                       #nvmem-cell-cells = <1>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+};
+
+&pio {
+       mmc0_pins_default: mmc0-pins-default {
+               mux {
+                       function = "flash";
+                       groups = "emmc_45";
+               };
+       };
+
+       mmc0_pins_uhs: mmc0-pins-uhs {
+               mux {
+                       function = "flash";
+                       groups = "emmc_45";
+               };
+       };
+};
diff --git a/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-nand.dts b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro-nand.dts
new file mode 100644 (file)
index 0000000..68b4635
--- /dev/null
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "mt7981b-huasifei-wh3000-pro.dtsi"
+
+/ {
+       model = "Huasifei WH3000 Pro NAND";
+       compatible = "huasifei,wh3000-pro-nand", "mediatek,mt7981";
+};
+
+&spi0 {
+       status = "okay";
+
+       spi_nand: flash@0 {
+               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@0 {
+                               label = "BL2";
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               label = "u-boot-env";
+                               reg = <0x100000 0x80000>;
+                       };
+
+                       partition@180000 {
+                               label = "Factory";
+                               reg = <0x180000 0x200000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x1000>;
+                                       };
+
+                                       macaddr_factory_4: macaddr@4 {
+                                               compatible = "mac-base";
+                                               reg = <0x4 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
+                       };
+
+                       partition@380000 {
+                               label = "FIP";
+                               reg = <0x380000 0x200000>;
+                               read-only;
+                       };
+
+                       partition@580000 {
+                               label = "ubi";
+                               reg = <0x580000 0xe280000>;
+                       };
+               };
+       };
+};
similarity index 67%
rename from target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dts
rename to target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dtsi
index b8a5a4cc35017784980c5039ae6292a06cca53b7..a00e9f6c9b90792e42e86942953068bba265681e 100644 (file)
@@ -9,9 +9,6 @@
 #include "mt7981b.dtsi"
 
 / {
-       model = "Huasifei WH3000 Pro";
-       compatible = "huasifei,wh3000-pro", "mediatek,mt7981";
-
        aliases {
                serial0 = &uart0;
                led-boot = &led_sys_red;
@@ -20,9 +17,8 @@
                led-upgrade = &led_sys_blue;
        };
 
-       chosen {
+       chosen: chosen {
                stdout-path = "serial0:115200n8";
-               bootargs-append = " root=PARTLABEL=rootfs rootwait";
        };
 
        gpio-export {
                compatible = "ethernet-phy-ieee802.3-c45";
                reg = <1>;
                reset-assert-us = <100000>;
-               reset-deassert-us = <100000>;
+               reset-deassert-us = <221000>;
                reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
                interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
                interrupt-parent = <&pio>;
        status = "okay";
 };
 
-&mmc0 {
-       bus-width = <8>;
-       cap-mmc-highspeed;
-       max-frequency = <52000000>;
-       non-removable;
-       #address-cells = <1>;
-       #size-cells = <0>;
-       pinctrl-names = "default", "state_uhs";
-       pinctrl-0 = <&mmc0_pins_default>;
-       pinctrl-1 = <&mmc0_pins_uhs>;
-       vmmc-supply = <&reg_3p3v>;
-       status = "okay";
-
-       card@0 {
-               compatible = "mmc-card";
-               reg = <0>;
-
-               block {
-                       compatible = "block-device";
-
-                       partitions {
-                               block-partition-factory {
-                                       partname = "factory";
-
-                                       nvmem-layout {
-                                               compatible = "fixed-layout";
-                                               #address-cells = <1>;
-                                               #size-cells = <1>;
-
-                                               eeprom_factory_0: eeprom@0 {
-                                                       reg = <0x0 0x1000>;
-                                               };
-
-                                               macaddr_factory_4: macaddr@4 {
-                                                       compatible = "mac-base";
-                                                       reg = <0x4 0x6>;
-                                                       #nvmem-cell-cells = <1>;
-                                               };
-                                       };
-                               };
-                       };
-               };
-       };
-};
-
 &pio {
-       mmc0_pins_default: mmc0-pins-default {
-               mux {
-                       function = "flash";
-                       groups = "emmc_45";
-               };
-       };
-
-       mmc0_pins_uhs: mmc0-pins-uhs {
-               mux {
-                       function = "flash";
-                       groups = "emmc_45";
-               };
-       };
-
        pwm1_pins: pwm1-pins {
                mux {
                        function = "pwm";
index e3dc404c97c111debc78757dbf1c1068f53fe7be..dccffdba52c6c03bfd8751355983bdf9f9d9059c 100644 (file)
@@ -125,7 +125,8 @@ mediatek_setup_interfaces()
        bananapi,bpi-r3-mini|\
        edgecore,eap111|\
        huasifei,wh3000|\
-       huasifei,wh3000-pro)
+       huasifei,wh3000-pro-emmc|\
+       huasifei,wh3000-pro-nand)
                ucidef_set_interfaces_lan_wan eth0 eth1
                ;;
        bazis,ax3000wm|\
index 89889967a293fba8f37eb0b1a34333f5623a7bf2..889401bd0ec94c5660f7873a6542ce51dda9f5e2 100644 (file)
@@ -5,7 +5,8 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-huasifei,wh3000-pro)
+huasifei,wh3000-pro-emmc|\
+huasifei,wh3000-pro-nand)
        ucidef_add_gpio_switch "modem_power" "Modem power" "modem_power" "0"
        ;;
 teltonika,rutc50)
index 394e8f6a080c7de687f96cdfec64281501ff6278..76a99aecdc166219c0252899df8ef18c1326c6a4 100644 (file)
@@ -139,7 +139,7 @@ platform_do_upgrade() {
        glinet,gl-x3000|\
        glinet,gl-xe3000|\
        huasifei,wh3000|\
-       huasifei,wh3000-pro|\
+       huasifei,wh3000-pro-emmc|\
        smartrg,sdg-8612|\
        smartrg,sdg-8614|\
        smartrg,sdg-8622|\
@@ -164,7 +164,8 @@ platform_do_upgrade() {
                ;;
        buffalo,wsr-6000ax8|\
        cudy,wr3000h-v1|\
-       cudy,wr3000p-v1)
+       cudy,wr3000p-v1|\
+       huasifei,wh3000-pro-nand)
                CI_UBIPART="ubi"
                nand_do_upgrade "$1"
                ;;
@@ -369,7 +370,7 @@ platform_copy_config() {
        glinet,gl-x3000|\
        glinet,gl-xe3000|\
        huasifei,wh3000|\
-       huasifei,wh3000-pro|\
+       huasifei,wh3000-pro-emmc|\
        jdcloud,re-cp-03|\
        nradio,c8-668gl|\
        smartrg,sdg-8612|\
index 5961bdd47f2a7ce902f59e40ff18ff994fd905d7..086d2fc47717640ca341645ac85fa6b59944c18a 100644 (file)
@@ -1710,18 +1710,38 @@ define Device/huasifei_wh3000
 endef
 TARGET_DEVICES += huasifei_wh3000
 
-define Device/huasifei_wh3000-pro
+define Device/huasifei_wh3000-pro-emmc
   DEVICE_VENDOR := Huasifei
   DEVICE_MODEL := WH3000 Pro
-  DEVICE_DTS := mt7981b-huasifei-wh3000-pro
+  DEVICE_VARIANT := eMMC
+  DEVICE_DTS := mt7981b-huasifei-wh3000-pro-emmc
   DEVICE_DTS_DIR := ../dts
-  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
+       kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
+  SUPPORTED_DEVICES += huasifei,wh3000-pro
   KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
-TARGET_DEVICES += huasifei_wh3000-pro
+TARGET_DEVICES += huasifei_wh3000-pro-emmc
+
+define Device/huasifei_wh3000-pro-nand
+  DEVICE_VENDOR := Huasifei
+  DEVICE_MODEL := WH3000 Pro
+  DEVICE_VARIANT := NAND
+  DEVICE_DTS := mt7981b-huasifei-wh3000-pro-nand
+  DEVICE_DTS_DIR := ../dts
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 229376k
+  KERNEL_IN_UBI := 1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
+       kmod-usb3 kmod-hwmon-pwmfan
+endef
+TARGET_DEVICES += huasifei_wh3000-pro-nand
 
 define Device/imou_hx21
   DEVICE_VENDOR := Imou