diff --git a/target/linux/ramips/dts/mt7628an_huasifei_shf283.dts b/target/linux/ramips/dts/mt7628an_huasifei_shf283.dts new file mode 100644 index 000000000..38b655e6b --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_huasifei_shf283.dts @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + */ + +#include "mt7628an.dtsi" + +#include +#include + +/ { + 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 = ; + }; + }; + + 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"; +}; + +ðernet { + 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>; + }; + }; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 4213d0848..a600e407c 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -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 diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/set-model-name b/target/linux/ramips/mt7621/base-files/etc/init.d/set-model-name index 1b8143fab..df2867f95 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/set-model-name +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/set-model-name @@ -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 } - - - - diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 981e8a1f0..bdf37a0d4 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -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)