diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dts b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dts new file mode 100644 index 0000000000..232f44f98a --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dts @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7981b-wavlink-wl-wnt100x3.dtsi" + +/ { + model = "WAVLINK WL-WNT100X3"; + compatible = "wavlink,wl-wnt100x3", "mediatek,mt7981b"; +}; + +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + read-only; + }; + + partition@180000 { + label = "factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_lan: macaddr@3fff4 { + reg = <0x3fff4 0x06>; + }; + + macaddr_wan: macaddr@3fffa { + reg = <0x3fffa 0x06>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x5a00000>; + }; + + partition@5f80000 { + label = "hw"; + reg = <0x5f80000 0x80000>; + read-only; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dtsi b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dtsi new file mode 100644 index 0000000000..933ff1f195 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wnt100x3.dtsi @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7981b.dtsi" + +/ { + aliases { + label-mac-device = &wifi; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + serial0 = &uart0; + }; + + chosen: chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-0 { + label = "reset"; + linux,code = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + button-1 { + label = "mode"; + linux,code = ; + linux,input-type = ; + gpios = <&pio 25 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + fan_5v: regulator-fan-5v { + compatible = "regulator-fixed"; + regulator-name = "fan"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&pio 22 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; + +&fan { + pwms = <&pwm 0 40000 0>; + fan-supply = <&fan_5v>; + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "sgmii"; + phy-handle = <&en8801sc>; + nvmem-cells = <&macaddr_lan>; + nvmem-cell-names = "mac-address"; + managed = "in-band-status"; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + nvmem-cells = <&macaddr_wan>; + nvmem-cell-names = "mac-address"; + }; +}; + +&mdio_bus { + en8801sc: ethernet-phy@29 { + compatible = "ethernet-phy-id03a2.9471"; + phy-mode = "sgmii"; + reg = <29>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <20000>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + }; +}; + +&pio { + pwm_pins: pwm0-pins { + mux { + function = "pwm"; + groups = "pwm0_1"; + }; + }; + + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; +}; 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 e431e9b0df..5824d77b0d 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 @@ -134,7 +134,8 @@ mediatek_setup_interfaces() edgecore,eap111|\ huasifei,wh3000|\ huasifei,wh3000-pro-emmc|\ - huasifei,wh3000-pro-nand) + huasifei,wh3000-pro-nand|\ + wavlink,wl-wnt100x3) ucidef_set_interfaces_lan_wan eth0 eth1 ;; bazis,ax3000wm|\ 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 8aadf3e0cf..1440f05ee6 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -240,6 +240,7 @@ platform_do_upgrade() { kebidumei,ax3000-u22|\ totolink,x6000r|\ wavlink,wl-wn573hx3|\ + wavlink,wl-wnt100x3|\ widelantech,wap430x|\ yuncore,ax835) default_do_upgrade "$1" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 5fe22fa0d1..318dda771b 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -3294,6 +3294,19 @@ define Device/wavlink_wl-wn573hx3 endef TARGET_DEVICES += wavlink_wl-wn573hx3 +define Device/wavlink_wl-wnt100x3 + DEVICE_VENDOR := WAVLINK + DEVICE_MODEL := WL-WNT100X3 + DEVICE_DTS := mt7981b-wavlink-wl-wnt100x3 + DEVICE_DTS_DIR := ../dts + IMAGE_SIZE := 65536k + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware \ + mt7981-wo-firmware kmod-hwmon-pwmfan + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += wavlink_wl-wnt100x3 + define Device/widelantech_wap430x DEVICE_VENDOR := Widelantech DEVICE_MODEL := WAP430X