diff --git a/arch/arm64/boot/dts/apple/t6040-j614s.dts b/arch/arm64/boot/dts/apple/t6040-j614s.dts index 2d364e9c5ac72..b04ae06f58b25 100644 --- a/arch/arm64/boot/dts/apple/t6040-j614s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j614s.dts @@ -99,120 +99,9 @@ }; /* - * USB4/Thunderbolt on all three Type-C ports: typec0 (left back, ACIO0), - * typec1 (left front, ACIO1) and typec2 (right, ACIO2), as on the J616s: the - * J614s ADT has the same acio0-2, dart-acio0-2 and acio-cpu0-2. The loader - * hands each router its router, adapter and NHI tuning and its DROM over. No - * PCIe tunnels yet: host-to-host (XDomain, thunderbolt-net) and USB4 links - * only. + * USB4/Thunderbolt on all three Type-C ports: typec0 (left back, ACIO0), typec1 (left front, + * ACIO1) and typec2 (right, ACIO2); the J614s ADT has acio0-2, dart-acio0-2 and acio-cpu0-2. */ -&pmgr_cio { - status = "okay"; -}; - -&ps_atc0_cio { - status = "okay"; -}; - -&ps_atc0_pcie { - status = "okay"; -}; - -&ps_atc0_cio_pcie { - status = "okay"; -}; - -&ps_atc0_cio_usb { - status = "okay"; -}; - -&usb4_0_mbox { - status = "okay"; -}; - -&usb4_0_acio { - status = "okay"; -}; - -&usb4_0_dart { - power-domains = <&ps_atc0_cio>; - /* ADT dart-acio0 vm-base: the NHI addresses its rings below 1 TiB + 4 GiB. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_0_nhi { - status = "okay"; -}; - -&ps_atc1_cio { - status = "okay"; -}; - -&ps_atc1_pcie { - status = "okay"; -}; - -&ps_atc1_cio_pcie { - status = "okay"; -}; - -&ps_atc1_cio_usb { - status = "okay"; -}; - -&usb4_1_mbox { - status = "okay"; -}; - -&usb4_1_acio { - status = "okay"; -}; - -&usb4_1_dart { - power-domains = <&ps_atc1_cio>; - /* The same DVA window as the ACIO0 router DART. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_1_nhi { - status = "okay"; -}; - -&ps_atc2_cio { - status = "okay"; -}; - -&ps_atc2_pcie { - status = "okay"; -}; - -&ps_atc2_cio_pcie { - status = "okay"; -}; - -&ps_atc2_cio_usb { - status = "okay"; -}; - -&usb4_2_mbox { - status = "okay"; -}; - -&usb4_2_acio { - status = "okay"; -}; - -&usb4_2_dart { - power-domains = <&ps_atc2_cio>; - /* The same DVA window as the ACIO0 router DART. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_2_nhi { - status = "okay"; -}; +#include "t6040-usb4-routers.dtsi" #include "t6040-j614s-extdisp-hdmi.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index aa077495ccdbe..fe2591c545be2 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -195,119 +195,10 @@ }; /* - * USB4/Thunderbolt on all three Type-C ports: typec0 (left back, ACIO0), - * typec1 (left front, ACIO1) and typec2 (right, ACIO2). The loader hands - * each router its router, adapter and NHI tuning and its DROM over. Each - * router carries its PCIe-C tunnel (t6040-pciec.dtsi). + * USB4/Thunderbolt on all three Type-C ports: typec0 (left back, ACIO0), typec1 (left front, + * ACIO1) and typec2 (right, ACIO2); the J616s ADT has acio0-2, dart-acio0-2 and acio-cpu0-2. */ -&pmgr_cio { - status = "okay"; -}; - -&ps_atc0_cio { - status = "okay"; -}; - -&ps_atc0_pcie { - status = "okay"; -}; - -&ps_atc0_cio_pcie { - status = "okay"; -}; - -&ps_atc0_cio_usb { - status = "okay"; -}; - -&usb4_0_mbox { - status = "okay"; -}; - -&usb4_0_acio { - status = "okay"; -}; - -&usb4_0_dart { - power-domains = <&ps_atc0_cio>; - /* ADT dart-acio0 vm-base: the NHI addresses its rings below 1 TiB + 4 GiB. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_0_nhi { - status = "okay"; -}; - -&ps_atc1_cio { - status = "okay"; -}; - -&ps_atc1_pcie { - status = "okay"; -}; - -&ps_atc1_cio_pcie { - status = "okay"; -}; - -&ps_atc1_cio_usb { - status = "okay"; -}; - -&usb4_1_mbox { - status = "okay"; -}; - -&usb4_1_acio { - status = "okay"; -}; - -&usb4_1_dart { - power-domains = <&ps_atc1_cio>; - /* The same DVA window as the ACIO0 router DART. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_1_nhi { - status = "okay"; -}; - -&ps_atc2_cio { - status = "okay"; -}; - -&ps_atc2_pcie { - status = "okay"; -}; - -&ps_atc2_cio_pcie { - status = "okay"; -}; - -&ps_atc2_cio_usb { - status = "okay"; -}; - -&usb4_2_mbox { - status = "okay"; -}; - -&usb4_2_acio { - status = "okay"; -}; - -&usb4_2_dart { - power-domains = <&ps_atc2_cio>; - /* The same DVA window as the ACIO0 router DART. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_2_nhi { - status = "okay"; -}; +#include "t6040-usb4-routers.dtsi" /* * The internal PCIe controller (Wi-Fi/Bluetooth, SD reader) needs APCIE_GP, diff --git a/arch/arm64/boot/dts/apple/t6040-j773s.dts b/arch/arm64/boot/dts/apple/t6040-j773s.dts index 0ce27db9b7a15..5e0747d83fe4a 100644 --- a/arch/arm64/boot/dts/apple/t6040-j773s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j773s.dts @@ -924,3 +924,21 @@ &t6040_sleep { apple,gp-pcie = <&pcie0>; }; + +/* + * USB4/Thunderbolt on the three back ports: typec0 (back middle, hpm0, ACIO0), typec1 (back left, + * hpm1, ACIO1) and typec2 (back right, hpm2, ACIO2). The J773s ADT has acio0-2, dart-acio0-2, + * acio-cpu0-2 and apciec0-2, with hpm0-2's acio-parent and acio0-2's atc-phy-parent pairing them + * this way. The PCIe tunnels are already described (t6040-usb4.dtsi); without the routers they + * cannot come up. + */ +#include "t604x-usb4-typec.dtsi" +#include "t6040-usb4-routers.dtsi" + +/* + * The routers' LSTX pins (AOP GPIO 49, 51, 53) are in the AOP pin controller. No display gate + * chain uses it on this board, so it is enabled here. + */ +&pinctrl_aop { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t6040-usb4-routers.dtsi b/arch/arm64/boot/dts/apple/t6040-usb4-routers.dtsi new file mode 100644 index 0000000000000..6ef6d9cf80a70 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6040-usb4-routers.dtsi @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * The T6040 (M4 Pro) USB4/Thunderbolt routers on all three Type-C ports, ACIO0-2, with their + * PCIe tunnels (t6040-usb4.dtsi): the CIO power domains, the router mailboxes, routers, DARTs + * and NHIs. For boards whose ADT has acio0-2, dart-acio0-2 and acio-cpu0-2: J614s, J616s, J773s. + * The loader hands each router its router, adapter and NHI tuning and its DROM over from this + * machine's ADT (usb4-N aliases). The routers' LSTX pins are in the AOP pin controller, which the + * board enables (J773s) or the HDMI display gate enables with its chain (J614s, J616s). + */ +&pmgr_cio { + status = "okay"; +}; + +&ps_atc0_cio { + status = "okay"; +}; + +&ps_atc0_pcie { + status = "okay"; +}; + +&ps_atc0_cio_pcie { + status = "okay"; +}; + +&ps_atc0_cio_usb { + status = "okay"; +}; + +&usb4_0_mbox { + status = "okay"; +}; + +&usb4_0_acio { + status = "okay"; +}; + +&usb4_0_dart { + power-domains = <&ps_atc0_cio>; + /* ADT dart-acio0 vm-base: the NHI addresses its rings below 1 TiB + 4 GiB. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + status = "okay"; +}; + +&usb4_0_nhi { + status = "okay"; +}; + +&ps_atc1_cio { + status = "okay"; +}; + +&ps_atc1_pcie { + status = "okay"; +}; + +&ps_atc1_cio_pcie { + status = "okay"; +}; + +&ps_atc1_cio_usb { + status = "okay"; +}; + +&usb4_1_mbox { + status = "okay"; +}; + +&usb4_1_acio { + status = "okay"; +}; + +&usb4_1_dart { + power-domains = <&ps_atc1_cio>; + /* The same DVA window as the ACIO0 router DART. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + status = "okay"; +}; + +&usb4_1_nhi { + status = "okay"; +}; + +&ps_atc2_cio { + status = "okay"; +}; + +&ps_atc2_pcie { + status = "okay"; +}; + +&ps_atc2_cio_pcie { + status = "okay"; +}; + +&ps_atc2_cio_usb { + status = "okay"; +}; + +&usb4_2_mbox { + status = "okay"; +}; + +&usb4_2_acio { + status = "okay"; +}; + +&usb4_2_dart { + power-domains = <&ps_atc2_cio>; + /* The same DVA window as the ACIO0 router DART. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + status = "okay"; +}; + +&usb4_2_nhi { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 927bcc5383ea2..0f82cd917b866 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi @@ -3481,7 +3481,7 @@ status = "okay"; }; -#include "t604x-j614-j616-usb4.dtsi" +#include "t604x-usb4-typec.dtsi" &t6040_sleep { apple,gp-pcie = <&pcie0>; diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi b/arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi similarity index 60% rename from arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi rename to arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi index ec32ca4bf9c03..bdf7e866bb52e 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi @@ -1,11 +1,9 @@ // 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. + * The M4 Pro and M4 Max USB4/Thunderbolt connector-to-router links: each Type-C port's + * connector (typec0-2, port@2) is linked to the USB4 router behind the same ATC PHY (ADT acioN + * atc-phy-parent = atc-phyN, hpmN acio-parent = acioN). The routers stay disabled unless a board + * enables them, and a port controller skips a link to a disabled router. */ &usb4_0_acio_tbt {