Skip to content

M3 Max (J516C): USB4 PCIe tunnels on all three USB-C ports - #498

Open
wbunting wants to merge 3 commits into
omacom:integration/aurorafrom
wbunting:t6031-pcie-tunnel
Open

wbunting wants to merge 3 commits into
omacom:integration/aurorafrom
wbunting:t6031-pcie-tunnel

Conversation

@wbunting

@wbunting wbunting commented Nov 17, 2026 •

Copy link
Copy Markdown

Brings up the USB4 PCIe tunnels on all three USB-C ports (ATC0, ATC1, ATC2) of the 16" M3 Max (J516C, T6031), the same way t6030-usb4.dtsi does it for the M3 Pro. Thunderbolt PCIe devices behind those ports now enumerate and get working MSIs.

PCI: apple: accept the T6031 PCIe-C MSI slices

T6031 has the T6030 PCIe-C MSI layout: one shared 512-vector AIC window, internal apcie0 on the first 32 vectors, and a 32-vector slice per tunnel host. Two things differ:

  • The window starts at AIC 1854, not 1342.
  • T6031's AIC takes the four-cell, die-numbered specifier.

The patch looks the window up per SoC (apple_t603x_msi_window()), accepts both specifier forms (die 0 only), and treats T6031 like T6030 in apple_pcie_tunnel_prepare(). T6030 behaviour is unchanged.

arm64: dts: apple: t6031-j516c: add the ATC0 USB4 PCIe tunnel

A new t6031-usb4.dtsi describes the ATC0 PCIe-C host, its DART and the apple,pcie-tunnel link.

  • All values come from the J516C ADT (apciec0, dart-apciec0, apciec0-piodma, acio0). The register windows and tunables match T6030; the AIC numbers and the MSI slice are T6031's.
  • The ACIO has no cpu window, because the T6031 ACIO uses the t8103 start sequence.
  • In the compiled J516C DTB, only /aliases, the ATC0 ACIO node and the new /usb4-pcie-tunnel-0 subtree change.

arm64: dts: apple: t6031-j516c: add the ATC1 and ATC2 USB4 PCIe tunnels

Describes the tunnel hosts behind ATC1 (USB-C Left Front) and ATC2 (USB-C Right) the same way as ATC0. Without them, a Thunderbolt PCIe device on those ports linked at the Thunderbolt level but never appeared on the PCI bus.

  • All values come from the J516C ADT (apciec1/2, dart-apciec1/2, apciec1/2-piodma). The register windows sit at 0xb/0xf instead of 0x7.
  • The controller and DART interrupts are 1375/1376 (ATC1) and 1403/1404 (ATC2).
  • The MSI slices are 0x40 and 0x60 of the shared window, the slices the driver already expects for these ECAM apertures.
  • The DART and OE fabric tunables are identical to ATC0's. m1n1 fills the per-port tunables through the usb4_N_pcie and usb4_N_pcie_adapter aliases.
  • checkpatch: 0 errors, 0 warnings.

Testing

