Skip to content

arm64: dts: apple: t6041: USB4/Thunderbolt routers on the J614c, J616c and J575c - #3630

Open
RyanTheTide wants to merge 4 commits into
mainfrom
feat/t6041-usb4-routers
Open

RyanTheTide wants to merge 4 commits into
mainfrom
feat/t6041-usb4-routers

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

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.dtsi never included the routers or the PCIe-C tunnels that t6040.dtsi does, so their Type-C ports got USB only.

ADT: in 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, 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 have usb4-N aliases, so aura copies each machine's own tunables and DROM.

Change

Not proven: no M4 Max in our lab. Needs owner rows (router bind, a Thunderbolt device enumerating per port); J575c owner 7robertodantas.

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 <[email protected]>
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 <[email protected]>
(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 <[email protected]>
(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 <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

On the AOP pinctrl point: correct, and it's the same situation the J614s/J616s are in on main today. The routers' LSTX pinctrl-0 is in pinctrl_aop, which on the M4 Pro/Max laptops and the J575c is enabled only by the HDMI display gate with its chain. So the routers bind when the HDMI chain is handed over and otherwise stay deferred. Enabling pinctrl_aop statically here would make today's display gate refuse that chain. The proper fix is #2371 (the gate enables a still-disabled pin controller itself and no longer refuses an enabled one); after it, the shared t6040-usb4-routers.dtsi can enable pinctrl_aop for every board. I'm listing #2371 as a dependency for bind-independent-of-HDMI rather than working around it. J773s (#3628) has no gate chain, so it enables the controller directly.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Merge readiness at 991b18c7: not ready yet

Check Detail
CI at head running running: KUnit ane-boot, KUnit clpc, KUnit ane-pm, KUnit dcp-fabric, KUnit dcp-topology, KUnit dcp-display
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok not needed: no runtime change
Conflicts ok none
PR text ok 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.

Areas: area:bringup, area:power

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@hci-kitten

Copy link
Copy Markdown
Contributor

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

  • MacBook Pro 14" M4 Max (J614c), aura Stage 1 1.0.0b13-ge9c79728
  • Kernel: main at 94ea195 plus the DT diff below (t6041.dtsi +61, t6041-j614c.dts +123). It includes t604x-j614-j616-usb4.dtsi and enables pmgr_cio, ps_atcN_{cio,pcie,cio_pcie,cio_usb}, usb4_N_{mbox,acio,dart,nhi} for N=0..2, with apple,pcie-tunnel deleted (no PCIe tunnels)
  • Booted as an aura-try Stage 2 trial; it committed (DCP bound, no deferred DT devices)

Result

  • thunderbolt-apple-acio bound on all three routers (381ac0000, 389ac0000, 391ac0000.cio); no hang at boot or on plug
  • Cable to an Intel Tiger Lake TB4 host (Linux): 391ac0000's NHI registered domain0, thunderbolt 0-1: new host found, vendor=0x8086, host-to-host link at 20.0 Gb/s with 1 lane (rx_lanes = tx_lanes = 1), and thunderbolt-net came up on both ends
  • Over thunderbolt-net: ping 0.3 ms; ssh bulk 547 MB/s with one stream and about 1.4 GB/s with four streams (the ssh cipher limits it, not the link)
  • Firmware syslog during training: Gen2/3 lane=0/1 entered CL0, error_recovery=1, then twice w_speed_transport.c:398: Timeout for at_rt command response expired!!!. register=8. The link stayed up anyway

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: usb4_0_dart apple,dma-range = <0x100 0x4000 0x0 0xffff0000> was copied from the J614s because the ADT value is redacted in the public dumps. I can read it from this machine's ADT if that helps.

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"

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@RyanTheTide
RyanTheTide changed the base branch from feat/t6040-j773s-usb4-routers to main December 1, 2026 09:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) kunit-full needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants