Skip to content

t6041-j575c: USB-C displays on all four back ports - #1871

Open
7robertodantas wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
7robertodantas:j575c-usbc-displays
Open

7robertodantas wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
7robertodantas:j575c-usbc-displays

Conversation

@7robertodantas

Copy link
Copy Markdown
Contributor

Summary

The J575c (Mac Studio, M4 Max) drove a USB-C display on typec1 only (#1546): dcpext1 had a single route, and the
tree deleted the display crossbars of ATC0, ATC2 and ATC3. macOS drives a display on each of the four back Type-C
ports. The J575c ADT has the four crossbars (atc0-3-dpxbar) and the external display processors dcpext0-3 at the
J614c/J616c's addresses, and iBoot starts dcpext2 here too (iop-dcpext2-nub).

This describes the ports as the J614c/J616c does (#1684), with the fourth port added:

  • dcpext1 gets a route to each of typec0-3 (t6041-j575c-usbc.dtsi), and atcphy0-3 are mode switches. The ATC0,
    ATC2 and ATC3 crossbars are no longer deleted.
  • dcpext2 is described with a route to each of typec0-3 (t6041-j575c-usbc-dcpext2.dtsi), as
    t6041-j616c-usbc-dcpext2.dtsi with the fourth route. With HDMI on dcpext0, two USB-C displays can run at the same
    time, each on any back port.
  • Display gate: the J575c USB-C chain enables the four crossbars and four routes, and a new J575c chain enables
    dcpext2 with its four routes.

The DT and the gate change are one commit. dcpext1's crossbars must be enabled by the gate, and the old gate list
names nodes the old tree deletes, so either half alone would break typec1's display.

The loader side needs no change: aura's t6041_exts fills dcpext2's firmware memory (aura f0adc275). The aura
build in a Stage 2 has to be at least that recent; with an older one dcpext2 keeps its placeholder and the gate
leaves its chain off, and dcpext1 works as before.

dcpext3 (a third USB-C processor) can follow the same way once #1793 adds a fourth T6041 gate chain. This PR does
not depend on #1793, but both edit the T6041 chain table in display-gate.c, so the second to merge may need a
small rebase.

Testing

J575c (macOS 27.2.1 installed). Kernel: integration/aurora 17a7c5f + this change, the same diff as the commit
here, which is rebased onto 5d112b1 without conflicts. aura main 3351432, U-Boot 250385f8. One USB-C to HDMI adapter (pin assignment D, two DP lanes beside USB3) to a 2560x1440 monitor. HDMI
to a second monitor (dcpext0) the whole time.

Port dcpext1 dcpext2 (test-only tree)
typec0 pass, first try pass, first try
typec1 pass, first try (boot-attached and two replugs) pass, first try
typec2 unreliable, see below unreliable, see below
typec3 pass, first try (boot-attached and replugs) pass, first try (boot-attached)
apple-t6041-display: /dcp@606e00000 enabled
apple-dcp 606e00000.dcp: allocated Type-C DPTX PHY 3
phy-apple-t6040-usb2 39aa90000.phy: DP PHY pin D: two lanes, USB3 retained, normal orientation
apple-dcp 606e00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:22

With a single display the first free processor, dcpext1, always takes it. To exercise dcpext2, a test-only tree
deleted dcpext1's routes and the connector endpoints that point at them, and enabled the four crossbars in the DT
(dcpext1's chain normally enables them). That tree is not part of this PR.

typec2: link training fails with DPTXPort: firmware reports link fault 22 on target 0:2 on both processors and
in both plug orientations. The driver retries every ~4 s. It came up after one retry (dcpext1) and after two
(dcpext2). It kept failing for over a minute once, also when attached at boot, while the same adapter worked at once
on typec3. macOS 27.2.1 on the same machine does not drive a display on typec2 with this adapter either: the
monitor reports no HDMI signal, in both orientations, before and after login, while typec0, typec1 and typec3 work
there too. So this is the port or the adapter on this unit, not this change. typec2's PHY tunables also match its ADT
(the one typec2-specific tunable_AUSPLL_CORE word, 0x49, is copied correctly).

Checks: CHECK_DTBS=y for t6041-j575c, t6041-j614c and t6041-j616c: no warnings. checkpatch: 0 errors.

Not tested: two USB-C displays at once (one adapter); typec2 with another adapter or cable.

AI disclosure: an LLM (Claude) helped compare the ADT with the tree, write this change and its description, and run
the tests. I reviewed the result and ran every hardware step on my Mac Studio.

🤖 Generated with Claude Code

The J575c drove a USB-C display on typec1 only: dcpext1 had a single
route, and the tree deleted the display crossbars of ATC0, ATC2 and ATC3.
macOS drives a display on each of its four back Type-C ports, and the
J575c ADT has the four crossbars (atc0-3-dpxbar) and the external display
processors dcpext0-3 at the J614c/J616c's addresses. iBoot starts dcpext2
here too (iop-dcpext2-nub), and aura's t6041_exts fills its firmware
memory.

Describe the ports as the J614c/J616c does, with the fourth one added:

- dcpext1 gets a route to each of typec0-3 (t6041-j575c-usbc.dtsi), and
  atcphy0-3 are mode switches. The ATC0, ATC2 and ATC3 crossbars are no
  longer deleted.
- dcpext2 is described with a route to each of typec0-3
  (t6041-j575c-usbc-dcpext2.dtsi), as t6041-j616c-usbc-dcpext2.dtsi with
  the fourth route. With HDMI on dcpext0, two USB-C displays can then run
  at the same time, each on any back port.
- The display gate's J575c USB-C chain enables the four crossbars and the
  four routes, and a new J575c chain enables dcpext2 with its four routes.

The DT and the gate change together: dcpext1's crossbars must be enabled
by the gate, and the old gate list names nodes the old tree deletes.

Tested on a J575c with aura main (3351432), one USB-C to HDMI adapter
(pin assignment D) at 2560x1440, and HDMI connected throughout:

- dcpext1 drives typec0, typec1 and typec3, boot-attached and after
  replugs, on the first link training attempt.
- dcpext2 (with dcpext1's routes removed in a test-only tree) drives
  typec0, typec1 and typec3 the same way.
- typec2 is unreliable on both processors and in both plug orientations:
  link training fails with "DPTXPort: firmware reports link fault 22",
  and the driver retries. It came up after one or two retries twice, and
  kept failing for over a minute once, also when attached at boot. macOS
  27.2.1 on the same machine does not drive a display on typec2 with this
  adapter either (both orientations, "no HDMI cable" on the monitor),
  while typec0, typec1 and typec3 work, so this is the port or the
  adapter, not this change. Its PHY tunables match the ADT.

Not tested: two USB-C displays at once (one adapter).

Assisted-by: LLM
Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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