Skip to content

arm64: dts: apple: t6040: Thunderbolt/USB4 on the Mac mini M4 Pro, router enables shared by every M4 Pro - #2284

Draft
RyanTheTide wants to merge 3 commits into
integration/aurorafrom
spec-m3m4/j773s-usb4
Draft

RyanTheTide wants to merge 3 commits into
integration/aurorafrom
spec-m3m4/j773s-usb4

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem. The Mac mini M4 Pro (J773s) has three Thunderbolt 5 ports on the back, but its USB4 routers were disabled and nothing linked its Type-C ports to them. Its ATC PHYs also had no mode-switch, so the port controller never switches them into USB4 mode. The J614s and J616s each carried their own copy of the same router enables, and the laptops got mode-switch only from a display include.

Change. Three commits:

  1. Link the J773s Type-C ports to the routers. t604x-j614-j616-usb4.dtsi becomes t6040-usb4-typec.dtsi, and the J773s includes it as well. Per the ADT the wiring matches the laptops: acioN sits behind atc-phyN, and port controller hpmN points at acioN.
  2. Give the ATC PHYs mode-switch in the shared file, for every board.
  3. Enable the routers, DARTs, NHIs, mailboxes, CIO reset block and ATC power domains once, in t6040-usb4.dtsi / t6040.dtsi, and drop the per-board copies. PCIe tunnels stay off as before: the router nodes no longer carry apple,pcie-tunnel, so no board has to delete it.

aura needs no change. Its router/DROM and ATC tunable handoff loops over /arm-io/acioN for any board.

Testing. cpp + dtc on every T604x board: same warning counts. Decompiled with phandles normalized:

  • J614s, J616s, J616s-tether, J575c, J614c, J616c: zero diff from the base.
  • J773s: gains the three port@2 links, mode-switch on atcphy0-2, and the enabled router blocks with their power domains.

Still to run (J773s, each back port).

  • USB3 still enumerates.
  • aura reports the usb4 tunables copied for all three routers.
  • Three NHIs probe.
  • A host-to-host TB link reaches 2x20 Gb/s with a thunderbolt-net iperf3 run.
  • Replug works, with no DART faults or SErrors.

Conflicts with #2069, which edits the old per-board blocks; whichever lands second needs a small rebase.

Assisted-by: LLM (Claude:Opus 5.5)

…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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

I checked this independently against the head (bff7312), building with cpp + dtc from a separate tree:

  • The J614s, J616s and J616s-tether sorted decompiles are identical to integration/aurora 0abc2f3 with the same enabled-node lists. The DTB bytes differ, which is node order only. dtc prints the same warning counts.
  • J773s: the enabled-node delta is the three ACIO routers (with NHI, DART and ports/port@1), the three router mailboxes, the ATC0-2 CIO/PCIe power states, the CIO reset block and port@2 on usb-pd@c/a/8. mode-switch is set on atcphy0-2.
  • The links resolve as the ADT has them: hpm0 (0xc, back middle) to typec0 to usb4_0, hpm1 (0xa) to usb4_1, hpm2 (0x8) to usb4_2. dart-acio0-2 vm-base is 1 TiB as on the J616s, so the shared apple,dma-range fits.
  • mode-switch is required here, not just tidier: t6040-usb2.c enters CIO mode only from t6040_dp_mux_set(). Without it the J773s ports would never leave USB mode.

This also builds cleanly together with the J773s front USB-C change (ATC3 fixed hub), which only touches t6040-j773s-usb-front.dtsi and t6040-usb2.c.

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