Skip to content

Commit 87c0123

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 85250b9 commit 87c0123

6 files changed

Lines changed: 234 additions & 0 deletions

File tree

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
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,mt7987";
10+
11+
chosen {
12+
bootargs = "console=ttyS0,115200n1 \
13+
earlycon=uart8250,mmio32,0x11000000 \
14+
root=PARTLABEL=rootfs rootwait";
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_3p3v: regulator-3p3v {
68+
compatible = "regulator-fixed";
69+
regulator-name = "fixed-3.3V";
70+
regulator-min-microvolt = <3300000>;
71+
regulator-max-microvolt = <3300000>;
72+
regulator-boot-on;
73+
regulator-always-on;
74+
};
75+
};
76+
77+
&eth {
78+
status = "okay";
79+
};
80+
81+
&fan {
82+
pwms = <&pwm 1 50000 0>;
83+
status = "okay";
84+
};
85+
86+
&gmac0 {
87+
phy-mode = "2500base-x";
88+
phy-handle = <&phy0>;
89+
status = "okay";
90+
};
91+
92+
&gmac1 {
93+
phy-mode = "internal";
94+
phy-handle = <&phy1>;
95+
status = "okay";
96+
};
97+
98+
&mdio {
99+
/* RTL8221B-VB-CG 2.5Gbps PHY (away from power) eth0 */
100+
phy0: phy@1 {
101+
compatible = "ethernet-phy-ieee802.3-c45";
102+
reg = <1>;
103+
reset-gpios = <&pio 42 GPIO_ACTIVE_LOW>;
104+
reset-assert-us = <100000>;
105+
reset-deassert-us = <100000>;
106+
interrupt-parent = <&pio>;
107+
interrupts = <41 IRQ_TYPE_LEVEL_LOW>;
108+
realtek,aldps-enable;
109+
};
110+
111+
/* built-in 2.5G Ethernet PHY (near power) eth1 */
112+
phy1: phy@15 {
113+
compatible = "ethernet-phy-ieee802.3-c45";
114+
reg = <15>;
115+
pinctrl-names = "i2p5gbe-led";
116+
pinctrl-0 = <&i2p5gbe_led0_pins>;
117+
};
118+
};
119+
120+
&mmc0 {
121+
pinctrl-names = "default", "state_uhs";
122+
pinctrl-0 = <&mmc_pins_default>;
123+
pinctrl-1 = <&mmc_pins_uhs>;
124+
bus-width = <8>;
125+
max-frequency = <48000000>;
126+
cap-mmc-highspeed;
127+
vmmc-supply = <&reg_3p3v>;
128+
non-removable;
129+
status = "okay";
130+
131+
card@0 {
132+
compatible = "mmc-card";
133+
reg = <0>;
134+
135+
block {
136+
compatible = "block-device";
137+
138+
partitions {
139+
block-partition-factory {
140+
partname = "factory";
141+
142+
nvmem-layout {
143+
compatible = "fixed-layout";
144+
#address-cells = <1>;
145+
#size-cells = <1>;
146+
147+
eeprom_factory_0: eeprom@0 {
148+
reg = <0x0 0x1e00>;
149+
};
150+
};
151+
};
152+
};
153+
};
154+
};
155+
};
156+
157+
&pcie0 {
158+
pinctrl-names = "default";
159+
pinctrl-0 = <&pcie0_pins>;
160+
status = "okay";
161+
162+
pcie@0,0 {
163+
reg = <0x0000 0 0 0 0>;
164+
#address-cells = <3>;
165+
#size-cells = <2>;
166+
167+
mt76@0,0 {
168+
compatible = "mediatek,mt76";
169+
reg = <0x0000 0 0 0 0>;
170+
171+
nvmem-cells = <&eeprom_factory_0>;
172+
nvmem-cell-names = "eeprom";
173+
};
174+
};
175+
};
176+
177+
&pio {
178+
pwm_fan_pins: pwm-fan-pins {
179+
mux {
180+
function = "pwm";
181+
groups = "pwm1_0";
182+
};
183+
};
184+
};
185+
186+
&pwm {
187+
status = "okay";
188+
pinctrl-names = "default";
189+
pinctrl-0 = <&pwm_fan_pins>;
190+
};
191+
192+
&ssusb {
193+
status = "okay";
194+
vusb33-supply = <&reg_3p3v>;
195+
};
196+
197+
&tphyu3port0 {
198+
status = "okay";
199+
};
200+
201+
&uart0 {
202+
pinctrl-names = "default";
203+
pinctrl-0 = <&uart0_pins>;
204+
status = "okay";
205+
};

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
@@ -108,6 +108,10 @@ glinet,gl-xe3000)
108108
ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wifi2g" "phy0-ap0"
109109
ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wifi5g" "phy1-ap0"
110110
;;
111+
hiveton,h5000m)
112+
ucidef_set_led_netdev "wlan2g" "wlan-2ghz" "amber:wlan-2ghz" "phy0.0-ap0" "link tx rx"
113+
ucidef_set_led_netdev "wlan5g" "wlan-5ghz" "blue:wlan-5ghz" "phy0.1-ap0" "link tx rx"
114+
;;
111115
huasifei,wh3000)
112116
ucidef_set_led_netdev "wan" "WAN" "red:wan" "eth1" "link tx rx"
113117
;;

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
@@ -138,6 +138,7 @@ mediatek_setup_interfaces()
138138
glinet,gl-mt3000|\
139139
glinet,gl-x3000|\
140140
glinet,gl-xe3000|\
141+
hiveton,h5000m|\
141142
openembed,som7981|\
142143
openwrt,one)
143144
ucidef_set_interfaces_lan_wan eth1 eth0
@@ -248,6 +249,10 @@ mediatek_setup_macs()
248249
lan_mac=$(macaddr_add "$wan_mac" 1)
249250
label_mac=$wan_mac
250251
;;
252+
hiveton,h5000m)
253+
lan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
254+
wan_mac=$(macaddr_add "$lan_mac" 1)
255+
;;
251256
mercusys,mr80x-v3|\
252257
mercusys,mr85x)
253258
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
@@ -126,6 +126,11 @@ case "$board" in
126126
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
127127
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
128128
;;
129+
hiveton,h5000m)
130+
base_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
131+
[ "$PHYNBR" = "0" ] && macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
132+
[ "$PHYNBR" = "1" ] && macaddr_add $base_mac 3 > /sys${DEVPATH}/macaddress
133+
;;
129134
iptime,ax3000q)
130135
addr=$(mtd_get_mac_binary "Factory" 0x4)
131136
[ "$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
@@ -133,6 +133,7 @@ platform_do_upgrade() {
133133
glinet,gl-mt6000|\
134134
glinet,gl-x3000|\
135135
glinet,gl-xe3000|\
136+
hiveton,h5000m|\
136137
huasifei,wh3000|\
137138
huasifei,wh3000-pro|\
138139
smartrg,sdg-8612|\
@@ -314,6 +315,7 @@ platform_check_image() {
314315
;;
315316
creatlentem,clt-r30b1|\
316317
creatlentem,clt-r30b1-112m|\
318+
hiveton,h5000m|\
317319
nradio,c8-668gl)
318320
# tar magic `ustar`
319321
magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)"
@@ -359,6 +361,7 @@ platform_copy_config() {
359361
glinet,gl-mt6000|\
360362
glinet,gl-x3000|\
361363
glinet,gl-xe3000|\
364+
hiveton,h5000m|\
362365
huasifei,wh3000|\
363366
huasifei,wh3000-pro|\
364367
jdcloud,re-cp-03|\

target/linux/mediatek/image/filogic.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,18 @@ define Device/h3c_magic-nx30-pro
15711571
endef
15721572
TARGET_DEVICES += h3c_magic-nx30-pro
15731573

1574+
define Device/hiveton_h5000m
1575+
DEVICE_VENDOR := Hiveton
1576+
DEVICE_MODEL := H5000M
1577+
DEVICE_DTS := mt7987a-hiveton-h5000m
1578+
DEVICE_DTS_DIR := ../dts
1579+
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-usb3 mt7987-2p5g-phy-firmware \
1580+
kmod-mt7996e kmod-mt7992-23-firmware f2fsck mkf2fs
1581+
KERNEL_LOADADDR := 0x40080000
1582+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
1583+
endef
1584+
TARGET_DEVICES += hiveton_h5000m
1585+
15741586
define Device/huasifei_wh3000
15751587
DEVICE_VENDOR := Huasifei
15761588
DEVICE_MODEL := WH3000

0 commit comments

Comments
 (0)