Skip to content

Commit

Permalink
ramips: add support for Huasifei WHF283
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Dec 28, 2024
1 parent 817dfb5 commit f2815ef
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 5 deletions.
136 changes: 136 additions & 0 deletions target/linux/ramips/dts/mt7628an_huasifei_shf283.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
* Copyright(c) 2017 Kristian Evensen <[email protected]>.
* Copyright(c) 2017 Piotr Dymacz <[email protected]>.
* All rights reserved.
*/

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
model = "Huasifei SHF283";
compatible = "huasifei,shf283", "mediatek,mt7628an-soc";

aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};

chosen {
bootargs = "console=ttyS0,115200";
};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};

leds {
compatible = "gpio-leds";

led_power: power {
label = "green:power";
gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
};

wlan {
label = "green:wlan";
gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
};

wan {
label = "green:wan";
gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
};

sys {
label = "green:sys";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};

};

gpio-export {
compatible = "gpio-export";
#size-cells = <0>;

modem_reset {
gpio-export,name = "modem_reset";
gpio-export,output = <0>;
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
};
};

&pcie {
status = "okay";
};

&ethernet {
mtd-mac-address = <&factory 0x28>;
};

&wmac {
status = "okay";
};

&state_default {
gpio {
groups = "i2c";
function = "gpio";
};
};

&uart1 {
status = "okay";
};

&spi0 {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <12000000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "bootloader";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "config";
reg = <0x30000 0x10000>;
read-only;
};

factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};

partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};
9 changes: 9 additions & 0 deletions target/linux/ramips/image/mt76x8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ define Device/hak5_wifi-pineapple-mk7
endef
TARGET_DEVICES += hak5_wifi-pineapple-mk7

define Device/huasifei_shf283
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Huasifei
DEVICE_MODEL := SHF283
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-usb-net-cdc-mbim \
kmod-usb-net-qmi-wwan kmod-usb-net-rndis kmod-usb-serial-option uqmi
endef
TARGET_DEVICES += huasifei_shf283

define Device/hilink_hlk-7628n
IMAGE_SIZE := 32448k
DEVICE_VENDOR := HILINK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
START=99

start() {
[ -n "$(fw_printenv -n model_name 2>/dev/null)" ] && fw_printenv -n model_name > /tmp/sysinfo/model
[ -n "$(fw_printenv -n model_name 2>/dev/null)" ] && \
fw_printenv -n model_name > /tmp/sysinfo/model
}




5 changes: 5 additions & 0 deletions target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan" "0:wan" "6@eth0"
;;
huasifei,shf283)
ucidef_add_switch "switch0" \
"2:lan" "3:lan" "4:lan" "1:wan" "6@eth0"
;;
hilink,hlk-7628n|\
hilink,hlk-7688a|\
hiwifi,hc5861b|\
Expand Down Expand Up @@ -223,6 +227,7 @@ ramips_setup_macs()
mercury,mac1200r-v2)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory_info 0xd)" 1)
;;
huasifei,shf283|\
rakwireless,rak633|\
unielec,u7628-01-16m|\
wavlink,wl-wn575a3)
Expand Down

0 comments on commit f2815ef

Please sign in to comment.