Skip to content

Commit f2815ef

Browse files
committed
ramips: add support for Huasifei WHF283
1 parent 817dfb5 commit f2815ef

File tree

4 files changed

+152
-5
lines changed

4 files changed

+152
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
// SPDX-License-Identifier: BSD-3-Clause
2+
/*
3+
* Copyright(c) 2017 Kristian Evensen <[email protected]>.
4+
* Copyright(c) 2017 Piotr Dymacz <[email protected]>.
5+
* All rights reserved.
6+
*/
7+
8+
#include "mt7628an.dtsi"
9+
10+
#include <dt-bindings/gpio/gpio.h>
11+
#include <dt-bindings/input/input.h>
12+
13+
/ {
14+
model = "Huasifei SHF283";
15+
compatible = "huasifei,shf283", "mediatek,mt7628an-soc";
16+
17+
aliases {
18+
led-boot = &led_power;
19+
led-failsafe = &led_power;
20+
led-running = &led_power;
21+
led-upgrade = &led_power;
22+
};
23+
24+
chosen {
25+
bootargs = "console=ttyS0,115200";
26+
};
27+
28+
keys {
29+
compatible = "gpio-keys";
30+
31+
reset {
32+
label = "reset";
33+
gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
34+
linux,code = <KEY_RESTART>;
35+
};
36+
};
37+
38+
leds {
39+
compatible = "gpio-leds";
40+
41+
led_power: power {
42+
label = "green:power";
43+
gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
44+
};
45+
46+
wlan {
47+
label = "green:wlan";
48+
gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
49+
};
50+
51+
wan {
52+
label = "green:wan";
53+
gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
54+
};
55+
56+
sys {
57+
label = "green:sys";
58+
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
59+
};
60+
61+
};
62+
63+
gpio-export {
64+
compatible = "gpio-export";
65+
#size-cells = <0>;
66+
67+
modem_reset {
68+
gpio-export,name = "modem_reset";
69+
gpio-export,output = <0>;
70+
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
71+
};
72+
};
73+
};
74+
75+
&pcie {
76+
status = "okay";
77+
};
78+
79+
&ethernet {
80+
mtd-mac-address = <&factory 0x28>;
81+
};
82+
83+
&wmac {
84+
status = "okay";
85+
};
86+
87+
&state_default {
88+
gpio {
89+
groups = "i2c";
90+
function = "gpio";
91+
};
92+
};
93+
94+
&uart1 {
95+
status = "okay";
96+
};
97+
98+
&spi0 {
99+
status = "okay";
100+
101+
flash@0 {
102+
compatible = "jedec,spi-nor";
103+
reg = <0>;
104+
spi-max-frequency = <12000000>;
105+
106+
partitions {
107+
compatible = "fixed-partitions";
108+
#address-cells = <1>;
109+
#size-cells = <1>;
110+
111+
partition@0 {
112+
label = "bootloader";
113+
reg = <0x0 0x30000>;
114+
read-only;
115+
};
116+
117+
partition@30000 {
118+
label = "config";
119+
reg = <0x30000 0x10000>;
120+
read-only;
121+
};
122+
123+
factory: partition@40000 {
124+
label = "factory";
125+
reg = <0x40000 0x10000>;
126+
read-only;
127+
};
128+
129+
partition@50000 {
130+
compatible = "denx,uimage";
131+
label = "firmware";
132+
reg = <0x50000 0xfb0000>;
133+
};
134+
};
135+
};
136+
};

target/linux/ramips/image/mt76x8.mk

+9
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ define Device/hak5_wifi-pineapple-mk7
156156
endef
157157
TARGET_DEVICES += hak5_wifi-pineapple-mk7
158158

159+
define Device/huasifei_shf283
160+
IMAGE_SIZE := 16064k
161+
DEVICE_VENDOR := Huasifei
162+
DEVICE_MODEL := SHF283
163+
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-usb-net-cdc-mbim \
164+
kmod-usb-net-qmi-wwan kmod-usb-net-rndis kmod-usb-serial-option uqmi
165+
endef
166+
TARGET_DEVICES += huasifei_shf283
167+
159168
define Device/hilink_hlk-7628n
160169
IMAGE_SIZE := 32448k
161170
DEVICE_VENDOR := HILINK

target/linux/ramips/mt7621/base-files/etc/init.d/set-model-name

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
START=99
44

55
start() {
6-
[ -n "$(fw_printenv -n model_name 2>/dev/null)" ] && fw_printenv -n model_name > /tmp/sysinfo/model
6+
[ -n "$(fw_printenv -n model_name 2>/dev/null)" ] && \
7+
fw_printenv -n model_name > /tmp/sysinfo/model
78
}
8-
9-
10-
11-

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

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ ramips_setup_interfaces()
6969
ucidef_add_switch "switch0" \
7070
"1:lan" "0:wan" "6@eth0"
7171
;;
72+
huasifei,shf283)
73+
ucidef_add_switch "switch0" \
74+
"2:lan" "3:lan" "4:lan" "1:wan" "6@eth0"
75+
;;
7276
hilink,hlk-7628n|\
7377
hilink,hlk-7688a|\
7478
hiwifi,hc5861b|\
@@ -223,6 +227,7 @@ ramips_setup_macs()
223227
mercury,mac1200r-v2)
224228
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory_info 0xd)" 1)
225229
;;
230+
huasifei,shf283|\
226231
rakwireless,rak633|\
227232
unielec,u7628-01-16m|\
228233
wavlink,wl-wn575a3)

0 commit comments

Comments
 (0)