Skip to content
55 changes: 49 additions & 6 deletions arch/arm64/boot/dts/apple/t6040-usb4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
interrupts = <AIC_IRQ 1791 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sram-parity";
mboxes = <&usb4_0_mbox>;
resets = <&ps_atc0_cio>;
resets = <&cio_reset 0>;
pinctrl-names = "lstx";
pinctrl-0 = <&usb4_0_lstx_pins>;
lstx-gpios = <&pinctrl_aop 49 GPIO_ACTIVE_HIGH>;
power-domains = <&ps_atc0_cio>, <&ps_atc0_cio_pcie>,
<&ps_atc0_cio_usb>, <&ps_atc0_pcie>;
thunderbolt-switch;
Expand All @@ -50,7 +53,7 @@

port@1 {
reg = <1>;
endpoint { };
usb4_0_acio_tbt: endpoint { };
};
};

Expand Down Expand Up @@ -127,7 +130,10 @@
interrupts = <AIC_IRQ 1839 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sram-parity";
mboxes = <&usb4_1_mbox>;
resets = <&ps_atc1_cio>;
resets = <&cio_reset 1>;
pinctrl-names = "lstx";
pinctrl-0 = <&usb4_1_lstx_pins>;
lstx-gpios = <&pinctrl_aop 51 GPIO_ACTIVE_HIGH>;
power-domains = <&ps_atc1_cio>, <&ps_atc1_cio_pcie>,
<&ps_atc1_cio_usb>, <&ps_atc1_pcie>;
thunderbolt-switch;
Expand All @@ -144,7 +150,7 @@

port@1 {
reg = <1>;
endpoint { };
usb4_1_acio_tbt: endpoint { };
};
};

Expand Down Expand Up @@ -221,7 +227,10 @@
interrupts = <AIC_IRQ 1887 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sram-parity";
mboxes = <&usb4_2_mbox>;
resets = <&ps_atc2_cio>;
resets = <&cio_reset 2>;
pinctrl-names = "lstx";
pinctrl-0 = <&usb4_2_lstx_pins>;
lstx-gpios = <&pinctrl_aop 53 GPIO_ACTIVE_HIGH>;
power-domains = <&ps_atc2_cio>, <&ps_atc2_cio_pcie>,
<&ps_atc2_cio_usb>, <&ps_atc2_pcie>;
thunderbolt-switch;
Expand All @@ -238,7 +247,7 @@

port@1 {
reg = <1>;
endpoint { };
usb4_2_acio_tbt: endpoint { };
};
};

Expand Down Expand Up @@ -514,3 +523,37 @@
};
};
};


/ {
/* ADT pmgr reg[44]: AppleT6041PMGR::enableCioReconfig at +0x2024. */
pmgr_cio: power-management@502820000 {
compatible = "apple,t6041-pmgr-cio", "syscon", "simple-mfd";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x5 0x02820000 0 0x4000>;
/* Enabled together with the routers. */
status = "disabled";

cio_reset: reset-controller@2024 {
compatible = "apple,t6041-cio-reset", "apple,t6000-cio-reset";
reg = <0x2024 0x4>;
#reset-cells = <1>;
};
};
};

&pinctrl_aop {
/* ADT acioN gpio-lstx. */
usb4_0_lstx_pins: usb4-0-lstx-pins {
pinmux = <APPLE_PINMUX(49, 1)>;
};

usb4_1_lstx_pins: usb4-1-lstx-pins {
pinmux = <APPLE_PINMUX(51, 1)>;
};

usb4_2_lstx_pins: usb4-2-lstx-pins {
pinmux = <APPLE_PINMUX(53, 1)>;
};
};
17 changes: 2 additions & 15 deletions arch/arm64/boot/dts/apple/t6041.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
/delete-node/ &jpeg0_dart;
/delete-node/ &jpeg1_dart;
/delete-node/ &scaler0_dart;
/delete-node/ &usb4_0_mbox;
/delete-node/ &usb4_1_mbox;
/delete-node/ &usb4_2_mbox;
/delete-node/ &sio_mbox;
/delete-node/ &pinctrl_smc;
/delete-node/ &ps_gpx;
Expand Down Expand Up @@ -128,19 +125,7 @@
/delete-node/ &ps_dispext0_fe;
/delete-node/ &ps_dispext0_cpu;
/delete-node/ &ps_pcpu0_3;
/delete-node/ &ps_atc0_cio;
/delete-node/ &ps_atc0_pcie;
/delete-node/ &ps_atc0_cio_pcie;
/delete-node/ &ps_atc0_cio_usb;
/delete-node/ &ps_atc1_cio;
/delete-node/ &ps_atc1_pcie;
/delete-node/ &ps_atc1_cio_pcie;
/delete-node/ &ps_atc1_cio_usb;
/delete-node/ &ps_atc2_cio;
/delete-node/ &ps_atc2_pcie;
/delete-node/ &ps_atc2_cio_pcie;
/delete-node/ &ps_pcpu0_4;
/delete-node/ &ps_atc2_cio_usb;
/delete-node/ &ps_atc3_cio;
/delete-node/ &ps_atc3_pcie;
/delete-node/ &ps_atc3_cio_pcie;
Expand Down Expand Up @@ -358,6 +343,8 @@
/delete-node/ &opp_p0;
/delete-node/ &opp_p1;

#include "t6040-usb4.dtsi"

/ {
opp_p0: opp-table-p0 {
compatible = "operating-points-v2";
Expand Down
54 changes: 54 additions & 0 deletions arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* MacBook Pro (14-inch and 16-inch, M4 Pro) USB4/Thunderbolt: each Type-C
* port's connector is linked to the USB4 router behind the same ATC PHY
* (ADT acioN atc-phy-parent = atc-phyN): typec0 (left back) to ACIO0,
* typec1 (left front) to ACIO1, typec2 (right) to ACIO2. The routers stay
* disabled, and a port controller skips a link to a disabled router, so this
* changes nothing until a board enables them.
*/

&usb4_0_acio_tbt {
remote-endpoint = <&typec0_con_tbt>;
};

&usb4_1_acio_tbt {
remote-endpoint = <&typec1_con_tbt>;
};

&usb4_2_acio_tbt {
remote-endpoint = <&typec2_con_tbt>;
};

&typec0 {
ports {
port@2 {
reg = <2>;
typec0_con_tbt: endpoint {
remote-endpoint = <&usb4_0_acio_tbt>;
};
};
};
};

&typec1 {
ports {
port@2 {
reg = <2>;
typec1_con_tbt: endpoint {
remote-endpoint = <&usb4_1_acio_tbt>;
};
};
};
};

&typec2 {
ports {
port@2 {
reg = <2>;
typec2_con_tbt: endpoint {
remote-endpoint = <&usb4_2_acio_tbt>;
};
};
};
};
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4997,3 +4997,5 @@
power-domain-names = "sys", "cpu", "mpm", "td", "base", "perf";
status = "okay";
};

#include "t604x-j614-j616-usb4.dtsi"
Loading