Skip to content

M3 Max (J516C): USB4 PCIe tunnel on ATC0 - #498

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

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

Conversation

@wbunting

Copy link
Copy Markdown

Brings up the USB4 PCIe tunnel on ATC0 of the 16" M3 Max (J516C, T6031), the same way t6030-usb4.dtsi does it for the M3 Pro. Thunderbolt PCIe devices behind that port 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.

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.
  • 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;
  • the ATC1 and ATC2 ports, which aren't described yet;
  • 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>
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