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/7] 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/7] 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/7] 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"; }; }; From 39ef5dfa861f06f0154832b18e02b180db745b5c Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 00:07:32 +1100 Subject: [PATCH 4/7] arm64: dts: apple: t604x: share the USB4 routers with the M4 Max The M4 Max has the M4 Pro's three USB4 routers behind ATC0-2: the J614c, J616c and J575c ADTs list acio0-2, dart-acio0-2, acio-cpu0-2 and apciec0-2 at the same addresses and interrupts as the J614s, J616s and J773s ADTs, with the same lstx GPIOs and DART vm-base, and the PMGR lists the ATCn_CIO, ATCn_PCIE, ATCn_CIO_PCIE and ATCn_CIO_USB power states at the same offsets. Each port controller names the router behind its ATC PHY (hpmN acio-parent = acioN), and every board calls that connector typecN. T6041 had none of this, so its Thunderbolt ports only ran USB3 and DisplayPort. Make the T6040 description the T604x one instead of copying it: - the CIO and PCIe-C power domains of ATC0-3 move from t6040-pmgr.dtsi to t604x-pmgr.dtsi, - the routers' coprocessor mailboxes move from t6040.dtsi to the USB4 file, - t6040-usb4.dtsi becomes t604x-usb4.dtsi, included by t604x.dtsi, so the routers are enabled on every T604x board, - t6040-usb4-typec.dtsi becomes t604x-usb4-typec.dtsi, and the J614c, J616c and J575c include it next to the M4 Pro boards. The T604x ATC PHYs already are their connectors' mode switches on the T6041 boards (t6041-j616c-usbc.dtsi, t6041-j575c-usbc.dtsi). The T6040 DTBs are unchanged: the sorted, label-resolved sources of the J614s, J616s, J616s tether and J773s are identical before and after. The T6041 boards gain the routers on ATC0-2 and their links. Not run on M4 Max hardware yet. Suggested-by: AxxzyWasTaken <98161954+AxxzyWasTaken@users.noreply.github.com> Link: https://github.com/aurora-silicon/linux/pull/1126 Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6040-j773s.dts | 2 +- arch/arm64/boot/dts/apple/t6040-pmgr.dtsi | 160 ----------------- arch/arm64/boot/dts/apple/t6040.dtsi | 48 ----- arch/arm64/boot/dts/apple/t6041-j575c.dts | 1 + .../boot/dts/apple/t6041-j614c-j616c.dtsi | 7 + .../arm64/boot/dts/apple/t604x-j614-j616.dtsi | 2 +- arch/arm64/boot/dts/apple/t604x-pmgr.dtsi | 167 ++++++++++++++++++ ...-usb4-typec.dtsi => t604x-usb4-typec.dtsi} | 18 +- .../{t6040-usb4.dtsi => t604x-usb4.dtsi} | 60 ++++++- arch/arm64/boot/dts/apple/t604x.dtsi | 1 + 10 files changed, 243 insertions(+), 223 deletions(-) rename arch/arm64/boot/dts/apple/{t6040-usb4-typec.dtsi => t604x-usb4-typec.dtsi} (63%) rename arch/arm64/boot/dts/apple/{t6040-usb4.dtsi => t604x-usb4.dtsi} (89%) diff --git a/arch/arm64/boot/dts/apple/t6040-j773s.dts b/arch/arm64/boot/dts/apple/t6040-j773s.dts index 587e7c4eedef8..f2ed069d4a74b 100644 --- a/arch/arm64/boot/dts/apple/t6040-j773s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j773s.dts @@ -797,7 +797,7 @@ #include "t6040-j773s-usb3.dtsi" #include "t6040-j773s-usb-front.dtsi" -#include "t6040-usb4-typec.dtsi" +#include "t604x-usb4-typec.dtsi" /* The video encoder, its DARTs and its power domains. */ &ps_venc0_sys { diff --git a/arch/arm64/boot/dts/apple/t6040-pmgr.dtsi b/arch/arm64/boot/dts/apple/t6040-pmgr.dtsi index 75650445572b1..ab4118990166c 100644 --- a/arch/arm64/boot/dts/apple/t6040-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-pmgr.dtsi @@ -1091,166 +1091,6 @@ status = "disabled"; }; - ps_atc0_cio: power-controller@398 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x398 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc0_cio"; - power-domains = <&ps_atc0_common>; - status = "disabled"; - }; - - ps_atc0_pcie: power-controller@3a0 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3a0 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc0_pcie"; - power-domains = <&ps_atc0_common>; - status = "disabled"; - }; - - ps_atc0_cio_pcie: power-controller@3a8 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3a8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc0_cio_pcie"; - power-domains = <&ps_atc0_cio>; - status = "disabled"; - }; - - ps_atc0_cio_usb: power-controller@3b0 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3b0 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc0_cio_usb"; - power-domains = <&ps_atc0_cio>; - status = "disabled"; - }; - - ps_atc1_cio: power-controller@3c0 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3c0 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc1_cio"; - power-domains = <&ps_atc1_common>; - status = "disabled"; - }; - - ps_atc1_pcie: power-controller@3c8 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3c8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc1_pcie"; - power-domains = <&ps_atc1_common>; - status = "disabled"; - }; - - ps_atc1_cio_pcie: power-controller@3d0 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3d0 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc1_cio_pcie"; - power-domains = <&ps_atc1_cio>; - status = "disabled"; - }; - - ps_atc1_cio_usb: power-controller@3d8 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3d8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc1_cio_usb"; - power-domains = <&ps_atc1_cio>; - status = "disabled"; - }; - - ps_atc2_cio: power-controller@3e8 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3e8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc2_cio"; - power-domains = <&ps_atc2_common>; - status = "disabled"; - }; - - ps_atc2_pcie: power-controller@3f0 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3f0 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc2_pcie"; - power-domains = <&ps_atc2_common>; - status = "disabled"; - }; - - ps_atc2_cio_pcie: power-controller@3f8 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x3f8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc2_cio_pcie"; - power-domains = <&ps_atc2_cio>; - status = "disabled"; - }; - - ps_atc2_cio_usb: power-controller@400 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x400 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc2_cio_usb"; - power-domains = <&ps_atc2_cio>; - status = "disabled"; - }; - - ps_atc3_cio: power-controller@420 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x420 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc3_cio"; - power-domains = <&ps_atc3_common>; - status = "disabled"; - }; - - ps_atc3_pcie: power-controller@428 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x428 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc3_pcie"; - power-domains = <&ps_atc3_common>; - status = "disabled"; - }; - - ps_atc3_cio_pcie: power-controller@430 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x430 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc3_cio_pcie"; - power-domains = <&ps_atc3_cio>; - status = "disabled"; - }; - - ps_atc3_cio_usb: power-controller@438 { - compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x438 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "atc3_cio_usb"; - power-domains = <&ps_atc3_cio>; - status = "disabled"; - }; - ps_fab5_soc: power-controller@440 { compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x440 4>; diff --git a/arch/arm64/boot/dts/apple/t6040.dtsi b/arch/arm64/boot/dts/apple/t6040.dtsi index e3f0beed3d6ce..207fc545d490b 100644 --- a/arch/arm64/boot/dts/apple/t6040.dtsi +++ b/arch/arm64/boot/dts/apple/t6040.dtsi @@ -459,52 +459,6 @@ apple,sw-drain; status = "disabled"; }; - - usb4_0_mbox: mailbox@381108000 { - compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; - reg = <0x3 0x81108000 0x0 0x4000>; - interrupt-parent = <&aic>; - interrupts = , - , - , - ; - interrupt-names = "send-empty", "send-not-empty", - "recv-empty", "recv-not-empty"; - #mbox-cells = <0>; - power-domains = <&ps_atc0_cio>; - status = "okay"; - }; - - usb4_1_mbox: mailbox@389108000 { - compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; - reg = <0x3 0x89108000 0x0 0x4000>; - interrupt-parent = <&aic>; - interrupts = , - , - , - ; - interrupt-names = "send-empty", "send-not-empty", - "recv-empty", "recv-not-empty"; - #mbox-cells = <0>; - power-domains = <&ps_atc1_cio>; - status = "okay"; - }; - - usb4_2_mbox: mailbox@391108000 { - compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; - reg = <0x3 0x91108000 0x0 0x4000>; - interrupt-parent = <&aic>; - interrupts = , - , - , - ; - interrupt-names = "send-empty", "send-not-empty", - "recv-empty", "recv-not-empty"; - #mbox-cells = <0>; - power-domains = <&ps_atc2_cio>; - status = "okay"; - }; - }; &avd { @@ -669,5 +623,3 @@ 0x504824000 0x504824004 0x5003c0000 0x5003e4000>; }; - -#include "t6040-usb4.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6041-j575c.dts b/arch/arm64/boot/dts/apple/t6041-j575c.dts index 75be806091fcf..d758058ccb505 100644 --- a/arch/arm64/boot/dts/apple/t6041-j575c.dts +++ b/arch/arm64/boot/dts/apple/t6041-j575c.dts @@ -2024,6 +2024,7 @@ #include "t6041-j575c-usbc.dtsi" #include "t6041-j575c-usbc-dcpext2.dtsi" #include "t6041-j575c-hdmi.dtsi" +#include "t604x-usb4-typec.dtsi" /* Not described: the SEP (no Touch ID sensor). */ diff --git a/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi b/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi index 8e2b49a4567ea..e7be6ac813eb8 100644 --- a/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi +++ b/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi @@ -2902,3 +2902,10 @@ &jpeg1 { status = "okay"; }; + +/* + * USB4/Thunderbolt on all three Type-C ports: the routers are enabled in + * t604x-usb4.dtsi. hpm0 (left back), hpm1 (left front) and hpm2 (right) + * name acio0, acio1 and acio2 as their routers, as on the J614s/J616s. + */ +#include "t604x-usb4-typec.dtsi" diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 77be582251596..f3a4907428928 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 "t6040-usb4-typec.dtsi" +#include "t604x-usb4-typec.dtsi" diff --git a/arch/arm64/boot/dts/apple/t604x-pmgr.dtsi b/arch/arm64/boot/dts/apple/t604x-pmgr.dtsi index 977818bca2ec3..455e1d8d11550 100644 --- a/arch/arm64/boot/dts/apple/t604x-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-pmgr.dtsi @@ -533,6 +533,173 @@ }; }; +/* + * The USB4 router (CIO) and PCIe-C domains of each ATC, children of its + * ATCn_COMMON. The J614s, J616s, J773s, J614c, J616c and J575c ADTs list + * them at the same offsets. t604x-usb4.dtsi enables the ATC0-2 ones. + */ +&pmgr_aux { + ps_atc0_cio: power-controller@398 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x398 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc0_cio"; + power-domains = <&ps_atc0_common>; + status = "disabled"; + }; + + ps_atc0_pcie: power-controller@3a0 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3a0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc0_pcie"; + power-domains = <&ps_atc0_common>; + status = "disabled"; + }; + + ps_atc0_cio_pcie: power-controller@3a8 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3a8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc0_cio_pcie"; + power-domains = <&ps_atc0_cio>; + status = "disabled"; + }; + + ps_atc0_cio_usb: power-controller@3b0 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3b0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc0_cio_usb"; + power-domains = <&ps_atc0_cio>; + status = "disabled"; + }; + + ps_atc1_cio: power-controller@3c0 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3c0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc1_cio"; + power-domains = <&ps_atc1_common>; + status = "disabled"; + }; + + ps_atc1_pcie: power-controller@3c8 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3c8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc1_pcie"; + power-domains = <&ps_atc1_common>; + status = "disabled"; + }; + + ps_atc1_cio_pcie: power-controller@3d0 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3d0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc1_cio_pcie"; + power-domains = <&ps_atc1_cio>; + status = "disabled"; + }; + + ps_atc1_cio_usb: power-controller@3d8 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3d8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc1_cio_usb"; + power-domains = <&ps_atc1_cio>; + status = "disabled"; + }; + + ps_atc2_cio: power-controller@3e8 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3e8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc2_cio"; + power-domains = <&ps_atc2_common>; + status = "disabled"; + }; + + ps_atc2_pcie: power-controller@3f0 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3f0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc2_pcie"; + power-domains = <&ps_atc2_common>; + status = "disabled"; + }; + + ps_atc2_cio_pcie: power-controller@3f8 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x3f8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc2_cio_pcie"; + power-domains = <&ps_atc2_cio>; + status = "disabled"; + }; + + ps_atc2_cio_usb: power-controller@400 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x400 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc2_cio_usb"; + power-domains = <&ps_atc2_cio>; + status = "disabled"; + }; + + ps_atc3_cio: power-controller@420 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x420 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc3_cio"; + power-domains = <&ps_atc3_common>; + status = "disabled"; + }; + + ps_atc3_pcie: power-controller@428 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x428 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc3_pcie"; + power-domains = <&ps_atc3_common>; + status = "disabled"; + }; + + ps_atc3_cio_pcie: power-controller@430 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x430 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc3_cio_pcie"; + power-domains = <&ps_atc3_cio>; + status = "disabled"; + }; + + ps_atc3_cio_usb: power-controller@438 { + compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x438 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "atc3_cio_usb"; + power-domains = <&ps_atc3_cio>; + status = "disabled"; + }; +}; + &pmgr_ane { ps_ane_mpm: power-controller@0 { compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; diff --git a/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi b/arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi similarity index 63% rename from arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi rename to arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi index ee5e8bd4491a5..0a28467e4ad2b 100644 --- a/arch/arm64/boot/dts/apple/t6040-usb4-typec.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-usb4-typec.dtsi @@ -1,13 +1,17 @@ // SPDX-License-Identifier: GPL-2.0+ OR MIT /* - * 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; + * M4 Pro and M4 Max (T6040/T6041) USB4/Thunderbolt: each Type-C port's + * connector is linked to the USB4 router behind the same ATC PHY. On every + * T604x 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, J614c, J616c): typec0 left back, + * typec1 left front, typec2 right; * Mac mini (J773s): typec0 back middle, typec1 back left, typec2 back - * right. + * right; + * Mac Studio (J575c): typec0 back right, typec1 back right middle, + * typec2 back left middle (its fourth router, ACIO3, is linked in + * t6041-j575c-usb4.dtsi). * A port controller skips a link to a disabled router. * * Each ATC PHY is its connector's mode switch: the port controller switches diff --git a/arch/arm64/boot/dts/apple/t6040-usb4.dtsi b/arch/arm64/boot/dts/apple/t604x-usb4.dtsi similarity index 89% rename from arch/arm64/boot/dts/apple/t6040-usb4.dtsi rename to arch/arm64/boot/dts/apple/t604x-usb4.dtsi index a247e4199bcbe..8b662a2368c41 100644 --- a/arch/arm64/boot/dts/apple/t6040-usb4.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-usb4.dtsi @@ -1,12 +1,14 @@ // SPDX-License-Identifier: GPL-2.0+ OR MIT /* - * T6040 USB4/PCIe-C resource description. + * T6040/T6041 USB4/PCIe-C resource description: the routers behind ATC0-2. * - * 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 + * The M4 Pro and M4 Max have the same ACIO, NHI, DART, mailbox and PCIe-C + * blocks behind ATC0-2, at the same addresses and interrupts, and every + * board of both (J614s, J616s, J773s, J614c, J616c, J575c) wires ACIO0-2 to + * three of its Thunderbolt ports. So the routers, their DARTs and NHIs, + * mailboxes and power domains are enabled here; t604x-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. @@ -28,6 +30,52 @@ usb4-2-pcie-adapter = &usb4_2_acio; }; + /* ADT acio-cpuN: the mailbox of each router's coprocessor. */ + usb4_0_mbox: mailbox@381108000 { + compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x81108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_atc0_cio>; + status = "okay"; + }; + + usb4_1_mbox: mailbox@389108000 { + compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x89108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_atc1_cio>; + status = "okay"; + }; + + usb4_2_mbox: mailbox@391108000 { + compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x91108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_atc2_cio>; + status = "okay"; + }; + usb4_0_acio: cio@381ac0000 { compatible = "apple,t6040-usb4-acio"; reg = <0x3 0x81ac0000 0x0 0xc000>, diff --git a/arch/arm64/boot/dts/apple/t604x.dtsi b/arch/arm64/boot/dts/apple/t604x.dtsi index 3484262fa7a43..4d7b38973b624 100644 --- a/arch/arm64/boot/dts/apple/t604x.dtsi +++ b/arch/arm64/boot/dts/apple/t604x.dtsi @@ -2065,3 +2065,4 @@ }; #include "t604x-pmgr.dtsi" +#include "t604x-usb4.dtsi" From 0586cb515d34effcb44df4f61b0db066570c6f26 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 00:07:46 +1100 Subject: [PATCH 5/7] pmdomain: apple: t6041-cio-reconfig: cover the fourth CIO port The CIO reconfiguration register has a request and a busy bit per router, and the PMGR lists four reconfiguration clocks (CIO0-RECONFIG to CIO3-RECONFIG) on every T6040 and T6041 board. The controller only registered three resets, so a fourth router could not take its reset. The Mac Studio (M4 Max, J575c) wires that fourth router (ADT acio3) to its fourth back Thunderbolt port. Register four resets. The laptops do not reference the fourth one, so nothing changes for them. The bit positions for port 3 follow the layout of ports 0-2 (request bit 3, busy bit 19); they are not yet confirmed on hardware. Signed-off-by: Ryan Murray --- drivers/pmdomain/apple/t6041-cio-reconfig.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pmdomain/apple/t6041-cio-reconfig.c b/drivers/pmdomain/apple/t6041-cio-reconfig.c index a6c13b41a801d..9bfcc92b146cf 100644 --- a/drivers/pmdomain/apple/t6041-cio-reconfig.c +++ b/drivers/pmdomain/apple/t6041-cio-reconfig.c @@ -2,9 +2,13 @@ /* * Apple T6041 CIO cluster reconfiguration controller * - * The three CIO ports share one PMGR register. Each port has a request bit - * and a busy bit sixteen positions above it. Firmware waits before and after - * the read/modify/write request, with a 192 ms budget for each wait. + * The CIO ports share one PMGR register. Each port has a request bit and a + * busy bit sixteen positions above it. Firmware waits before and after the + * read/modify/write request, with a 192 ms budget for each wait. + * + * The PMGR has four of them (ADT pmgr CIO0-RECONFIG to CIO3-RECONFIG) on + * every T6040/T6041 board, whether or not the board wires the fourth router: + * the J575c does (ADT acio3), the laptops don't. */ #include @@ -18,7 +22,7 @@ #include #include -#define T6041_CIO_RECONFIG_PORTS 3 +#define T6041_CIO_RECONFIG_PORTS 4 #define T6041_CIO_RECONFIG_POLL_US 100 #define T6041_CIO_RECONFIG_TIMEOUT_US 192000 From e38f04cbbc0b6a5d436d1f3719ee2cadbb8710ea Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 00:07:51 +1100 Subject: [PATCH 6/7] PCI: apple: pick the T6040 PCIe-C MSI slices by controller, not machine The T6040 PCIe-C hosts share one MSI window, and each tunnel bridge owns a 32-vector slice selected by its ECAM aperture. The check selected that table with the machine compatible "apple,t6040", so the same controller on an M4 Max (T6041) fell through to "invalid MSI slice". Select it by the controller's own match data (t6040_pciec_hw, compatible "apple,t6040-pciec"), which T6041 uses for the same block, and add the fourth bridge the Mac Studio (M4 Max) has (ADT apciec3, ECAM 0x1c80000000, vector base 0x80, AIC 2199). No board enables a T604x PCIe tunnel yet, so this changes nothing today. Signed-off-by: Ryan Murray --- drivers/pci/controller/pcie-apple.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index 8e20a36cc575e..8a87725081642 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -3407,7 +3407,12 @@ static int apple_msi_init(struct apple_pcie *pcie) default: goto invalid_slice; } - } else if (of_machine_is_compatible("apple,t6040")) { + } else if (pcie->hw == &t6040_pciec_hw) { + /* + * The T6040 PCIe-C block, on the M4 Pro and M4 Max + * alike: same ECAM apertures and MSI window. The M4 + * Max Mac Studio adds a fourth router (ADT apciec3). + */ aic_base = 2071; switch (ecam.start) { case 0x1c50000000ULL: @@ -3419,6 +3424,9 @@ static int apple_msi_init(struct apple_pcie *pcie) case 0x1c70000000ULL: expected_base = 0x60; break; + case 0x1c80000000ULL: + expected_base = 0x80; + break; default: goto invalid_slice; } From 06e48f986042916f46506aa21c34cae8b74149ee Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 00:08:23 +1100 Subject: [PATCH 7/7] arm64: dts: apple: t6041-j575c: USB4/Thunderbolt on the fourth back port The Mac Studio (M4 Max) has four back Thunderbolt ports. ATC0-2 have the shared routers of t604x-usb4.dtsi. The fourth port, behind ATC3, has a fourth router that the laptops lack (they use ATC3 for HDMI): ADT acio3, dart-acio3, acio-cpu3, apciec3 and dart-apciec3, the same blocks as ACIO0-2 at 0x8000000 above ACIO2, with their own interrupts, LSTX pin (AOP 55) and CIO reset slot 3. Its port controller hpm3 (back left, typec3) names acio3 as its router. Add t6041-j575c-usb4.dtsi: it describes and enables the fourth router, its mailbox and power domains, and links it to typec3. Its PCIe tunnel is described but stays disabled, like the other three. Not run on hardware yet. Link: https://github.com/aurora-silicon/linux/issues/1498 Link: https://github.com/aurora-silicon/linux/pull/1126 Signed-off-by: Ryan Murray --- .../boot/dts/apple/t6041-j575c-usb4.dtsi | 238 ++++++++++++++++++ arch/arm64/boot/dts/apple/t6041-j575c.dts | 1 + 2 files changed, 239 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/t6041-j575c-usb4.dtsi diff --git a/arch/arm64/boot/dts/apple/t6041-j575c-usb4.dtsi b/arch/arm64/boot/dts/apple/t6041-j575c-usb4.dtsi new file mode 100644 index 0000000000000..d4a9754b6b9cd --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6041-j575c-usb4.dtsi @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Mac Studio (M4 Max) USB4/Thunderbolt on the fourth back Type-C port. + * + * ATC0-2 have the routers of t604x-usb4.dtsi, linked to typec0-2 by + * t604x-usb4-typec.dtsi. The J575c also wires a fourth router, behind ATC3 + * (ADT acio3, dart-acio3, acio-cpu3, apciec3, dart-apciec3): the same + * blocks as ACIO0-2, 0x8000000 above ACIO2, with their own interrupts. Its + * port controller hpm3 (back left, typec3) names acio3 as its router. The + * laptops use ATC3 for HDMI and have no acio3. + */ + +/ { + aliases { + usb4-3-acio = &usb4_3_acio; + usb4-3-nhi = &usb4_3_nhi; + usb4-3-pcie = &usb4_3_pcie; + usb4-3-pcie-adapter = &usb4_3_acio; + }; + + /* ADT acio-cpu3: the mailbox of the router's coprocessor. */ + usb4_3_mbox: mailbox@399108000 { + compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x99108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_atc3_cio>; + }; + + usb4_3_acio: cio@399ac0000 { + compatible = "apple,t6040-usb4-acio"; + reg = <0x3 0x99ac0000 0x0 0xc000>, + <0x3 0x99080000 0x0 0x26000>, + <0x3 0x99e44000 0x0 0x4000>, + <0x3 0x99100000 0x0 0x4000>; + reg-names = "rc", "sram", "pcie-adapter", "cpu"; + interrupt-parent = <&aic>; + interrupts = ; + interrupt-names = "sram-parity"; + mboxes = <&usb4_3_mbox>; + resets = <&cio_reset 3>; + pinctrl-names = "lstx"; + pinctrl-0 = <&usb4_3_lstx_pins>; + lstx-gpios = <&pinctrl_aop 55 GPIO_ACTIVE_HIGH>; + power-domains = <&ps_atc3_cio>, <&ps_atc3_cio_pcie>, + <&ps_atc3_cio_usb>, <&ps_atc3_pcie>; + thunderbolt-switch; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x3 0x98000000 0x2000000>; + nonposted-mmio; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + usb4_3_acio_tbt: endpoint { + remote-endpoint = <&typec3_con_tbt>; + }; + }; + }; + + usb4_3_dart: iommu@1a80000 { + compatible = "apple,t6041-dart", "apple,t8110-dart"; + reg = <0x1a80000 0xc000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + /* ADT dart-acio3 vm-base: NHI rings below 1 TiB + 4 GiB. */ + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + }; + + usb4_3_nhi: nhi@1f00000 { + compatible = "apple,t6040-usb4-nhi"; + reg = <0x1f00000 0x100000>; + reg-names = "nhi"; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names = "txring0", "txring1", "txring2", "txring3", + "txring4", "txring5", "txring6", "txring7", + "txring8", "txring9", "txring10", "txring11", + "rxring0", "rxring1", "rxring2", "rxring3", + "rxring4", "rxring5", "rxring6", "rxring7", + "rxring8", "rxring9", "rxring10", "rxring11"; + iommus = <&usb4_3_dart 0>, <&usb4_3_dart 1>, + <&usb4_3_dart 2>, <&usb4_3_dart 3>, + <&usb4_3_dart 4>, <&usb4_3_dart 5>, + <&usb4_3_dart 6>, <&usb4_3_dart 7>, + <&usb4_3_dart 8>, <&usb4_3_dart 9>, + <&usb4_3_dart 10>, <&usb4_3_dart 11>, + <&usb4_3_dart 16>, <&usb4_3_dart 17>, + <&usb4_3_dart 18>, <&usb4_3_dart 19>, + <&usb4_3_dart 20>, <&usb4_3_dart 21>, + <&usb4_3_dart 22>, <&usb4_3_dart 23>, + <&usb4_3_dart 24>, <&usb4_3_dart 25>, + <&usb4_3_dart 26>, <&usb4_3_dart 27>; + /* To be filled by the loader. */ + apple,thunderbolt-drom = [00]; + }; + }; + + /* Not used yet: the routers run without PCIe tunnels. */ + usb4_3_pcie_tunnel: usb4-pcie-tunnel-3 { + #address-cells = <2>; + #size-cells = <2>; + ranges; + nonposted-mmio; + status = "disabled"; + + apciec3_dart: iommu@39c000000 { + compatible = "apple,t6041-dart", "apple,t8110-dart"; + reg = <0x3 0x9c000000 0x0 0x20000>; + interrupt-parent = <&aic>; + interrupts = ; + #iommu-cells = <1>; + status = "disabled"; + }; + + usb4_3_pcie: pcie@1c80000000 { + compatible = "apple,t6040-pciec"; + device_type = "pci"; + reg = <0x1c 0x80000000 0x0 0x10000000>, + <0x3 0x9c034000 0x0 0x4000>, + <0x3 0x9c020000 0x0 0x8000>, + <0x3 0x9c038000 0x0 0x4000>, + <0x3 0x9c060000 0x0 0x4000>, + <0x3 0x98020000 0x0 0x4000>, + <0x3 0x9c02c000 0x0 0x4000>, + <0x3 0x9c028000 0x0 0x4000>; + reg-names = "config", "rc", "port0", "fabric", "debug", + "ioa", "ltssm", "intr2axi"; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + ; + interrupt-names = "port", "intx-a", "intx-b", "intx-c", + "intx-d", "parity"; + power-domains = <&ps_atc3_pcie>; + msi-controller; + msi-parent = <&usb4_3_pcie>; + msi-ranges = <&aic AIC_IRQ 2199 IRQ_TYPE_EDGE_RISING 32>; + apple,msi-vector-base = <0x80>; + iommu-map = <0x0 &apciec3_dart 0x0 0x100>; + iommu-map-mask = <0xff>; + bus-range = <0x0 0x80>; + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x43000000 0x14 0x0 0x14 0x0 0x2 0x0>, + <0x02000000 0x0 0x100000 0x16 0x100000 0x0 0x3ff00000>, + <0x42000000 0x0 0x40000000 0x16 0x40000000 0x0 0x40000000>; + status = "disabled"; + + usb4_3_pcie_port: pci@0,0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + external-facing; + #address-cells = <3>; + #size-cells = <2>; + ranges; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &usb4_3_pcie_port 0 0 0 0>, + <0 0 0 2 &usb4_3_pcie_port 0 0 0 1>, + <0 0 0 3 &usb4_3_pcie_port 0 0 0 2>, + <0 0 0 4 &usb4_3_pcie_port 0 0 0 3>; + }; + }; + }; +}; + +&pinctrl_aop { + /* ADT acio3 gpio-lstx. */ + usb4_3_lstx_pins: usb4-3-lstx-pins { + pinmux = ; + }; +}; + +&ps_atc3_cio { + status = "okay"; +}; + +&ps_atc3_pcie { + status = "okay"; +}; + +&ps_atc3_cio_pcie { + status = "okay"; +}; + +&ps_atc3_cio_usb { + status = "okay"; +}; + +&typec3 { + ports { + port@2 { + reg = <2>; + typec3_con_tbt: endpoint { + remote-endpoint = <&usb4_3_acio_tbt>; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t6041-j575c.dts b/arch/arm64/boot/dts/apple/t6041-j575c.dts index d758058ccb505..43955ab49c822 100644 --- a/arch/arm64/boot/dts/apple/t6041-j575c.dts +++ b/arch/arm64/boot/dts/apple/t6041-j575c.dts @@ -2025,6 +2025,7 @@ #include "t6041-j575c-usbc-dcpext2.dtsi" #include "t6041-j575c-hdmi.dtsi" #include "t604x-usb4-typec.dtsi" +#include "t6041-j575c-usb4.dtsi" /* Not described: the SEP (no Touch ID sensor). */