Skip to content

J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) - #2069

Merged
RyanTheTide merged 5 commits into
aurora-silicon:mainfrom
petrskuta:pr/j614s-studio-display-usb
Nov 28, 2026
Merged

RyanTheTide merged 5 commits into
aurora-silicon:mainfrom
petrskuta:pr/j614s-studio-display-usb

Conversation

@petrskuta

@petrskuta petrskuta commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What: Tunneled PCIe (PCIe-C) on all three Thunderbolt ports of the J614s (T6040), so a Studio Display's USB hubs, speakers, microphones, camera and USB-C port work. Findings in #1589.
Tested: J614s M4 Pro at f5299c0 (row; same Image and J614s DTB as 0c6814f, whose full evidence is below): Studio Display (2022) on each of the three Thunderbolt ports (hotplug), USB2/USB3 hubs, speakers, microphone, camera, the display's USB-C port (USB 3 drive at 5 Gb/s) and s2idle resume: pass.
Risk: two-way door · J614s (M4 Pro) only. The t6040_pciec_hw match data only takes effect where an apple,t6040-pciec node is enabled, and only the J614s enables one (the other T6040 boards carry the shared PCIe-C description on nodes that stay disabled); a broken PCIe-C bring-up would cost the Studio Display's USB side, not the picture (#2068) or the Mac's own USB.
Not yet: nothing

Details

#2068 is merged, so this is four commits on main.

  1. PCI: apple: T6040 PCIe-C is an Intr2AXI controller. t6040_pciec_hw was modelled on T8132, but the ADT's apciec,t6040 has no oe-fabric region, so kernel_init cold init failed (-ENODATA). It now takes the T6050 path: tunnel_intr2axi, no_port_reset, and RID2SID slots allocated rather than indexed by SID. With iommu-map-mask = <0xff> the xHCI (RID 0x300) and the display's bridge (RID 0x100) share SID 0, and the indexed slot failed the xHCI's enable with a silent -EBUSY.
  2. arm64: dts: apple: t6040-j614s: PCIe-C on the left Thunderbolt port. Enables the tunnel, DART and controller with apple,pciec-kernel-init, plus the controller, port and DART description from the J614s ADT (apciec0 / dart-apciec0), and apple,bypass-sids = <253 255> as on T6050's PCIe-C DART: the port's own writes and its MSIs use those streams. Without the bypass no MSI arrived (xHCI Command Aborted on every device) and the DART fault IRQ stormed. Full error reporting, CTC flush and the ATC0 PCIe power domain are as on T6050.
  3. arm64: dts: apple: t6040-j614s: PCIe-C on all three Thunderbolt ports. The ADT's apciec0-2 and dart-apciec0-2 are identical, so the description moves to t6040-j614s-pciec.dtsi (one J614S_PCIEC(n) template for ports 0, 1 and 2). Port 0 is unchanged.
  4. arm64: dts: apple: t6040: share the PCIe-C description between boards. The J616s ADT carries the same apciec0-2 / dart-apciec0-2 values as the J614s, so they are T6040 SoC data: the template moves to t6040-pciec.dtsi, included by t6040.dtsi, and a board only enables the tunnel, DART and controller of each port. The J614s DTB is unchanged.
Evidence

Build (for this table; the row at f5299c07fecb is linked above): head 0c6814f0c1a2, unmodified, with the fleet configuration of the aurora-nightly release (config-7.3.0-aurora-nightly, from b14959b819cf; only LOCALVERSION=-pr2069 and toolchain-detected symbols differ), LLVM/clang 23.1.5, Rust 1.100.0, bindgen 0.73.2 with tools/aurora-bindgen. Kernel 7.3.0-pr2069+, DTBs through a committed Stage 2 trial. MacBook Pro 14" M4 Pro (apple,j614s apple,t6040), os-fw 26.6.2, system-fw 27.2, KDE Plasma. 2026-11-27.

