diff --git a/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-emmc.dts b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-emmc.dts new file mode 100644 index 000000000..3c2e383d5 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-huasifei-wh3000-emmc.dts @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "HUASIFEI WH3000 eMMC version"; + compatible = "huasifei,wh3000-emmc", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &led_sys_red; + led-failsafe = &led_sys_red; + led-running = &led_sys_white; + led-upgrade = &led_sys_white; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=PARTLABEL=rootfs rootwait"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + mode { + label = "mode"; + linux,code = ; + linux,input-type = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys_red: led-0 { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_sys_white: led-1 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + }; + + usb_vbus: regulator-usb { + compatible = "regulator-fixed"; + regulator-name = "usb-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + regulator-boot-on; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + phy-handle = <&phy1>; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + phy1: phy@1 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <1>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&pio>; + realtek,aldps-enable; + }; +}; + +&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"; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + vbus-supply = <&usb_vbus>; +}; + +&wifi { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + cap-mmc-highspeed; + max-frequency = <52000000>; + vmmc-supply = <®_3p3v>; + non-removable; + status = "okay"; +}; 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 990e0df21..deb084e9a 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 @@ -31,7 +31,8 @@ mediatek_setup_interfaces() bananapi,bpi-r3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ;; - bananapi,bpi-r3-mini) + bananapi,bpi-r3-mini|\ + huasifei,wh3000-emmc) ucidef_set_interfaces_lan_wan eth0 eth1 ;; bananapi,bpi-r4|\ @@ -122,6 +123,11 @@ mediatek_setup_macs() lan_mac=$(macaddr_add "$wan_mac" 1) label_mac=$wan_mac ;; + huasifei,wh3000-emmc) + label_mac=$(mmc_get_mac_binary factory 0x4) + lan_mac="$(macaddr_add $label_mac 2)" + wan_mac="$(macaddr_add $label_mac 3)" + ;; imou,lc-hx3001) lan_mac=$(mtd_get_mac_ascii u-boot-env mac) wan_mac=$(macaddr_add "$lan_mac" 2) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata index cb264d450..2c75bbfbe 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata @@ -9,7 +9,8 @@ board=$(board_name) case "$FIRMWARE" in "mediatek/mt7981_eeprom_mt7976_dbdc.bin") case "$board" in - cmcc,rax3000m-emmc) + cmcc,rax3000m-emmc|\ + huasifei,wh3000-emmc) caldata_extract_mmc "factory" 0x0 0x1000 ;; esac diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 383ee95ca..b21649c64 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -50,7 +50,8 @@ case "$board" in ;; glinet,gl-mt6000|\ glinet,gl-x3000|\ - glinet,gl-xe3000) + glinet,gl-xe3000|\ + huasifei,wh3000-emmc) addr=$(mmc_get_mac_binary factory 0x04) [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress 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 77b57fc8e..e7568146c 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -49,6 +49,7 @@ platform_do_upgrade() { glinet,gl-x3000|\ glinet,gl-xe3000|\ hf,m7986r1-emmc|\ + huasifei,wh3000-emmc|\ jdcloud,re-cs-05) CI_KERNPART="kernel" CI_ROOTPART="rootfs" @@ -104,6 +105,7 @@ platform_copy_config() { glinet,gl-x3000|\ glinet,gl-xe3000|\ hf,m7986r1-emmc|\ + huasifei,wh3000-emmc|\ jdcloud,re-cs-05) emmc_copy_config ;; diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 469474034..811ed3cd6 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -442,6 +442,19 @@ define Device/h3c_magic-nx30-pro endef TARGET_DEVICES += h3c_magic-nx30-pro +define Device/huasifei_wh3000-emmc + DEVICE_VENDOR := HUASIFEI + DEVICE_MODEL := WH3000 eMMC + DEVICE_DTS := mt7981b-huasifei-wh3000-emmc + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 f2fsck mkf2fs + 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-emmc + define Device/hf_m7986r1-emmc DEVICE_VENDOR := HF DEVICE_MODEL := M7986R1 (eMMC)