mediatek: add support for TP-Link TL-XDR4288

The TP-Link TL-XDR4288 has the same hardware as the
TP-Link TL-XDR6088 except for the wireless part.

Note: WiFi: MT7976DAN (2.4G 2T2R, 5G 3T3R)

Signed-off-by: AnYun <amadeus@openjmu.xyz>
This commit is contained in:
AmadeusGhost 2023-04-08 23:18:03 +08:00
parent 4552e6a16c
commit e4901141b5
7 changed files with 146 additions and 29 deletions

View File

@ -168,7 +168,7 @@
partition@0 { partition@0 {
label = "bl2"; label = "bl2";
reg = <0x000000 0x0100000>; reg = <0x000000 0x0100000>;
// read-only; read-only;
}; };
config: partition@100000 { config: partition@100000 {
@ -179,20 +179,20 @@
factory: partition@160000 { factory: partition@160000 {
label = "factory"; label = "factory";
reg = <0x160000 0x00a0000>; reg = <0x160000 0x0060000>;
read-only; read-only;
}; };
partition@200000 { partition@1c0000 {
label = "reserved"; label = "reserved";
reg = <0x200000 0x0180000>; reg = <0x1c0000 0x01c0000>;
read-only; read-only;
}; };
partition@380000 { partition@380000 {
label = "fip"; label = "fip";
reg = <0x380000 0x0180000>; reg = <0x380000 0x0180000>;
// read-only; read-only;
}; };
partition@500000 { partition@500000 {
@ -220,23 +220,6 @@
mediatek,pull-down-adv = <0>; /* bias-disable */ mediatek,pull-down-adv = <0>; /* bias-disable */
}; };
}; };
wf_2g_5g_pins: wf_2g_5g-pins {
mux {
function = "wifi";
groups = "wf_2g", "wf_5g";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <4>;
};
};
}; };
&ssusb { &ssusb {
@ -254,13 +237,10 @@
}; };
&wmac { &wmac {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
mediatek,mtd-eeprom = <&factory 0x0>; mediatek,mtd-eeprom = <&factory 0x0>;
nvmem-cells = <&macaddr_config_1c>; nvmem-cells = <&macaddr_config_1c>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
status = "okay";
}; };
&config { &config {

View File

@ -0,0 +1,80 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7986a-tl-xdr-common.dtsi"
/ {
model = "TP-Link TL-XDR4288";
compatible = "tplink,tl-xdr4288", "mediatek,mt7986a";
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan3";
};
port@3 {
reg = <3>;
label = "lan4";
};
port@5 {
reg = <5>;
label = "lan5";
phy-handle = <&phy5>;
phy-mode = "2500base-x";
};
port@6 {
reg = <6>;
label = "cpu";
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
&pio {
wf_dbdc_pins: wf-dbdc-pins {
mux {
function = "wifi";
groups = "wf_dbdc";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <4>;
};
};
};
&wmac {
pinctrl-names = "dbdc";
pinctrl-0 = <&wf_dbdc_pins>;
};

View File

@ -39,3 +39,27 @@
}; };
}; };
}; };
&pio {
wf_2g_5g_pins: wf_2g_5g-pins {
mux {
function = "wifi";
groups = "wf_2g", "wf_5g";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <4>;
};
};
};
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
};

View File

@ -54,3 +54,27 @@
}; };
}; };
}; };
&pio {
wf_2g_5g_pins: wf_2g_5g-pins {
mux {
function = "wifi";
groups = "wf_2g", "wf_5g";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <4>;
};
};
};
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
};

View File

@ -19,12 +19,13 @@ mediatek_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
ucidef_set_interface_macaddr "wan" "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)" ucidef_set_interface_macaddr "wan" "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)"
;; ;;
tplink,tl-xdr6086) tplink,tl-xdr4288|\
ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
;;
tplink,tl-xdr6088) tplink,tl-xdr6088)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1
;; ;;
tplink,tl-xdr6086)
ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
;;
xiaomi,redmi-router-ax6000) xiaomi,redmi-router-ax6000)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
;; ;;

View File

@ -19,6 +19,7 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
;; ;;
tplink,tl-xdr4288|\
tplink,tl-xdr6086|\ tplink,tl-xdr6086|\
tplink,tl-xdr6088) tplink,tl-xdr6088)
[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress

View File

@ -151,6 +151,13 @@ define Device/tplink_tl-common
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef endef
define Device/tplink_tl-xdr4288
DEVICE_MODEL := TL-XDR4288
DEVICE_DTS := mt7986a-tl-xdr4288
$(call Device/tplink_tl-common)
endef
TARGET_DEVICES += tplink_tl-xdr4288
define Device/tplink_tl-xdr6086 define Device/tplink_tl-xdr6086
DEVICE_MODEL := TL-XDR6086 DEVICE_MODEL := TL-XDR6086
DEVICE_DTS := mt7986a-tl-xdr6086 DEVICE_DTS := mt7986a-tl-xdr6086