Skip to content

Commit 0fd2789

Browse files
committed
mediatek: add Huasifei WH3000 Pro support
**Huasifei WH3000 Pro** 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: eMMC 8GB 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: power/reset and mode (BTN_0) LEDS: blue, red, blue+red=pink UART: 3.3V, TX, RX, GND / 115200 8N1 **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-squashfs-sysupgrade.bin ``` **Factory MAC** You can find your Factory MAC which is mentioned on the box at `/dev/mmcblck0p2` partition `factory` starting from `0x4` ``` dd if=/dev/mmcblk0p2 bs=1 skip=4 count=6 | hexdump -C ``` Cherry-picked from coolsnowwolf/lede@949d0bd Fixed `green` to `blue` LED in dts, added `SUPPORTED_DEVICES += huasifei,fudy-pro` - to make sysupgrade compatible with factory QWRT/Lede fork firmware. Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
1 parent 7aa441d commit 0fd2789

5 files changed

Lines changed: 235 additions & 2 deletions

File tree

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
5+
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/input/input.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
#include "mt7981b.dtsi"
10+
11+
/ {
12+
model = "Huasifei WH3000 Pro";
13+
compatible = "huasifei,wh3000-pro", "mediatek,mt7981";
14+
15+
aliases {
16+
serial0 = &uart0;
17+
led-boot = &led_sys_red;
18+
led-failsafe = &led_sys_red;
19+
led-running = &led_sys_blue;
20+
led-upgrade = &led_sys_blue;
21+
};
22+
23+
chosen {
24+
stdout-path = "serial0:115200n8";
25+
bootargs-append = " root=PARTLABEL=rootfs rootwait";
26+
};
27+
28+
gpio-export {
29+
compatible = "gpio-export";
30+
31+
modem-power {
32+
gpio-export,name = "modem_power";
33+
gpio-export,output = <0>;
34+
gpios = <&pio 4 GPIO_ACTIVE_HIGH>;
35+
};
36+
};
37+
38+
gpio-keys {
39+
compatible = "gpio-keys";
40+
41+
reset {
42+
label = "reset";
43+
linux,code = <KEY_RESTART>;
44+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
45+
};
46+
47+
mode {
48+
label = "mode";
49+
linux,code = <BTN_0>;
50+
linux,input-type = <EV_SW>;
51+
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
52+
debounce-interval = <60>;
53+
};
54+
};
55+
56+
gpio-leds {
57+
compatible = "gpio-leds";
58+
59+
led_sys_red: led-0 {
60+
color = <LED_COLOR_ID_RED>;
61+
function = LED_FUNCTION_STATUS;
62+
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
63+
};
64+
65+
led_sys_blue: led-1 {
66+
color = <LED_COLOR_ID_BLUE>;
67+
function = LED_FUNCTION_STATUS;
68+
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
69+
};
70+
};
71+
};
72+
73+
&eth {
74+
pinctrl-names = "default";
75+
pinctrl-0 = <&mdio_pins>;
76+
status = "okay";
77+
78+
gmac0: mac@0 {
79+
compatible = "mediatek,eth-mac";
80+
reg = <0>;
81+
phy-mode = "2500base-x";
82+
phy-handle = <&phy1>;
83+
84+
nvmem-cells = <&macaddr_factory_4 2>;
85+
nvmem-cell-names = "mac-address";
86+
};
87+
88+
gmac1: mac@1 {
89+
compatible = "mediatek,eth-mac";
90+
reg = <1>;
91+
phy-mode = "gmii";
92+
phy-handle = <&int_gbe_phy>;
93+
94+
nvmem-cells = <&macaddr_factory_4 3>;
95+
nvmem-cell-names = "mac-address";
96+
};
97+
};
98+
99+
&mdio_bus {
100+
phy1: ethernet-phy@1 {
101+
compatible = "ethernet-phy-ieee802.3-c45";
102+
reg = <1>;
103+
reset-assert-us = <100000>;
104+
reset-deassert-us = <100000>;
105+
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
106+
interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
107+
interrupt-parent = <&pio>;
108+
realtek,aldps-enable;
109+
};
110+
};
111+
112+
&fan {
113+
interrupt-parent = <&pio>;
114+
interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
115+
pwms = <&pwm 1 40000 0>;
116+
status = "okay";
117+
};
118+
119+
&mmc0 {
120+
bus-width = <8>;
121+
cap-mmc-highspeed;
122+
max-frequency = <52000000>;
123+
non-removable;
124+
#address-cells = <1>;
125+
#size-cells = <0>;
126+
pinctrl-names = "default", "state_uhs";
127+
pinctrl-0 = <&mmc0_pins_default>;
128+
pinctrl-1 = <&mmc0_pins_uhs>;
129+
vmmc-supply = <&reg_3p3v>;
130+
status = "okay";
131+
132+
card@0 {
133+
compatible = "mmc-card";
134+
reg = <0>;
135+
136+
block {
137+
compatible = "block-device";
138+
139+
partitions {
140+
block-partition-factory {
141+
partname = "factory";
142+
143+
nvmem-layout {
144+
compatible = "fixed-layout";
145+
#address-cells = <1>;
146+
#size-cells = <1>;
147+
148+
eeprom_factory_0: eeprom@0 {
149+
reg = <0x0 0x1000>;
150+
};
151+
152+
macaddr_factory_4: macaddr@4 {
153+
compatible = "mac-base";
154+
reg = <0x4 0x6>;
155+
#nvmem-cell-cells = <1>;
156+
};
157+
};
158+
};
159+
};
160+
};
161+
};
162+
};
163+
164+
&pio {
165+
mmc0_pins_default: mmc0-pins-default {
166+
mux {
167+
function = "flash";
168+
groups = "emmc_45";
169+
};
170+
};
171+
172+
mmc0_pins_uhs: mmc0-pins-uhs {
173+
mux {
174+
function = "flash";
175+
groups = "emmc_45";
176+
};
177+
};
178+
179+
pwm1_pins: pwm1-pins {
180+
mux {
181+
function = "pwm";
182+
groups = "pwm1_0";
183+
};
184+
};
185+
};
186+
187+
&pwm {
188+
pinctrl-names = "default";
189+
pinctrl-0 = <&pwm1_pins>;
190+
status = "okay";
191+
};
192+
193+
&uart0 {
194+
status = "okay";
195+
};
196+
197+
&usb_phy {
198+
status = "okay";
199+
};
200+
201+
&watchdog {
202+
status = "okay";
203+
};
204+
205+
&wifi {
206+
nvmem-cells = <&eeprom_factory_0>;
207+
nvmem-cell-names = "eeprom";
208+
status = "okay";
209+
};
210+
211+
&xhci {
212+
status = "okay";
213+
};

target/linux/mediatek/filogic/base-files/etc/board.d/02_network

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ mediatek_setup_interfaces()
6464
;;
6565
bananapi,bpi-r3-mini|\
6666
edgecore,eap111|\
67-
huasifei,wh3000)
67+
huasifei,wh3000|\
68+
huasifei,wh3000-pro)
6869
ucidef_set_interfaces_lan_wan eth0 eth1
6970
;;
7071
bananapi,bpi-r4|\

target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ board_config_update
55
board=$(board_name)
66

77
case "$board" in
8-
zbtlink,zbt-z8102ax)
8+
huasifei,wh3000-pro)
9+
ucidef_add_gpio_switch "modem_power" "Modem power" "modem_power" "0"
10+
;;
11+
zbtlink,zbt-z8102ax|\
12+
zbtlink,zbt-z8102ax-v2)
913
ucidef_add_gpio_switch "5g1" "Power 1st modem" "5g1" "1"
1014
ucidef_add_gpio_switch "5g2" "Power 2nd modem" "5g2" "1"
1115
ucidef_add_gpio_switch "pcie" "Power PCIe port" "pcie" "1"

target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ platform_do_upgrade() {
104104
glinet,gl-x3000|\
105105
glinet,gl-xe3000|\
106106
huasifei,wh3000|\
107+
huasifei,wh3000-pro|\
107108
smartrg,sdg-8612|\
108109
smartrg,sdg-8614|\
109110
smartrg,sdg-8622|\
@@ -221,6 +222,7 @@ platform_copy_config() {
221222
glinet,gl-x3000|\
222223
glinet,gl-xe3000|\
223224
huasifei,wh3000|\
225+
huasifei,wh3000-pro|\
224226
jdcloud,re-cp-03|\
225227
smartrg,sdg-8612|\
226228
smartrg,sdg-8614|\

target/linux/mediatek/image/filogic.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,19 @@ define Device/huasifei_wh3000
940940
endef
941941
TARGET_DEVICES += huasifei_wh3000
942942

943+
define Device/huasifei_wh3000-pro
944+
DEVICE_VENDOR := Huasifei
945+
DEVICE_MODEL := WH3000 Pro
946+
DEVICE_DTS := mt7981b-huasifei-wh3000-pro
947+
DEVICE_DTS_DIR := ../dts
948+
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
949+
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
950+
KERNEL_INITRAMFS := kernel-bin | lzma | \
951+
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
952+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
953+
endef
954+
TARGET_DEVICES += huasifei_wh3000-pro
955+
943956
define Device/jcg_q30-pro
944957
DEVICE_VENDOR := JCG
945958
DEVICE_MODEL := Q30 PRO

0 commit comments

Comments
 (0)