Skip to content

arm64: dts: apple: t604x: USB4/Thunderbolt on the M4 Max (J614c, J616c, J575c) - #2312

Draft
RyanTheTide wants to merge 10 commits into
integration/aurorafrom
m4fam/t6041-usb4
Draft

RyanTheTide wants to merge 10 commits into
integration/aurorafrom
m4fam/t6041-usb4

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #2284. This branch is stacked on it (spec-m3m4/j773s-usb4, bff7312). Only the last four commits are new here.

Problem

The M4 Max boards (J614c, J616c, J575c) have no USB4 router description, so their Thunderbolt 5 ports only run USB3 and DisplayPort alt mode. #2284 enables the routers on every M4 Pro, but it does that in t6040-usb4.dtsi, t6040.dtsi and t6040-pmgr.dtsi, and t6041.dtsi includes none of them.

The ADTs show the routers are the same hardware. The J614c, J616c and J575c list acio0-2, dart-acio0-2, acio-cpu0-2 and apciec0-2 at the same addresses and interrupts as the J614s, J616s and J773s. The lstx GPIOs and DART vm-base match too, and the PMGR lists the ATCn_CIO, ATCn_PCIE, ATCn_CIO_PCIE and ATCn_CIO_USB states at the same offsets. On every one of these boards, port controller hpmN names acioN as its router, and the board calls that connector typecN. The J575c also has a fourth router (acio3) behind ATC3, for its fourth back port. The laptops use ATC3 for HDMI and have no acio3.

Change

  • One description for T6040 and T6041.
    • The CIO/PCIe-C power domains move from t6040-pmgr.dtsi to t604x-pmgr.dtsi.
    • The router mailboxes move from t6040.dtsi into the USB4 file.
    • t6040-usb4.dtsi becomes t604x-usb4.dtsi, included by t604x.dtsi. The routers on ATC0-2 are now the SoC default on both chips.
    • t6040-usb4-typec.dtsi becomes t604x-usb4-typec.dtsi. The J614c, J616c and J575c include it, as the M4 Pro boards do.
    • The T6041 ATC PHYs are already their connectors' mode switches (t6041-j616c-usbc.dtsi, t6041-j575c-usbc.dtsi), so CIO entry has what arm64: dts: apple: t6040: Thunderbolt/USB4 on the Mac mini M4 Pro, router enables shared by every M4 Pro #2284 found it needs.
  • J575c fourth port. t6041-j575c-usb4.dtsi describes and enables ACIO3 with its DART, NHI, mailbox, power domains, LSTX pin (AOP 55) and CIO reset slot 3, and links it to typec3. Its PCIe tunnel is described but stays disabled, like the other three.
  • Drivers, as separate commits, selected by hardware:
    • t6041-cio-reconfig registers four resets instead of three. The PMGR has CIO0-3-RECONFIG on every T604x board.
    • pcie-apple picks the T6040 PCIe-C MSI slice table by its controller match (apple,t6040-pciec) instead of the machine compatible apple,t6040, and adds the fourth bridge. No T604x board enables a PCIe tunnel yet, so nothing changes today.

No thunderbolt or ATC PHY driver change is needed. They match apple,t6040-usb4-acio, apple,t6040-usb4-nhi and apple,t6040-atcphy, which T6041 uses, and their only machine checks are for T6050 boards. The PHY CIO mode from #1126 is already in integration/aurora through #1220. The boot loader copies the router tuning and DROM for every ADT acioN (acio,v2 included), so it needs no change either.

This replaces the T6041 device tree part of #1126, which no longer applies to integration/aurora. The idea and the first T6041 description are from @AxxzyWasTaken.

Testing

Still to run

Hardware rows on a J616c or J614c and on a J575c, with a USB4 or Thunderbolt partner on each port. The partner can be another Mac for host-to-host, or a TB3/TB4 dock. Exact steps and pass criteria are below.

Hardware rows

