Repository navigation
arm64: dts: apple: t6041: USB4/Thunderbolt routers on the J614c, J616c and J575c - #3630
RyanTheTide wants to merge 4 commits into
Conversation
The J773s (Mac mini, M4 Pro) described the PCIe tunnels of its three back ports but left the three USB4 routers disabled, so no Thunderbolt or USB4 device could ever reach them. Its ADT has acio0-2, dart-acio0-2, acio-cpu0-2 and apciec0-2; hpm0-2's acio-parent and acio0-2's atc-phy-parent pair typec0 (back middle), typec1 (back left) and typec2 (back right) with ACIO0, ACIO1 and ACIO2, as on the J614s and J616s. The J614s and J616s enabled the routers with the same per-board block. Move it to t6040-usb4-routers.dtsi and include it on all three. The connector-to-router glue is board-neutral too: rename t604x-j614-j616-usb4.dtsi to t604x-usb4-typec.dtsi and include it on the J773s. The J773s enables the AOP pin controller for the routers' LSTX pins itself; it has no HDMI display gate chain that would. Only t6040-j773s.dtb changes; the J614s, J616s, J616s-tether, J575c, J614c and J616c DTBs are byte-identical, and CHECK_DTBS reports nothing before or after. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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 <ryan@aurorasilicon.org> (cherry picked from commit 0586cb5)
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 <ryan@aurorasilicon.org> (cherry picked from commit e38f04c)
…c and J575c The M4 Max boards had no USB4 router nodes at all: t6041.dtsi never included the routers or the PCIe-C tunnels that t6040.dtsi does, so the J614c, J616c and J575c Type-C ports got USB only. The J616c and J614c ADTs' acio0-2, acio-cpu0-2, dart-acio0-2, apciec0-2 and dart-apciec0-2 equal the J616s's: registers, interrupts and LSTX pins. The J616c pairs hpm0-2 with acio0-2 (acio-parent) and acio0-2 with atc-phy0-2 (atc-phy-parent), as the M4 Pro boards do. - The router mailboxes move from t6040.dtsi to t604x-usb4-mbox.dtsi, included at the same place in t6040.dtsi (its DTBs are byte-identical) and inside t6041.dtsi's root node. - t6041.dtsi includes t6040-usb4.dtsi and t6040-pciec.dtsi; the routers stay disabled there. - The J614c/J616c and J575c include the connector-to-router links and the shared router enables (t6040-usb4-routers.dtsi). The routers' LSTX pins are in the AOP pin controller, which the HDMI display gate enables with its chain on these boards, as on the J614s and J616s. - J575c: back ports 1-3 only. Its hpm0-2 sit where the J773s's do and its acio0-2 are the J616c's; the fourth router (ACIO3) needs its own nodes and CIO reset slot. The T6040 DTBs (J614s, J616s, J616s-tether) are byte-identical; CHECK_DTBS output is unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
There was a problem hiding this comment.
Verdict: HOLD at 991b18c7 pending dependencies and M4 Max validation.
Blockers: Land or reconcile #3628 first. Verify AOP pinctrl is available on each enabled board without relying on HDMI bring-up, or cover the dependency through #2371. Validate the inferred J575c port mapping with actual USB4 enumeration on each enabled port, and obtain the J614c/J616c owner rows.
Checked: The MSI selection uses the PCIe-C hardware description, the CIO bound gains the fourth slot, and shared DT descriptions serve the existing controllers. The owner reports unchanged schema output and T6040 DTB identity.
|
On the AOP pinctrl point: correct, and it's the same situation the J614s/J616s are in on main today. The routers' LSTX |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J614c owner boot row. Not this exact branch: a smaller DT-only variant of the same idea, so this is evidence for the J614c ADT mapping and router bring-up rather than a Tested-by for #3630 as posted. Happy to boot the exact branch next. Setup
Result
Not tested: the other two ports with a peer attached, DP tunnels, PCIe tunnels, a TB5 peer. Lane bonding did not happen: x1 only against a host that can do x2. Assumption to check: DT diff (main 94ea195)diff --git a/arch/arm64/boot/dts/apple/t6041-j614c.dts b/arch/arm64/boot/dts/apple/t6041-j614c.dts
index d35e9b7e3..78b4fa8be 100644
--- a/arch/arm64/boot/dts/apple/t6041-j614c.dts
+++ b/arch/arm64/boot/dts/apple/t6041-j614c.dts
@@ -114,3 +114,126 @@ &ps_aes {
&aes {
status = "okay";
};
+
+/*
+ * USB4/Thunderbolt on all three Type-C ports, as on the J614s: typec0 (left
+ * back, hpm0, ATC0/ACIO0), typec1 (left front, hpm1, ACIO1) and typec2
+ * (right, hpm2, ACIO2). Each connector already links to atcphyN/dwc3_N, and
+ * ACIOn sits in the same ATCn block. The loader (aura/m1n1) copies each
+ * router's RC, adapter and NHI tuning and its DROM from the ADT through the
+ * usb4-N-* aliases. No PCIe tunnels yet: USB4 links, host-to-host
+ * (thunderbolt-net) and DP tunnels only, as on the J614s.
+ */
+#include "t604x-j614-j616-usb4.dtsi"
+
+&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 {
+ power-domains = <&ps_atc0_cio>;
+ /* As on the J614s (ADT dart-acio0 vm-base, redacted in the public dumps). */
+ 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 {
+ power-domains = <&ps_atc1_cio>;
+ /* As on the J614s (ADT dart-acio1 vm-base, redacted in the public dumps). */
+ 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 {
+ power-domains = <&ps_atc2_cio>;
+ /* As on the J614s (ADT dart-acio2 vm-base, redacted in the public dumps). */
+ apple,dma-range = <0x100 0x4000 0x0 0xffff0000>;
+ status = "okay";
+};
+
+&usb4_2_nhi {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/apple/t6041.dtsi b/arch/arm64/boot/dts/apple/t6041.dtsi
index 837aeb817..2755529a3 100644
--- a/arch/arm64/boot/dts/apple/t6041.dtsi
+++ b/arch/arm64/boot/dts/apple/t6041.dtsi
@@ -1068,3 +1068,64 @@ &sio_dart {
&sio_mbox {
status = "okay";
};
+
+/*
+ * USB4/Thunderbolt routers (ACIO) on ATC0-2. They are the T6040's hardware:
+ * in the J614c and J616c ADTs (macOS 26.6.2 and 27.3), acio0-2, acio-cpu0-2,
+ * dart-acio0-2 (with its mapper stream IDs), apciec0-2, dart-apciec0-2 and the
+ * PMGR register list are identical to the J614s's, so the routers, their
+ * DARTs, NHIs and PCIe-C tunnels are the shared t6040-usb4.dtsi description.
+ * The ATCn_CIO power states come from t6041-sleep-pmgr.dtsi. Everything stays
+ * disabled until a board enables it.
+ */
+/ {
+ /* ADT acio-cpu0 reg[0] and interrupts; the J614s's (T6040) values. */
+ usb4_0_mbox: mailbox@381108000 {
+ compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4";
+ reg = <0x3 0x81108000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 934 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 935 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 936 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 937 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "send-empty", "send-not-empty",
+ "recv-empty", "recv-not-empty";
+ #mbox-cells = <0>;
+ power-domains = <&ps_atc0_cio>;
+ status = "disabled";
+ };
+
+ /* ADT acio-cpu1 reg[0] and interrupts; the J614s's (T6040) values. */
+ usb4_1_mbox: mailbox@389108000 {
+ compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4";
+ reg = <0x3 0x89108000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 944 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 945 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 946 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 947 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "send-empty", "send-not-empty",
+ "recv-empty", "recv-not-empty";
+ #mbox-cells = <0>;
+ power-domains = <&ps_atc1_cio>;
+ status = "disabled";
+ };
+
+ /* ADT acio-cpu2 reg[0] and interrupts; the J614s's (T6040) values. */
+ usb4_2_mbox: mailbox@391108000 {
+ compatible = "apple,t6041-asc-mailbox", "apple,asc-mailbox-v4";
+ reg = <0x3 0x91108000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 954 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 955 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 956 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 957 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "send-empty", "send-not-empty",
+ "recv-empty", "recv-not-empty";
+ #mbox-cells = <0>;
+ power-domains = <&ps_atc2_cio>;
+ status = "disabled";
+ };
+};
+
+#include "t6040-usb4.dtsi" |
There was a problem hiding this comment.
Verdict: MERGE at 991b18c75496
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: The MSI selection uses the PCIe-C hardware description, the CIO bound gains the fourth slot, and shared DT descriptions serve the existing controllers. The owner reports unchanged schema output and T6040 DTB identity.
Follow-ups (not blocking): Merge #3628 first; follow-ups: AOP pinctrl availability, J575c port-map enumeration, J614c/J616c owner rows
DjDeveloperr
left a comment
There was a problem hiding this comment.
Correct. pcie->hw == &t6040_pciec_hw matches only apple,t6040-pciec, so M4 Pro keeps its slices and M4 Max now gets the same ones instead of invalid_slice. The fourth ECAM slice and the fourth CIO reconfig port follow the ADT. #3628 is merged, so the base is fine.
The readiness bot's "no runtime change" is wrong: the M4 Max boards get new router and tunnel nodes, and pcie-apple.c changes. Hardware gates before merge:
- An M4 Max owner boot at this head: J614c, J616c or J575c. The routers bind after the HDMI chain is handed over, a USB4/TB device enumerates, and a PCIe tunnel device shows up. The J614c owner offered to boot the exact branch.
- A J616s (T6040) regression row for the shared PCIe change. The DTB is byte-identical, so a USB4 PCIe tunnel device on one port is enough.
The merge-base changed after approval.
J616c (16" M4 Max, T6041, 32-core) — boot & sleep observation (3 commits carried atop
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-review at 991b18c75496. Our approval from 12-02 07:15Z was dismissed right away because the merge base had changed. The head hasn't moved since 11-29, so I looked at it on today's main.
Checked at this head merged with main (75c4aa65e685; the DTBs on dbfe45ac89b6, which differs in no DT file):
- Merges clean. The delta is the same 7 files as before: two driver edits and the DTs, so it isn't DT-only.
- I built all 7 T604x DTBs (dtc) on main and on the merge: the four T6040 boards (J614s, J616s, J616s-tether, J773s) are byte-identical; only J614c, J616c and J575c differ, and warning counts are the same on both sides. Arm64 objects weren't rebuilt here.
pcie-apple.c: the branch is only reached by the T8122/T6040 PCIe-C hardware. Every T6040 tunnel node isapple,t6040-pciec, so T6040 machines take the same case as before, plus the new fourth ECAM. On T6030 the machine check still comes first. I see no path where the change alters an M4 Pro, so I withdraw my request for a J616s row.- New since my review: the J616c row above carries the same three commits on
main: all three routers bind on a cold boot, 0 error lines, still bound after s2idle x1 and deep x2. That covers boot, bind and sleep on an M4 Max. Thanks.
One thing missing: one Thunderbolt or USB4 device with a PCIe function, plugged into one port of an M4 Max (J616c or J614c) at this head: it should enumerate, do I/O and get its MSIs, since the new MSI slice selection and the PCIe tunnels are the part nothing has exercised yet.
Not blocking: the J575c port pairing is inferred (as the description says) and has no boot row yet, and the AOP pinctrl dependency is #2371.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 991b18c75496. The J616c result covers router bind and sleep. Before merge, a J616c or J614c still needs to enumerate a USB4 PCIe device, complete I/O and show its MSI counter rising.
The merge-base changed after approval.
|
The J616c result at |
|
Exact-head undocked J616c (MacBook Pro 16" M4 Max, T6041, 27.2 firmware, zero local patches) A/B no-regression row: PASS (note: no USB4 PCIe dock/enclosure was attached here, so the PCIe tunnel/MSI enumeration half remains open for a docked J616c/J614c). Builds & Boot IDs
Results
Undocked no-regression half passes cleanly on J616c. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 991b18c on main 2eceb1f. CHECK_DTBS validated all seven T604x DTBs on both trees with zero diagnostics. The four T6040 DTBs are byte-identical. The PCIe-C MSI change selects the common controller hardware and adds the fourth ECAM slice.
The exact-head J616c run covers router bind and sleep. Before merge, a docked J616c or J614c still needs to enumerate a real USB4 PCIe endpoint, complete I/O and show its MSI counter advancing before and after sleep. Auto-merge is enabled, so I’m leaving approval pending until that receipt arrives.
Tested: no runtime change on any lab Mac (no M4 Max in our lab): all 7 T604x DTBs build at 991b18c with CHECK_DTBS output unchanged from main, T6040 DTBs byte-identical; pcie-apple.o and t6041-cio-reconfig.o build with the K114S-STACK Aurora config (LLVM, no warnings); needs J614c/J616c/J575c owner boot rows
Risk: two-way · J614c, J616c, J575c (plus J773s from the stacked #3628); T6040 laptops byte-identical
Stacked on #3628 (J773s routers + the shared
t6040-usb4-routers.dtsi); I'll retarget to main once #3628 merges.What: the M4 Max boards (J614c, J616c, J575c) had no USB4 router nodes at all.
t6041.dtsinever included the routers or the PCIe-C tunnels thatt6040.dtsidoes, so their Type-C ports got USB only.ADT: in the J616c and J614c ADTs,
acio0-2,acio-cpu0-2,dart-acio0-2,apciec0-2anddart-apciec0-2equal the J616s's (registers, interrupts, LSTX pins). The J616c's live ADT pairs hpm0-2 with acio0-2 (acio-parent) and acio0-2 with atc-phy0-2 (atc-phy-parent), matching its typec0-2 -> atcphy0-2 endpoints. The routers haveusb4-Naliases, so aura copies each machine's own tunables and DROM.Change
PCI: appleandpmdomain: apple: t6041-cio-reconfig(from our draft arm64: dts: apple: t604x: USB4/Thunderbolt on the M4 Max (J614c, J616c, J575c) #2312, unchanged): pick the PCIe-C MSI slices by controller instead of by machine, so the M4 Max tunnels get theirs; cover the fourth CIO port.t604x-usb4-mbox.dtsi(included at the same spot int6040.dtsi, so T6040 DTBs are byte-identical, and insidet6041.dtsi's root).t6041.dtsiincludest6040-usb4.dtsi+t6040-pciec.dtsi. J614c/J616c and J575c include the typec glue and the shared router enables.pinctrl_aopenable on these boards: like the J614s/J616s, they get it from the HDMI display gate with its chain (t6040: enable the AOP pin controller for the USB4 routers, not only with the HDMI chain #2371).Not proven: no M4 Max in our lab. Needs owner rows (router bind, a Thunderbolt device enumerating per port); J575c owner 7robertodantas.