Port ACIO / tunnel PCIe-C cold init Root port 106b:1018, Titan Ridge 8086:15ef, xHCI 8086:15f0 + xhci_hcd Hubs 05ac:101d / 05ac:101e (10 Gb/s), display 05ac:1114 Audio card, mic 3 s recording Camera (uvcvideo, MJPEG 1920x1080 frame)
Left, near MagSafe 381ac0000.cio, tunnel 0 status 0x3, link up pass pass pass pass
Left, rear 389ac0000.cio, tunnel 1 status 0x3, link up pass pass pass pass
Right 391ac0000.cio, tunnel 2 status 0x3, link up pass pass pass pass
  • Speakers: tone played to the Studio Display sink (PipeWire), heard: pass.
  • Display USB-C port: USB 3 drive enumerated at 5 Gb/s behind the USB3 Gen2 hub, partitions read; a USB keyboard on the display's USB2 hub works: pass.
  • s2idle with the display on the right port: suspend entry and exit, then the xHCI, hubs, keyboard, drive, audio card, microphone and camera all back: pass.
  • Kernel log over all hotplugs and the resume: no Command Aborted, no DART fault, no PCIe-C errors (only the usual unassignable I/O bridge windows and of_irq_parse_pci: failed with rc=-22 on the Titan Ridge's unused downstream bridge 0001:02:04.0).
  • Baseline on 7.3.0-aurora-nightly (same Mac, display attached): no PCIe-C root port, no display xHCI, no hubs, audio card or camera.

@petrskuta
petrskuta force-pushed the pr/j614s-studio-display-usb branch from 82219c7 to 35a6e91 Compare November 16, 2026 09:39
@petrskuta petrskuta changed the title J614s: PCIe-C on the left Thunderbolt port (Studio Display USB, audio, camera) J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) Nov 16, 2026
@petrskuta
petrskuta force-pushed the pr/j614s-studio-display-usb branch from 5d0f77c to b19f247 Compare November 16, 2026 12:59
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for getting tunneled PCIe working on the M4 Pro. Moving T6040 onto the Intr2AXI match data, with the comment explaining why, is the approach we prefer.

Since this is stacked on #2068, the diff also carries that PR's per-SoC pixel-clock selection (drivers/gpu/drm/apple/dcp-fabric.c:459-463), the per-chip apple_t6040_dp_tunnel_rate() symbol, and the T6040-only tmu_hifi_bi (drivers/thunderbolt/apple.c:255). We select behaviour by a hardware property rather than by the list of machines it was tested on, so those are best sorted out in #2068 (see the note there). The three commits new in this PR look fine on that front.

We can run Thunderbolt and PCIe no-regression rows on our M1 Pro, M2, M4 Pro and A18 Pro once #2068 settles.

@RyanTheTide

Copy link
Copy Markdown
Contributor

dcp_fabric_t6040_tunnel_clock() in dcp-fabric.c decides whether apple_t6040_dp_tunnel_rate() drives the tunnel and whether dcp_tunnel_prepare() skips apple_atc_dp_tunnel_open(), and it decides this with of_machine_is_compatible("apple,t6040"/"apple,t6041"). Which clock feeds DP IN 0/1 is a property of the ATC PHY behind the route. It should come from that PHY's compatible or match data, or from a property on the DCP or route node, not from the machine compatible. Until then this should stay a draft.

@RyanTheTide

Copy link
Copy Markdown
Contributor

On integration/aurora 110861f, t6040_pciec_hw is still modelled on T8132 and the J614s has no PCIe-C nodes, so this is still needed. The branch applies cleanly to 110861f. It is stacked on #2068, which is still open. The three commits new here look fine, but they can only land after #2068, which first needs its tunnel clock selection (dcp_fabric_t6040_tunnel_clock()) taken from the ATC PHY's match data or a DT property instead of the machine compatible.

Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches; CHECK_DTBS over the 138 Apple DTBs this change rebuilds: no new warnings against the tip. Host tests (tools/asahi/run-host-tests.py --only) on 110861f plus this change: apple-dcp passes (1/1); t6030-clock-tests passes (1/1).

