Skip to content

Commit 61408bb

Browse files
rbqvqhauke
authored andcommitted
ramips: add support for Hongdian H8850 v20
This is an industrial 4G router equipped with OpenWrt SNAPSHOT OEM customized version WARNING: The original firmware device tree is modified from evb boards, and the device tree name is evb board. This submitted device tree is a modified version, which deletes the non-this-device parts and adds GPIO watchdog. Specification: - SoC: MediaTek MT7628DAN - Flash: 16 MB - RAM: 64 MB - Power: DC 5V-36V 1.5A - Ethernet: 1x WAN/LAN, 3x LAN (10/100 Mbps) - Wireless radio: 802.11n 2.4g-only - LED: System/Power (PWR): Always Off Modem (NET): GPIO/3 active-low LAN: Always On RF (Modem Signal): GPIO/2 active-low WIFI: GPIO/44 active-low - Button: WPS / RESET: GPIO/11 active-low - UART: 1x UART on PCB - 115200 8N1 - GPIO Watchdog: GPIO/0 mode=toggle timeout=1s - Modem: 1x Built-in modem on board (Power: GPIO/4 active-high) - SIM Slots: 1x SIM Slots Issue: - Factory partition not store mac address on original firmware Flash instruction: Using TTL: 1. Connect the board to the computer via TTL. 2. Enter original firmware failsafe mode. 3. Use wget download firmware to board /tmp 4. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h8850-v20-squashfs-sysupgrade.bin firmware" to flash Original Firmware Dump / More details: https://blog.gov.cooking/archives/research-hongdian-h8850-v20-and-flash.html Signed-off-by: Coia Prant <[email protected]> Tested-by: Coia Prant <[email protected]> Link: openwrt/openwrt#20259 (cherry picked from commit 23a070d) Link: openwrt/openwrt#21007 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent ce660d9 commit 61408bb

File tree

4 files changed

+176
-5
lines changed

4 files changed

+176
-5
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7628an.dtsi"
4+
5+
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/input/input.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
/ {
10+
compatible = "hongdian,h8850-v20", "mediatek,mt7628an-soc";
11+
model = "Hongdian H8850 v20";
12+
13+
aliases {
14+
led-boot = &led_net;
15+
led-failsafe = &led_net;
16+
led-running = &led_net;
17+
led-upgrade = &led_net;
18+
};
19+
20+
chosen {
21+
bootargs = "console=ttyS0,115200";
22+
};
23+
24+
leds {
25+
compatible = "gpio-leds";
26+
27+
led-rf {
28+
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
29+
color = <LED_COLOR_ID_GREEN>;
30+
function = "rf";
31+
};
32+
33+
led_net: led-net {
34+
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
35+
color = <LED_COLOR_ID_GREEN>;
36+
function = LED_FUNCTION_MOBILE;
37+
};
38+
39+
led-wifi {
40+
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
41+
color = <LED_COLOR_ID_GREEN>;
42+
function = LED_FUNCTION_WLAN;
43+
linux,default-trigger = "phy0tpt";
44+
};
45+
};
46+
47+
keys {
48+
compatible = "gpio-keys";
49+
50+
reset {
51+
label = "reset";
52+
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
53+
linux,code = <KEY_RESTART>;
54+
};
55+
};
56+
57+
watchdog {
58+
compatible = "linux,wdt-gpio";
59+
60+
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
61+
hw_algo = "toggle";
62+
hw_margin_ms = <600>;
63+
always-running;
64+
};
65+
66+
gpio-export {
67+
compatible = "gpio-export";
68+
69+
gpio_modem_power {
70+
gpio-export,name = "modem_power";
71+
gpio-export,output = <1>;
72+
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
73+
};
74+
};
75+
};
76+
77+
&watchdog {
78+
status = "disabled";
79+
};
80+
81+
&spi0 {
82+
status = "okay";
83+
84+
flash@0 {
85+
compatible = "jedec,spi-nor";
86+
reg = <0>;
87+
spi-max-frequency = <40000000>;
88+
89+
partitions {
90+
compatible = "fixed-partitions";
91+
#address-cells = <1>;
92+
#size-cells = <1>;
93+
94+
partition@0 {
95+
label = "u-boot";
96+
reg = <0x0 0x30000>;
97+
read-only;
98+
};
99+
100+
partition@30000 {
101+
label = "u-boot-env";
102+
reg = <0x30000 0x10000>;
103+
read-only;
104+
};
105+
106+
partition@40000 {
107+
label = "factory";
108+
reg = <0x40000 0x10000>;
109+
read-only;
110+
111+
nvmem-layout {
112+
compatible = "fixed-layout";
113+
#address-cells = <1>;
114+
#size-cells = <1>;
115+
116+
eeprom_factory_0: eeprom@0 {
117+
reg = <0x0 0x400>;
118+
};
119+
120+
macaddr_factory_4: macaddr@4 {
121+
reg = <0x4 0x6>;
122+
};
123+
};
124+
};
125+
126+
partition@50000 {
127+
compatible = "denx,uimage";
128+
label = "firmware";
129+
reg = <0x50000 0xfb0000>;
130+
};
131+
};
132+
};
133+
};
134+
135+
&state_default {
136+
gpio {
137+
groups = "i2s", "i2c", "spi cs1", "gpio", "perst", "refclk", "wdt", "p4led_an", "wled_an";
138+
function = "gpio";
139+
};
140+
};
141+
142+
&ethernet {
143+
nvmem-cells = <&macaddr_factory_4>;
144+
nvmem-cell-names = "mac-address";
145+
};
146+
147+
&esw {
148+
mediatek,portmap = <0x3e>;
149+
mediatek,portdisable = <0x30>;
150+
};
151+
152+
&wmac {
153+
status = "okay";
154+
155+
nvmem-cells = <&eeprom_factory_0>;
156+
nvmem-cell-names = "eeprom";
157+
};

