Repository navigation
Conversation
Multi-die AIC2 controllers such as T6031/T6034 encode interrupt specifiers with four cells (<type die irq flags>) instead of three (<type irq flags>). All T6031/T6034 USB4 PCIe-C tunnel hosts sit on die 0 and share the same 32-vector per-bridge slice shape already validated by apple_t8122_msi_window() and apple_t8122_msi_claim(). Add apple_pciec_msi_irq_index() in pcie-apple-t8122.h to validate both 3-cell single-die and 4-cell die-0 specifiers (rejecting non-zero die, wrong trigger flags, or disallowed 4-cell specifiers), use it in apple_msi_init() before claiming a slice, and extend tools/asahi/pcie-apple-msi-slice-tests.c to cover both specifier parsing and the T6031 slice shape (window 1854, bases 0x20/0x40/0x60). Single-die T6030 and T6040 keep strict 3-cell specifier validation. Based on work by Will Bunting in omacom/linux-aurora#498. Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Describe the USB4 PCIe-C tunnel hosts, DARTs, and apple,pcie-tunnel
links for ATC0, ATC1, and ATC2 in t6031-usb4.dtsi (modelled on
t6030-usb4.dtsi) and include it from t6031.dtsi so all single-die
T6031/T6034 M3 Max boards (J514C, J516C, J514M, J516M) inherit it
while leaving multi-die T6032 (M3 Ultra) untouched.
- All values come from the J516C ADT (apciec0..2, dart-apciec0..2,
apciec0..2-piodma, acio0..2). Register windows sit at 0x7, 0xb, and
0xf with controller/DART interrupts 1347/1348, 1375/1376, and
1403/1404.
- MSIs use the 32-vector slices at offsets 0x20 (1886), 0x40 (1918),
and 0x60 (1950) of T6031's shared AIC 1854 window (internal apcie0
owns 0..31 in t6031-die0.dtsi).
- Each ACIO gains its pcie-adapter window, ps_atcN_pcie power domain /
post-init-provider, and apple,pcie-tunnel link; unlike T6030 there
is no "cpu" window because T6031 ACIO uses the t8103 start sequence.
- Remove the duplicate disabled pciec{0,1,2}_dart nodes from
t6031-misc-interfaces.dtsi and repoint apciec{0,1,2}_piodma iommus
in t6031-peripherals.dtsi to usb4_{0,1,2}_pcie_dart, matching
t6030's tunnel layout.
Tested on J516C (16" M3 Max) across all three USB-C ports with a
Universal Audio Apollo Twin X (TB3) and a Ugreen TB5 dock (JHL9480,
Intel I226-V 2.5GbE + NVMe): devices enumerate behind their tunnel
bridges with working MSIs and zero DART/AER errors.
Signed-off-by: Will Bunting <18180928+wbunting@users.noreply.github.com>
Co-developed-by: Marcelo Alcantara <maralc@gmail.com>
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Exact-head J516C hardware verification remains pending, requiring maintainer confirmation of PCIe/DART enumeration, shared MSI delivery, and hotplug and suspend/resume behavior before approval.
No open issues 🎉
What changed in this PR
Enables USB4 PCIe tunnels on all three T6031/T6034 M3 Max ports, extending the existing Apple PCIe tunnel support while leaving T6032 unchanged.
Changes:
- Accepts four-cell die-0 AIC MSI specifiers while preserving stricter validation for existing platforms.
- Adds three tunnel hosts, DARTs, power-domain links, and bootloader aliases.
- Extends MSI parsing tests and removes duplicate DART definitions.
| File | Description |
|---|---|
| tools/asahi/pcie-apple-msi-slice-tests.c | Tests T6031 MSI slices and interrupt specifier validation. |
| drivers/pci/controller/pcie-apple.c | Uses the parsed IRQ index during MSI setup. |
| drivers/pci/controller/pcie-apple-t8122.h | Adds three- and four-cell MSI specifier validation. |
| arch/arm64/boot/dts/apple/t6031.dtsi | Includes the new USB4 tunnel definitions. |
| arch/arm64/boot/dts/apple/t6031-usb4.dtsi | Defines ATC0–2 PCIe tunnels and supporting resources. |
| arch/arm64/boot/dts/apple/t6031-peripherals.dtsi | Repoints PIODMA references to the tunnel DARTs. |
| arch/arm64/boot/dts/apple/t6031-misc-interfaces.dtsi | Removes duplicate disabled DART nodes. |
Review effort: Balanced
|
Exact-head
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…562) Carries upstream PR aurora-silicon/linux#4014 (M3 Max ATC0/ATC1/ATC2 USB4 PCIe tunnels + 4-cell die-0 AIC MSI specifier support in pcie-apple, preserving Will Bunting's authorship from #498) onto integration/aurora-7.3 via tag carry-input/4014-92ad1cef3e33. Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approve at 33a87e888ec3 for the code. Please hold the merge for one more row: nothing has run this PR's device tree yet.
Hardware so far. The J516C run at this head booted the kernel with the installed boot.bin device tree, as its note says. That tree has no tunnel nodes, so the run shows internal PCIe still works, but neither the new DT nor the changed MSI branch ran. The bot's "Hardware row: ok" counts that line. Will's three-port run was on an older base, with a different driver patch and no power domain on the tunnel DARTs.
MSI parsing.
- I compiled the old and new branch from
pcie-apple.cside by side and ran 26 million combinations of SoC, cell count, type, die, flags, IRQ, base, count and ECAM through both. Every result for 2, 3 or 5 cells is the same, so T6030, T6040 and T8122 behave as before. The newly accepted ones are all 4-cell, die 0, type 0, edge-rising on thet8122-pciecdescription, and none of them on T6030. - A bad specifier is now refused before the slice is claimed (the old code claimed first in some of those cases).
- Die 1 is refused. T6034 needs nothing extra.
- No new SoC or board gate, and no AIC number in the driver.
Device tree. I compared all three tunnels with Apple's public 27.2.1 device trees (26B131) for J514c, J516c, J514m and J516m. Registers, controller and DART interrupts, ranges, the PCIe adapter windows, the MSI window (1854) and the bridge bases (32/64/96, 32 vectors each) all match, and the four boards agree, so T6034 is covered. The internal host owns only the first 32 vectors. ACIO's fourth domain is the ADT's ATCn_PCIE. The DART and oe-fabric tunables aren't in the public tree. They rest on the J516C's live ADT and equal T6030 tunnel 0's.
Run here, head on main 49fa570626f5 (clean; main hasn't touched these files since, and hosted DT checks, host tests and the Apple build all ended in startup_failure):
drivers/pci/controlleranddrivers/thunderbolt, W=1: 0 warnings before and after.- All T603x and T8122 DTBs, W=1: no new warnings.
CHECK_DTBSon all T603x: identical. DART power-domain check and sibling drift: 0 new. - Only J514C, J516C, J514M and J516M change: the three tunnels, the ACIO properties and the aliases. J575D, T6030 and T8122 are byte-identical.
pcie-apple-msi-slice,pciec-policy,cio-native,pcie-adopted-clkpm,t8132-usb4-policyandj613-usb4host tests pass.- Not run: the full host suite and a full Image build.
Rows owed, with this head's DTB booted on a T6031 or T6034 laptop:
- Boot with nothing attached: three tunnels in
/proc/device-tree, the loader-filledapple,tunable-rc/fabric/debugpresent, three ACIOs probed, Wi-Fi/Bluetooth/SD fine. - A Thunderbolt PCIe device on each of the three ports: it enumerates, its MSI counts rise under traffic, two ports at once, no
MSI sliceerror, DART fault or AER. - Unplug and replug three times, once in use, then one s2idle with the device attached.
A peer T8122 or T6040 Mac, or a T6030 Mac, with a Thunderbolt PCIe device gives the no-regression row for the shared branch. Boots without one don't reach it.
Not blocking:
- The dtsi says T6031 has no
cpuwindow. The ADT does have it (acio-cpuN,0x701100000,iop,mxwrap-acio, like T6030). The driver just doesn't use it on T6031. Worth rewording if the branch moves anyway. - Please drop the tool names and session ID from the PR body (rulebook rule 5).
- Land it with a merge commit, so Will's commit stays Will's.
It shares no file with #3640, and the two build together, so either can go first.
Summary
Upstreams Will Bunting's T6031 (M3 Max) USB4 PCIe tunnel bring-up (originally in omacom/linux-aurora#498) onto
aurora-silicon/linuxmain, adapted cleanly to currentmain's board-agnostict8122_pciec_hwMSI slice validator,t6031.dtsilayout, anddt-schema-clean Aura aliases:PCI: apple: accept 4-cell die-0 AIC MSI specifiers for PCIe-C slices(51e6f90):apple_pciec_msi_irq_index()indrivers/pci/controller/pcie-apple-t8122.haccepting 3-cell single-die<AIC_IRQ irq flags>and (when multi-die is permitted fort8122_pciec_hw) 4-cell die-0<AIC_IRQ 0 irq flags>specifiers, while keeping single-die T6030 and T6040 strict 3-cell and rejecting non-zero die, wrong type/flags, or malformed cell counts beforeapple_t8122_msi_claim().apple_t8122_msi_window()+apple_t8122_msi_claim()+apple_pciec_msi_slice()with zeroof_machine_is_compatible("apple,t6031")gating and zero hardcoded1854constants.tools/asahi/pcie-apple-msi-slice-tests.cwith T6031 slice shape (1854 + 32/64/96) and full specifier parsing tests.arm64: dts: apple: t6031: add ATC0, ATC1, and ATC2 USB4 PCIe tunnels(33a87e8, Author: Will Bunting):arch/arm64/boot/dts/apple/t6031-usb4.dtsi(modelled ont6030-usb4.dtsi/ #3640) describing ATC0/ATC1/ATC2 PCIe-C tunnel hosts (0x7/0xb/0xf), DARTs (power-domains = <&ps_atcN_cio_pcie>), ACIOpcie-adapterwindows +ps_atcN_pciepower domains +apple,pcie-tunnellinks, and 32-vector MSI slices (1886/1918/1950, bases32/64/96against internalpcie0's1854+32int6031-die0.dtsi).usb4-0-pcie,usb4-0-pcie-adapter, ..., supported byaura/src/kboot.clines 4089–4176; 0 newdt-validatewarnings across all five boards).t6031-usb4.dtsifromt6031.dtsiso all four single-die M3 Max MacBook Pro boards (J514C,J516C,J514M,J516M) inherit it while leaving multi-die T6032 (J575D) byte-identical.pciec{0,1,2}_dartnodes fromt6031-misc-interfaces.dtsiand repointsapciec{0,1,2}_piodmaint6031-peripherals.dtsito&usb4_{0,1,2}_pcie_dart, matching #3640.Credits & AI assistance
Original J516C ADT extraction, DTS, and physical Thunderbolt hardware testing by Will Bunting (omacom/linux-aurora#498, assisted by Claude). Ported to current
aurora-silicon/linuxmain(board-agnostic 4-cell helper,t6031.dtsiintegration, DART power domains, deduplicatedt6031-misc-interfaces.dtsi, hyphenated schema-clean aliases) and reviewed with Codex (01a238fc-90b7-73e0-bfd0-954c841322b0).Tested: Physical J516C (16-inch M3 Max, T6031) testing by Will Bunting across ATC0, ATC1, and ATC2 with a Universal Audio Apollo Twin X (TB3,
0001:03:00.0behind JHL6240,ua_apolloMSI self-test + 5-min audio capture/playback 0 xruns) and Ugreen TB5 dock (JHL9480 + Intel I226-V 2.5GbE + NVMe, 0 RX/TX/DART/AER errors); exact-head33a87e888ec3built clean (0drivers/pci/warnings,b1203-092433-0a58) and boot-verified onnaeems-m3-max(J516C,j1203-093545-b716,boot-healthPASS,pcie-apple/apple-dartclean, 0 PCIe/DART/TB/ACIO/AER errors — Tier-1 run keeps existingboot.binDTB);dt-validate2026.9 across J514C/J516C/J514M/J516M/J575D reports 0 new warnings (J575D byte-identical);pcie-apple-msi-slice-testsandj613-usb4host tests pass; Codex Round 2 review VERIFIED (01a238fc-90b7-73e0-bfd0-954c841322b0).Risk: two-way ·
drivers/pci/controller/pcie-apple{,-t8122.h}4-cell die-0 MSI specifier parsing andarch/arm64/boot/dts/apple/t6031*USB4 PCIe tunnel nodes