Repository navigation
J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) - #2069
Conversation
82219c7 to
35a6e91
Compare
5d0f77c to
b19f247
Compare
|
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 ( We can run Thunderbolt and PCIe no-regression rows on our M1 Pro, M2, M4 Pro and A18 Pro once #2068 settles. |
|
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. |
b19f247 to
ead9c21
Compare
|
On integration/aurora 110861f, 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). |
ead9c21 to
6672422
Compare
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]>
6672422 to
0c6814f
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
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.
(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 I don't have a J616s ADT, so yes please, posting its values would help. The ones to compare, for
If they match, I'll move the block into a shared I'll check that the refactored J614s DTB compiles to the same result as at |
|
J616s (M4 Pro, T6040) ADT, compared with
apciec1 and apciec2 equal apciec0 for every list. So the whole block can move to a shared |
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]>
|
Hardware row at Mac: The change only touches DTS files: the
|
|
Verdict at |
There was a problem hiding this comment.
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.
Signed-off-by: Ryan Murray <[email protected]> # Conflicts: # arch/arm64/boot/dts/apple/t6040.dtsi
|
Merged dtbs_check (dtschema 2026.x) on J614s, J616s, J616s tether and J773s gives 0 warnings at both main and 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 |
There was a problem hiding this comment.
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
cbf6a5afagainstmain(844781f1): resolves only thearch/arm64/boot/dts/apple/t6040.dtsiinclusion 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 testedf5299c07head. drivers/pci/controller/pcie-apple.c:t6040_pciec_hwswitches 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-EBUSYon shared SID 0 downstream devices.arch/arm64/boot/dts/apple/t6040-pciec.dtsi: shared SoC description included fromt6040.dtsiwith nodes disabled by default and enabled ont6040-j614s.dts. Provenance of theapple,dma-range,apple,bypass-sids, andapple,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-byon 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 currentlyQUEUED; land once green.
|
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
Not covered here: a display picture on the eGPU (an amdgpu DMUB issue when GDM releases its outputs, followed up separately). Lab evidence: |
|
J616s row: an RX 7900 XTX in a Thunderbolt 5 eGPU enclosure works over PCIe-C on the M4 Pro (left front port) Kernel:
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 ( EvidenceLab trace |
|
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
Lab evidence: |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
…oard arm64: dts: apple: t6040: PCIe-C tunnels on every M4 Pro (on #2069)
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
Imageand 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_hwmatch data only takes effect where anapple,t6040-pciecnode 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.t6040_pciec_hwwas modelled on T8132, but the ADT'sapciec,t6040has nooe-fabricregion, 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. Withiommu-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.apple,pciec-kernel-init, plus the controller, port and DART description from the J614s ADT (apciec0/dart-apciec0), andapple,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 (xHCICommand Abortedon every device) and the DART fault IRQ stormed. Full error reporting, CTC flush and the ATC0 PCIe power domain are as on T6050.apciec0-2anddart-apciec0-2are identical, so the description moves tot6040-j614s-pciec.dtsi(oneJ614S_PCIEC(n)template for ports 0, 1 and 2). Port 0 is unchanged.apciec0-2/dart-apciec0-2values as the J614s, so they are T6040 SoC data: the template moves tot6040-pciec.dtsi, included byt6040.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
f5299c07fecbis linked above): head0c6814f0c1a2, unmodified, with the fleet configuration of theaurora-nightlyrelease (config-7.3.0-aurora-nightly, fromb14959b819cf; onlyLOCALVERSION=-pr2069and toolchain-detected symbols differ), LLVM/clang 23.1.5, Rust 1.100.0, bindgen 0.73.2 withtools/aurora-bindgen. Kernel7.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.106b:1018, Titan Ridge8086:15ef, xHCI8086:15f0+xhci_hcd05ac:101d/05ac:101e(10 Gb/s), display05ac:1114uvcvideo, MJPEG 1920x1080 frame)381ac0000.cio, tunnel 0389ac0000.cio, tunnel 1391ac0000.cio, tunnel 2Command Aborted, no DART fault, no PCIe-C errors (only the usual unassignable I/O bridge windows andof_irq_parse_pci: failed with rc=-22on the Titan Ridge's unused downstream bridge0001:02:04.0).7.3.0-aurora-nightly(same Mac, display attached): no PCIe-C root port, no display xHCI, no hubs, audio card or camera.