target/linux/ramips/image/mt76x8.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,15 @@ define Device/hongdian_h7920-v40
347347
endef
348348
TARGET_DEVICES += hongdian_h7920-v40
349349

350+
define Device/hongdian_h8850-v20
351+
IMAGE_SIZE := 16064k
352+
DEVICE_VENDOR := Hongdian
353+
DEVICE_MODEL := H8850
354+
DEVICE_VARIANT := v20
355+
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
356+
endef
357+
TARGET_DEVICES += hongdian_h8850-v20
358+
350359
define Device/iptime_a3
351360
IMAGE_SIZE := 7936k
352361
UIMAGE_NAME := a3

target/linux/ramips/mt76x8/base-files/etc/board.d/02_network

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ ramips_setup_interfaces()
117117
ucidef_add_switch "switch0" \
118118
"0:lan" "1:lan" "4:wan" "6@eth0"
119119
;;
120+
hongdian,h8850-v20|\
121+
keenetic,kn-1613|\
122+
motorola,mwr03)
123+
ucidef_add_switch "switch0" \
124+
"1:lan" "2:lan" "3:lan" "0:wan" "6@eth0"
125+
;;
120126
iptime,a3|\
121127
totolink,a3)
122128
ucidef_add_switch "switch0" \
@@ -132,11 +138,6 @@ ramips_setup_interfaces()
132138
ucidef_add_switch "switch0" \
133139
"0:lan" "1:lan" "2:lan" "6@eth0"
134140
;;
135-
keenetic,kn-1613|\
136-
motorola,mwr03)
137-
ucidef_add_switch "switch0" \
138-
"1:lan" "2:lan" "3:lan" "0:wan" "6@eth0"
139-
;;
140141
kroks,kndrt31r19)
141142
ucidef_add_switch "switch0" \
142143
"0:lan" "6@eth0"
@@ -260,6 +261,7 @@ ramips_setup_macs()
260261
;;
261262
duzun,dm06|\
262263
hongdian,h7920-v40|\
264+
hongdian,h8850-v20|\
263265
netgear,r6020|\
264266
netgear,r6080|\
265267
netgear,r6120|\

target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ hongdian,h7920-v40)
1313
ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1"
1414
ucidef_add_gpio_switch "switch_serial_mode" "Switch RS232 to RS485" "serial_rs485_mode" "0"
1515
;;
16+
hongdian,h8850-v20)
17+
ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1"
18+
;;
1619
esac
1720

1821
board_config_flush

0 commit comments

Comments
 (0)