Repository navigation
thunderbolt: apple: Enable stable T6050 DisplayPort tunnel handoff - #1271
Conversation
3a3515a to
597d90d
Compare
a56dc70 to
0f9b7b7
Compare
597d90d to
0881b67
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Tested on the M5 Pro: thunderbolt and thunderbolt_apple load cleanly with this change. J714s's ATC2 router (enabled by t6050-max.dtsi) gets its mailbox but defers, because J714s has no board ports or DROM yet; it fails quietly, with no oops. Tunnels weren't exercised (nothing attached). apple-dpin-lifecycle passes in KUnit.
Setup. 14-inch M5 Pro (J714sAP, T6050, macOS 27.0 firmware). RAM boot through aura of #1273's head (the whole stack on ewb/j716c-usb4-public-base), plus our M5 Pro GPU commit, plus #1308. #1308 is needed because the base doesn't build t6050-j714s.dtb; see there. The kit DT is the J714s one compiled on this tree. Modules: nvme, display, smc, input, gpu and usb4 (mux-apple-display-crossbar, phy-apple-dptx, atc-t6050-dp, dwc3-apple, sn201202x, thunderbolt, thunderbolt_apple). No display or dock was attached. ATC0 carries the debug link.
Whole-stack result on J714s.
- Boots to a shell with no oops, WARN or BUG.
2ab000000.phyand383000000.phy-> apple-t6050-dp-phy (phys .0-.5);2aa280000.usband382280000.usb-> dwc3-apple. typec port0 and port1 register (device/sink, no partner). The debug port is left alone and the KIS link stayed up throughout.- Internal panel:
display-subsystem-> apple-drm,card1-eDP-1connected and enabled at 3024x1890. GPU: card0 and renderD128. - ATC2 router mailbox
381108000binds and thunderbolt_apple loads.381ac0000.aciostays deferred because J714s has no boardports/DROM yet.
KUnit on the same tree (ARM64 QEMU, panic_on_warn=1, PROVE_LOCKING, DEBUG_OBJECTS_WORK): 356 tests, 354 passed, 2 skipped by design.
Map all four T6050 DP IN adapters, forward their HPD interrupts to the display driver, and apply the host link, TMU and DP OUT policies needed for USB4 display tunneling. Preserve the existing M4 handshake policy. Wait 100 ms for a T6050 request generation to settle before handing it to DCP. Retired transient requests must not occupy the second display processor during dock discovery. Block delayed IRQ handlers and polling from reading registers after powered retirement. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
0881b67 to
9eb9bc2
Compare
8f09aef to
29e1188
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
Needed before this can go in:
-
It does not build on its base.
drivers/thunderbolt/apple.cusesapple_dcp_tb_dp_event(),APPLE_DP_TUNNEL_IRQ_HPDandAPPLE_DP_TUNNEL_HPD_CHANGED, which integration/aurora does not have; they come frominclude/linux/soc/apple/dp-tunnel.hin #1270. Please base this branch onewb/j716c-public-usb4-drm(or move those declarations here), so CI builds what is merged. -
Two changes reach every Apple silicon host, not only T6050. Both are keyed on
tb_port_is_apple_host_dpin(), which is true whereverhost_dp_policyhasTB_HOST_DP_NOTIFY(the M1, M2 and M3 DP IN profiles too):tb_dp_apple_ssc_offset()now rewrites the DP OUT adapter's TMU capability word 6 on every Apple host tunnel.tb_dp_activate()no longer clearsADP_DP_CS_3_NO_AUTO_LTwhen the tunnel goes away, so a DP OUT adapter stays without automatic link training after an Apple host tunnel leaves.
Either limit them to T6050 (anapple_cio_hwflag, likeno_asym/host_tmu), or keep them for all hosts and add results from an earlier SoC (M1/M2 class) with a Thunderbolt display: tunnel up, unplug/replug, and the dock's own DP OUT used again after the tunnel is torn down.
-
Please give the commit message the source of
TB_DP_APPLE_SSC_OFFSET(1500) and thetmu_params_host_enhancedconstants (how they were measured), and name word 6 of the TMU adapter capability intb_regs.hinstead of usingout->cap_tmu + 6.
RyanTheTide
left a comment
There was a problem hiding this comment.
Correction to point 3 above: TMU_ADP_CS_6 already exists in tb_regs.h (0x06), with TMU_ADP_CS_6_DTS (bit 1) and TMU_ADP_CS_6_DISABLE_TMU_OBJ_CL1/CL2 (bits 2 and 3). tb_dp_apple_ssc_offset() replaces bits 15:0 of that word with 1500 (0x5dc), which sets bits 2 and 3 and clears bit 1. Please use TMU_ADP_CS_6, add a named mask for the SSC offset field, and explain why the field overlaps those bits on this adapter (or write only the bits that belong to it).
The T6050 USB4 DisplayPort tunnel merges (aurora-silicon#1268, aurora-silicon#1270, aurora-silicon#1271) gave the display fabric up to four DP IN adapters per port (DCP_FABRIC_DPIN_MAX, dcp_fabric_dpin_slot()), a per-DP IN tunnel clock on T6050, firmware 27 pipelines that never take a tile, and apple_dp_tunnel_routes_port() to find a connector's display routes off port 3. The extracted production bodies no longer built against these fixtures, and tunnel-route read past its two-entry dpin[] array. Model the new code rather than stubbing it out: - t6030-clock: the route records its tunnel_rate; the T6050 PHY clock call is a recording stub that only a T6050 machine may reach. A new case checks DP IN n runs tunnel clock n + 1 and that the route keeps its rate only when the clock started. - t6030-wiring: extract apple_dp_tunnel_routes_port() as production (the extractor now keeps a return type on its own line) and take DCP_FABRIC_DPIN_MAX from the header. New cases: routes on port 2 beside a USB4 router on port 3, four named DP INs on a five-output crossbar, DP IN 2/3 on a three-output crossbar, and DP IN 2/3 without a DP IN 0/1 pair. - tunnel-route: dpin[] and the crossbar are sized from the header. DP IN 2/3 on a three-output crossbar and DP IN 4 stay refused; new checks cover four- and five-output crossbars, named and legacy. - tiled-split: extract dcp_fabric_dpin_slot() and enum dcp_firmware_version. The readiness-judged, any-external-untileable and dcpext-tileable mutants match the new untileable condition with the same meaning. New firmware 27 cases (DP IN 1 alone, with a tile hint, DP IN 3 in DP IN 1's slot) and mutants (fw27-tileable, dpin3-primary-slot). No existing case changed its expected result, and no driver change was needed: every failure was a stale fixture. Signed-off-by: Diljit Singh <hey@djdev.me>
Map all four T6050 DP IN adapters, forward their HPD interrupts to the display driver, and apply the host-link, TMU and DP OUT policies needed for USB4 display tunneling. Preserve the existing M4 handshake policy.
Wait 100 ms for a T6050 request generation to settle before handing it to DCP, so transient requests do not occupy the second display processor during discovery. Block delayed IRQ and polling paths from reading registers after powered retirement.
Based on integration/aurora, which has the Apple USB4 router groundwork from #1323. Also depends on #1270 and its prerequisites for the display-tunnel API and implementation. Combine these dependencies for builds and testing; this branch contains only the Thunderbolt handoff commit. Its feature patch is unchanged by this restack.
Validation: the combined dependency tree builds Image.gz, modules and all 137 Apple DTBs, including all 11 T6050 boards. ARM64 QEMU passes 245 display KUnit tests with one existing skip, with debug mutex/work-object checks and panic_on_warn=1. All 20 affected binding documents and focused source/modeled-handoff DT checks pass; the three-port resource check and 30 reciprocal graph edges pass. Full-registry schema validation retains the documented unrelated tunable-type collision.
Hardware validation: the final combined source tree booted on J716c with clean upstream Aquamarine. The internal panel runs at 3456×2234@120 Hz, and the two external monitors were captured at 3840×2160@240 and @120 Hz. The user tested the TS5 on all three physical ports and confirmed both displays, USB input and Ethernet working. The firmware-27 swap timestamp fix that boot needed is now #1404.
The hardware image also combines the public platform PRs #936, #938, #941, #942 and #943 for storage, networking, SMC and related platform support. These are boot-test inputs, not extra ancestors of this feature branch. The combined test tree remains local and is not a PR base.
Created with GPT-6 Astra in Codex.