Skip to content

drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles - #2359

Closed
RyanTheTide wants to merge 3 commits into
mainfrom
hack/drm-board-gates-b
Closed

RyanTheTide wants to merge 3 commits into
mainfrom
hack/drm-board-gates-b

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The T6030 display fabric was selected by the root compatible apple,t6030:

  • drivers/gpu/drm/apple/dcp-fabric.c: dcp_direct_crossbar_link() (around line 2622, merged in 3522452), dcp_tunnel_set_rate() (around line 2700, 9e03c19), dcp_route_tunnel_clock_blocked() and dcp_route_clock_rate().
  • drivers/phy/apple/atc.c: apple_atc_tunnel_t8122_clock() and the tunnel clock stop in atcphy_configure() (around line 4207, 6a6ee2a).

What these follow is hardware, not the machine. The T6030 display crossbars only route a selected output until its link is brought up, and only external sources 0 and 2 reach the ATC tunnel pixel clocks. The T6030 ATC PHY clocks both DP IN outputs from its own AUSPLL tunnel clock.

Change

These paths are now selected by the IP block compatibles, through match data:

  • struct apple_dcp_hw_data gets t6030_fabric, which is set for apple,t6030-dcp and apple,t6030-dcpext and read through dcp_is_t6030_fabric().
  • struct atcphy_hw gets t8122_tunnel_clock. It is set in a new apple,t6030-atcphy match entry (the T8122 PHY data plus the flag) and in the T8132 PHY data. apple_atc_tunnel_t8122_clock() and the stop in atcphy_configure() both read it. A T8132 PHY never reaches the stop in atcphy_configure() (atcphy_configure_t8132() returns first), so that condition is the one it had before.

Every SoC it reaches: this is no functional change on any in-tree DT. Only the T6030 machines (J514s, J516s) carry apple,t6030-dcp/-dcpext/-atcphy, and every display processor and ATC PHY on them carries one. T6031/T6034 use apple,t6031-* and T8122 uses apple,t8122-*, so they keep their paths, and so do all other SoCs. Nobody has checked whether the T8122 and T6031 PHYs, which are the same generation, want the same tunnel clock sequence. That question is tracked in #2348 and is not changed here.

Testing

  • arm64 LLVM build with W=1 of dcp.o, dcp-fabric.o, atc.o (with the ATC KUnit file built in): no new warnings.
  • Host replays of the production functions, clang with ASan/UBSan: tools/asahi/t6030-clock-tests.py (21/21), tools/asahi/tunnel-route-tests.py (all cases and the three negative controls), tools/asahi/dcpext26-crossbar-union-tests.py (passes; both drop controls still fail as intended), tools/asahi/atc-usb3-tests.py (38/38, now resolving the new match entry), and the full tools/testing/selftests/drivers/gpu/apple-dcp suite. The fixtures model the match data where they used to model the machine check.
  • KUnit not run on a target: it needs a booted arm64 kernel, and this change has no runtime effect off T6030.

