From a50925feb1dd5a973e4cdbaade674a4b0bcc84e4 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 23:07:57 +1100 Subject: [PATCH 1/3] arm64: dts: apple: t6040: link the Mac mini Type-C ports to the USB4 routers The links from each Type-C connector to the USB4 router behind the same ATC PHY lived in a file only the M4 Pro MacBook Pros included. The Mac mini (J773s) has the same wiring: its ADT pairs acio0-2 with atc-phy0-2 and with the port controllers hpm0-2 (back middle, back left, back right), which the board already names typec0-2, and the router, DART and lstx GPIO addresses match the laptops'. Rename t604x-j614-j616-usb4.dtsi to t6040-usb4-typec.dtsi and include it from the J773s as well. The routers stay disabled, and a port controller skips a link to a disabled router, so nothing changes at runtime yet. The J614s, J616s and J616s-tether DTBs are byte-identical. Signed-off-by: Ryan --- arch/arm64/boot/dts/apple/t6040-j773s.dts | 1 + ...-j614-j616-usb4.dtsi => t6040-usb4-typec.dtsi} | 15 +++++++++------ arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) rename arch/arm64/boot/dts/apple/{t604x-j614-j616-usb4.dtsi => t6040-usb4-typec.dtsi} (54%) diff --git a/arch/arm64/boot/dts/apple/t6040-j773s.dts b/arch/arm64/boot/dts/apple/t6040-j773s.dts index 003cbefd8ba55..587e7c4eedef8 100644 --- a/arch/arm64/boot/dts/apple/t6040-j773s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j773s.dts @@ -797,6 +797,7 @@ #include "t6040-j773s-usb3.dtsi" #include "t6040-j773s-usb-front.dtsi" +#include "t6040-usb4-typec.dtsi" /* The video encoder, its DARTs and its power domains. */ &ps_venc0_sys { diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi b/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi similarity index 54% rename from arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi rename to arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi index ec32ca4bf9c03..41fc751de3078 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616-usb4.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi @@ -1,11 +1,14 @@ // 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. + * M4 Pro (T6040) USB4/Thunderbolt: each Type-C port's connector is linked + * to the USB4 router behind the same ATC PHY. On every T6040 board the ADT + * pairs acioN with atc-phyN (atc-phy-parent) and with the port controller + * whose acio-parent is acioN, and the boards name that connector typecN: + * MacBook Pro 14/16 (J614s, J616s): typec0 left back, typec1 left front, + * typec2 right; + * Mac mini (J773s): typec0 back middle, typec1 back left, typec2 back + * right. + * A port controller skips a link to a disabled router. */ &usb4_0_acio_tbt { diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 75df37d6053a6..77be582251596 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi @@ -3481,4 +3481,4 @@ status = "okay"; }; -#include "t604x-j614-j616-usb4.dtsi" +#include "t6040-usb4-typec.dtsi" From 05faeac804d3bca97cd62a41354400a0e35ffc6d Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 23:15:35 +1100 Subject: [PATCH 2/3] arm64: dts: apple: t6040: make the ATC PHYs the Type-C mode switch on every board The port controller finds the PHY it switches between USB3, DP alt mode and USB4/Thunderbolt by the PHY's mode-switch property. Only the M4 Pro MacBook Pros set it, from their external display file, so on the Mac mini (J773s) the port controllers never get a mux and a USB4 link could not come up even with the routers enabled. Move the three mode-switch properties into t6040-usb4-typec.dtsi next to the connector links, which every T6040 board includes. The J614s, J616s and J616s-tether DTBs are byte-identical; the J773s gains mode-switch on atcphy0-2. Signed-off-by: Ryan --- .../boot/dts/apple/t6040-j616s-extdisp-usbc.dtsi | 13 +------------ arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-usbc.dtsi b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-usbc.dtsi index 1bffe53b5ec83..9d0c2a0b88d0a 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-usbc.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-usbc.dtsi @@ -36,18 +36,7 @@ /delete-property/ apple,always-on; }; -/* tipd switches the PHY into DP alt mode through the connector graph. */ -&atcphy0 { - mode-switch; -}; - -&atcphy1 { - mode-switch; -}; - -&atcphy2 { - mode-switch; -}; +/* The PHYs are the connectors' mode switches: see t6040-usb4-typec.dtsi. */ /* * Type-C display routes through the display fabric, as T6030 and J700: diff --git a/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi b/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi index 41fc751de3078..ee5e8bd4491a5 100644 --- a/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi @@ -9,8 +9,24 @@ * Mac mini (J773s): typec0 back middle, typec1 back left, typec2 back * right. * A port controller skips a link to a disabled router. + * + * Each ATC PHY is its connector's mode switch: the port controller switches + * it between USB3, DP alt mode and USB4/Thunderbolt through the connector + * graph, and finds it by this property. */ +&atcphy0 { + mode-switch; +}; + +&atcphy1 { + mode-switch; +}; + +&atcphy2 { + mode-switch; +}; + &usb4_0_acio_tbt { remote-endpoint = <&typec0_con_tbt>; }; From bff7312f2325841111c5b4099fcd0e0748f8caa7 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 23:16:51 +1100 Subject: [PATCH 3/3] arm64: dts: apple: t6040: enable the USB4 routers on every M4 Pro The J614s and J616s each carried an identical block enabling ACIO0-2, their DARTs, NHIs, mailboxes, the CIO reconfiguration block and the ATC power domains, while the Mac mini (J773s), which has the same three routers behind its three back Thunderbolt ports, had none of it. Its ADT has the same acio0-2, dart-acio0-2 (same vm-base) and acio-cpu0-2 at the same addresses, with the same lstx GPIOs. Enable them once in the SoC files instead: the router, DART, NHI and CIO reconfiguration nodes in t6040-usb4.dtsi with the router DART DMA window, the mailboxes in t6040.dtsi, and the power domains at the end of t6040-usb4.dtsi. PCIe tunnels stay off as before: rather than every board deleting apple,pcie-tunnel, the routers no longer carry it. The J614s, J616s and J616s-tether DTBs are unchanged apart from phandle numbering and property order. The J773s gains the three routers. Signed-off-by: Ryan --- arch/arm64/boot/dts/apple/t6040-j614s.dts | 117 ---------------------- arch/arm64/boot/dts/apple/t6040-j616s.dts | 115 --------------------- arch/arm64/boot/dts/apple/t6040-usb4.dtsi | 88 +++++++++++++--- arch/arm64/boot/dts/apple/t6040.dtsi | 9 +- 4 files changed, 76 insertions(+), 253 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j614s.dts b/arch/arm64/boot/dts/apple/t6040-j614s.dts index 2d4bd56b1ba99..4873f5f6d9f3e 100644 --- a/arch/arm64/boot/dts/apple/t6040-j614s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j614s.dts @@ -98,121 +98,4 @@ status = "disabled"; }; -/* - * 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. - */ -&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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_0_dart { - /* 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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_1_dart { - /* 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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_2_dart { - /* 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-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 e81fb8b6b5d0d..ccd11ef695907 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -229,121 +229,6 @@ status = "okay"; }; -/* - * 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. No PCIe - * tunnels yet: host-to-host (XDomain, thunderbolt-net) and USB4 links only. - */ -&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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_0_dart { - /* 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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_1_dart { - /* 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 { - /delete-property/ apple,pcie-tunnel; - status = "okay"; -}; - -&usb4_2_dart { - /* The same DVA window as the ACIO0 router DART. */ - apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; - status = "okay"; -}; - -&usb4_2_nhi { - status = "okay"; -}; - /* * The internal PCIe controller (Wi-Fi/Bluetooth, SD reader) needs APCIE_GP, * APCIE_SYS_GP and APCIE_PHY_SW on top of the always-on ANS/APCIE_ST* diff --git a/arch/arm64/boot/dts/apple/t6040-usb4.dtsi b/arch/arm64/boot/dts/apple/t6040-usb4.dtsi index cd3b2c21aca7a..a247e4199bcbe 100644 --- a/arch/arm64/boot/dts/apple/t6040-usb4.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-usb4.dtsi @@ -2,7 +2,14 @@ /* * T6040 USB4/PCIe-C resource description. * - * Every node is disabled here; a board enables the routers it has qualified. + * Every M4 Pro board (J614s, J616s, J773s) wires ACIO0-2 to its three + * Thunderbolt ports, so the routers, their DARTs and NHIs, mailboxes and + * power domains are enabled here; t6040-usb4-typec.dtsi links them to the + * board's Type-C connectors. The loader hands each router its router, + * adapter and NHI tuning and its DROM over. No PCIe tunnels yet: the + * routers carry no apple,pcie-tunnel link, so only host-to-host (XDomain, + * thunderbolt-net) and USB4 links come up, and the tunnel nodes stay + * disabled. */ / { @@ -39,12 +46,11 @@ power-domains = <&ps_atc0_cio>, <&ps_atc0_cio_pcie>, <&ps_atc0_cio_usb>, <&ps_atc0_pcie>; thunderbolt-switch; - apple,pcie-tunnel = <&usb4_0_pcie_tunnel>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x3 0x80000000 0x2000000>; nonposted-mmio; - status = "disabled"; + status = "okay"; ports { #address-cells = <1>; @@ -62,7 +68,9 @@ #iommu-cells = <1>; interrupt-parent = <&aic>; interrupts = ; - status = "disabled"; + /* 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: nhi@1f00000 { @@ -114,7 +122,7 @@ <&usb4_0_dart 26>, <&usb4_0_dart 27>; /* To be filled by the loader. */ apple,thunderbolt-drom = [00]; - status = "disabled"; + status = "okay"; }; }; @@ -136,12 +144,11 @@ power-domains = <&ps_atc1_cio>, <&ps_atc1_cio_pcie>, <&ps_atc1_cio_usb>, <&ps_atc1_pcie>; thunderbolt-switch; - apple,pcie-tunnel = <&usb4_1_pcie_tunnel>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x3 0x88000000 0x2000000>; nonposted-mmio; - status = "disabled"; + status = "okay"; ports { #address-cells = <1>; @@ -159,7 +166,9 @@ #iommu-cells = <1>; interrupt-parent = <&aic>; interrupts = ; - status = "disabled"; + /* The same DVA window as the ACIO0 router DART. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + status = "okay"; }; usb4_1_nhi: nhi@1f00000 { @@ -211,7 +220,7 @@ <&usb4_1_dart 26>, <&usb4_1_dart 27>; /* To be filled by the loader. */ apple,thunderbolt-drom = [00]; - status = "disabled"; + status = "okay"; }; }; @@ -233,12 +242,11 @@ power-domains = <&ps_atc2_cio>, <&ps_atc2_cio_pcie>, <&ps_atc2_cio_usb>, <&ps_atc2_pcie>; thunderbolt-switch; - apple,pcie-tunnel = <&usb4_2_pcie_tunnel>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x3 0x90000000 0x2000000>; nonposted-mmio; - status = "disabled"; + status = "okay"; ports { #address-cells = <1>; @@ -256,7 +264,9 @@ #iommu-cells = <1>; interrupt-parent = <&aic>; interrupts = ; - status = "disabled"; + /* The same DVA window as the ACIO0 router DART. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + status = "okay"; }; usb4_2_nhi: nhi@1f00000 { @@ -308,7 +318,7 @@ <&usb4_2_dart 26>, <&usb4_2_dart 27>; /* To be filled by the loader. */ apple,thunderbolt-drom = [00]; - status = "disabled"; + status = "okay"; }; }; @@ -533,8 +543,7 @@ #address-cells = <1>; #size-cells = <1>; reg = <0x5 0x02820000 0 0x4000>; - /* Enabled together with the routers. */ - status = "disabled"; + status = "okay"; cio_reset: reset-controller@2024 { compatible = "apple,t6041-cio-reset"; @@ -558,3 +567,52 @@ pinmux = ; }; }; + +/* The routers' power domains. */ +&ps_atc0_cio { + status = "okay"; +}; + +&ps_atc0_pcie { + status = "okay"; +}; + +&ps_atc0_cio_pcie { + status = "okay"; +}; + +&ps_atc0_cio_usb { + status = "okay"; +}; + +&ps_atc1_cio { + status = "okay"; +}; + +&ps_atc1_pcie { + status = "okay"; +}; + +&ps_atc1_cio_pcie { + status = "okay"; +}; + +&ps_atc1_cio_usb { + status = "okay"; +}; + +&ps_atc2_cio { + status = "okay"; +}; + +&ps_atc2_pcie { + status = "okay"; +}; + +&ps_atc2_cio_pcie { + status = "okay"; +}; + +&ps_atc2_cio_usb { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t6040.dtsi b/arch/arm64/boot/dts/apple/t6040.dtsi index 27fc991fdcc96..e3f0beed3d6ce 100644 --- a/arch/arm64/boot/dts/apple/t6040.dtsi +++ b/arch/arm64/boot/dts/apple/t6040.dtsi @@ -460,7 +460,6 @@ status = "disabled"; }; - /* ACIO 0 remains disabled until its host-router handoff is supported. */ usb4_0_mbox: mailbox@381108000 { compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; reg = <0x3 0x81108000 0x0 0x4000>; @@ -473,10 +472,9 @@ "recv-empty", "recv-not-empty"; #mbox-cells = <0>; power-domains = <&ps_atc0_cio>; - status = "disabled"; + status = "okay"; }; - /* ACIO 1 remains disabled until its host-router handoff is supported. */ usb4_1_mbox: mailbox@389108000 { compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; reg = <0x3 0x89108000 0x0 0x4000>; @@ -489,10 +487,9 @@ "recv-empty", "recv-not-empty"; #mbox-cells = <0>; power-domains = <&ps_atc1_cio>; - status = "disabled"; + status = "okay"; }; - /* ACIO 2 remains disabled until its host-router handoff is supported. */ usb4_2_mbox: mailbox@391108000 { compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; reg = <0x3 0x91108000 0x0 0x4000>; @@ -505,7 +502,7 @@ "recv-empty", "recv-not-empty"; #mbox-cells = <0>; power-domains = <&ps_atc2_cio>; - status = "disabled"; + status = "okay"; }; };