diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index b43a5dcfcd7..add5dbb3d30 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -59,7 +59,8 @@ acer,vero-w6m|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ glinet,gl-x3000|\ -glinet,gl-xe3000) +glinet,gl-xe3000|\ +huasifei,wh3000) local envdev=$(find_mmc_part "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x80000" ;; diff --git a/target/linux/mediatek/dts/mt7981b-huasifei-wh3000.dts b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000.dts new file mode 100644 index 00000000000..c12367b84af --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000.dts @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "Huasifei WH3000"; + compatible = "huasifei,wh3000", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &wlan_led; + led-failsafe = &wlan_led; + led-upgrade = &wlan_led; + }; + + chosen { + bootargs = "root=PARTLABEL=rootfs rootwait"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-mode { + label = "mode"; + linux,code = ; + linux,input-type = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wan_led: led-0 { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + wlan_led: led-1 { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x40000000>; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + nvmem-cells = <&macaddr_factory_4 2>; + nvmem-cell-names = "mac-address"; + phy-mode = "2500base-x"; + phy-handle = <&phy1>; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + nvmem-cells = <&macaddr_factory_4 3>; + nvmem-cell-names = "mac-address"; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <1>; + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&pio>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + realtek,aldps-enable; + }; +}; + +&mmc0 { + bus-width = <8>; + cap-mmc-highspeed; + max-frequency = <52000000>; + no-sd; + no-sdio; + non-removable; + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + vmmc-supply = <®_3p3v>; + status = "okay"; + + card@0 { + compatible = "mmc-card"; + reg = <0>; + + block { + compatible = "block-device"; + + partitions { + block-partition-factory { + partname = "factory"; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; + }; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_factory_4 1>; + nvmem-cell-names = "mac-address"; + }; +}; + +&xhci { + status = "okay"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 73d91ee2441..840072a5562 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -49,6 +49,9 @@ glinet,gl-xe3000) ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wifi2g" "phy0-ap0" ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wifi5g" "phy1-ap0" ;; +huasifei,wh3000) + ucidef_set_led_netdev "wan" "WAN" "red:wan" "eth1" "link tx rx" + ;; mercusys,mr90x-v1|\ mercusys,mr90x-v1-ubi) ucidef_set_led_netdev "lan-0" "lan-0" "green:lan-0" "lan0" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index a97cd37c587..7d9610d62c6 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -64,7 +64,8 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ;; bananapi,bpi-r3-mini|\ - edgecore,eap111) + edgecore,eap111|\ + huasifei,wh3000) ucidef_set_interfaces_lan_wan eth0 eth1 ;; bananapi,bpi-r4|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 2a8029dd187..89aeaadedb2 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -104,6 +104,7 @@ platform_do_upgrade() { glinet,gl-mt6000|\ glinet,gl-x3000|\ glinet,gl-xe3000|\ + huasifei,wh3000|\ smartrg,sdg-8612|\ smartrg,sdg-8614|\ smartrg,sdg-8622|\ @@ -220,6 +221,7 @@ platform_copy_config() { glinet,gl-mt6000|\ glinet,gl-x3000|\ glinet,gl-xe3000|\ + huasifei,wh3000|\ jdcloud,re-cp-03|\ smartrg,sdg-8612|\ smartrg,sdg-8614|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 248593ede78..60f45a73e67 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -925,6 +925,21 @@ define Device/h3c_magic-nx30-pro endef TARGET_DEVICES += h3c_magic-nx30-pro +define Device/huasifei_wh3000 + DEVICE_VENDOR := Huasifei + DEVICE_MODEL := WH3000 + DEVICE_DTS := mt7981b-huasifei-wh3000 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \ + kmod-usb3 f2fsck mkf2fs + SUPPORTED_DEVICES += huasifei,wh3000-emmc + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += huasifei_wh3000 + define Device/jcg_q30-pro DEVICE_VENDOR := JCG DEVICE_MODEL := Q30 PRO