Repository navigation
Conversation
|
[Joshua's agent] Thank you, Petr. Your commit 5 of this PR ("thunderbolt: apple: run T6040's TMU in bi-directional HiFi", 0737589) is carried for the T6050 in #2088, with you as the commit author. On a 14-inch M5 Max the display kept its link on the boots we ran with it. #2088 carries the same commit alone: your commit 5 here already defines QUIRK_TMU_HIFI_BI as BIT(15) with the same tb.c hunks, so the two PRs overlap and there is no bit clash. Whichever of #2068 and #2088 lands second drops the duplicate. (Edited: an earlier version of this comment wrongly named a BIT(12) clash.) |
Per Petr Skuta's T6040 work (aurora-silicon#2068), a Studio Display's router and DP OUT adapter report "Min Required TMU Mode" 3, bi-directional HiFi, and macOS runs the link that way. A device router that already reads as bi-directional HiFi is left alone by tb_enable_tmu(), so the host never disables and re-enables its TMU, and the display drops HPD about a second into 5120x2880@60 ("IOAVVideoInterface terminated"). Add QUIRK_TMU_HIFI_BI: every device router is configured for bi-directional HiFi, disabled, offered the host's time and enabled again. On the Studio Display tried (14-inch M5 Max) the router logs the disable and the mode set and no local_time line, and sysfs reads it as generation 3, so tb_switch_is_usb4() is false and tb_switch_tmu_post_time() returns early: the time post is a no-op there and the effect is the disable and enable. Whether posting the time matters on a USB4 device router is not shown. The host router's TMU stays with its firmware where QUIRK_HOST_TMU is set. Set for T6050 only: T6040's DP IN is disabled in this tree, so its entry is left alone. Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> [joshuaswarren: set for T6050, BIT(15); commit message reworded to say what the logs show of the time post] Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
Thanks for the Studio Display bring-up on the J614s, and for keeping František's commits under his name. Two parts don't match how we usually structure things.
Also, We can run Thunderbolt display rows on our M1 Pro, M2, M4 Pro and A18 Pro. |
|
dcp_fabric_t6040_tunnel_clock() in dcp-fabric.c decides whether apple_t6040_dp_tunnel_rate() drives the tunnel and whether dcp_tunnel_prepare() skips apple_atc_dp_tunnel_open(), and it decides this with of_machine_is_compatible("apple,t6040"/"apple,t6041"). Which clock feeds DP IN 0/1 is a property of the ATC PHY behind the route. It should come from that PHY's compatible or match data, or from a property on the DCP or route node, not from the machine compatible. Until then this should stay a draft. |
|
@petrskuta, a tidy-up pass over the open PRs here. These of yours need something:
If any of these are no longer needed, closing them helps; otherwise a merge or rebase onto integration/aurora is usually all they need. Thanks! |
In CIO mode the T6040 ATC PHY's AUSPLL feeds the pixel clocks of the router's DP IN adapters: one fixed AUSPLL frequency, a divider select per link rate in TX_DP_CTRL0 (RBR 4, HBR 3, HBR2 1, HBR3 0), the clock switch gate in the cfg bank, and the stop. DP IN 0 uses PCLK1 and switch 1; DP IN 1 uses PCLK2 and switch 2 and needs PCLK1 running as well. appledrm drives it through phy_configure() on the PHY's DP phy, with three new DP options: set_tunnel_rate, tunnel_dpin and tunnel_rate (the DP link rate code, 0 to stop). Which path a tunnel takes follows the PHY behind the route, not the machine: an "apple,t6040-atcphy" PHY clocks the tunnel itself (on T6040 and T6041 alike) and needs no apple_atc_dp_tunnel_open(). The PHY stops the tunnel clocks when it leaves CIO. [petr: taken from fbalazsy/linux j616s/split-display (the tunnel clock, 432f1ec "give the DP tunnel pixel clock a symbol of its own" and 346a417 "give DP IN 1 of a tunnel its PCLK1 prerequisite") onto integration/aurora. Tested on the J614s with a Studio Display (2022) on Thunderbolt up to 5120x2880@60, aurora-silicon#1589.] [petr: per review, the clock goes through phy_configure() instead of an exported apple_t6040_dp_tunnel_rate(), and dcp-fabric selects it by the PHY's compatible instead of of_machine_is_compatible("apple,t6040"/"t6041").] Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com> Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On T6040/T6041 the crossbar's 0x34 is a per-clock UHBR select (bit n set when the link rate is UHBR) and the ATC enable of a DP IN output is at 0x38. The T6030 link wrote the ATC enable to 0x34, which set the UHBR select of an HBR2 stream and left the ATC disabled: the tunnel trained but no pixel data reached the DP IN. DP IN tunnels carry DP 1.x rates only, so clear the UHBR select and set the enable at 0x38; the DP alt mode output keeps the T6030 write. Resume checks the same register. [petr: split out of fbalazsy/linux 5e66575 "drm/apple: T6041 display coprocessors across hibernation and S2R" (with its comment from ed490dd). On the J614s this took the Studio Display's video path from ~480 to ~976,000 packets/s at 1080p60, aurora-silicon#1589.] Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com> Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Give the T6040 ACIO the M4 (T8132) DP IN policy and qualify T6040 and T6041 for DP tunnels. Their DP IN adapters take the t8103 handshake and the M3 flow, as on T8132; the pixel clock is the ATC PHY's AUSPLL, set through phy_configure(). Tested on the J614s (M4 Pro) with a Studio Display (2022) on the left Thunderbolt port: 1920x1080, 2560x1440 and 5120x2880 at 60 Hz, extended desktop, aurora-silicon#1589. Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dcp_tunnel_crossbar_up() routes the mux at the first
DidChangeLinkConfiguration and enables the connection only for
dcp_t602x_tunnel_route(), which never matches the T6041 crossbar on 26.6.
Its clocks then stay off until a retrain runs the up path again. 1080p
and 1440p got video only because the firmware retrained after the mode
set; 5120x2880 keeps the trained link ("Forcing link status to true for
synched-pipe config") and stayed dark with the crossbar's FIFO and pixel
clocks off.
Also enable the connection at the first link up for the T6041 crossbar.
Tested on the J614s with a Studio Display (2022): 5120x2880@60,
aurora-silicon#1589.
Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tunnel's AUSPLL start sets CLKOUT_MASTER 0x808 and refuses to start
while either bit is set ('already in use'), but the stop cleared only
0x8. After the first stop, e.g. a DPMS off of a Studio Display, the
tunnel clock could not start again:
DP tunnel: AUSPLL already in use (master 0x81d54, cmd 0x10000018)
DP tunnel pixel clock (rate 0x14) failed: -16
and the display stayed dark after DPMS on. Clear both outputs.
Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host test extracts dcp_route_clock_rate() from the display fabric and builds it on its own. The fabric now sets the tunnel clock through phy_configure() when the route's PHY is a T6040 ATC PHY, so the test needs those helpers and a model of the PHY operation. Extract dcp_phy_clocks_tunnel() and dcp_phy_tunnel_rate() with the other fabric functions, give the model PHY an OF node and stub phy_configure() with the DP tunnel options. Add a case that runs a T6040 ATC PHY on the T6040, T6041 and T6030 machines through DP IN 0 and 1: the rate reaches the PHY with set_tunnel_rate alone and the right adapter, neither the ATC nor the T6050 provider is called, and a clock that fails to start leaves the route's rate alone. [petr: reworked for phy_configure() and the PHY compatible.] Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com> Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d64847a to
8d87e19
Compare
|
@RyanTheTide thanks for the review. Rebased onto
Checks:
#2069 is rebased on top of this; its three commits are unchanged. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review on 8d87e19b0abc:
What passes
- Architecture & §1: Reworking the T6040 tunnel pixel clock onto
phy_configure()(include/linux/phy/phy-dp.h), selecting the clock path via the PHY'sapple,t6040-atcphycompatible indcp-fabric.cinstead of machine compatibles, usingxbar->hw->t604x_dpin_atcinapple-display-crossbar.c, dropping the superseded TMU commit after#2088, and preserving František Balázsy's authorship on commits 1, 2, and 6 are all in the right direction. - §6 Naming & CI: Clean; live
host-testsCI is green on8d87e19b0abc(including the newt6040-tunnel-clockhost-test case).
Blocking findings
- §4 Attribution (hard rule): All 6 commits (
d09a208c6845,8b2ff009f717,f6a80ac0f409,afe228ed9494,70fb03405868,8d87e19b0abc) carryCo-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. Git commits must carry human author/committer and humanSigned-off-by:only (zero AI trailers); please stripCo-Authored-By:from every commit and keep AI disclosure in the PR description only. - §2 Correctness bug in
drivers/phy/apple/t6040-usb2.c(t6040_tun_pll_start()):The entry check atack = readl(core + T6040_CORE_AUSPLL_CMD) & T6040_CORE_AUSPLL_CMD_ACK; if (t6040_tun_pll_cmd(tphy, (ack ? 0 : T6040_CORE_AUSPLL_CMD_REQ) | 0x10000000, true) || readl_poll_timeout(core + T6040_CORE_DP_PCLK_STATUS, v, !!(v & T6040_CORE_DP_PCLK_STATUS_LOCK) == !ack, 10, 500 * USEC_PER_MSEC) || t6040_tun_pll_cmd(tphy, (ack ? T6040_CORE_AUSPLL_CMD_REQ : 0) | 0x10010000, ack)) {
t6040_tun_pll_start()only rejectsAUSPLL_CMD_REQ(not a staleAUSPLL_CMD_ACK == 1, which can occur after a PHY power/reset cycle). Ifack == true:- The first
t6040_tun_pll_cmd()waits for hardcodedtrueinstead of!ack, so it returns immediately without waiting forACKto toggle low. - The
T6040_CORE_DP_PCLK_STATUS_LOCKpoll waits for!!(v & LOCK) == !ack(i.e.LOCK == 0, unlocked!) instead ofLOCK == 1.
Please pass!ackto the firstt6040_tun_pll_cmd()(matchingt6040_tun_pll_stop()) and poll unconditionally forv & T6040_CORE_DP_PCLK_STATUS_LOCK.
- The first
- §5 Evidence & regression counts: The J614s run on
8d87e19b0abcwas tested stacked with#2069and omits the §5 regression counts (default command line confirmation, SELinux AVC count if enforcing, failed systemd units count, and new kernel errors vs baseline). Please post explicit §5 regression counts on the updated head, and note a non-T6040 regression check (or T6040 DP alt-mode check) sincedcp-fabric.c,apple-display-crossbar.c, andinclude/linux/phy/phy-dp.hare shared paths.
Non-blocking notes
- In
t6040_tun_select_write(), retuning DP IN 0 while DP IN 1 is active clears PCLK1's enable bit between the twowritel()calls, momentarily gating DP IN 1's prerequisite clock (comparedrivers/phy/apple/atc.c:2979). Also, ift6040_tun_switch(tphy, 0, true)times out when starting DP IN 1 alone,tphy->tun_preis stillfalsesoswitch_faileddoes not clear switch 0'ssw_gatebit. dcp_tunnel_split_up_locked()does not calldcp_dpxbar_link(..., true)after firstmux_control_try_select()onapple,t6041-display-crossbar(only relevant fordpin1/tiled displays, which you already note are untested).
Assisted-by: LLM (Gemini 4 Neon)
A Studio Display (2022) on a Thunderbolt port of the J614s (MacBook Pro 14" M4 Pro, T6040) now shows a picture, up to its native 5120x2880@60, as an extended desktop. Before this series it only charged. Findings and the whole path are in #1589.
Most of the credit goes to @fbalazsy. The first two commits are his work, kept under his authorship and sign-off: the T6040 DP tunnel pixel clock, and the T604X crossbar ATC enable that sat in his hibernation commit. Without them there is no picture at all. So is the host-test update for his clock (commit 6). The review rework in commits 1 and 6 is noted in them as
[petr: …]. The other three commits are mine.Commits
phy_configure()with three new DP options ininclude/linux/phy/phy-dp.h(set_tunnel_rate,tunnel_dpin,tunnel_rate). dcp-fabric picks this path from the PHY behind the route, anapple,t6040-atcphy, not from the machine compatible, and it covers T6040 and T6041. From fbalazsy/linuxj616s/split-display.5e6657513.dcp_tunnel_crossbar_up()enabled the connection at the first link up only whendcp_t602x_tunnel_route()matched, and it never matches the T6041 crossbar on 26.6. Lower modes worked only because the firmware retrained after the mode set. 5120x2880 keeps the trained link and stayed dark with the crossbar clocks off.CLKOUT_MASTER0x808 and refuses to start while either bit is set, but the stop cleared only 0x8. After a DPMS off the clock could not start again (AUSPLL already in use), and the display stayed dark after DPMS on.dcp_route_clock_rate()and now models the PHY check andphy_configure(). A new case runs a T6040 ATC PHY on the T6040, T6041 and T6030 machines through DP IN 0 and 1. From fbalazsy/linuxca29f8ed9.The TMU change that was commit 5 is gone: #2088 (merged as
5d336151) makes bi-directional HiFi the default for every Apple CIO host. Other SoCs and DP alt mode routes are unchanged.Testing
On this head, rebased onto
integration/auroraf5fae3cbb047:tools/asahi/t6030-clock-tests.py: 22/22 pass. Full LLVM=1 + Rust build with the linux-aurora 7.3.0.aurora1-41 config, with no new warnings.apple,j614s apple,t6040, kernel7.3.0-pr2068+(this series plus J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) #2069) with the stock 7.3.0-1-41 DTB, KDE Plasma 6.8. Studio Display (2022):AUSPLL already in usein the kernel log.Earlier testing of the previous head (os-fw 26.6.2, system-fw 27.2, Hyprland 0.57.2) also covered 1920x1080 and 2560x1440, and 6 hotplugs in 90 s across all three ports. On the same port with #2069, the display's USB side (speakers, microphones, camera, USB-C ports) works too.
Known limitations, not addressed here:
🤖 Generated with Claude Code