Repository navigation
arm64: dts: apple: t6040: PCIe-C tunnels on every M4 Pro (on #2069) - #3512
Conversation
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, #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, #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]>
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]>
Signed-off-by: Ryan Murray <[email protected]> # Conflicts: # arch/arm64/boot/dts/apple/t6040.dtsi
The PCIe-C tunnels (apciec0-2 with dart-apciec0-2) are part of the T6040 and have no board wiring: the J614s, J616s and J773s ADTs all list the same three controllers and DARTs with identical tunables. Enable the tunnel, its DART and its controller in t6040-pciec.dtsi instead of in each board, and stop deleting the routers' apple,pcie-tunnel link on the J616s, which left an enclosure on any of its Thunderbolt ports without PCIe. Nothing comes up on its own: a controller is only populated when its USB4 router, which the board enables, asks for a PCIe tunnel. On boards whose routers are still off (J773s) the nodes stay idle. The J614s and T6041 DTBs are unchanged; the J616s and J616s tether DTBs gain the three tunnels. Signed-off-by: Ryan Murray <[email protected]>
There was a problem hiding this comment.
Verdict: FINISH, then merge at d20d264f
Blockers:
- Stacked on open
#2069: land after#2069merges (and wait for the 22 queued CI checks to finish green). - Missing live J616s Thunderbolt/PCIe-C enumeration row at
d20d264f(noted underNot yet:).
Checked:
- Top commit
d20d264f: cleanly eliminates per-board gating by placingstatus = "okay"inside sharedarch/arm64/boot/dts/apple/t6040-pciec.dtsi, dropping the redundant board-level enables fromt6040-j614s.dts(J614s and T6041 DTBs remain byte-identical to#2069), and removing/delete-property/ apple,pcie-tunnel;fromt6040-j616s.dts;dtbs_check0 warnings. - Checked for Apple material, tool attribution, private serials, and board gating: clean;
MERGEABLEonmain; humanSigned-off-bypresent.
Evidence
- Head:
d20d264f(base: main,mergeable: MERGEABLE,+112/-10across 5 files; top commit only on top of#2069).
Each PCIe-C DART sits in its port's ATC PCIe power domain. Now that the tunnels are enabled on every T6040 board, enable that domain with them, so a board that does not enable it itself (J773s) does not carry an enabled DART on a disabled domain. The J614s and J616s already enable these domains; their DTBs are unchanged. Signed-off-by: Ryan Murray <[email protected]>
|
dt-checks failed on the DART power-domain step: the three J773s tunnel DARTs were enabled on disabled |
There was a problem hiding this comment.
The shared T6040 macro now enables the supplying ATC PCIe domain alongside each tunnel and DART. This addresses the J773s disabled-domain finding without a board gate. The owner reports no changes to the previously exercised J614s and J616s DTBs across this revision. Keep hosted DT checks and verification of J773s tunnel operation as landing gates.
|
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: |
|
Code-owner heads-up for the 6-point rule: @aurora-silicon/omarchy-mac @aurora-silicon/aurora-maintainers, this is a DT-only PCIe-over-Thunderbolt change (Ryan's order: tunnels on in every Mac's DT). It has an App approval, hardware rows (see above) and local dt-checks with 0 new warnings. We plan to merge once CI is green and at least an hour has passed since this ping, unless someone objects here. Revert = revert the PR's commits. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J614s hardware row at MacBook Pro 14" M4 Pro (J614s, Compared with this unit's normal boot (#2069 build, same displays and cables) using the same check script:
RESULTSVERDICT: pass on J614s. The PCIe-C tunnel with the Studio Display enumerates and binds at this head exactly as on #2069; no new error lines from the PCIe-C or tunnel DART paths. |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
arm64: dts: apple: t604x: enable ADT-present peripherals and move tunnel PIODMA (on #3512)
What: Turns the PCIe-C tunnels (apciec0-2 and their DARTs) on for every M4 Pro (T6040) board. Until now the J616s deleted its routers'
apple,pcie-tunnellink ("No PCIe tunnels yet"), so a Thunderbolt enclosure on any of its ports never enumerated. The tunnels are SoC blocks with no board wiring: the J614s, J616s and J773s ADTs list the same three controllers and DARTs with the same tunables. Sot6040-pciec.dtsinow enables them and boards no longer have to. Stacked on #2069: review only the top commitd20d264f.Tested: DTB comparison: the J614s and T6041 DTBs are identical to #2069's, and the J616s and J616s tether DTBs are identical to the J616s one-shot (main + #2069 + J616s enable) that our lab boots for the RX 7900 XTX TB5 enclosure row. dtbs_check: 0 warnings at main and at this head (J614s, J616s, J616s tether, J773s).
Risk: two-way door · T6040 only. Nothing comes up on its own: the USB4 router driver populates a tunnel only when a PCIe tunnel is requested, and only where the board enables that router (the J773s routers are still off, so its nodes stay idle). Revert = revert the one commit.
Not yet: J616s enumeration row with the TB5 enclosure at this head. It will be posted here.
Details
t6040-pciec.dtsi: theT6040_PCIEC(n)macro also setsstatus = "okay"onusb4_N_pcie_tunnel,apciecN_dartandusb4_N_pcie.t6040-j614s.dts: drops its nine now-redundant enables. Its DTB is unchanged.t6040-j616s.dts: drops the three/delete-property/ apple,pcie-tunneland the "No PCIe tunnels yet" comment. The ATC PCIe power domains were already enabled there.arch/arm64/boot/dts/apple/adt-coverage/t6040-j616s.txtlines 96-166 map/arm-io/apciec0-2anddart-apciec0-2. The J616s-vs-J614s tunable comparison is in J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) #2069 (comment) thread.