Boot the kernel from this branch with the matching Stage 2 DTB (t6041-j616c.dtb, t6041-j614c.dtb or t6041-j575c.dtb) and the current aura.

  1. Probe (no cable):
    • dmesg | grep -iE 'thunderbolt|acio|nhi|cio-reconfig' shows no probe errors.
    • ls /sys/bus/thunderbolt/devices/ lists domain0, domain1 and domain2 (and domain3 on the J575c), each with its host router.
  2. Host-to-host on each port in turn (J616c/J614c: left back, left front, right; J575c: all four back ports), against another Mac running Linux USB4, for example a J616s:
    • modprobe thunderbolt-net; the peer shows up as /sys/bus/thunderbolt/devices/*-1.
    • cat .../*-1/rx_speed .../*-1/rx_lanes: pass is 20 Gb/s x 2 or better.
    • iperf3 over the thunderbolt interface: pass is above 10 Gbit/s (the J616s reached 18.5).
  3. Dock or device on each port:
    • boltctl list (or /sys/bus/thunderbolt/devices/*-1/{vendor_name,device_name,authorized}) shows the device, and boltctl authorize succeeds.
    • USB devices behind a USB4 dock enumerate (lsusb -t).
    • PCIe tunnels are not enabled yet, so PCIe devices behind the dock are expected to be missing.
  4. Replug the same port and flip the cable: the domain comes back at the same link speed, with no acio/nhi timeouts in dmesg.
  5. Regression: with no USB4 partner, USB3 SuperSpeed and DisplayPort alt mode still work on the same ports.
  6. J575c back-left port (ACIO3, CIO reset slot 3): run row 2 there. A cio-reconfig timeout on that port means the slot-3 bit positions are wrong.

Assisted-by: LLM (Claude:Opus 5.5)

RyanTheTide and others added 7 commits November 19, 2026 23:07
…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 <ryan@aurorasilicon.org>
… 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 <ryan@aurorasilicon.org>
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 <ryan@aurorasilicon.org>
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: #1126
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>
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>
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: #1498
Link: #1126
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor

Step 1 (probe, no cable) on a J616C (binned T6041). This PR's head 06e48f9 (on #2284, integration 0abc2f3), built with the tree's own t6041-j616c.dtb, one-shot boot.

Result: the boot is clean, but the routers don't probe on this Mac, because of the boot loader rather than this PR.

  • 0 failed units, no GPU errors, display up. Type-C ports 0-3 are present, with partners on 0 and 1.
  • thunderbolt loads, but /sys/bus/thunderbolt/devices/ is empty and dmesg has no thunderbolt/acio/nhi/cio-reconfig lines.
  • The compiled DTB has the three NHIs okay (/cio@381ac0000/nhi@1f00000 and the same under cio@389ac0000 and cio@391ac0000). In the live tree (/sys/firmware/devicetree/base) all three are disabled. This PR's other changes are present, for example mode-switch on all three ATC PHYs.
  • Cause: the Stage 2 on this Mac is aura 1.0.0b9 (c507a021). Its dt_disable_missing_devs("acio", "cio@", 8, 2) matches each FDT cio@ node against ADT acioN reg[2]. On the J616C, /arm-io/acio0 has reg[1] = 0x381ac0000 and reg[2] = 0x381ac4000. So cio@381ac0000 matches nothing, and all three routers are disabled before Linux starts. aura main fixed this in kboot: keep ACIO v2 USB4 routers and hand over their tuning aura#103 (3ea74035, 7 Nov, "keep ACIO v2 USB4 routers and hand over their tuning"): adt_acio_rc_regnum() returns 1 on ACIO v2.

So on the M4 Max this PR needs a Stage 2 with aura#103. That's worth a line in the description or the release notes, since a Mac still on an older Stage 2 will boot fine but show no USB4 domains. I'll redo step 1 behind a Stage 2 that has #103 (the b14 candidate), and the cable rows if I can get a partner on it.

Disclosure: prepared with an AI tool; tested as described.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor

Step 1 redone on the J616C behind a Stage 2 with the aura#103 ACIO fix (aura#421 dev-a88879cfd1fc, two trial boots): all three NHIs are okay in the live tree, and thunderbolt-apple-nhi plus thunderbolt-apple-acio bind 381ac0000.cio, 389ac0000.cio and 391ac0000.cio, with nothing deferred and no errors. No cable was attached. Root on NVMe, 0 failed units. So this PR's tree probes on the M4 Max once the boot loader is post-#103. The cable rows still need a USB4/TB partner.

Disclosure: prepared with an AI tool; tested as described.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 2.

Building on the J616c probe results above (checked at 06e48f9): the four new commits keep the T6040 DTBs identical, and selecting the PCIe-C MSI table by pcie->hw == &t6040_pciec_hw (drivers/pci/controller/pcie-apple.c:3410) in place of the machine compatible is correct.

  1. The PR does not merge, and the rebase is not mechanical. Since the merge base, integration has changed the files this series moves: dd93e00 gives the USB4 DARTs their power domains, and e16376a names only enabled states from the USB4 DARTs, both in t6040-usb4.dtsi and t6040.dtsi (and the J614s/J616s/J773s boards). A rebase that keeps "our" side of the rename to t604x-usb4.dtsi drops both changes on every M4 Pro without a dtc warning. Rebase after arm64: dts: apple: t6040: Thunderbolt/USB4 on the Mac mini M4 Pro, router enables shared by every M4 Pro #2284 (also conflicting), carry those properties into the shared files, and re-run the label-resolved T6040 comparison against the new base, not against arm64: dts: apple: t6040: Thunderbolt/USB4 on the Mac mini M4 Pro, router enables shared by every M4 Pro #2284.
  2. drivers/pmdomain/apple/t6041-cio-reconfig.c:25,41-42: slot 3 (request bit 3, busy bit 19) is extrapolated, as the commit message says, and the J575c is the only board that uses it. A wrong guess writes an unknown bit in a shared PMGR register on every ACIO3 reset. This needs J575c evidence before merge: the slot-3 row, plus a raw read of the register before the first write showing bits 3 and 19 idle as expected. Without that, leave ACIO3 disabled in t6041-j575c-usb4.dtsi and keep nr_resets at 3.
  3. Nit: the MSI slices are still a table of hard-coded ECAM apertures and vector bases (pcie-apple.c:3410-3432), now with a fourth entry. Each bridge's slice could come from its DT node (msi-ranges or msi-map on the PCIe-C host) so that new boards need no driver change. A follow-up is fine, since no T604x tunnel is enabled yet.

The probe row above showed that M4 Max routers need a Stage 2 with aura#103 to get through dt_disable_missing_devs. Put that requirement in the description.

HW row: on the rebased head, with a Stage 2 that has aura#103. J616c or J614c: rows 2-5 of the description on every port (thunderbolt-net 2 x 20 Gb/s, iperf3 > 10 Gbit/s, dock USB enumerates, replug and flip, USB3 and DP alt mode unchanged with no partner). J575c: the same on all four back ports, including ACIO3 (no cio-reconfig timeout). J616s regression on the new base. 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

t6040-j614s.dts, t6040-j616s.dts: kept this branch's removal of the per-board router blocks; integration's router DART power-domains (ps_atcN_cio) carried into the shared usb4_N_dart nodes in t6040-usb4.dtsi.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Brings in the updated #2284 branch, which merged integration/aurora. No conflicts: the router DART power-domains followed t6040-usb4.dtsi into t604x-usb4.dtsi.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…domain

A DART probes as a device of its own and faults when read with its block
off, so every Apple DART now names its engine's power state, as the ACIO0-2
router DARTs do (ps_atcN_cio). Give the J575c's fourth router DART
ps_atc3_cio too.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged the updated #2284 branch (b0e5305, which carries integration/aurora f5f023b); no textual conflicts, the router DART power-domains followed into t604x-usb4.dtsi, and a follow-up commit gives the J575c ACIO3 DART ps_atc3_cio. All seven T604x board DTBs build with unchanged dtc warnings; T6040 boards are label-resolved identical to #2284, T6041 boards only gain nodes; DART power-domain check: no new findings; t6041-cio-reconfig.o and pcie-apple.o build with W=1 and no warnings.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Still needed: #2284 to land first; either J575c evidence for CIO reset slot 3 (a raw read of the register showing bits 3 and 19 idle, plus a back-left port row) or ACIO3 left disabled until then; the description should say the M4 Max routers need a Stage 2 with aura#103; and the cable rows on a J616c or J614c.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants