ramips: add support for Huasifei WHF283

This commit is contained in:
coolsnowwolf 2024-11-26 23:17:06 +08:00
parent 817dfb5381
commit f2815ef000
4 changed files with 152 additions and 5 deletions

View File

@ -0,0 +1,136 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
* Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
* Copyright(c) 2017 Piotr Dymacz <pepe2k@gmail.com>.
* 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>;
};
};
};
};

View File

@ -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

View File

@ -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
}

View File

@ -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|\
@ -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)