Skip to content

Commit b39ea51

Browse files
committed
mediatek: add support for Hiveton H5000M
mediatek: add support for Hiveton H5000M Hardware specification: SoC: MediaTek MT7987A Flash: 8GB eMMC RAM: 1GB DDR4 Ethernet: 2x 2.5GbE (RTL8221B PHY + Internal PHY) WiFi: MediaTek MT7991 Dual-band (2.4GHz/5GHz) Interface: M.2 USB for 5G module LED: Power (hw-controlled), 2.5G LAN (hw-controlled), 5G Module (hw-controlled), LED-3 (user-definable), LED-4 (user-definable) Button: Reset, WPS Power: USB Type-C PD Other: PWM Fan control Flash instructions: Factory `mmcblk0p2` partition is empty, stock ImmortalWrt-798x-mt799x-6.6-mtwifi from PadavanOnly firmware uses `MT7991_MT7976_EEPROM_BE5040_iPAiLNA.bin`. You can flash it as eeprom before flashing OpenWrt: ``` dd if=/lib/firmware/MT7991_MT7976_EEPROM_BE5040_iPAiLNA.bin of=/dev/mmcblk0p2 bs=1 count=7680 sync ``` Power off the device. Press and hold the Reset button. Power on the device while keeping the Reset button pressed. Wait for the device to enter U-Boot recovery mode. Connect to the device via Ethernet (default IP: 192.168.1.1). Set your PC's IP to 192.168.1.x (e.g., 192.168.1.100). Open a web browser and navigate to http://192.168.1.1 Upload and flash the OpenWrt firmware Wait for the flashing process to complete and the device to reboot. Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
1 parent 5a9cfbb commit b39ea51

6 files changed

Lines changed: 271 additions & 0 deletions

