diff --git a/target/linux/mediatek/dts/mt7981b-tplink-f65v1.dts b/target/linux/mediatek/dts/mt7981b-tplink-f65v1.dts new file mode 100644 index 0000000000..0a6c287857 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-tplink-f65v1.dts @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; +#include +#include +#include +#include + +#include "mt7981b.dtsi" + +/ { + compatible = "tplink,f65-v1", "mediatek,mt7981"; + model = "TP-Link F65 v1"; + + aliases { + serial0 = &uart0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led_status { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 35 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + 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 = <0x00000 0x100000>; + read-only; + }; + + partition@100000 { + label = "boot-config"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "boot-config1"; + reg = <0x200000 0x100000>; + read-only; + }; + + partition@300000 { + compatible = "u-boot,env"; + label = "u-boot-env"; + reg = <0x300000 0x100000>; + }; + + partition@400000 { + label = "fip0"; + reg = <0x400000 0x200000>; + read-only; + }; + + partition@600000 { + label = "fip1"; + reg = <0x600000 0x200000>; + read-only; + }; + + partition@800000 { + label = "oops"; + reg = <0x800000 0x100000>; + read-only; + }; + + partition@900000 { + label = "ubi"; + reg = <0x900000 0x2680000>; + }; + + partition@2F80000 { + label = "ubi_1"; + reg = <0x2F80000 0x2680000>; + read-only; + }; + + partition@5600000 { + label = "factory"; + reg = <0x5600000 0x800000>; + read-only; + }; + + partition@5E00000 { + label = "runtime_data"; + reg = <0x5E00000 0xC00000>; + read-only; + }; + + partition@6A00000 { + label = "backup_data"; + reg = <0x6A00000 0x800000>; + read-only; + }; + + partition@7200000 { + label = "runtime_backup"; + reg = <0x7200000 0x800000>; + read-only; + }; + + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + }; + }; +}; + +ð { + status = "okay"; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&wifi { + 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 6770b86424..e431e9b0df 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 @@ -122,6 +122,7 @@ mediatek_setup_interfaces() netgear,eax17|\ netgear,wax220|\ openfi,6c|\ + tplink,f65-v1|\ ubnt,unifi-6-plus|\ wavlink,wl-wn573hx3|\ widelantech,wap430x|\ @@ -302,7 +303,8 @@ mediatek_setup_macs() wan_mac=$label_mac lan_mac=$(macaddr_add "$label_mac" 1) ;; - tplink,eap683-lr) + tplink,eap683-lr|\ + tplink,f65-v1) label_mac=$(get_mac_binary "/tmp/factory/default-mac" 0) lan_mac=$label_mac ;; 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 89f0a2a85a..90125db143 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 @@ -14,6 +14,9 @@ case "$FIRMWARE" in ln -sf /tmp/tp_data/MT7981_EEPROM.bin \ /lib/firmware/$FIRMWARE ;; + tplink,f65-v1) + ln -sf /tmp/factory/radio /lib/firmware/$FIRMWARE + ;; tplink,fr365-v1) ln -sf /tmp/wlan/radio /lib/firmware/$FIRMWARE ;; 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 8bd48a15d2..25b363b906 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 @@ -221,7 +221,8 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress ;; - tplink,eap683-lr) + tplink,eap683-lr|\ + tplink,f65-v1) addr=$(get_mac_label) [ "$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/preinit/09_mount_cfg_part b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part index 451e867cc8..acb8e6b4d1 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part @@ -22,7 +22,8 @@ preinit_mount_cfg_part() { tplink,re6000xd) mount_ubi_part "tp_data" "tp_data" ;; - tplink,eap683-lr) + tplink,eap683-lr|\ + tplink,f65-v1) mount_ubi_part "factory" "ubi_factory_data" ;; tplink,fr365-v1) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 84369e23ea..5fe22fa0d1 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -3091,6 +3091,19 @@ define Device/tplink_re6000xd endef TARGET_DEVICES += tplink_re6000xd +define Device/tplink_f65-v1 + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := F65 + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7981b-tplink-f65v1 + DEVICE_DTS_DIR := ../dts + 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 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +endef +TARGET_DEVICES += tplink_f65-v1 + define Device/tplink_fr365-v1 DEVICE_VENDOR := TP-Link DEVICE_MODEL := FR365