t6040_pciec_hw was modelled on T8132: the kernel_init (oe-fabric) cold
init, the T8132 port reset values and SID-indexed RID2SID slots. The
ADT's apciec,t6040 has no oe-fabric region (config, rc, port0, fabric,
debug, ioa, ltssm, intr2axi), so cold init failed mapping it (-ENODATA).
Its fabric, rc, debug, config and DART tunables are T6050's with small
value differences.

Make it an Intr2AXI controller with T6050's no_port_reset, and allocate
RID2SID slots as T6050 does: with iommu-map-mask 0xff the Studio
Display's xHCI (RID 0x300) and its Thunderbolt bridge (RID 0x100) share
SID 0, and an SID-indexed slot failed the xHCI's enable with a silent
-EBUSY ("Can't enable PCI device, BIOS handoff failed").

Tested on the J614s with a Studio Display (2022) on the left port: cold
init completes (link up), the display's Titan Ridge bridges and xHCI
enumerate and xhci_hcd binds, aurora-silicon#1589.

Signed-off-by: Petr Škuta <[email protected]>
Enable the left port's tunneled PCIe (usb4_0_pcie_tunnel, apciec0_dart,
usb4_0_pcie) and keep the ACIO's apple,pcie-tunnel, so a Thunderbolt
device's PCIe functions reach a root port. No boot loader hands the port
over, so the kernel cold-initializes it (apple,pciec-kernel-init).

From the j614s ADT (macOS 26 IODeviceTree) apciec0 and dart-apciec0:
- the controller's fabric, rc and debug tunables and the port's config
  tunables;
- the DART's tunables and its DMA window: vm-base 1 TiB + 2 GiB, vm-size
  0x7ff00000, the first 16 KiB a dead mapping;
- bypass streams 253 and 255 (bypass-253, bypass-255): the port's own
  writes, its MSIs turned into AIC writes, use them. Without the bypass
  no MSI arrived (xHCI "Command Aborted") and the DART fault IRQ stormed.
As on T6050's PCIe-C DART: full error reporting, CTC flush and the ATC0
PCIe power domain.

Tested on the J614s with a Studio Display (2022): its USB2 and USB3 Gen2
hubs, speakers and microphones (snd-usb-audio), camera (uvcvideo), HID
and a USB-C port (a USB 3.1 drive at 5 Gb/s) work,
aurora-silicon#1589.

Signed-off-by: Petr Škuta <[email protected]>
The ADT's apciec0-2 and dart-apciec0-2 carry identical tunables, DMA
windows and bypass streams, so describe the PCIe-C of the left port once
in t6040-j614s-pciec.dtsi and use it for all three ports. Port 0 is
unchanged; ports 1 and 2 keep their ACIO's apple,pcie-tunnel now.

Signed-off-by: Petr Škuta <[email protected]>
@petrskuta
petrskuta force-pushed the pr/j614s-studio-display-usb branch from 6672422 to 0c6814f Compare November 25, 2026 06:03
@petrskuta
petrskuta marked this pull request as ready for review November 25, 2026 06:03
@petrskuta
petrskuta requested review from a team as code owners November 25, 2026 06:03
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions github-actions Bot removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 27, 2026

@RyanTheTide RyanTheTide 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.

Verdict at 0c6814f0: one question before merge (not a code blocker).

The earlier gate/duplication finding is gone: #2068 merged and this PR no longer touches dcp-fabric.c or thunderbolt/apple.c. The pcie-apple.c change is match data with a hardware reason, which is fine.

Question: t6040-j614s-pciec.dtsi carries the apciec0-2 DART window, the bypass SIDs and the controller/fabric/port tunables from the J614s ADT. These look like T6040 SoC data rather than J614s board data, and the J616s (also T6040) has the same three ports. Our rules put SoC data in the shared dtsi (t6040.dtsi or a t6040-pciec.dtsi), with each board only enabling its ports. That way the J616s, and any other T6040 board, gets it by enabling the nodes.

Could you check whether the J616s ADT values match? If they do, please move the block to a shared T6040 file. If some values differ per board, a one-line note saying which ones keeps it as is. We can post the J616s ADT values here if that helps.

@petrskuta

Copy link
Copy Markdown
Contributor Author