File tree

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
/dts-v1/;
4+
#include "mt7987a.dtsi"
5+
#include <dt-bindings/input/input.h>
6+
7+
/ {
8+
model = "Hiveton H5000M";
9+
compatible = "hiveton,h5000m", "mediatek,mt7987a", "mediatek,mt7987";
10+
11+
chosen {
12+
bootargs = "console=ttyS0,115200n1 \
13+
earlycon=uart8250,mmio32,0x11000000 \
14+
root=PARTLABEL=rootfs rootwait pci=pcie_bus_perf";
15+
};
16+
17+
gpio-keys {
18+
compatible = "gpio-keys";
19+
20+
reset {
21+
label = "reset";
22+
linux,code = <KEY_RESTART>;
23+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
24+
debounce-interval = <10>;
25+
};
26+
27+
wps {
28+
label = "wps";
29+
linux,code = <KEY_WPS_BUTTON>;
30+
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
31+
debounce-interval = <10>;
32+
};
33+
};
34+
35+
/*
36+
* LED Indicator Layout
37+
* -------------------
38+
* Total of 5 LED indicators, viewed from front with antenna facing up (left to right):
39+
*
40+
* LED 1: 5G Module indicator
41+
* LED 2: Built-in 2.5G Ethernet port indicator
42+
* LED 3: User-definable (configurable in system)
43+
* LED 4: User-definable (configurable in system)
44+
* LED 5: Power indicator
45+
*
46+
* Note:
47+
* - LEDs 1, 2, and 5 are hardware-controlled and cannot be modified via software
48+
* - In vendor firmware, LEDs 3 and 4 are used as WiFi link activity indicators
49+
* for dual-band (2.4GHz/5GHz) respectively
50+
*/
51+
leds {
52+
compatible = "gpio-leds";
53+
54+
led_3: led-3 {
55+
function = LED_FUNCTION_WLAN_2GHZ;
56+
color = <LED_COLOR_ID_AMBER>;
57+
gpios = <&pio 3 GPIO_ACTIVE_LOW>;
58+
};
59+
60+
led_4: led-4 {
61+
function = LED_FUNCTION_WLAN_5GHZ;
62+
color = <LED_COLOR_ID_BLUE>;
63+
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
64+
};
65+
};
66+
67+
reg_1p8v: regulator-1p8v {
68+
compatible = "regulator-fixed";
69+
regulator-name = "fixed-1.8V";
70+
regulator-min-microvolt = <1800000>;
71+
regulator-max-microvolt = <1800000>;
72+
regulator-boot-on;
73+
regulator-always-on;
74+
};
75+
76+
reg_3p3v: regulator-3p3v {
77+
compatible = "regulator-fixed";
78+
regulator-name = "fixed-3.3V";
79+
regulator-min-microvolt = <3300000>;
80+
regulator-max-microvolt = <3300000>;
81+
regulator-boot-on;
82+
regulator-always-on;
83+
};
84+
85+
reg_usb_5v: regulator-usb-5v {
86+
compatible = "regulator-fixed";
87+
regulator-name = "usb-5v";
88+
regulator-max-microvolt = <5000000>;
89+
regulator-min-microvolt = <5000000>;
90+
regulator-boot-on;
91+
regulator-always-on;
92+
};
93+
};
94+
95+
&eth {
96+
status = "okay";
97+
};
98+
99+
&fan {
100+
pwms = <&pwm 1 50000 0>;
101+
status = "okay";
102+
};
103+
104+
&gmac0 {
105+
phy-mode = "2500base-x";
106+
phy-handle = <&phy0>;
107+
status = "okay";
108+
};
109+
110+
&gmac1 {
111+
phy-mode = "internal";
112+
phy-handle = <&phy1>;
113+
status = "okay";
114+
};
115+
116+
&mdio {
117+
/* RTL8221B-VB-CG 2.5Gbps PHY (away from power) eth0 */
118+
phy0: phy@1 {
119+
compatible = "ethernet-phy-ieee802.3-c45";
120+
reg = <1>;
121+
reset-gpios = <&pio 42 GPIO_ACTIVE_LOW>;
122+
reset-assert-us = <100000>;
123+
reset-deassert-us = <100000>;
124+
interrupt-parent = <&pio>;
125+
interrupts = <41 IRQ_TYPE_LEVEL_LOW>;
126+
realtek,aldps-enable;
127+
};
128+
129+
/* built-in 2.5G Ethernet PHY (near power) eth1 */
130+
phy1: phy@15 {
131+
compatible = "ethernet-phy-ieee802.3-c45";
132+
reg = <15>;
133+
pinctrl-names = "i2p5gbe-led";
134+
pinctrl-0 = <&i2p5gbe_led0_pins>;
135+
};
136+
};
137+
138+
&mmc0 {
139+
pinctrl-names = "default", "state_uhs";
140+
pinctrl-0 = <&mmc_pins_default>;
141+
pinctrl-1 = <&mmc_pins_uhs>;
142+
bus-width = <8>;
143+
max-frequency = <48000000>;
144+
cap-mmc-highspeed;
145+
vmmc-supply = <&reg_3p3v>;
146+
non-removable;
147+
status = "okay";
148+
149+
card@0 {
150+
compatible = "mmc-card";
151+
reg = <0>;
152+
153+
block {
154+
compatible = "block-device";
155+
156+
partitions {
157+
block-partition-factory {
158+
partname = "factory";
159+
160+
nvmem-layout {
161+
compatible = "fixed-layout";
162+
#address-cells = <1>;
163+
#size-cells = <1>;
164+
165+
eeprom_factory_0: eeprom@0 {
166+
reg = <0x0 0x1e00>;
167+
};
168+
};
169+
};
170+
};
171+
};
172+
};
173+
};
174+
175+
&pcie0 {
176+
pinctrl-names = "default";
177+
pinctrl-0 = <&pcie0_pins>;
178+
status = "okay";
179+
180+
pcie@0,0 {
181+
reg = <0x0000 0 0 0 0>;
182+
#address-cells = <3>;
183+
#size-cells = <2>;
184+
device_type = "pci";
185+
186+
mt76@0,0 {
187+
compatible = "mediatek,mt76";
188+
reg = <0x0000 0 0 0 0>;
189+
190+
nvmem-cells = <&eeprom_factory_0>;
191+
nvmem-cell-names = "eeprom";
192+
193+
#address-cells = <1>;
194+
#size-cells = <0>;
195+
196+
ieee80211-freq-limit = <2400000 2500000>,
197+
<5170000 5835000>;
198+
};
199+
};
200+
};
201+
202+
&pcie1 {
203+
status = "disabled";
204+
};
205+
206+
&pio {
207+
pcie0_pereset {
208+
gpio-hog;
209+
gpios = <36 GPIO_ACTIVE_HIGH>;
210+
output-high;
211+
line-name = "pcie-perst";
212+
};
213+
214+
pwm_fan_pins: pwm-fan-pins {
215+
mux {
216+
function = "pwm";
217+
groups = "pwm1_0";
218+
};
219+
};
220+
};
221+
222+
&pwm {
223+
status = "okay";
224+
pinctrl-names = "default";
225+
pinctrl-0 = <&pwm_fan_pins>;
226+
};
227+
228+
&ssusb {
229+
status = "okay";
230+
vusb33-supply = <&reg_3p3v>;
231+
vbus-supply = <&reg_usb_5v>;
232+
};
233+
234+
&tphyu3port0 {
235+
status = "okay";
236+
};
237+
238+
&uart0 {
239+
pinctrl-names = "default";
240+
pinctrl-0 = <&uart0_pins>;
241+
status = "okay";
242+
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ glinet,gl-xe3000)
111111
ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wifi2g" "phy0-ap0"
112112
ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wifi5g" "phy1-ap0"
113113
;;
114+
hiveton,h5000m)
115+
ucidef_set_led_netdev "wlan2g" "wlan-2ghz" "amber:wlan-2ghz" "phy0.0-ap0" "link tx rx"
116+
ucidef_set_led_netdev "wlan5g" "wlan-5ghz" "blue:wlan-5ghz" "phy0.1-ap0" "link tx rx"
117+
;;
114118
huasifei,wh3000)
115119
ucidef_set_led_netdev "wan" "WAN" "red:wan" "eth1" "link tx rx"
116120
;;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ mediatek_setup_interfaces()
146146
glinet,gl-mt3600be|\
147147
glinet,gl-x3000|\
148148
glinet,gl-xe3000|\
149+
hiveton,h5000m|\
149150
openembed,som7981|\
150151
openwrt,one)
151152
ucidef_set_interfaces_lan_wan eth1 eth0
@@ -262,6 +263,10 @@ mediatek_setup_macs()
262263
lan_mac=$(macaddr_add "$wan_mac" 1)
263264
label_mac=$wan_mac
264265
;;
266+
hiveton,h5000m)
267+
lan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
268+
wan_mac=$(macaddr_add "$lan_mac" 1)
269+
;;
265270
mercusys,mr80x-v3|\
266271
mercusys,mr85x)
267272
mac_dirty=$(cat "/tmp/tp_data/default-mac" | sed -n 's/^'"MAC"'://p')

