Skip to content

Commit af0647d

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 5adc663 commit af0647d

5 files changed

Lines changed: 233 additions & 1 deletion

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
@@ -74,7 +74,8 @@ mediatek_setup_interfaces()
7474
;;
7575
bananapi,bpi-r3-mini|\
7676
edgecore,eap111|\
77-
huasifei,wh3000)
77+
huasifei,wh3000|\
78+
huasifei,wh3000-pro)
7879
ucidef_set_interfaces_lan_wan eth0 eth1
7980
;;
8081
bananapi,bpi-r4)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ board_config_update
55
board=$(board_name)
66

77
case "$board" in
8+
huasifei,wh3000-pro)
9+
ucidef_add_gpio_switch "modem_power" "Modem power" "modem_power" "0"
10+
;;
811
zbtlink,zbt-z8102ax|\
912
zbtlink,zbt-z8102ax-v2)
1013
ucidef_add_gpio_switch "5g1" "Power 1st modem" "5g1" "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
@@ -110,6 +110,7 @@ platform_do_upgrade() {
110110
glinet,gl-x3000|\
111111
glinet,gl-xe3000|\
112112
huasifei,wh3000|\
113+
huasifei,wh3000-pro|\
113114
smartrg,sdg-8612|\
114115
smartrg,sdg-8614|\
115116
smartrg,sdg-8622|\
@@ -276,6 +277,7 @@ platform_copy_config() {
276277
glinet,gl-x3000|\
277278
glinet,gl-xe3000|\
278279
huasifei,wh3000|\
280+
huasifei,wh3000-pro|\
279281
jdcloud,re-cp-03|\
280282
nradio,c8-668gl|\
281283
smartrg,sdg-8612|\

target/linux/mediatek/image/filogic.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,19 @@ define Device/huasifei_wh3000
10881088
endef
10891089
TARGET_DEVICES += huasifei_wh3000
10901090

1091+
define Device/huasifei_wh3000-pro
1092+
DEVICE_VENDOR := Huasifei
1093+
DEVICE_MODEL := WH3000 Pro
1094+
DEVICE_DTS := mt7981b-huasifei-wh3000-pro
1095+
DEVICE_DTS_DIR := ../dts
1096+
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
1097+
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
1098+
KERNEL_INITRAMFS := kernel-bin | lzma | \
1099+
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
1100+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1101+
endef
1102+
TARGET_DEVICES += huasifei_wh3000-pro
1103+
10911104
define Device/jcg_q30-pro
10921105
DEVICE_VENDOR := JCG
10931106
DEVICE_MODEL := Q30 PRO

0 commit comments

Comments
 (0)