Question: t6040-j614s-pciec.dtsi carries the apciec0-2 DART window, the bypass SIDs and the controller/fabric/port tunables from the J614s ADT. These look like T6040 SoC data rather than J614s board data […]

(Reply to this review.)

Thanks. Agreed, these look like T6040 SoC data, not J614s board data. On T6050 the J714s and J716c carry identical PCIe-C fabric, RC and port tunables, and T6040's fabric values differ from T6050's (e.g. fabric 0x18 is 0xff/0xe0 here vs 0x1ff/0x1e0). So they follow the SoC, not the board.

I don't have a J616s ADT, so yes please, posting its values would help. The ones to compare, for apciec0-2 and dart-apciec0-2:

  • DART: vm-base / vm-size (J614s: 1 TiB + 2 GiB, 0x7ff00000, first 16 KiB a dead mapping), the bypass-253 / bypass-255 flags, and the DART tunables
  • controller: the debug, rc and fabric tunables
  • port: the config tunables

If they match, I'll move the block into a shared t6040-pciec.dtsi next to t6040-usb4.dtsi, and t6040-j614s.dts will only enable the three ports. If any differ, those stay in the board file with a one-line note saying which ones and why.

I'll check that the refactored J614s DTB compiles to the same result as at 0c6814f0, so behaviour on the J614s doesn't change.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (M4 Pro, T6040) ADT, compared with t6040-j614s-pciec.dtsi at 0c6814f0 by decoding the tunable records (offset, mask, value): everything matches, on all three ports.

J616s ADT vs J614s dtsi
dart-apciec0-2 window vm-base 1101659111424 (1 TiB + 2 GiB), vm-size 0x7ff00000, dead mapping [0x0, 0x4000] same
dart-apciec0-2 bypass bypass-253, bypass-255 present same
dart-tunables-instance-0 6 records identical
atc-apcie-debug-tunables 1 record identical
atc-apcie-rc-tunables 4 records identical
atc-apcie-fabric-tunables 35 records (incl. 0x18 0xff 0xe0) identical
apcie-config-tunables (port) <0x140 0x1 0x1>, <0x2a0 0x7e 0xa>, <0x1090 0x1 0x0> identical

apciec1 and apciec2 equal apciec0 for every list. So the whole block can move to a shared t6040-pciec.dtsi, with t6040-j614s.dts (and later the J616s) only enabling the three ports.

The PCIe-C DART window, bypass streams and the DART, controller and
port tunables are T6040 SoC data: the J616s ADT carries the same values
as the J614s for apciec0-2 and dart-apciec0-2. Move them from
t6040-j614s-pciec.dtsi to t6040-pciec.dtsi, included by t6040.dtsi, so
a T6040 board only enables the tunnel, DART and controller of each port.

The J614s DTB is unchanged. Other T6040 boards gain the properties on
nodes that stay disabled.

Signed-off-by: Petr Škuta <[email protected]>
@petrskuta

Copy link
Copy Markdown
Contributor Author

Hardware row at f5299c07f (head; adds arm64: dts: apple: t6040: share the PCIe-C description between boards on top of 0c6814f0): pass.