target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ case "$board" in
131131
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
132132
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
133133
;;
134+
hiveton,h5000m)
135+
base_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
136+
[ "$PHYNBR" = "0" ] && macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
137+
[ "$PHYNBR" = "1" ] && macaddr_add $base_mac 3 > /sys${DEVPATH}/macaddress
138+
;;
134139
iptime,ax3000q)
135140
addr=$(mtd_get_mac_binary "Factory" 0x4)
136141
[ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ platform_do_upgrade() {
173173
glinet,gl-mt6000|\
174174
glinet,gl-x3000|\
175175
glinet,gl-xe3000|\
176+
hiveton,h5000m|\
176177
huasifei,wh3000|\
177178
huasifei,wh3000-pro-emmc|\
178179
smartrg,sdg-8612|\
@@ -361,6 +362,7 @@ platform_check_image() {
361362
;;
362363
creatlentem,clt-r30b1|\
363364
creatlentem,clt-r30b1-112m|\
365+
hiveton,h5000m|\
364366
nradio,c8-668gl)
365367
# tar magic `ustar`
366368
magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)"
@@ -406,6 +408,7 @@ platform_copy_config() {
406408
glinet,gl-mt6000|\
407409
glinet,gl-x3000|\
408410
glinet,gl-xe3000|\
411+
hiveton,h5000m|\
409412
huasifei,wh3000|\
410413
huasifei,wh3000-pro-emmc|\
411414
jdcloud,re-cp-03|\

target/linux/mediatek/image/filogic.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,18 @@ define Device/h3c_magic-nx30-pro
17461746
endef
17471747
TARGET_DEVICES += h3c_magic-nx30-pro
17481748

1749+
define Device/hiveton_h5000m
1750+
DEVICE_VENDOR := Hiveton
1751+
DEVICE_MODEL := H5000M
1752+
DEVICE_DTS := mt7987a-hiveton-h5000m
1753+
DEVICE_DTS_DIR := ../dts
1754+
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-usb3 mt7987-2p5g-phy-firmware \
1755+
kmod-mt7996e kmod-mt7992-23-firmware f2fsck mkf2fs
1756+
KERNEL_LOADADDR := 0x40080000
1757+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1758+
endef
1759+
TARGET_DEVICES += hiveton_h5000m
1760+
17491761
define Device/huasifei_wh3000
17501762
DEVICE_VENDOR := Huasifei
17511763
DEVICE_MODEL := WH3000

0 commit comments

Comments
 (0)