Skip to content

J614s/T6040: Thunderbolt displays (Studio Display up to 5120x2880@60) - #2068

Open
petrskuta wants to merge 7 commits into
aurora-silicon:integration/aurorafrom
petrskuta:pr/j614s-studio-display
Open

petrskuta wants to merge 7 commits into
aurora-silicon:integration/aurorafrom
petrskuta:pr/j614s-studio-display

Conversation

@petrskuta

@petrskuta petrskuta commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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 7). The other four commits are mine.

Commits

  1. phy: apple: t6040: DP tunnel pixel clock (František Balázsy). In CIO mode the PHY's AUSPLL feeds the DP IN pixel clocks, driven by appledrm through apple_t6040_dp_tunnel_rate(). From fbalazsy/linux j616s/split-display.
  2. mux: apple-display-crossbar: enable the T604X ATC for a DP IN tunnel (František Balázsy). On T604X, 0x34 is the per-clock UHBR select and the DP IN ATC enable is at 0x38. Writing the T6030 enable to 0x34 set UHBR for an HBR2 stream and left the ATC off, so no pixel data reached the DP IN (~480 clock-sync packets/s). With this commit it is ~976,000 packets/s at 1080p60. Split out of fbalazsy/linux 5e6657513.
  3. thunderbolt: apple: drive displays behind T6040/T6041 DP tunnels. The M4 (T8132) DP IN policy for the T6040 ACIO, and T6040/T6041 added to the qualified SoCs.
  4. drm/apple: enable a T6041 tunnel's crossbar at its first link up. dcp_tunnel_crossbar_up() enabled the connection at the first link up only when dcp_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.
  5. thunderbolt: apple: run T6040's TMU in bi-directional HiFi. macOS runs every router's TMU in bi-directional HiFi with a Studio Display attached, and its DP OUT adapter reports "Min Required TMU Mode" 3. With the host in uni-directional LowRes, the display dropped HPD exactly one second into 5K. This adds QUIRK_TMU_HIFI_BI, set for T6040/T6041 only.
  6. phy: apple: t6040: release both AUSPLL clock outputs when a tunnel stops. The tunnel's AUSPLL start sets CLKOUT_MASTER 0x808 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.
  7. tools: asahi: model the T6040 tunnel clock in the T6030 clock host test (František Balázsy). The host test extracts dcp_route_clock_rate() and now needs the T6040 helper and a stub of apple_t6040_dp_tunnel_rate(); it adds a case for both machines through DP IN 0 and 1. From fbalazsy/linux ca29f8ed9.

Other SoCs and DP alt mode routes are unchanged.

Testing

  • MacBook Pro 14" M4 Pro, apple,j614s apple,t6040, os-fw 26.6.2, system-fw 27.2. This series on integration/aurora cc8cdb428, kernel otherwise built with the linux-aurora 7.3.0.aurora1-40 config. Hyprland 0.57.2.
  • Studio Display (2022) on the left Thunderbolt port (ATC0, dpin0, PCLK1), hotplug after login: 1920x1080, 2560x1440 and 5120x2880 at 60 Hz all show a picture. At 5K the display stays connected (no HPD drop) as an extended desktop at scale 2.
  • All three Thunderbolt ports (ATC0 left near MagSafe, ATC1 left rear, ATC2 right): 5K picture on each.
  • Plug cycles: 6 hotplugs in 90 s across all three ports, one unplugged mid-setup: 5K each time (~3.3 s to ready), no kernel errors.
  • DPMS off and on (hl.dsp.dpms on DP-1): the picture comes back at 5K.
  • Coldplug (display attached at boot): the picture survives the login screen's handover and stays at 5K. Before commit 6 it was lost there, the same failed clock restart.
  • s2idle suspend and resume (systemctl suspend), with and without the display attached: the Mac wakes, the link retrains and the display comes back at 5K.
  • On the same port with J614s: PCIe-C on the Thunderbolt ports (Studio Display USB, audio, camera) #2069, the display's USB side (speakers, microphones, camera, USB-C ports) works too.

Known limitations, not addressed here:

  • The second tile / dpin1 is not used: 5K60 runs on dpin0 alone, as on macOS. In a macOS ioreg of this Mac with the Studio Display attached, only one DP IN / DP OUT pair is active (display DP OUT 11 "DP State" 2, DP OUT 12 idle). Displays that need two streams are not tested.

🤖 Generated with Claude Code

fbalazsy and others added 5 commits November 16, 2026 10:06
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 apple_t6040_dp_tunnel_rate(), a symbol of its
own as for T6050, so phy-apple-atc and phy-apple-t6040-usb2 can both be
built. 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.]

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

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>
macOS runs the host router's TMU in mode 3 (bi-directional HiFi) with a
Studio Display attached, and the display's router and DP OUT adapter
report "Min Required TMU Mode" 3. Linux put the J614s host in
uni-directional LowRes and left the display's router alone because it
already read as bi-directional HiFi, so the host's time was never posted
to it. The display then dropped HPD one second into 5120x2880@60
("IOAVVideoInterface terminated ... display HPD removed").

Add QUIRK_TMU_HIFI_BI: the host router configured for bi-directional
HiFi, and every device router configured, disabled, given the host's
time and enabled again. Set it for T6040/T6041.

Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
petrskuta and others added 2 commits November 16, 2026 10:33
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 calls the T6040 PHY's own tunnel clock
symbol on T6040 and T6041, so the test needs that helper and a model of the
symbol.

Extract dcp_fabric_t6040_tunnel_clock() with the other fabric functions, stub
apple_t6040_dp_tunnel_rate() and add a case that runs both machines through
DP IN 0 and 1: the rate reaches the T6040 symbol with 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.

Signed-off-by: František Balázsy <frantisekbalazsy@gmail.com>
Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com>
@joshuaswarren

joshuaswarren commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

joshuaswarren pushed a commit to joshuaswarren/linux that referenced this pull request Nov 16, 2026
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>
@RyanTheTide

Copy link
Copy Markdown
Contributor

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.

drivers/gpu/drm/apple/dcp-fabric.c:459-463 picks the tunnel pixel-clock path with of_machine_is_compatible("apple,t6040") || ("apple,t6041"). The PHY on the route already identifies itself, so the choice could follow the PHY (its ops or compatible). We select by a hardware property rather than by SoC name.

drivers/phy/apple/t6040-usb2.c:2241-2257 exports a third per-chip *_dp_tunnel_rate() symbol ("a symbol of its own, as for T6050"), which dcp-fabric fetches with symbol_get() at :488-496 and :3101-3106. Could this be a single PHY operation (for example phy_configure() with DP options) that each ATC PHY driver implements? Then dcp-fabric needs no per-chip branch.

Also, drivers/thunderbolt/apple.c:250-255 sets tmu_hifi_bi for T6040 only. The reason is macOS and sink behaviour, so it fits better as the default for every Apple CIO host (see #2088).

We can run Thunderbolt display rows on our M1 Pro, M2, M4 Pro and A18 Pro.

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.

4 participants