On a J516C (MacBook Pro 16", M3 Max), with this branch merged with #292 (external displays):

  • Pass: a Universal Audio Apollo Twin X (Thunderbolt 3) on the ATC0 port enumerates as 0001:03:00.0 behind its JHL6240 bridges. The PCIe-C link is up within 1 ms of cold init.
  • Pass: the out-of-tree ua_apollo driver's MSI self-test passes. A 5-minute playback and capture run had 0 xruns and 0 dropouts.
  • Pass: no DART/IOMMU faults or AER errors. The Apollo was power-cycled (link down and up) three times during the boot.
  • Pass: an external display over Thunderbolt worked at the same time.
  • Pass (ATC2): a Ugreen Thunderbolt 5 dock (JHL9480 Barlow Ridge) on the right-hand port: "Link up on /usb4-pcie-tunnel-2/pcie@f30000000", the dock's JHL9480 bridges, its Intel I226-V Ethernet and an NVMe drive behind it enumerate on bus 0002. The I226-V (igc) links at 2500 Mb/s full duplex and passes traffic as the default route with 0 RX/TX errors. No DART/IOMMU faults or AER errors. The Apollo on ATC0 kept working at the same time.
  • Pass (ATC1): the same Apollo Twin X moved to USB-C Left Front: "Link up on /usb4-pcie-tunnel-1/pcie@b30000000", it enumerates as 0001:03:00.0 behind its JHL6240 bridges, the ua_apollo MSI self-test passes and its PipeWire mic source works. No DART/IOMMU faults. The dock on ATC2 kept working at the same time.
  • Build: each commit compiles on its own with W=1 and no new warnings. t6031-j516c.dtb builds.
  • checkpatch: reports only the two device-tree warnings existing files also get: MAINTAINERS for the new file, and the undocumented apple,t6031-dart and apple,t8122-pciec compatibles.

Not tested:

  • the J514C (14" M3 Max), which can't use this until its board file includes the dtsi;
  • suspend/resume with a tunnelled device;
  • hot unplug while a device is in use;
  • KUnit, which I couldn't run here because there's no QEMU on this machine.

AI assistance

Written with Claude (Opus 5.5) in an agent harness: the ADT extraction, the driver and DT changes, and these commit messages. I reviewed the diffs, and the hardware testing above is from my machine. Each commit carries Assisted-by: Claude:claude-opus-5-5.

T6031 (M3 Max) shares T6030's PCIe-C MSI layout: the ADT gives every
apcie and apciec host one 512-vector AIC window, the internal apcie0
takes its first 32 vectors, and each tunnel host owns the next 32-vector
slice. Two things differ: the window starts at AIC 1854 instead of 1342,
and T6031's AIC takes a four-cell specifier with a die number.

Look the window up by SoC in apple_t603x_msi_window(), accept both
specifier forms (die 0 only), and treat T6031 like T6030 where
apple_pcie_tunnel_prepare() decides whether to keep the t8122 hardware
description. T6030 behaviour is unchanged.

Tested on a J516C (MacBook Pro 16", M3 Max) with the ATC0 tunnel from the
following patch: a Thunderbolt 3 audio interface (Universal Audio Apollo
Twin X) enumerates behind its JHL6240 bridges, and its driver's MSI
self-test passes with no DART faults.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Will Bunting <18180928+wbunting@users.noreply.github.com>
Describe ATC0's PCIe-C host, its DART and the apple,pcie-tunnel link in a
new t6031-usb4.dtsi, modelled on t6030-usb4.dtsi. Every value is from the
J516C ADT (apciec0, dart-apciec0, apciec0-piodma, acio0). The register
windows and tunables match T6030. The AIC numbers (1347, 1348) and the
MSI slice (AIC 1854 + 0x20, 32 vectors) are T6031's.

Add the usb4_0_pcie and usb4_0_pcie_adapter aliases so m1n1 fills the
rc, fabric, debug, root port and PCIe adapter tunables. Give the ACIO its
PCIe adapter window and its fourth power domain (ps_atc0_pcie). Unlike
T6030, leave out the ACIO's "cpu" window: the T6031 ACIO uses the t8103
start sequence.

Only ATC0 is described. ATC1 and ATC2 need their own ADT values and
testing.

Compared with the current t6031-j516c.dtb, only /aliases, the ATC0 ACIO
node and the new /usb4-pcie-tunnel-0 subtree change.

Tested on a J516C: a Thunderbolt 3 device on the ATC0 port enumerates
through the tunnel as 0001:03:00.0 with the PCIe-C link up and no DART
faults. Not tested: the J514C (14" M3 Max), suspend/resume, and hot
unplug.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Will Bunting <18180928+wbunting@users.noreply.github.com>
Only ATC0 (USB-C Left Back) had a PCIe tunnel, so a Thunderbolt PCIe
device on USB-C Left Front or USB-C Right linked at the Thunderbolt
level but never appeared on the PCI bus.

Describe the tunnel hosts behind ATC1 and ATC2 the same way. Every
value is from the J516C ADT (apciec1/2, dart-apciec1/2,
apciec1/2-piodma): the register windows sit at 0xb/0xf instead of
0x7, the controller and DART interrupts are 1375/1376 and 1403/1404,
the MSI slices are 0x40 and 0x60 of the shared window (the slices the
driver already expects for these ECAM apertures), and the DART and OE
fabric tunables are identical to ATC0's. m1n1 fills the per-port
tunables through the usb4_N_pcie and usb4_N_pcie_adapter aliases.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Will Bunting <18180928+wbunting@users.noreply.github.com>
@wbunting wbunting changed the title M3 Max (J516C): USB4 PCIe tunnel on ATC0 M3 Max (J516C): USB4 PCIe tunnels on ATC0, ATC1 and ATC2 Nov 24, 2026
@wbunting wbunting changed the title M3 Max (J516C): USB4 PCIe tunnels on ATC0, ATC1 and ATC2 M3 Max (J516C): USB4 PCIe tunnels on all three USB-C ports Nov 24, 2026
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable code defects were found.

Summary

Adds T6031 USB4 PCIe tunnels to J516C and teaches the PCIe driver its MSI window.

  • ATC0 on the J516C now has a PCIe tunnel for connected devices.
  • ATC1 on the J516C now has a PCIe tunnel for connected devices.
  • ATC2 on the J516C now has a PCIe tunnel for connected devices.
  • The Apple PCIe driver now assigns tunnel MSI slices on T6031.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Endpoint["Endpoint MSI data: 0–31"] --> Map["Host MSI map adds slice offset"]
  Map --> Slice["ATC0: 32 · ATC1: 64 · ATC2: 96"]
  Slice --> AIC["T6031 AIC: die 0, IRQ 1854 + offset + data"]
Loading

Reviews (1) · Last reviewed commit: "arm64: dts: apple: t6031-j516c: add the ..." · Reviewed by Greptile

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