Skip to content

Commit f4c211f

Browse files
fildunskyhauke
authored andcommitted
mediatek: add Huasifei WH3000 Pro NAND support
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: openwrt/openwrt#22694 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent a9e2245 commit f4c211f

7 files changed

Lines changed: 182 additions & 74 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
5+
#include "mt7981b-huasifei-wh3000-pro.dtsi"
6+
7+
/ {
8+
model = "Huasifei WH3000 Pro eMMC";
9+
compatible = "huasifei,wh3000-pro-emmc", "mediatek,mt7981";
10+
};
11+
12+
&chosen {
13+
bootargs-append = " root=PARTLABEL=rootfs rootwait";
14+
};
15+
16+
&mmc0 {
17+
bus-width = <8>;
18+
cap-mmc-highspeed;
19+
max-frequency = <52000000>;
20+
non-removable;
21+
#address-cells = <1>;
22+
#size-cells = <0>;
23+
pinctrl-names = "default", "state_uhs";
24+
pinctrl-0 = <&mmc0_pins_default>;
25+
pinctrl-1 = <&mmc0_pins_uhs>;
26+
vmmc-supply = <&reg_3p3v>;
27+
status = "okay";
28+
29+
card@0 {
30+
compatible = "mmc-card";
31+
reg = <0>;
32+
33+
block {
34+
compatible = "block-device";
35+
36+
partitions {
37+
block-partition-factory {
38+
partname = "factory";
39+
40+
nvmem-layout {
41+
compatible = "fixed-layout";
42+
#address-cells = <1>;
43+
#size-cells = <1>;
44+
45+
eeprom_factory_0: eeprom@0 {
46+
reg = <0x0 0x1000>;
47+
};
48+
49+
macaddr_factory_4: macaddr@4 {
50+
compatible = "mac-base";
51+
reg = <0x4 0x6>;
52+
#nvmem-cell-cells = <1>;
53+
};
54+
};
55+
};
56+
};
57+
};
58+
};
59+
};
60+
61+
&pio {
62+
mmc0_pins_default: mmc0-pins-default {
63+
mux {
64+
function = "flash";
65+
groups = "emmc_45";
66+
};
67+
};
68+
69+
mmc0_pins_uhs: mmc0-pins-uhs {
70+
mux {
71+
function = "flash";
72+
groups = "emmc_45";
73+
};
74+
};
75+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
5+
#include "mt7981b-huasifei-wh3000-pro.dtsi"
6+
7+
/ {
8+
model = "Huasifei WH3000 Pro NAND";
9+
compatible = "huasifei,wh3000-pro-nand", "mediatek,mt7981";
10+
};
11+
12+
&spi0 {
13+
status = "okay";
14+
15+
spi_nand: flash@0 {
16+
compatible = "spi-nand";
17+
reg = <0>;
18+
19+
spi-max-frequency = <52000000>;
20+
spi-tx-bus-width = <4>;
21+
spi-rx-bus-width = <4>;
22+
23+
partitions {
24+
compatible = "fixed-partitions";
25+
#address-cells = <1>;
26+
#size-cells = <1>;
27+
28+
partition@0 {
29+
label = "BL2";
30+
reg = <0x0 0x100000>;
31+
read-only;
32+
};
33+
34+
partition@100000 {
35+
label = "u-boot-env";
36+
reg = <0x100000 0x80000>;
37+
};
38+
39+
partition@180000 {
40+
label = "Factory";
41+
reg = <0x180000 0x200000>;
42+
read-only;
43+
44+
nvmem-layout {
45+
compatible = "fixed-layout";
46+
#address-cells = <1>;
47+
#size-cells = <1>;
48+
49+
eeprom_factory_0: eeprom@0 {
50+
reg = <0x0 0x1000>;
51+
};
52+
53+
macaddr_factory_4: macaddr@4 {
54+
compatible = "mac-base";
55+
reg = <0x4 0x6>;
56+
#nvmem-cell-cells = <1>;
57+
};
58+
};
59+
};
60+
61+
partition@380000 {
62+
label = "FIP";
63+
reg = <0x380000 0x200000>;
64+
read-only;
65+
};
66+
67+
partition@580000 {
68+
label = "ubi";
69+
reg = <0x580000 0xe280000>;
70+
};
71+
};
72+
};
73+
};

target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dts renamed to target/linux/mediatek/dts/mt7981b-huasifei-wh3000-pro.dtsi

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
#include "mt7981b.dtsi"
1010

1111
/ {
12-
model = "Huasifei WH3000 Pro";
13-
compatible = "huasifei,wh3000-pro", "mediatek,mt7981";
14-
1512
aliases {
1613
serial0 = &uart0;
1714
led-boot = &led_sys_red;
@@ -20,9 +17,8 @@
2017
led-upgrade = &led_sys_blue;
2118
};
2219

23-
chosen {
20+
chosen: chosen {
2421
stdout-path = "serial0:115200n8";
25-
bootargs-append = " root=PARTLABEL=rootfs rootwait";
2622
};
2723

2824
gpio-export {
@@ -101,7 +97,7 @@
10197
compatible = "ethernet-phy-ieee802.3-c45";
10298
reg = <1>;
10399
reset-assert-us = <100000>;
104-
reset-deassert-us = <100000>;
100+
reset-deassert-us = <221000>;
105101
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
106102
interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
107103
interrupt-parent = <&pio>;
@@ -116,66 +112,7 @@
116112
status = "okay";
117113
};
118114

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-
164115
&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-
179116
pwm1_pins: pwm1-pins {
180117
mux {
181118
function = "pwm";

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
@@ -125,7 +125,8 @@ mediatek_setup_interfaces()
125125
bananapi,bpi-r3-mini|\
126126
edgecore,eap111|\
127127
huasifei,wh3000|\
128-
huasifei,wh3000-pro)
128+
huasifei,wh3000-pro-emmc|\
129+
huasifei,wh3000-pro-nand)
129130
ucidef_set_interfaces_lan_wan eth0 eth1
130131
;;
131132
bazis,ax3000wm|\

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

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

77
case "$board" in
8-
huasifei,wh3000-pro)
8+
huasifei,wh3000-pro-emmc|\
9+
huasifei,wh3000-pro-nand)
910
ucidef_add_gpio_switch "modem_power" "Modem power" "modem_power" "0"
1011
;;
1112
teltonika,rutc50)

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ platform_do_upgrade() {
139139
glinet,gl-x3000|\
140140
glinet,gl-xe3000|\
141141
huasifei,wh3000|\
142-
huasifei,wh3000-pro|\
142+
huasifei,wh3000-pro-emmc|\
143143
smartrg,sdg-8612|\
144144
smartrg,sdg-8614|\
145145
smartrg,sdg-8622|\
@@ -164,7 +164,8 @@ platform_do_upgrade() {
164164
;;
165165
buffalo,wsr-6000ax8|\
166166
cudy,wr3000h-v1|\
167-
cudy,wr3000p-v1)
167+
cudy,wr3000p-v1|\
168+
huasifei,wh3000-pro-nand)
168169
CI_UBIPART="ubi"
169170
nand_do_upgrade "$1"
170171
;;
@@ -369,7 +370,7 @@ platform_copy_config() {
369370
glinet,gl-x3000|\
370371
glinet,gl-xe3000|\
371372
huasifei,wh3000|\
372-
huasifei,wh3000-pro|\
373+
huasifei,wh3000-pro-emmc|\
373374
jdcloud,re-cp-03|\
374375
nradio,c8-668gl|\
375376
smartrg,sdg-8612|\

target/linux/mediatek/image/filogic.mk

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,18 +1710,38 @@ define Device/huasifei_wh3000
17101710
endef
17111711
TARGET_DEVICES += huasifei_wh3000
17121712

1713-
define Device/huasifei_wh3000-pro
1713+
define Device/huasifei_wh3000-pro-emmc
17141714
DEVICE_VENDOR := Huasifei
17151715
DEVICE_MODEL := WH3000 Pro
1716-
DEVICE_DTS := mt7981b-huasifei-wh3000-pro
1716+
DEVICE_VARIANT := eMMC
1717+
DEVICE_DTS := mt7981b-huasifei-wh3000-pro-emmc
17171718
DEVICE_DTS_DIR := ../dts
1718-
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
1719+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
1720+
kmod-hwmon-pwmfan kmod-usb3 f2fsck mkf2fs
1721+
SUPPORTED_DEVICES += huasifei,wh3000-pro
17191722
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
17201723
KERNEL_INITRAMFS := kernel-bin | lzma | \
17211724
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
17221725
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
17231726
endef
1724-
TARGET_DEVICES += huasifei_wh3000-pro
1727+
TARGET_DEVICES += huasifei_wh3000-pro-emmc
1728+
1729+
define Device/huasifei_wh3000-pro-nand
1730+
DEVICE_VENDOR := Huasifei
1731+
DEVICE_MODEL := WH3000 Pro
1732+
DEVICE_VARIANT := NAND
1733+
DEVICE_DTS := mt7981b-huasifei-wh3000-pro-nand
1734+
DEVICE_DTS_DIR := ../dts
1735+
UBINIZE_OPTS := -E 5
1736+
BLOCKSIZE := 128k
1737+
PAGESIZE := 2048
1738+
IMAGE_SIZE := 229376k
1739+
KERNEL_IN_UBI := 1
1740+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1741+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
1742+
kmod-usb3 kmod-hwmon-pwmfan
1743+
endef
1744+
TARGET_DEVICES += huasifei_wh3000-pro-nand
17251745

17261746
define Device/imou_hx21
17271747
DEVICE_VENDOR := Imou

0 commit comments

Comments
 (0)