Skip to content

Commit 150f181

Browse files
fildunskyhauke
authored andcommitted
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 [email protected]` 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 <[email protected]> Link: openwrt/openwrt#19315 (cherry picked from commit db1de8d) Link: openwrt/openwrt#19391 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent f59e340 commit 150f181

File tree

5 files changed

+233
-1
lines changed

5 files changed

+233
-1
lines changed
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 "mt7981.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
@@ -70,7 +70,8 @@ mediatek_setup_interfaces()
7070
;;
7171
bananapi,bpi-r3-mini|\
7272
edgecore,eap111|\
73-
huasifei,wh3000)
73+
huasifei,wh3000|\
74+
huasifei,wh3000-pro)
7475
ucidef_set_interfaces_lan_wan eth0 eth1
7576
;;
7677
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
@@ -106,6 +106,7 @@ platform_do_upgrade() {
106106
glinet,gl-x3000|\
107107
glinet,gl-xe3000|\
108108
huasifei,wh3000|\
109+
huasifei,wh3000-pro|\
109110
smartrg,sdg-8612|\
110111
smartrg,sdg-8614|\
111112
smartrg,sdg-8622|\
@@ -231,6 +232,7 @@ platform_copy_config() {
231232
glinet,gl-x3000|\
232233
glinet,gl-xe3000|\
233234
huasifei,wh3000|\
235+
huasifei,wh3000-pro|\
234236
jdcloud,re-cp-03|\
235237
smartrg,sdg-8612|\
236238
smartrg,sdg-8614|\

target/linux/mediatek/image/filogic.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,19 @@ define Device/huasifei_wh3000
10311031
endef
10321032
TARGET_DEVICES += huasifei_wh3000
10331033

1034+
define Device/huasifei_wh3000-pro
1035+
DEVICE_VENDOR := Huasifei
1036+
DEVICE_MODEL := WH3000 Pro
1037+
DEVICE_DTS := mt7981b-huasifei-wh3000-pro
1038+
DEVICE_DTS_DIR := ../dts
1039+
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
1040+
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
1041+
KERNEL_INITRAMFS := kernel-bin | lzma | \
1042+
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
1043+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1044+
endef
1045+
TARGET_DEVICES += huasifei_wh3000-pro
1046+
10341047
define Device/iptime_ax3000sm
10351048
DEVICE_VENDOR := ipTIME
10361049
DEVICE_MODEL := AX3000SM

0 commit comments

Comments
 (0)