Still to run

  • J514s or J516s (community owners): a USB4/TB dock with a DP monitor, and the HDMI port, light up as before. dmesg | grep -iE 'tunnel pixel clock|crossbar output' shows no new failures. cat /sys/kernel/debug/phy/*/ (if exposed), or the existing tunnel debug lines with dyndbg='file atc.c +p', show DP tunnel source 0 rate ...: 0.
  • Lab regression rows (no behaviour change expected): J616s (T6040), M1 Pro (T6000) and M2 (T8112) boot with their DP-alt outputs working as before, and there is no new warning in dmesg | grep -iE 'atcphy|dcp'.
Credit

The T6030 tunnel clock, crossbar flow and source-aware clocks are Chris Kearney's work (6a6ee2a, 9e03c19). Diljit Singh merged the native26 and T8132 crossbar gates (3522452). This change only alters how those paths are selected.

Hardware rows (combined test kernel, 2026-11-20)

This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:

  • kernel errors, failed units and SELinux denials;
  • microphone capture byte counts;
  • camera frame counts;
  • USB speeds;
  • panel brightness steps;
  • every retry/refusal message these drafts touch;
  • 2 s2idle cycles on M1 Pro, M2 and J616s.

M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.

This PR: No lab Mac has a T6030; boot-clean regression rows on the four Macs only.

… compatibles

The T6030 display paths were selected by the root compatible
(of_machine_is_compatible("apple,t6030")):

 - dcp-fabric.c: the tunnel pixel clock sources a route may use
   (dcp_route_tunnel_clock_blocked(), dcp_route_clock_rate(),
   dcp_tunnel_set_rate()) and the explicit crossbar link-up of a direct
   output (dcp_direct_crossbar_link());
 - atc.c: the T8122-generation tunnel clock (apple_atc_tunnel_t8122_clock())
   and the matching stop before a mode change (atcphy_configure()).

What these follow is hardware: the T6030 display crossbars, where a
selected output is only routed until its link is brought up and only
external sources 0 and 2 reach the ATC PHY's tunnel pixel clocks, and
the T6030 ATC PHY, which clocks both DP IN outputs from its own AUSPLL
tunnel clock. Every display processor behind those crossbars is an
apple,t6030-dcp or apple,t6030-dcpext, and every such PHY an
apple,t6030-atcphy.

Select them by those compatibles, through match data: a t6030_fabric
flag for the two T6030 processors, read by dcp_is_t6030_fabric(), and a
t8122_tunnel_clock flag for the PHY, set in a new apple,t6030-atcphy
entry (the T8122 PHY data plus the flag) and in the T8132 PHY data. The
PHY's mode change reads the same flag; a T8132 PHY never reaches that
path (atcphy_configure_t8132()), so it is the condition it had.

No functional change on any in-tree device tree: the T6030 machines
(J514s, J516s) carry exactly these compatibles, and no other SoC does
(T6031/T6034 use apple,t6031-*, T8122 apple,t8122-*). Whether the T8122
and T6031 PHYs, of the same generation, want the same tunnel clock
sequence is not known and is not changed here.

The host fixtures that replay these functions model the match data the
way they modelled the machine check, and the ATC USB3 host test now
resolves the new apple,t6030-atcphy entry.

Fixes: 6a6ee2a ("thunderbolt, phy, soc: apple: T6030 USB4/Thunderbolt, Type-C and DP tunnel support")
Fixes: 9e03c19 ("drm/apple: reserve the T6030 HDMI processor with source-aware tunnel clocks")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…s unused

The PHY host fixtures in phy.py define of_machine_is_compatible() for
the ATC functions they extract. Since the T6030 tunnel clock stop in
atcphy_configure() reads the PHY's match data instead of the machine,
no extracted function calls the mock any more, and the units fail to
build under -Werror=unused-function. Mark the two mocks unused, as the
fixtures do for other optional stubs.

Fixes: 6cb4c3e ("drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 2.

  1. The PR conflicts with integration/aurora in drivers/gpu/drm/apple/dcp-fabric.c and tools/asahi/dcpext26-crossbar-union-tests.py. Since this branch's base, d6d84d5 ("route DisplayPort tunnels through the J713 external DCPs") rewrote the same T6030 checks to also take the T8132 dcpext. Base now has dcp_fabric_tunnel_clock_blocked(of_machine_is_compatible("apple,t6030"), ...) at dcp-fabric.c:257 and if (of_machine_is_compatible("apple,t6030") || t8132) at :485, and both are new call sites this PR does not convert. Rebase onto a fresh branch and convert every apple,t6030 machine check in the file to dcp_is_t6030_fabric(route->dcp). Those two included, there are four on base: :257, :485, :2634 and :2713.

  2. dcp-fabric.c:362-366 (dcp_typec_ordered_dual_stream()) still selects by of_machine_is_compatible("apple,t6030") || of_machine_is_compatible("apple,t6050"). That is the same T6030 fabric property ("their external processors are interchangeable"), and it is left on the root compatible. With the rest converted, a DT whose processors carry apple,t6030-dcpext takes the T6030 tunnel-clock and crossbar paths, but the ordering here still follows the machine. Count ordered routes at route registration from the processor's match data, as dcp_dual_stream_routes already counts dual-stream routes, and read that here. Give T6050 its own flag the same way, or leave it with a comment that says why it stays.

Checked and fine:

  • In drivers/phy/apple/atc.c, the T6030 PHY nodes list apple,t6030-atcphy first (t6030.dtsi:1769, :1944, :2119, :2146), so the new match entry (atc.c:8014) wins over the T8122 one.
  • t8122_tunnel_clock on the T8132 data is unreachable at :4217, because atcphy_configure_t8132() returns first.
  • The binding already lists the compatible.
  • Both commits carry only a human Signed-off-by.

HW row: after the rebase, J514s or J516s (community owner) on the new head. A USB4 dock with a DP monitor and the HDMI port both light up, and there are no new tunnel pixel clock/crossbar output failures. One J616s boot with USB-C DP as a no-regression row. 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

Conflicts: dcp-fabric.c (dcp_direct_crossbar_link: keep dcp_is_t6030_fabric() plus integration's dcp_t6041_ext_v27()), dcpext26-crossbar-union-tests.py (extract both dcp_t6041_ext_v27 and dcp_is_t6030_fabric).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged integration/aurora (d1b022d); conflicts in drivers/gpu/drm/apple/dcp-fabric.c and tools/asahi/dcpext26-crossbar-union-tests.py resolved, drivers/gpu/drm/apple/ and drivers/phy/apple/ (arm64 fleet config, LLVM) build; dcpext26/atc-usb3/t6030-clock/tunnel-route host tests and apple-dcp selftests (92/92) pass.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The rebase onto integration/aurora converts all four T6030 machine checks; dcp_typec_ordered_dual_stream() (dcp-fabric.c:362-366) still checks the root compatible, which #2417 converts, so either land the two together or add a comment here saying why it stays. Still needed: a fresh review of 81af464, a J514s or J516s row (USB4 dock with a DP monitor plus HDMI, no tunnel clock or crossbar failures) and a J616s USB-C DP no-regression boot.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Folded into #2457, which carries this PR's commits unchanged; review continues there.

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.

1 participant