Skip to content

thunderbolt: apple: Enable stable T6050 DisplayPort tunnel handoff - #1271

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
ewb/j716c-public-usb4-thunderbolt
Nov 11, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
ewb/j716c-public-usb4-thunderbolt

Conversation

@erikwb

@erikwb erikwb commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

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

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.phy and 383000000.phy -> apple-t6050-dp-phy (phys .0-.5); 2aa280000.usb and 382280000.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-1 connected and enabled at 3024x1890. GPU: card0 and renderD128.
  • ATC2 router mailbox 381108000 binds and thunderbolt_apple loads. 381ac0000.acio stays deferred because J714s has no board ports/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>
@erikwb
erikwb force-pushed the ewb/j716c-public-usb4-thunderbolt branch from 0881b67 to 9eb9bc2 Compare November 9, 2026 14:40
@erikwb
erikwb force-pushed the ewb/j716c-public-usb4-drm branch from 8f09aef to 29e1188 Compare November 9, 2026 14:40
@erikwb
erikwb changed the base branch from ewb/j716c-public-usb4-drm to mergetrain/j716c-usb4-20261109 November 9, 2026 14:41
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Leaving this open: it calls apple_dcp_tb_dp_event() and the APPLE_DP_TUNNEL_* events from #1270, which is based on #1012 (firmware-27 display), and #1012 isn't being merged in this round. Its base, #1323, is going in now; this can follow with #1270.

🤖 Generated with Claude Code

@erikwb
erikwb changed the base branch from mergetrain/j716c-usb4-20261109 to integration/aurora November 10, 2026 02:17

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

Needed before this can go in:

  1. It does not build on its base. drivers/thunderbolt/apple.c uses apple_dcp_tb_dp_event(), APPLE_DP_TUNNEL_IRQ_HPD and APPLE_DP_TUNNEL_HPD_CHANGED, which integration/aurora does not have; they come from include/linux/soc/apple/dp-tunnel.h in #1270. Please base this branch on ewb/j716c-public-usb4-drm (or move those declarations here), so CI builds what is merged.

  2. Two changes reach every Apple silicon host, not only T6050. Both are keyed on tb_port_is_apple_host_dpin(), which is true wherever host_dp_policy has TB_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 clears ADP_DP_CS_3_NO_AUTO_LT when 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 (an apple_cio_hw flag, like no_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.
  3. Please give the commit message the source of TB_DP_APPLE_SSC_OFFSET (1500) and the tmu_params_host_enhanced constants (how they were measured), and name word 6 of the TMU adapter capability in tb_regs.h instead of using out->cap_tmu + 6.

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

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).

@DjDeveloperr
DjDeveloperr merged commit a333484 into integration/aurora Nov 11, 2026
DjDeveloperr added a commit to satchlj/linux that referenced this pull request Nov 11, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants