Skip to content

Commit ebee946

Browse files
rbqvqhauke
authored andcommitted
ramips: add support for Hongdian H7920 v40
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 MT7628NN - Flash: 16 MB - RAM: 128 MB - Power: DC 5V-36V 1.5A - Ethernet: 1x WAN [slot not install], 1x LAN (10/100 Mbps) - Wireless radio: 802.11n 2.4g-only [antenna not install] - LED: System/Power (RUN): GPIO/37 active-low Modem: GPIO/3 active-low RF (Modem Signal): GPIO/2 active-low - Button: WPS / RESET: GPIO/11 active-low - UART: 1x UART on PCB - 115200 8N1 - Serial / COM: 1X RS232/RS485 on board (GPIO/6 hi:RS485 lo:RS232) - GPIO Watchdog: GPIO/0 mode=toggle timeout=1s - Modem: 1x Built-in modem on board (Power: GPIO/4 active-high) - PCIe: 1x miniPCIe for modem [slot not install] - SIM Slots: 1x SIM Slots Issue: - Factory partition not store mac address on original firmware Flash instruction: Using SSH/Telnet: 1. Connect the board to the computer via RJ45 Ethernet 2. Login 192.168.8.1 with root password "superzxmn" (SSH Port 22, Telnet Port 5188) 3. Download openwrt firmware on the computer. 4. Use scp or sftp put firmware to board /tmp 5. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h7920-v40-squashfs-sysupgrade.bin firmware" to flash Original Firmware Dump / More details: https://blog.gov.cooking/archives/research-hongdian-h7920-v40-and-flash.html Signed-off-by: Coia Prant <[email protected]> Tested-by: Coia Prant <[email protected]> Link: openwrt/openwrt#17726 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 2fea2ed commit ebee946

File tree

4 files changed

+186
-0
lines changed

4 files changed

+186
-0
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
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,h7920-v40", "mediatek,mt7628an-soc";
11+
model = "Hongdian H7920 v40";
12+
13+
aliases {
14+
led-boot = &led_sys;
15+
led-failsafe = &led_sys;
16+
led-running = &led_sys;
17+
led-upgrade = &led_sys;
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 {
34+
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
35+
color = <LED_COLOR_ID_GREEN>;
36+
function = LED_FUNCTION_MOBILE;
37+
};
38+
39+
led_sys: led-sys {
40+
gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
41+
color = <LED_COLOR_ID_GREEN>;
42+
function = LED_FUNCTION_POWER;
43+
default-state = "on";
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 = <0>;
72+
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
73+
};
74+
75+
gpio_serial_rs485_mode {
76+
gpio-export,name = "serial_rs485_mode";
77+
gpio-export,output = <0>;
78+
gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
79+
};
80+
};
81+
};
82+
83+
&watchdog {
84+
status = "disabled";
85+
};
86+
87+
&spi0 {
88+
status = "okay";
89+
90+
flash@0 {
91+
compatible = "jedec,spi-nor";
92+
reg = <0>;
93+
spi-max-frequency = <40000000>;
94+
95+
partitions {
96+
compatible = "fixed-partitions";
97+
#address-cells = <1>;
98+
#size-cells = <1>;
99+
100+
partition@0 {
101+
label = "u-boot";
102+
reg = <0x0 0x30000>;
103+
read-only;
104+
};
105+
106+
partition@30000 {
107+
label = "u-boot-env";
108+
reg = <0x30000 0x10000>;
109+
read-only;
110+
};
111+
112+
partition@40000 {
113+
label = "factory";
114+
reg = <0x40000 0x10000>;
115+
read-only;
116+
117+
nvmem-layout {
118+
compatible = "fixed-layout";
119+
#address-cells = <1>;
120+
#size-cells = <1>;
121+
122+
eeprom_factory_0: eeprom@0 {
123+
reg = <0x0 0x400>;
124+
};
125+
126+
macaddr_factory_28: macaddr@28 {
127+
reg = <0x28 0x6>;
128+
};
129+
};
130+
};
131+
132+
partition@50000 {
133+
compatible = "denx,uimage";
134+
label = "firmware";
135+
reg = <0x50000 0xfb0000>;
136+
};
137+
};
138+
};
139+
};
140+
141+
&state_default {
142+
gpio {
143+
groups = "i2s", "gpio", "refclk";
144+
function = "gpio";
145+
};
146+
};
147+
148+
&ethernet {
149+
nvmem-cells = <&macaddr_factory_28>;
150+
nvmem-cell-names = "mac-address";
151+
};
152+
153+
&esw {
154+
mediatek,portmap = <0x3e>;
155+
mediatek,portdisable = <0x3c>;
156+
};
157+
158+
&wmac {
159+
status = "okay";
160+
161+
nvmem-cells = <&eeprom_factory_0>;
162+
nvmem-cell-names = "eeprom";
163+
};
164+
165+
&uart1 {
166+
status = "okay";
167+
};
168+
169+
&pcie {
170+
status = "okay";
171+
};

target/linux/ramips/image/mt76x8.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ define Device/hiwifi_hc5861b
339339
endef
340340
TARGET_DEVICES += hiwifi_hc5861b
341341

342+
define Device/hongdian_h7920-v40
343+
IMAGE_SIZE := 16064k
344+
DEVICE_VENDOR := Hongdian
345+
DEVICE_MODEL := H7920
346+
DEVICE_VARIANT := v40
347+
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
348+
endef
349+
TARGET_DEVICES += hongdian_h7920-v40
350+
342351
define Device/iptime_a3
343352
IMAGE_SIZE := 7936k
344353
UIMAGE_NAME := a3

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ ramips_setup_interfaces()
109109
;;
110110
duzun,dm06|\
111111
glinet,gl-mt300n-v2|\
112+
hongdian,h7920-v40|\
112113
teltonika,rut200|\
113114
teltonika,rut241)
114115
ucidef_add_switch "switch0" \
@@ -299,6 +300,7 @@ ramips_setup_macs()
299300
totolink,a3)
300301
wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40)
301302
;;
303+
hongdian,h7920-v40|\
302304
jotale,js76x8-8m|\
303305
jotale,js76x8-16m|\
304306
jotale,js76x8-32m|\

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ board_config_update
99
board=$(board_name)
1010

1111
case "$board" in
12+
hongdian,h7920-v40)
13+
ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1"
14+
ucidef_add_gpio_switch "switch_serial_mode" "Switch RS232 to RS485" "serial_rs485_mode" "0"
15+
;;
1216
teltonika,rut200|\
1317
teltonika,rut241)
1418
ucidef_add_gpio_switch "digital_output" "Digital output" "digital_output" "0"

0 commit comments

Comments
 (0)