Repository navigation
phy: apple: atc: select the T8103 and T600x tunnel clocks by PHY compatible - #2415
RyanTheTide wants to merge 5 commits into
Conversation
… 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>
…atible
The DP tunnel pixel clock sequence of a T8103-generation PHY was picked
by the root compatible: apple_atc_tunnel_is_t600x() (apple,t6000 or
apple,t6001) and apple_atc_tunnel_is_t8103_style() (apple,t8103,
apple,t8112 or T600x). A T8103-style PHY feeds both DP IN adapters from
one AUSPLL pixel clock; a T600x one also runs PCLK2 and the DPRX clock
and is opened before the first rate request; every other PHY took the
per-DP IN T602x sequence.
Which of these a PHY needs is a property of the PHY: the T8103 and
T8112 PHYs ("apple,t8103-atcphy", the T8112 one through its fallback),
the T600x PHY ("apple,t6000-atcphy") and the T602x PHY
("apple,t6020-atcphy") all share the T8103 register generation and match
data today. Give the T600x and T602x PHYs their own match entries (the
T8103 data, which they get now through the fallback) and say in the
match data which tunnel clock they have: tunnel_t8103_clock for the
T8103 entry and T600x, tunnel_dprx_clock for T600x only.
apple_atc_dp_tunnel_open() now answers -EOPNOTSUPP for a PHY of another
driver before it looks at the match data, as it did on every machine
but T6000/T6001.
No functional change on T8103, T8112, T6000, T6001 and T602x. T6002
(M1 Ultra), whose PHYs are the same apple,t6000-atcphy blocks
(t600x-dieX.dtsi) but whose root compatible was not in the list, now
gets the T600x sequence instead of the T602x one; there the T602x path
refused every rate with -EOPNOTSUPP, as T6002 has no T602x tunnel
wiring (apple_atc_t602x_qualified()).
The ATC USB3 host test resolves the two new entries.
Fixes: 49fa065 ("phy: apple: atc: run the t8103 tunnel clock sequence on t600x")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Blockers: 1.
The last commit (e583b4e) is sound. What I checked:
HW row: on the rebased head, the dock rows the PR already lists. M1 Pro J316s: "DP tunnel open" with TX_DP_CTRL0 set and a picture on 5/5 replugs. M2 J413: T8103-sequence rate lines, no open line, picture on 5/5. Both A/B against the base kernel, with 0 AVC, 0 failed units and 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>
No conflicts: integration/aurora comes in through the updated hack/drm-board-gates-b (81af464), merged cleanly. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
The conflict is gone after the rebase. Still needed: #2359 (whose commits this carries) to land first, then the M1 Pro J316s and M2 J413 dock rows on this head (picture on 5/5 replugs, A/B against the base kernel). |
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at 10ccffeb28c1. The refactor drops the root SoC test and uses the ATC block's own match data. Please verify the final combined patch on the J413 with a USB4 dock, including the same negotiated lane rate before and after and reattachment after s2idle. The T6002 functional change also needs its own positive row.
|
Folded into #2457, which carries this PR's commits unchanged; review continues there. |
Problem
drivers/phy/apple/atc.c picked the DP tunnel pixel clock sequence of a T8103-generation PHY by the machine's root compatible:
apple_atc_tunnel_is_t600x()(~2903) matchedapple,t6000orapple,t6001.apple_atc_tunnel_is_t8103_style()(~5001) matchedapple,t8103,apple,t8112or T600x.Both came from 49fa065 ("phy: apple: atc: run the t8103 tunnel clock sequence on t600x").
A T8103-style PHY feeds both DP IN adapters from one AUSPLL pixel clock. A T600x PHY also runs PCLK2 and the DPRX clock, and it is opened (
apple_atc_dp_tunnel_open()) before the first rate request. Every other PHY took the per-DP-IN T602x sequence. Which sequence applies is a property of the PHY. The T8103, T8112 (by fallback), T600x and T602x PHYs all used theapple,t8103-atcphymatch data, so that data could not tell them apart, and the machine list did it instead.Change
apple,t6000-atcphyandapple,t6020-atcphy. Both carry the T8103 data they already got through the fallback compatible.atcphy_hwflags, documented in the kernel-doc:tunnel_t8103_clock(set for the T8103 entry, which T8112 also uses, and for T600x) andtunnel_dprx_clock(T600x only).apple_atc_dp_tunnel_open()now returns -EOPNOTSUPP for a PHY that belongs to another driver (T6050's atc-t6050-dp.c) before it reads the match data. The caller in dcp-fabric.c treats that as "nothing to open".This is stacked on #2359 (hack/drm-board-gates-b): its two commits appear here too and go in with it; review only the last commit. That PR adds
t8122_tunnel_clockand theapple,t6030-atcphyentry next to these lines, and this branch builds on its struct and match table.Why every SoC is safe:
t8122_tunnel_clockfrom drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles #2359.apple,t6000-atcphyblocks (t600x-dieX.dtsi), but its root compatible was missing from the list. It now gets the T600x sequence. Before, it went down the T602x path, which on T6002 answered every rate with -EOPNOTSUPP, becauseapple_atc_t602x_qualified()only admits T6020/T6021 wiring.Original work: Christian Bartels (T600x tunnel clock), ported by Chris Kearney.
Testing
drivers/phy/apple/(atc.o and the rest): no compiler warnings. The kernel-doc warnings onstruct apple_atcphyare the same as on the base.atc-usb3(with mutations) andt6030-clockpass, as do the selftests in tools/testing/selftests/drivers/gpu/apple-dcp (phy, transaction).Still to run
dmesg | grep "DP tunnel open"shows the open with TX_DP_CTRL0 set, and the display lights up, the same as on the base kernel. A/B: picture on 5/5 dock replugs on both kernels.dyndbgon atc.c,DP tunnel clock ratelines appear from the T8103 sequence, there is no "DP tunnel open" line, and the picture comes up 5/5 on both kernels.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:
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: M1 Pro and M2 boot clean. No dock display was attached, so the tunnel rows are still to run.