Skip to content

J616s: USB4/Thunderbolt on the left back port (T6040 ACIO0) - #1220

Merged
RyanTheTide merged 6 commits into
integration/aurorafrom
tb3/j616s-usb4
Nov 8, 2026
Merged

RyanTheTide merged 6 commits into
integration/aurorafrom
tb3/j616s-usb4

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

USB4/Thunderbolt on the J616s (M4 Pro, 16-inch) left back port, ACIO0. Integration already carries the T6040 router, DART and NHI description, disabled and with the NHI ring interrupts fixed (#1212). This PR adds what is still missing and enables port 0 on the J616s only.

  • thunderbolt: apple / PCI: apple: the driver half of PCI: apple: draft T6040 USB4 tunnel resources #1052 (T6040 v2 router, Type 7 NHI, T6040 PCIe-C data). The diff is byte-identical to the code that ran in TB2's trial 5b.
  • phy: apple: t6040: CIO mode. This is AxxzyWasTaken's commit from phy: apple: t6040: CIO mode, and the T6041 USB4 resources #1126, cherry-picked with his authorship and Signed-off-by.
  • Bindings: apple,t6041-cio-reset, plus LSTX for apple,t6040-usb4-acio.
  • t6040-usb4.dtsi and the J614s/J616s boards (from arm64: dts: apple: j614s/j616s: wire the USB4 routers (disabled) #1165): each router gets its CIO reconfig reset and LSTX pin, and each Type-C connector is linked to its router in the graph. The CIO reconfig block now uses the T8132 PMGR compatibles. The aliases are renamed usb4-N-acio, which is the name aura looks up for the router tuning. Nothing is enabled in this commit.
  • t6040-j616s.dts: enables ACIO0, its DART (ADT vm-base window), NHI, mailbox, CIO reconfig and power domains. There is no PCIe tunnel yet, so this covers host-to-host (XDomain, thunderbolt-net) and USB4 links.

Not included: #946's b9fcf33 (T8110 DART set up from scratch) and the router-DART apple,bypass-sids / full-error-reporting / ctc-flush props. The proof boot below runs without them (this was the trial 5c ablation).

J616s board DTB vs production Stage 2 DTB (b975817a), semantic diff: only the USB4 nodes above and the #1212 IRQ fix changed. Everything else is phandle renumbering.

Hardware proof (J616s <-> M2, TB5 cable): results are posted as comments below.

🤖 Generated with Claude Code

RyanTheTide and others added 5 commits November 8, 2026 23:19
Teach the Apple USB4 glue and the PCIe-C controller the T6040 (M4 Pro)
generation: the v2 router layout, its Type 7 NHI and the T6040 PCIe-C
register and shared-MSI data. Taken from the driver half of the draft
in linux#1052; the device tree half is already in integration.

Tested on the J616s (M4 Pro) against the M2 over a TB5 cable: router
firmware ready, XDomain link 2 x 20 Gb/s each way, thunderbolt-net
iperf3 17.9 / 19.6 Gbit/s.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Take the lanes for USB4 or the Thunderbolt alternate mode: the common
tunables and the CIO ones, the crossbar with orientation in one bit, both
lanes released, then the same PHY firmware as USB3. USB3 stays parked until
the lanes come back. The order is AppleT6040TypeCPhy mode 2 from the 25G83
kernelcache and matches the T6050 recipe, except for the AHB clock request
at CFG +0x28.

Not run on hardware.

Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
(cherry picked from commit cf72776, linux#1126)
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
The T6040 (M4 Pro/Max) routers are reset through the PMGR CIO reconfig
register, like T6000, and drive an LSTX sideband pin, like T8132. Add the
apple,t6041-cio-reset compatible and let apple,t6040-usb4-acio carry the
lstx pinctrl state and lstx-gpios.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
… pins and Type-C ports

Give each T6040 router its CIO reconfig reset line (ADT pmgr reg[44],
enableCioReconfig at +0x2024), its LSTX pin and lstx-gpios (ADT acioN
gpio-lstx: AOP pins 49, 51, 53), and label the routers' graph endpoints.
The CIO reconfig block uses the T8132 PMGR compatibles.

On the J614s/J616s link each Type-C connector to the router behind the
same ATC PHY (ADT acioN atc-phy-parent): typec0 (left back) to ACIO0,
typec1 (left front) to ACIO1, typec2 (right) to ACIO2. The port
controller skips a link to a disabled router.

Name the routers' aliases usb4-N-acio, the name the loader looks up for
the router (RC) tuning, as on T8112.

Nothing is enabled here. From linux#1165.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Enable ACIO0 (typec0, left back), its DART, NHI, mailbox, CIO reconfig
block and power domains. The loader hands over the router, adapter and
NHI tuning and the DROM. Give the router DART the ADT vm-base window so
the NHI rings sit where its 32-bit + 1 TiB addressing reaches them. The
PCIe tunnel stays off: host-to-host (XDomain, thunderbolt-net) and USB4
links only for now.

Tested on the J616s against the M2 (TB5 cable): link after cold boot,
2 x 20 Gb/s each way, thunderbolt-net iperf3; see the PR for numbers.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware proof on the J616s (M4 Pro), cabled to the M2 with a TB5 cable. The test kernel 7.3.0-aurora-tb3a was built from this branch's exact tree. Stage 2 was aura b5 + aura#103 with this branch's J616s DTB, booted once through aura-try.

  • Link comes up by itself at boot. Router firmware is ready at 6.9 s and both lanes reach CL0 at 7.3 s. At 12.8 s thunderbolt 0-1 appears: the M2 as an XDomain host, 20.0 Gb/s x 2 lanes each way. thunderbolt_net auto-loads and has carrier at ~36 s. aura handed over RC 348 B, adapter 12 B, NHI 1188 B and DROM 76 B.
  • No J716c: Thunderbolt 5 and USB4 on the right USB-C port #946 b9fcf33 and no router-DART bypass/full-error/ctc-flush props were needed (this boot was the trial 5c ablation).
  • thunderbolt-net: ping 0.16-0.49 ms. iperf3 J616s->M2 18.5 Gbit/s; M2->J616s 11.4 Gbit/s, with that run interrupted by the M2 entering s2idle (TB2's trial 5b measured 19.6 Gbit/s).
  • s2idle on the J616s with the link up (rtcwake on rtc1): suspend succeeded, the XDomain survived and tbnet carrier returned after resume. The M2 also suspended and resumed several times during the trial; the link stayed and the tbnet paths came back each time.
  • SELinux enforcing, 0 AVC. The trial boot's kernel log has one error, avd firmware -2, which is unrelated to this PR.
  • Known issue: unbinding and rebinding the thunderbolt-apple-acio platform device leaves the tb domain alive, and tbnet_login_work then oopses in tb_cfg_request. This happens only on the remove path, not on boot, sleep or a cable unplug. It is tracked as a follow-up and does not block this PR.
  • Physical unplug/replug was not tested; it needs a person at the machine.

Other Macs: the driver changes only add T6040 match data (the v1 router and PCIe paths are unchanged), and only t6040-j616s.dts enables anything.

…y helper

apple_cio_pcie_tunnel_is_preinitialized() now calls
apple_cio_pciec_eligible(), which also admits apple,t6040-pciec. Pull the
helper into the test build and take a const node in the fixture's
of_device_is_compatible(), as the kernel's does.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
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