Skip to content

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

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

RyanTheTide wants to merge 7 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>
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.

1 participant