Mac: T6040 / J614s (MacBook Pro 14" M4 Pro), os-fw 26.6.2, system-fw 27.2, KDE Plasma. Build: f5299c07f, same configuration and toolchain as the row at 0c6814f0 (config-7.3.0-aurora-nightly with LOCALVERSION=-pr2069, LLVM/clang 23.1.5, Rust 1.100.0, bindgen 0.73.2 with tools/aurora-bindgen). Kernel 7.3.0-pr2069+, default command line. 2026-11-27.

The change only touches DTS files: the Image at f5299c07f is byte-identical to 0c6814f0's (same SHA-256), and the decompiled t6040-j614s.dtb is identical to 0c6814f0's. The J616s, J616s-tether and J773s DTBs only gain the PCIe-C properties, on nodes that stay disabled.

Port ACIO / tunnel PCIe-C Root port 106b:1018, Titan Ridge 8086:15ef, xHCI 8086:15f0 + xhci_hcd Hubs 05ac:101d / 05ac:101e (10 Gb/s), display 05ac:1114 Audio card Camera (uvcvideo)
Left, near MagSafe (at boot) 381ac0000.cio, tunnel 0 up pass pass pass pass
Left, rear (hotplug) 389ac0000.cio, tunnel 1 populated after tunnel enable pass pass pass pass
Right (hotplug) 391ac0000.cio, tunnel 2 populated after tunnel enable pass pass pass pass
  • Right port: microphone recording (peak −7 dB), MJPEG 1920x1080 camera frame, tone played to the Studio Display sink and heard: pass.
  • USB keyboard on the display's USB2 hub and a USB 3 drive at 5 Gb/s on its USB3 Gen2 hub: present on every port.
  • s2idle with the display on the right port: suspend entry and exit; xHCI, hubs, display, keyboard, drive, audio card, microphone (recording, peak −20 dB) and camera (frame) all back: pass.
  • Kernel log over the boot, both hotplugs and the resume: no Command Aborted, no DART fault, no PCIe-C errors. Also present, all unchanged from 0c6814f0: the unassignable I/O bridge windows, of_irq_parse_pci: failed with rc=-22 on the Titan Ridge's unused downstream bridge (0001:02:04.0), and hid_sensor_rotation probe -22 on the display's rotation sensor. The DCP updateFrequencies EDT ERROR, pmu ram read error and IOAVVideoInterface open failed messages also occur on 7.3.0-aurora-nightly without this PR.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Verdict at f5299c07: merge after one main merge. The refactor moves the block unchanged (DART window, bypass SIDs, DART/debug/rc/fabric/port tunables) into t6040-pciec.dtsi included from t6040.dtsi, with nodes disabled there and the J614s enabling its three ports. Your row at this head shows the J614s DTB identical to 0c6814f0's, and other T6040 boards gain only disabled nodes. The branch now conflicts with main, though, and the push cleared the approval. Please merge main in with one normal push. I'll approve at that head and merge once CI is green; the row carries if these DTS files and pcie-apple.c stay byte-identical.

@aurora-silicon-review aurora-silicon-review Bot 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.

I rebuilt six DTBs before and after the refactor. J614s is byte-identical and all three newly described PCIe-C controller nodes are disabled on J616s, J616s tether and J773s. Both T6041 controls are byte-identical. This supports carrying the existing J614s hardware evidence if the conflict resolution preserves the resulting DTB and driver. Before landing, please resolve the main conflict with a normal forward merge and clarify provenance for the literal register tuning arrays newly added by the full PR. Matching ADT wiring supports sharing the topology. For any Apple-derived tuning values, use machine-provided data at boot and keep the raw tuning private. If the literals are public-clean, cite their independently measured or documented origin. Recheck CI and the DTBs at the resulting head.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 27, 2026
Signed-off-by: Ryan Murray <[email protected]>

# Conflicts:
#	arch/arm64/boot/dts/apple/t6040.dtsi
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merged main (844781f) into the branch as cbf6a5af: a plain merge commit, no force push. The only conflict was in t6040.dtsi, where main's SIO block and this PR's #include "t6040-pciec.dtsi" touch the same spot; both are kept. The PR's four changed files have the same blobs as at f5299c07 (t6040-j614s.dts, t6040-pciec.dtsi, t6040.dtsi, pcie-apple.c), so @petrskuta's J614s row at f5299c07 still covers them byte for byte.

dtbs_check (dtschema 2026.x) on J614s, J616s, J616s tether and J773s gives 0 warnings at both main and cbf6a5af.

Still to run: a J616s (M4 Pro) row. Our lab is booting a one-shot kernel built from main + exactly these four blobs with the RX 7900 XTX TB5 enclosure. The follow-up that turns the tunnels on for every T6040 board (J616s included) will be a separate PR stacked on this one.

@DjDeveloperr, a heads-up since this touches pcie-apple.c (the t6040_pciec_hw match data only): we plan to merge under the 6-point rule once the J616s row and a non-author review are in at this head.

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at cbf6a5af

Blockers: none (wait for the 22 queued CI checks to finish green and a second-family regression check before landing).

Checked:

  • Verified forward-merge commit cbf6a5af against main (844781f1): resolves only the arch/arm64/boot/dts/apple/t6040.dtsi inclusion context alongside the SIO block, preserving identical blobs across all four changed files (t6040-j614s.dts, t6040-pciec.dtsi, t6040.dtsi, drivers/pci/controller/pcie-apple.c) from the tested f5299c07 head.
  • drivers/pci/controller/pcie-apple.c: t6040_pciec_hw switches to .tunnel_intr2axi = true / .no_port_reset = true (allocating RID2SID slots rather than indexing by SID), matching T6040's Intr2AXI PCIe-C block and avoiding -EBUSY on shared SID 0 downstream devices.
  • arch/arm64/boot/dts/apple/t6040-pciec.dtsi: shared SoC description included from t6040.dtsi with nodes disabled by default and enabled on t6040-j614s.dts. Provenance of the apple,dma-range, apple,bypass-sids, and apple,tunable* properties is documented directly as hardware facts from the macOS 26 IODeviceTree ADT (cross-checked against J616s ADT, matching the existing T6050/T8132 DT convention).
  • Hardware row: J614s M4 Pro exact-blob row PASS at f5299c07f (Studio Display USB/audio/camera working); non-J614s T6040 DTBs keep all three PCIe-C nodes disabled and T6041 DTBs are byte-identical.
  • Checked for Apple copyrighted material, AI attribution, private serials, and board/SoC gates: clean; human Signed-off-by on every commit.
Evidence
  • Head: cbf6a5afd1a3 (base: main, mergeable: MERGEABLE, 5 commits).
  • All 22 CI checks (apple-build, dt-checks, host-tests, kunit, pr-text, readiness, KUnit suites) are currently QUEUED; land once green.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (M4 Pro) hardware row: pass. A Thunderbolt 5 PCIe enclosure enumerates and binds through this PR's PCIe-C description.

Kernel: a one-shot built from main 844781f plus exactly this PR's changed-file blobs (byte-identical to #2069 at cbf6a5af). The J616s DTB is byte-identical (sorted decompile) to #3512. It also carries #2301 (the Gen4 cable word for T6040 routers, a separate draft). Without #2301 the router trains at Gen3 and the enclosure never gets a USB4 link, so there's no PCIe tunnel to test; that's a router-side issue, not this PR's.

  • Enclosure: an RX 7900 XTX (Navi 31) in a TB5 dock on the left-front port.
  • Gen4 training completed, TBT5 2x40 Gb/s. The PCIe-C tunnel on that port cold-initialized, linked up and enumerated the card at 0001:05:00.0, and the main-branch amdgpu bound (PSP/SMU OK, DCN 3.2, 24 GB VRAM, MSIs working).
  • Tunnel DMA (amdgpu SDMA benchmark): host→VRAM 48.2 Gb/s, VRAM→host 49.6 Gb/s, about 76% of PCIe 4.0 x4.
  • vkmark on the 7900 XTX: 20954.
  • With no device plugged, the other two tunnels stay idle, and all three routers bind with their apple,pcie-tunnel links.

Not covered here: a display picture on the eGPU (an amdgpu DMUB issue when GDM releases its outputs, followed up separately). Lab evidence: traces/gpu/20261128-j616s-egpu/.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s row: an RX 7900 XTX in a Thunderbolt 5 eGPU enclosure works over PCIe-C on the M4 Pro (left front port)

Kernel: main 844781f + #2069 (the T6040 PCIe-C driver and shared DT) + #3512's J616s DT change (byte-identical J616s DTB) + #2301 (USB4 Gen4 cable word), on the J616s fleet configuration and the default command line. The DTB was loaded as a one-shot Stage 2 trial. MacBook Pro 14" M4 Pro (J616s), AOOSTAR EG02 (Intel JHL9480, TB5) with a Sapphire RX 7900 XTX, 2026-11-28/29.

  • Without thunderbolt: apple: request USB4 Gen4 wherever the host router has it (T6040/T6041 TB5) #2301 the link never forms. The router gets the 20 Gb/s cable word (0x13), sends no Gen4 broadcast and logs SBX disconnected!, then goes Dead End and restarts. That happened 3 of 3 times, and the enclosure only showed up as USB2. The host router's lane adapters do advertise Gen4 (LANE_ADP_CS_0 supported speeds 0xe).
  • With thunderbolt: apple: request USB4 Gen4 wherever the host router has it (T6040/T6041 TB5) #2301: the cable word is 0x803, Gen4 trains, and the enclosure comes up as TBT5 at 2 x 40 Gb/s. PCIe-C tunnel 1 cold-initializes and links up. The JHL9480, the Navi switch and the 7900 XTX enumerate at 0001:05:00.0. BAR0 is 256 MB: there is no room for the 32 GB resizable BAR, so it falls back to 256 MB. MSI works.
  • amdgpu from main binds: PSP 13.0.0, SMU 13.0.0, DCN 3.2 + DMUB, 24 GB VRAM. radeonsi's clear readback is exact, and RADV NAVI31 works.
  • PCIe throughput through the tunnel (amdgpu SDMA benchmark, 1024 x 64 MiB): host to VRAM 48.2 Gb/s (6.03 GB/s), VRAM to host 49.6 Gb/s (6.20 GB/s).
  • Benchmarks at 1920x1080: vkmark gives 20954 on the 7900 XTX and 14115 on the M4 Pro's own GPU. glmark2 (GL) gives 7950 on the 7900 XTX and 15046 on the M4 Pro. GL shows a flat ~0.1 ms per-frame floor; see Not yet.
  • Display: the 7900 XTX's HDMI drives Weston. FurMark GL 1920x1080 ran fullscreen for 150 s at avg 338 FPS (min 282), 100 % GPU, about 340 W, junction 85 C. The capture card recorded the HDMI output.
  • Over the whole session: no Gen4 link errors, no DART faults, no PCIe-C errors.

Not yet: s2idle and a bound hot-unplug with the eGPU on this Mac. The GL per-frame latency floor needs a look (Vulkan is unaffected). Stopping GDM while mutter drove the eGPU outputs left DMUB failing (Error queueing DMUB command), and loading amdgpu after GDM was stopped avoided it. That is a display-stack follow-up, not this PR.

Evidence

Lab trace traces/gpu/20261128-j616s-egpu/ (README): plug logs before and after #2301, enumeration, bind, benchmarks, throughput, the HDMI capture frames and clip. The Mac was restored to its saved default afterwards: saved kernel booted, no one-shot pending, SELinux enforcing, 0 failed units, boot images unchanged.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Second-family regression row (J316s, M1 Pro, T6000): pass. The same kernel used for the J616s row (main 844781f + this PR's exact blobs, fleet89 config) was booted as a one-shot on the J316s with its normal fleet DTB, so #2069's pcie-apple.c ran on another family.

  • Kernel 7.3.0-aurora-tbpcie1+: Enforcing, 0 failed units. The fleet smoke row (display, input, net, audio sink, GPU render) passed. All 3 USB4 routers bound with their tunnel links, and the internal PCIe (Wi-Fi/BT) came up.
  • Kernel error lines: 0 on the production boot, 3 on the trial boot, neither from this PR. bpf-restrict-fs: Failed to load BPF object happens because the test kernel was built without BTF. brcmfmac ... ring 4: r_ptr 0 outside depth 0 is main's 11-23 ring-pointer check firing intermittently: it also appears on a J713 fleet85 boot without this PR. J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) #2069 only changes the T6040 PCIe-C match data.
  • Restored and verified: saved fleet89, empty next_entry, Enforcing, 0 failed units, test kernel removed.

Lab evidence: traces/usb/20261128-dt-complete-tunnels/m1pro-regress-tbpcie1/.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at cbf6a5af. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J614s+J616s-eGPU+J316s-regression. (5) There's no blocking review. (6) Dj was pinged here 630 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 37a9d68 into aurora-silicon:main Nov 28, 2026
23 checks passed
RyanTheTide added a commit that referenced this pull request Nov 28, 2026
…oard

arm64: dts: apple: t6040: PCIe-C tunnels on every M4 Pro (on #2069)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants