From af8ba9b4263d330ac830cdac7334323a2c8d284a Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 8 May 2026 16:06:09 +0800 Subject: [PATCH] mediatek: add TP-Link TL-7DR7230 v1 support Hardware specification: SoC: MediaTek MT7988D 3x A73 Flash: ESMT F50L1G41LB 128MB RAM: GDQ2BFAA-CJ DDR4 512MB Ethernet: 1x 2.5G Wan, 4x 1G Lan WiFi1: MT7975N 2.4GHz 4T4R WiFi2: MT7979N 5GHz 4T5R Button: Reset, WPS Power: DC 12V 2A MAC addresses map: LAN 4C:xx:xx:xx:xx:A7 WAN 4C:xx:xx:xx:xx:A8 2G 4C:xx:xx:xx:xx:A7 5G 4C:xx:xx:xx:xx:A9 Flash instructions: 1. Update 7dr7230mv1-middleware.bin in vendor uboot 2. Update factory.bin in the middleware firmware 3. After openwrt boots up, install kmod-mtd-rw and execute: insmod mtd-rw i_want_a_brick=1 4. Replace the stock bootloader to OpenWrt's: mtd write openwrt-mediatek-filogic-tplink_tl-7dr7230-v1-preloader.bin bl2 mtd write openwrt-mediatek-filogic-tplink_tl-7dr7230-v1-bl31-uboot.fip fip 5. Run the following command to remove the OEM UBI volume: ubirmvol /dev/ubi0 -N kernel ubirmvol /dev/ubi0 -N rootfs ubimkvol /dev/ubi0 -N ubootenv -s 1MiB ubimkvol /dev/ubi0 -N ubootenv2 -s 1MiB 6. Upload sysupgrade.bin to perform the upgrade. Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/24200 Signed-off-by: Jonas Jelonek --- .../mediatek/dts/mt7988-tplink-tl-common.dtsi | 250 ++++++++++++++++++ .../dts/mt7988d-tplink-tl-7dr7230-v1.dts | 32 +++ .../dts/mt7988d-tplink-tl-7dr7230.dtsi | 109 ++++++++ .../dts/mt7988d-tplink-tl-7dr72xx.dtsi | 51 ++++ .../filogic/base-files/etc/board.d/02_network | 1 + .../base-files/lib/upgrade/platform.sh | 2 + target/linux/mediatek/image/filogic.mk | 33 +++ 7 files changed, 478 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7988-tplink-tl-common.dtsi create mode 100644 target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230-v1.dts create mode 100644 target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230.dtsi create mode 100644 target/linux/mediatek/dts/mt7988d-tplink-tl-7dr72xx.dtsi diff --git a/target/linux/mediatek/dts/mt7988-tplink-tl-common.dtsi b/target/linux/mediatek/dts/mt7988-tplink-tl-common.dtsi new file mode 100644 index 00000000000..ec6077d0d27 --- /dev/null +++ b/target/linux/mediatek/dts/mt7988-tplink-tl-common.dtsi @@ -0,0 +1,250 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7988a.dtsi" +#include +#include +#include +#include +#include + +/ { + aliases { + serial0 = &serial0; + label-mac-device = &gmac0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&cci { + proc-supply = <&rt5190_buck3>; +}; + +&cpu0 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu1 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu2 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu3 { + proc-supply = <&rt5190_buck3>; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio0_pins>; + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + rt5190a_64: rt5190a@64 { + compatible = "richtek,rt5190a"; + reg = <0x64>; + vin2-supply = <&rt5190_buck1>; + vin3-supply = <&rt5190_buck1>; + vin4-supply = <&rt5190_buck1>; + + regulators { + rt5190_buck1: buck1 { + regulator-name = "rt5190a-buck1"; + regulator-min-microvolt = <5090000>; + regulator-max-microvolt = <5090000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + buck2 { + regulator-name = "vcore"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + regulator-always-on; + }; + rt5190_buck3: buck3 { + regulator-name = "vproc"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + }; + buck4 { + regulator-name = "rt5190a-buck4"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + ldo { + regulator-name = "rt5190a-ldo"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + pcie@0,0 { + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + mt7992@0,0 { + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + #address-cells = <1>; + #size-cells = <0>; + + band@0 { + reg = <0>; + nvmem-cells = <&macaddr_config_1c 0>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_config_1c 2>; + nvmem-cell-names = "mac-address"; + }; + }; + }; +}; + +&pio { + i2c0_pins: i2c0-g0-pins { + mux { + function = "i2c"; + groups = "i2c0_1"; + }; + }; + + mdio0_pins: mdio0-pins { + mux { + function = "eth"; + groups = "mdc_mdio0"; + }; + + conf { + groups = "mdc_mdio0"; + drive-strength = ; + }; + }; + + spi0_flash_pins: spi0-flash-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x000000 0x0100000>; + read-only; + }; + + partition@180000 { + label = "factory"; + reg = <0x180000 0x00a0000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1e00>; + }; + }; + }; + + partition@360000 { + label = "config"; + reg = <0x360000 0x0020000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_1c: macaddr@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@580000 { + label = "fip"; + reg = <0x580000 0x0200000>; + read-only; + }; + }; + }; +}; + +&serial0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230-v1.dts b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230-v1.dts new file mode 100644 index 00000000000..b048b994c76 --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230-v1.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7988d-tplink-tl-7dr7230.dtsi" + +/ { + model = "TP-Link TL-7DR7230 v1"; + compatible = "tplink,tl-7dr7230-v1", "mediatek,mt7988d"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: status-red { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 53 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: status-green { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 54 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230.dtsi b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230.dtsi new file mode 100644 index 00000000000..cdc75cc8d3c --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr7230.dtsi @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7988d-tplink-tl-7dr72xx.dtsi" + +&gmac0 { + nvmem-cells = <&macaddr_config_1c 0>; + nvmem-cell-names = "mac-address"; + status = "okay"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_config_1c 1>; + nvmem-cell-names = "mac-address"; +}; + +&gsw_phy0 { + pinctrl-names = "gbe-led"; + pinctrl-0 = <&gbe0_led0_pins>; +}; + +&gsw_phy0_led0 { + color = ; + function = LED_FUNCTION_LAN; + status = "okay"; +}; + +&gsw_phy1 { + pinctrl-names = "gbe-led"; + pinctrl-0 = <&gbe1_led0_pins>; +}; + +&gsw_phy1_led0 { + color = ; + function = LED_FUNCTION_LAN; + status = "okay"; +}; + +&gsw_phy2 { + pinctrl-names = "gbe-led"; + pinctrl-0 = <&gbe2_led0_pins>; +}; + +&gsw_phy2_led0 { + color = ; + function = LED_FUNCTION_LAN; + status = "okay"; +}; + +&gsw_phy3 { + pinctrl-names = "gbe-led"; + pinctrl-0 = <&gbe3_led0_pins>; +}; + +&gsw_phy3_led0 { + color = ; + function = LED_FUNCTION_LAN; + status = "okay"; +}; + +&gsw_port0 { + label = "lan4"; +}; + +&gsw_port1 { + label = "lan3"; +}; + +&gsw_port2 { + label = "lan2"; +}; + +&gsw_port3 { + label = "lan1"; +}; + +&i2p5gbe_led0 { + color = ; + function = LED_FUNCTION_WAN; +}; + +&pio { + gbe0_led0_pins: gbe0-led0-pins { + mux { + function = "led"; + groups = "gbe0_led0"; + }; + }; + + gbe1_led0_pins: gbe1-led0-pins { + mux { + function = "led"; + groups = "gbe1_led0"; + }; + }; + + gbe2_led0_pins: gbe2-led0-pins { + mux { + function = "led"; + groups = "gbe2_led0"; + }; + }; + + gbe3_led0_pins: gbe3-led0-pins { + mux { + function = "led"; + groups = "gbe3_led0"; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr72xx.dtsi b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr72xx.dtsi new file mode 100644 index 00000000000..0e83ec08920 --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-tplink-tl-7dr72xx.dtsi @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7988-tplink-tl-common.dtsi" + +/ { + chosen { + bootargs = "root=/dev/fit0 rootwait"; + rootdisk = <&ubi_rootdisk>; + }; + + cpus { + /delete-node/ cpu@3; + }; +}; + +&gmac1 { + phy-handle = <&int_2p5g_phy>; + phy-mode = "internal"; + status = "okay"; +}; + +&i2p5gbe_led0 { + status = "okay"; +}; + +&int_2p5g_phy { + pinctrl-names = "i2p5gbe-led"; + pinctrl-0 = <&i2p5gbe_led0_pins>; +}; + +&partitions { + partition@780000 { + label = "ubi"; + reg = <0x780000 0x7080000>; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; + }; +}; + +&pio { + i2p5gbe_led0_pins: 2p5gbe-led0-pins { + mux { + function = "led"; + groups = "2p5gbe_led0"; + }; + }; +}; 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 a289e102405..448265913af 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 @@ -89,6 +89,7 @@ mediatek_setup_interfaces() netcore,n60-pro|\ nradio,c8-668gl|\ ruijie,rg-x60-pro|\ + tplink,tl-7dr7230*|\ unielec,u7981-01*|\ wavlink,wl-wn536ax6-a|\ zbtlink,zbt-z8102ax|\ 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 35fe4e91254..487eef10db7 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -210,6 +210,7 @@ platform_do_upgrade() { snr,snr-cpe-ax2|\ teralink,tl3020-256mb|\ tplink,be450-ubi|\ + tplink,tl-7dr7230*|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ tplink,tl-xdr6088|\ @@ -456,6 +457,7 @@ platform_check_image() { routerich,ax3000-ubootmod|\ teralink,tl3020-256mb|\ tplink,be450-ubi|\ + tplink,tl-7dr7230*|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ tplink,tl-xdr6088|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 0acaa7dcb7d..92418f946b8 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -3662,6 +3662,39 @@ define Device/tplink_fr365-v1 endef TARGET_DEVICES += tplink_fr365-v1 +define Device/tplink-tl-7dr-common + DEVICE_VENDOR := TP-Link + DEVICE_DTS_DIR := ../dts + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata + DEVICE_PACKAGES := kmod-mt7992-firmware mt7988-wo-firmware +endef + +define Device/tplink_tl-7dr7230-v1 + DEVICE_MODEL := TL-7DR7230 + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7988d-tplink-tl-7dr7230-v1 + $(call Device/tplink-tl-7dr-common) + DEVICE_PACKAGES += kmod-phy-mediatek-2p5g mt7988-2p5g-phy-firmware + IMAGES += factory.bin + IMAGE/factory.bin := append-squashfs4-fakeroot | sysupgrade-tar \ + kernel=$$$$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE) rootfs=$$$$@ | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7988-bl2 spim-nand-ddr4 + ARTIFACT/bl31-uboot.fip := mt7988-bl31-uboot tplink_tl-7dr7230-v1 +endef +TARGET_DEVICES += tplink_tl-7dr7230-v1 + define Device/tplink_tl-xdr-common DEVICE_VENDOR := TP-Link DEVICE_DTS_DIR := ../dts