Skip to content

arm64: dts: apple, PCI: apple: enable T6031/T6034 USB4 PCIe tunnels (ATC0-2) - #4014

Open
maralcbr wants to merge 2 commits into
mainfrom
feat/t6031-usb4-pcie-tunnels
Open

maralcbr wants to merge 2 commits into
mainfrom
feat/t6031-usb4-pcie-tunnels

Conversation

@maralcbr

@maralcbr maralcbr commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upstreams Will Bunting's T6031 (M3 Max) USB4 PCIe tunnel bring-up (originally in omacom/linux-aurora#498) onto aurora-silicon/linux main, adapted cleanly to current main's board-agnostic t8122_pciec_hw MSI slice validator, t6031.dtsi layout, and dt-schema-clean Aura aliases:

  1. PCI: apple: accept 4-cell die-0 AIC MSI specifiers for PCIe-C slices (51e6f90):

    • Adds apple_pciec_msi_irq_index() in drivers/pci/controller/pcie-apple-t8122.h accepting 3-cell single-die <AIC_IRQ irq flags> and (when multi-die is permitted for t8122_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 before apple_t8122_msi_claim().
    • Reuses existing board-agnostic apple_t8122_msi_window() + apple_t8122_msi_claim() + apple_pciec_msi_slice() with zero of_machine_is_compatible("apple,t6031") gating and zero hardcoded 1854 constants.
    • Extends tools/asahi/pcie-apple-msi-slice-tests.c with T6031 slice shape (1854 + 32/64/96) and full specifier parsing tests.
  2. arm64: dts: apple: t6031: add ATC0, ATC1, and ATC2 USB4 PCIe tunnels (33a87e8, Author: Will Bunting):

    • Adds arch/arm64/boot/dts/apple/t6031-usb4.dtsi (modelled on t6030-usb4.dtsi / #3640) describing ATC0/ATC1/ATC2 PCIe-C tunnel hosts (0x7/0xb/0xf), DARTs (power-domains = <&ps_atcN_cio_pcie>), ACIO pcie-adapter windows + ps_atcN_pcie power domains + apple,pcie-tunnel links, and 32-vector MSI slices (1886/1918/1950, bases 32/64/96 against internal pcie0's 1854+32 in t6031-die0.dtsi).
    • Uses schema-valid hyphenated Aura aliases (usb4-0-pcie, usb4-0-pcie-adapter, ..., supported by aura/src/kboot.c lines 4089–4176; 0 new dt-validate warnings across all five boards).
    • Includes t6031-usb4.dtsi from t6031.dtsi so all four single-die M3 Max MacBook Pro boards (J514C, J516C, J514M, J516M) inherit it while leaving multi-die T6032 (J575D) byte-identical.
    • Removes duplicate disabled pciec{0,1,2}_dart nodes from t6031-misc-interfaces.dtsi and repoints apciec{0,1,2}_piodma in t6031-peripherals.dtsi to &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/linux main (board-agnostic 4-cell helper, t6031.dtsi integration, DART power domains, deduplicated t6031-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.0 behind JHL6240, ua_apollo MSI 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-head 33a87e888ec3 built clean (0 drivers/pci/ warnings, b1203-092433-0a58) and boot-verified on naeems-m3-max (J516C, j1203-093545-b716, boot-health PASS, pcie-apple/apple-dart clean, 0 PCIe/DART/TB/ACIO/AER errors — Tier-1 run keeps existing boot.bin DTB); dt-validate 2026.9 across J514C/J516C/J514M/J516M/J575D reports 0 new warnings (J575D byte-identical); pcie-apple-msi-slice-tests and j613-usb4 host 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 and arch/arm64/boot/dts/apple/t6031* USB4 PCIe tunnel nodes

maralcbr and others added 2 commits December 3, 2026 09:23
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@maralcbr

maralcbr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head 33a87e888ec3 build + J516C boot verification complete:

  • Build: b1203-092433-0a58 (7.3.0-lab33a87e88-cdee, 0 warnings in drivers/pci/)
  • Live J516C boot (naeems-m3-max, j1203-093545-b716): booted in 35s, boot-health PASS, verify-4014-t6031-usb4 PASS — internal pcie-apple 580000000.pcie (BCM4388 Wi-Fi/BT + GL9755 SD) and all 17 apple-dart instances probed cleanly with 0 PCIe/DART/Thunderbolt/ACIO/AER warnings or errors in dmesg.
  • Note: Tier-1 lab runs keep the host's installed boot.bin DTB, so physical TB3/TB5 tunnel enumeration across ATC0/ATC1/ATC2 relies on Will Bunting's J516C hardware run from omacom/linux-aurora#498 (Universal Audio Apollo Twin X TB3 + Ugreen TB5 dock JHL9480/I226-V/NVMe) and will also activate on packaged update-m1n1 / aura boots via the Omarchy edge carry.
  • Also noting that pull_request_target workflows (dt-checks, host-tests, apple-build, pr-readiness) are currently hitting repo-wide startup_failure across open PRs on aurora-silicon/linux; locally all dt-validate (5 boards, 0 new warnings, J575D byte-identical) and host tests (pcie-apple-msi-slice-tests, j613-usb4) pass on 33a87e888ec3.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 33a87e88: ready to merge

Check Detail
CI at head ok 7 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at 33a87e88
Conflicts ok none
PR text ok Risk: two-way · drivers/pci/controller/pcie-apple{,-t8122.h} 4-cell die-0 MSI specifier parsing and arch/arm64/boot/dts/apple/t6031 USB4 PCIe tunnel nodes

Areas: area:gpu, area:platform
Merge: gh pr merge 4014 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

maralcbr added a commit to omacom/linux-aurora that referenced this pull request Dec 2, 2026
…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 DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.c side 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 the t8122-pciec description, 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/controller and drivers/thunderbolt, W=1: 0 warnings before and after.
  • All T603x and T8122 DTBs, W=1: no new warnings. CHECK_DTBS on 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-policy and j613-usb4 host 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:

  1. Boot with nothing attached: three tunnels in /proc/device-tree, the loader-filled apple,tunable-rc/fabric/debug present, three ACIOs probed, Wi-Fi/Bluetooth/SD fine.
  2. A Thunderbolt PCIe device on each of the three ports: it enumerates, its MSI counts rise under traffic, two ports at once, no MSI slice error, DART fault or AER.
  3. 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 cpu window. 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.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants