Skip to content

arm64: dts: apple: t6022-j475d: enable DP alt mode on the rear USB-C ports - #462

Open
jcrowthe wants to merge 1 commit into
omacom:integration/aurorafrom
jcrowthe:j475d-dp-altmode
Open

jcrowthe wants to merge 1 commit into
omacom:integration/aurorafrom
jcrowthe:j475d-dp-altmode

Conversation

@jcrowthe

Copy link
Copy Markdown

On the Mac Studio (M2 Ultra, J475d) no display controller is wired to the four rear USB-C ports, so a USB-C DisplayPort display there stays dark. The dcpext1 routes in t602x-j474-j475.dtsi sit inside the APPLE_T602X_NON_ULTRA block together with the USB4/PCIe-C wiring, and t6022 does not define it.

The die-0 half of the t6022 keeps the plain labels and the same rear-port wiring as the M2 Max Studio, so this narrows the guard instead of adding a J475d copy:

  • t602x-j474-j475.dtsi: only the USB4 aliases, the PCIe-C tunnels and the non-Ultra &display iommus stay under APPLE_T602X_NON_ULTRA. The dcpext1 display routes, dpaudio2, the ATC crossbars and the always-on ATC common power domains apply to J475d too.
  • t6022-j475d.dts: t6022-jxxxd.dtsi points the display subsystem at the die-1 HDMI DART only, so add dispext1_dart there for the framebuffers of the new pipe.

Why dcpext1

From macOS on the same J475d (ioreg, IODeviceTree and service planes):

  • display-crossbar0 (display-crossbar,t602x) has ufp-endpoints dispext0–7 and dfp-endpoints atc0–7 plus lpdptx-phy0/1. The routing is chosen at runtime, so the ADT alone doesn't fix a controller per port.
  • With an LG UltraFine 4K on a USB-C to DisplayPort cable, macOS drives it from DCPEXT1 (dcpext1@15C00000, die 0) on rear port 2 (hpm2 / Port-USB-C@3, usb-pd@3b) and again on rear port 1 (hpm3 / Port-USB-C@4, usb-pd@3c). The display-crossbar0 NVRAM state changes in exactly one byte between the two (0x20 → 0x30).
  • HDMI is DCPEXT5 under macOS. Linux keeps using dcpext0_die1 (dcpext4) for HDMI, which is unchanged here.

Device tree check

Built with the kernel's own scripts/dtc (the t602x trees use floating-point literals):

  • On bed544b without this change, t6022-j475d.dtb is byte-identical to the one in linux-aurora 7.2.11.aurora16-1.
  • With it, t6020-j474s and t6021-j475c keep the same nodes and properties. Sorted dtc -I dtb -O dts -s output is identical; only the position of the dcpext1 alias within /aliases changes.
  • On t6022-j475d, the only changes are the dcpext1 alias, dcp@315c00000 enabled with phys/mux-controls/typec-routes for usb-pd@38, @3f, @3b and @3c, dpaudio2 enabled, the four atc*-dpxbar muxes enabled, apple,always-on on ps_atc0..3_common, and the second iommus entry on display-subsystem.

Testing

Mac Studio (M2 Ultra, 2023), apple,j475d/apple,t6022. Stock linux-aurora 7.2.11.aurora16-1 kernel and modules, with only this device tree swapped into boot.bin. OS firmware 13.5, system firmware 26.6.2. m1n1 stage 2 is ba130ffb + omacom/m1n1#46 + the T602x DART patch from #379, which the HDMI DCP needs on this machine (#428); dcpext1 does not depend on it. Hyprland 0.57.2. LG UltraFine 4K over a USB-C to DisplayPort cable, Dell U2718Q on HDMI at the same time.

dcpext1 boots cold and joins the aggregate next to the HDMI DCP:

apple-dcp 315c00000.dcp: DCP index:2 dptx target phy: 0 dptx die: 0
apple-drm soc@200000000:display-subsystem: bound 315c00000.dcp (ops dcp_comp_ops [appledrm])
apple-dcp 315c00000.dcp: DCP booted
apple-display-crossbar f0304c000.mux: Switched dpphy to dispext1,0
apple-dcp 315c00000.dcp: allocated Type-C DPTX PHY 2
apple-dcp 315c00000.dcp: set_digital_out_mode() "3840x2160": 60 ... depth:10

Results (rear ports counted from the left, looking at the back):

Action Port Connector Result
Coldplug rear 2 (typec2) DP-3 pass, 3840x2160@60, 10 bpc
Hotplug rear 1 (typec3) DP-4 pass, 3840x2160@60 (see note 2)
Hotplug rear 3 (typec1) DP-2 pass, 3840x2160@60, about 0.4 s to picture
Hotplug rear 4 (typec0) DP-1 pass, 3840x2160@60, about 0.4 s to picture
DPMS off, then wake on input rear 4 DP-1 pass, stayed off for 75 s, woke on input
HDMI alongside DP HDMI-A-1 pass, both at 4K60
Front USB-C ports (die 1) not tested, not wired by this change
Thunderbolt DP tunnel not tested, USB4/PCIe-C stays non-Ultra
DP audio not tested; av_service_connect starts the audio service
Suspend/resume not tested

No WARNING, BUG or oops in any of these boots.

Notes, none of which keeps the display from coming up:

  1. On unplug from rear 2, a modeset already in flight was refused: ERROR: Modeset done, but pipe not enabled: fSoftPowerState=1, fDisplayPowerState=0, fHardPowerState=1 / set_digital_out_mode returned 80000104.
  2. The first connect on rear 1 timed out once (dcp_dptx_connect: timed out waiting for port 0 link configuration) and came up on its own about a second later. Rear 3 and rear 4 connected without it. The HDMI DCP on this machine logs the same timeout at every boot (j475d (Mac Studio M2 Ultra): dcpext RTKit boot times out (-62), apple-drm never binds — HDMI and Thunderbolt displays all stuck on simpledrm #428), where it does not retry by itself.
  3. While locked, the screens repeatedly turn back on. The Dell drops HPD about 7 s into standby and reasserts it 0.5 s later, and Hyprland's backend then re-enables the DPMS-off outputs. That is a compositor issue, reported as DPMS-off outputs are turned back on when another connector's hotplug triggers a CRTC recheck hyprwm/aquamarine#495, and it also happens with the LG switched off.

Related: #428 (J475d HDMI), #379 (m1n1 DART fix), and fc4add9 / 4ef8124, which added these routes for the non-Ultra boards.

…ports

On the Mac Studio (M2 Ultra) no display controller is wired to the four
rear USB-C ports, so a USB-C DisplayPort display there never lights up.
The dcpext1 routes in t602x-j474-j475.dtsi sit inside the
APPLE_T602X_NON_ULTRA block together with the USB4/PCIe-C wiring, and
t6022 does not define it.

The die-0 half of the t6022 keeps the plain labels and the same rear-port
wiring as the M2 Max Studio. macOS on a J475d drives a DP alt mode display
on rear ports 1 and 2 from DCPEXT1 through the display crossbar (ADT
display-crossbar0, "display-crossbar,t602x"), the same controller the
non-Ultra boards use. Keep only the USB4 aliases, the PCIe-C tunnels and
the non-Ultra display iommus under the guard. The dcpext1 display routes,
dpaudio2, the ATC crossbars and the always-on ATC common power domains now
apply to J475d too.

t6022-jxxxd.dtsi points the display subsystem at the die-1 HDMI DART only,
so add dispext1_dart to it on J475d for the framebuffers of the new pipe.

J474s and J475c keep the same nodes and properties; only the position of
the dcpext1 alias within /aliases changes.

Signed-off-by: Jacob Crowther <3944151+jcrowthe@users.noreply.github.com>
@jcrowthe

Copy link
Copy Markdown
Author

Follow-up stacked on this one: #463 enables Thunderbolt DP tunnels on the J475d (t6022 qualification in thunderbolt_apple and phy-apple-atc, plus dual-stream DT wiring with die-0 dcpext0). It includes this commit unchanged as its base, so merging #462 first keeps #463's diff to its own three commits.

@scottjones scottjones added the ci:build Build, test and boot the kernel for this PR now label Nov 13, 2026

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. We've been wanting M2 Ultra display support for a while, and narrowing APPLE_T602X_NON_ULTRA instead of copying the routes into a J475d file is the right call. The test table and the macOS ioreg notes made it easy to follow.

I built J474s, J475c and J475d (with j414s and j416c as a control) at the base, at #462 and at #463, and diffed the decompiled trees. J474s and J475c only change in /aliases order, which is harmless since aliases are looked up by name. The J475d delta matches what you describe, with no dangling references and no dtc warnings. No bugs found.

I've put a few questions on #463, since most of them are about the tunnel side. The J474s/J475c one applies here too: has anyone run this on one of those boards, or is the DT diff the only check so far?

As a first-time contributor your CI runs need a maintainer to start them. I've started the full build, KUnit and boot run, and I'll approve once it's green and the questions are answered.

@jcrowthe

Copy link
Copy Markdown
Author

Thanks! I've answered the questions on #463, including J474s/J475c: I don't have either board, so the DT diff is the only check from me. I've asked @ytgconsulting, who has a J475c, whether they can try a DP-alt display on a rear port.

One correction to the table above: "Coldplug" there meant attached across a reboot. I've since done a real power-on with the UltraFine attached, and it comes up (details on #463).

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. CI is green, and the J474s/J475c device trees come out unchanged. Before this merges I'd like the J475c check with a DP-alt display on a rear port, if ytgconsulting can run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:build Build, test and boot the kernel for this PR now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants