Skip to content

arm64: dts: apple: t6050-j714s: the left-back USB-C port (USB, USB4, DisplayPort) - #2017

Open
Isaac-Duarte wants to merge 10 commits into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s/left-back-port
Open

Isaac-Duarte wants to merge 10 commits into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s/left-back-port

Conversation

@Isaac-Duarte

@Isaac-Duarte Isaac-Duarte commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Add the J714s left-back USB-C port (ATC0, next to MagSafe): USB2/3, USB4/Thunderbolt PCIe/USB tunnels and DisplayPort alt mode/dock tunnels. This revision depends on aura #278 for activation and per-machine PHY tables. Older aura leaves the new port disabled.

The original six commits are kept (the connector-group binding and driver commits amended for review). Follow-up commits add a typed firmware ownership interface and make ATC0 conditional on that handoff. The last commit makes that interface generic (apple,atc-handoff), so other boards whose loader USB port sits on an ATC can reuse it; apple,connector-group is honoured on every SoC.

Port and display routing

  • Describe hpm0/typec2, PHY/mailbox, DRD and USB DARTs, USB4 router/mailbox/NHI/DART, LSTX GPIO77, PCIe tunnel/domain1/MSI slice, crossbar and DP clock gates. Addresses/interrupts and router/controller tables follow the J714s ADT and the existing ATC1/J716c descriptions; the DP clock-source register follows J716c's ATC0.
  • Keep DP-1..DP-6 stable through apple,connector-group. When ATC0 is handed over, its dcpext0/dcpext2/dcpext1 routes append as DP-7/8/9; dcpext1 remains tunnel-only.
  • Skip a route whose PHY or crossbar node is disabled, both in failsafe supplier preflight and route registration. Missing/malformed suppliers and ordinary lookup/defer errors still fail or defer; a merely late supplier is not dropped.

Ownership and calibration

All 27 ATC0 devices, power providers and crossbar start disabled. The generic apple,atc-handoff interface at /firmware/atc0-handoff names the port's PHY in apple,phy and the complete group in apple,devices; shared AUSS, CIO reset and AOP GPIO providers remain available to the existing ports. GPIO77 stays reserved until activation.

The static PHY tables and static apple,guest-port-reserved claim are removed. One copied PLL value differed from another J714s ADT, so replacing it with another constant would not establish a portable table.

The companion aura exports all 14 PHY tables from the current machine's ADT and enables the group only after USB and display shutdown, with zero retained DMA/overflow and no debug, console or sticky USB0 controller-use reservation. It updates a private DT copy, including the ownership claim and release of only GPIO77. Failed export/allocation/space leaves the disabled tree unchanged; malformed or previously activated ownership trees refuse the next stage. Debug/proxy boots keep ATC0 reserved for that boot. A read-only inherited-controller check requires the validated USB0 layout, powered PHY/DRD domains and held reset or the existing retired-device predicate; unproved states stay disabled.

Validation of the follow-up

Kernel head 4529f492a65232428ff76381fafd3a64fd0eead5; companion aura 9526e6a2cf89a77d72a1ea9cdcfd8a6ef13bcde9:

  • Full AArch64 aura image links; built-in logo verification passes.
  • 1,024 production policy combinations plus kernel/hibernation DT identity/error gates pass.
  • 18 inherited-controller state cases pass, including refusal of unpowered/unknown register access.
  • 20 ASan/UBSan end-to-end production ADT-to-DTB scenarios pass. They verify all 27 statuses, GPIO77-only release, other properties unchanged, byte-identical failure rollback, malformed/reused-group refusal and a second PLL input. Any MMIO aborts the harness.
  • Independent driver/ADT checks pass 14/14 tables and physical-bank/bounds validation for each of ATC0, ATC1 and ATC2 after handoff.
  • All 11 T6050 DTBs compile W=1. Only J714s differs from the original base; the original parent's head/base comparison had identical 35 warning records. The handoff binding and full-schema J714s base/head comparison pass with no added warnings.
  • Display C code is unchanged from parent 33d56ee4defc: independent QEMU arm64 topology 6/6 and fabric 116 pass/1 existing skip; git diff --check passes.

Reproduction and retained artifact commands are documented in the companion's docs/j714s-atc0-handoff.md.

Prior author hardware evidence and remaining qualification

The earlier version was tested on J714s using integration c33c5fd plus the six original commits before the bf423bf rebase. That evidence includes dock USB3/PCIe and DP-7/8/9 across reboots, DP alt mode plus a dock on another port in both arrangements, monitor power cycles on all three ports, suspend-to-idle without dock displays, disabled-PHY route skipping and forced enabled-PHY failure behavior. These results do not qualify the new producer handoff.

Draft: the follow-up has not been installed or booted on our J714s. New native debug-host preservation and normal-port activation tests are required before merge. Four-display pipeline pressure and deep sleep with an ATC0 device also remain open. The installed default is unchanged; no physical-port or deep-sleep pass is inferred from CPU/build results.

An enabled PHY that fails to probe can still make every dcpext listing it become unusable after the existing deferred-probe timeout; the panel and other ports' USB remain available. Existing inherited-connection SuperSpeed fallback and intermittent dock/DP tunnel timeouts remain separate issues. This change does not claim to resolve them.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

We can't validate this one on our M5 Pro (J714s) rig: the left-back USB-C port is the one that carries the rig's debug link to the host, so nothing else can be plugged into it there, and a test boot that changes that port could cut the link. We're leaving its hardware check to someone with a free left-back port, and we haven't tested it here.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Note from the J714s display validation today: this PR was NOT tested here. Our rig's debug cable uses the left-back port, so that port can't carry a display or USB4 device in our setup. None of our kits (k2b to k6, run for #1921/#2006 and our follow-up fixes) included this branch.

@Isaac-Duarte
Isaac-Duarte force-pushed the j714s/left-back-port branch 3 times, most recently from cc70a54 to 862f08d Compare November 16, 2026 01:44
The J714s's third USB-C port, the left-back one next to MagSafe (ATC0),
has no description, so nothing plugged into it works. Add its USB 2/3
chain: the SN201202x hpm0 on nub-spmi-a0 at 0xc with its connector, the
combo PHY with its firmware mailbox, usb-drd0 and its two DARTs, and the
ATC0 power domains.

The values are the left-front port's (ATC1) moved to ATC0: register
blocks less 0x8000000, interrupts less 32 (the PHY mailbox's less 10).
They match the J714sAP ADT, J716c's ATC0 and the T6050 inventory, whose
usb_drd0, usb0_dart, usb0_dart1 and ps_atc0_* nodes this enables; the
DRD's tunables are the same on every port. The PHY's DP clock source
register, which the ADT does not give per port, is ATC1's less 0x10, as
on J716c.

The inventory makes the FAB3 SoC domain ATC0_COMMON's parent. That
domain is not described on J714s, and ATC1's and ATC2's common domains
have no parent here, so drop it rather than hand FAB3 to Linux (J716c
enables ps_fab3_soc instead, which puts it under genpd's unused
power-off).

The connector is typec2, after the right (typec0) and left-front
(typec1) ones. hpm0 joins the other port controllers in
t6050-j714s-sleep.dtsi with apple,sleep-ssps.

This is the debug (DFU) port, as the ADT marks it (hpm0 has
uart-hpm-rids, usb-drd0 the NCM debug gadget's settings), and the boot
loader's debug link: the console on serial0 (the dockchannel UART) and,
on request, its USB proxy, whose USB2 route it sets with one DVEn action
in a short DBMa session. The boot loader has so far kept the port out of
the DT on purpose ("Port 0 carries aura's debug link: never describe
it"); this hands it to Linux. tipd, the PHY and the DRD's role switch
then decide what the USB2 pair carries, and the port's domains and DARTs
are Linux's, including genpd's power-off when unused.

The boot loader exports the PHY's tunables for ports 1-5 only, so this
port's are in the DT, from the J714sAP ADT's atc-phy0 (and usb-drd0's
PIPE handler table). They are ATC1's except in axi2af, aus40cmn-shm and
cio4pll.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Add the left-back port's (ATC0) USB4/Thunderbolt router and its PCIe
tunnel, so a USB4 or Thunderbolt dock works there as on the other two
ports: acio0 with its CPU mailbox, DART and NHI, the PCIe-C root port
apciec0 and its DART, their power domains, the LSTX pin, the CIO
reconfig reset and the link from hpm0's connector.

Every address and interrupt is the left-front router's
(t6050-j714s-left-usb4.dtsi) moved to ATC0, and the result is the same
as J716c's ATC0 router and tunnel (t6050-j716c-left-usb4.dtsi),
including the LSTX pin (AOP GPIO 77, now exposed with 79 and 81), the
PCIe windows, MSI slice 128-159 and PCI domain 1, which nothing else
uses here. The inventory's apciec0_dart gives way to the tunnel's, as
for ATC1. The AOP GPIOs' reserved ranges, which leave only the routers'
LSTX pins, move from t6050-j714s-left-usb4.dtsi to the board file, the
one place that knows all three.

The router, NHI, DART and tunnel tunables are ATC1's: they are the same
on ATC1 and ATC2 here and on J716c's ATC0 and ATC1. The router also gets
its four DP IN interrupts (AIC 1603, 1604, 1609, 1610; the inventory's
atc0-dpin0..3, as on J716c), so DP IN events need not be polled once a
display pipeline is routed to this port.

The host DROM and the PHY's CIO80 RX_TOP tunables are the J714sAP
ADT's (acio0 thunderbolt-drom, atc-phy0 tunable_LN0/LN1_RX_TOP_CIO_DFLT).
The ADT's acio0, acio-cpu0, dart-acio0, apciec0, dart-apciec0 and
atc0-dpin0..3 registers, interrupts, LSTX pin (77) and PCIe ranges and
domain agree with the values above.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
@Isaac-Duarte
Isaac-Duarte marked this pull request as ready for review November 16, 2026 19:07

Copy link
Copy Markdown
Contributor

Independent review/testing of 33d56ee. I would keep this unmerged pending the ATC0 data/handoff issues below.

  1. The static ATC0 PLL table does not match another J714s. t6050-j714s-left-back.dtsi:354 supplies <0x4c 0xfe7f 0x4e1e> in apple,tunable-cio4pll. Our retained J714sAP / Mac17,9 ADT supplies <0x4c 0xfe7f 0x4e1d> in atc-phy0/tunable_CIO4PLL_CORE. The changed bits are inside the write mask. An independent check using the exact-head driver tables checked all 175 ATC0 records, physical bank addresses and write bounds: 13/14 properties match exactly, with this one record differing. The compiled DTB independently reproduces the mismatch. Aura skips port zero, so its usual per-machine ADT export does not replace this static tuple. This needs a per-machine export/handoff, or evidence that the constant is safe across these ADTs; replacing it globally with our value would not establish that. The retained ADT is from 2026-11-08, so per-unit versus firmware variation is not distinguished, and no electrical malfunction is claimed.

  2. The documented debug-port handoff remains a merge gate. apple,guest-port-reserved admits the PHY but is not proof that the producer relinquished the active DVEn route or stopped its USB DMA. Aura still deliberately skips ATC0, and its retained-DMA memory reservation is not an exclusive-ownership handshake for the port/DART. Please settle the active-debug-host and retained-DMA cases with aura, including refusal when ownership cannot be transferred. The debug-host boot/replug item in the PR remains unvalidated here.

Independent automated results at this exact head, on Fedora/QEMU arm64:

  • apple-dcp-topology: 6/6 passed, no skips, including connector grouping and disabled-supplier/route tests.
  • apple-dcp-fabric: 116 passed, 1 existing skip (S35_dual_retry_off, covered by W3), no failures.
  • All 11 T6050 DTBs built with W=1 at this head and base bf423bf0e42c2599fe9de617225d218b61ca55df. Only t6050-j714s.dtb differs; the other ten are byte-identical. Both builds have the same 35 normalized warning records, with none added or removed.
  • git diff --check passed. The source remained clean at the exact tested head.

These are independent source/build/QEMU/retained-data results. No trial kernel/DTB was installed or booted on our J714s, and no physical left-back USB/USB4/DP, DebugUSB or deep-sleep pass is claimed. Our target debug link occupies that port; the original default remains unchanged. Earlier comments about the absence of our hardware coverage still apply.

Copy link
Copy Markdown
Contributor

Pushed two follow-up commits on top of the original six, head 19c1940, with companion aura #278 at 7f73ae62a01be854fe1e8996f21da749679db800.

The kernel DT now starts all 27 ATC0 devices/power providers/crossbar disabled, keeps GPIO77 reserved and removes the static PHY tables and ownership claim. The companion producer exports the current machine's 14 tables and enables the group atomically only after successful shutdown, zero retained DMA/overflow and no debug/proxy/controller-use ownership. Partial gadget registration and prior failed shutdown cannot be hidden by a later empty stop. Shared providers and other GPIO reservations are preserved. Older aura safely leaves ATC0 disabled.

Validation of the follow-up:

  • Full AArch64 aura image builds and logo verification passes.
  • 512 production policy combinations and kernel/hibernation identity/error gates pass.
  • 18 ASan/UBSan end-to-end ADT-to-DTB scenarios pass: all 27 nodes and GPIO reservations checked, other properties unchanged, failed allocation/space/export rolls back byte-for-byte, malformed/reused groups refuse, and a second PLL input is exported correctly. Every MMIO access aborts these tests.
  • Independent driver/ADT validation now passes 14/14 tables for each of ATC0, ATC1 and ATC2, including the previously mismatched PLL.
  • All 11 T6050 DTBs compile W=1. The new handoff binding and targeted DT schema check pass. The display C code is unchanged from the parent tested earlier (topology 6/6, fabric 116 pass/1 existing skip).

Both changes remain draft pending native debug-host and normal-port qualification of this new handoff. No new image or DTB was installed/booted on our J714s, no physical port/deep-sleep result is inferred, and the default remains unchanged. The original author's hardware results describe the earlier version, not this follow-up. Reproduction is documented in the companion's docs/j714s-atc0-handoff.md.

@Isaac-Duarte

This comment was marked as off-topic.

@Isaac-Duarte

Copy link
Copy Markdown
Contributor Author

Thanks for helping here hard to test without s second mac! Appreciate it!

@Isaac-Duarte
Isaac-Duarte marked this pull request as ready for review November 16, 2026 21:04

Copy link
Copy Markdown
Contributor

CI integration fixes are pushed: kernel 4529f49, paired aura 9526e6a2cf89a77d72a1ea9cdcfd8a6ef13bcde9. The closed core /chosen schema correctly rejected the earlier extension, so the group now has its own typed /firmware/atc0-handoff interface and closed binding. Full local J714s schema comparison has 12 baseline/head diagnostic lines and zero added or removed diagnostics. The rebuilt producer passes 1,024 policy cases, 18 inherited-state cases, 20 sanitizer E2E scenarios and four affected USB pytest checks. The macOS host test now uses native ABI types while retaining the production register definitions and strict checks. CI is rerunning on the matching heads; I am keeping ownership until it is green. Native qualification/default limits are unchanged.

Copy link
Copy Markdown
Contributor

Confirmed CI is green on the final matched heads: Linux 4529f49 passes both Host tests and Device tree checks; companion aura 9526e6a2cf89a77d72a1ea9cdcfd8a6ef13bcde9 passes all six workflows, including the macOS/compiler test matrix and both size checks. The schema and host-ABI failures were corrected without skipping jobs or relaxing validation. Local build/E2E evidence and native-qualification limits remain as documented. No merge, installation or default change performed here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the left-back port work, and for the earlier J714s results on the first version. Two code points, then the row for the current head:

  1. drivers/gpu/drm/apple/dcp-fabric.c:4820-4821 ignores apple,connector-group unless dcp_typec_fixed_crtcs() is true, and that helper is of_machine_is_compatible("apple,t6050") (:395). Grouping is a board-description property, so please honour it wherever the DT has it. If fixed CRTCs really are a property of the T6050 display fabric, the cleaner place to say so is the fabric's own compatible or a DT property on the fabric node, not the root compatible. A new property can be honoured on its own presence, without the helper.

  2. The handoff interface is named for one board and one port: apple,j714s-atc0-handoff (Documentation/devicetree/bindings/firmware/apple,j714s-atc0-handoff.yaml:22, t6050-j714s-left-back.dtsi:696). Nothing in it is J714s-specific: it is a group of nodes that stays disabled until the loader releases a Type-C port it may be using. A generic name such as apple,atc-handoff (with the PHY phandle and apple,devices) lets the same binding and aura code cover other boards whose loader USB port sits on an ATC. The aura side (drm: apple: isolate an experimental T8140 external display profile #278) would follow the same rename.

Row needed on a J714s with the left-back port free, using this head and aura #278 9526e6a2:

  • Boot log shows ATC0 handed over. A USB3 device on left-back enumerates at 5 Gb/s or more (lsusb -t).
  • A Thunderbolt dock on left-back: boltctl list shows it authorized, lspci -t shows its PCIe devices, and unplug/replug x3 re-enumerates each time.
  • A DP alt-mode monitor on left-back modesets (modetest -c shows the connector as connected, still DP-7 or later), and DP-1..DP-6 names are unchanged on the other ports.
  • A boot with the loader's debug USB on left-back keeps the link and leaves ATC0 disabled.

After that, we can run no-regression rows on our A18 Pro (Neo) and M4 Pro (displays and USB-C on every port).

Isaac-Duarte and others added 8 commits November 19, 2026 11:52
On T6050 every Type-C port/pipeline pair gets a DRM connector, numbered
pipeline by pipeline, with tunnel-only routes after the others.
Userspace keys per-monitor settings on the connector names, so a port
whose routes are added to a board later must not take names the
existing connectors have.

Add a route property, apple,connector-group (0 to 3, default 0): the
connectors are created group by group, so a port added to a board in
the next group gets the next names. It is meant to be the same for all
routes to one port. On SoCs with a connector per port/pipeline pair,
the tunnel-only routes' come after the others in each group.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
apple_probe_typec_ports() creates T6050's port/pipeline connectors
pipeline by pipeline, and the tunnel-only pairs in a second pass. A
port added to a board takes a place in every pipeline's run, so every
later connector is renumbered: on the J714s, a left-back port would
turn dcpext2's right-port connector from DP-3 into DP-4, and so on.

Create the connectors group by group (apple,connector-group, default
0). The number of passes is two per group, up to the largest group a
route has. On T6050 the tunnel-only pairs come after the others in
each group: dcp_typec_port_pass() replaces dcp_typec_port_tunnel_only()
and gives a pair's pass. Elsewhere a port's routes share its
connectors, which take the first pass of the port's largest group.
Without the property nothing changes.

A malformed group, or one above 3, fails the route's registration.

The topology test builds the J714s's fabric (three ports, dcpext0 to
dcpext2 with dcpext1 tunnel-only) and checks the connector order:
DP-1..DP-6 as before for the right and left-front ports, and the
left-back port's pairs as DP-7..DP-9 in group 1 (or a later group),
where in group 0 they would take DP-3. It also checks a port's shared
connector pass.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
…isabled

A DCP's Type-C routes are all or nothing, and a disabled PHY or
crossbar never registers, so looking it up defers for ever. A failsafe
external DCP (T6050's) waits for it in its supplier preflight,
dcp_ext_route_suppliers(), until deferred probing gives up (about 10 s
after boot), then joins the display subsystem as an unusable pipe with
every route disabled. A native T6030 one disables all its routes, and
any other fails its probe. One port's disabled PHY so costs every
external display on every port.

Leave out a route whose PHY or crossbar node is disabled, in the
preflight and when the routes register: dcp_typec_route_supplier_disabled()
makes that decision for both. Registration also disables the route in
the device tree, as is done for all of them on failure, so that its
port's controller stops waiting for its mode-switch.

Only a disabled node does this. A missing or malformed phys or
mux-controls entry, and every lookup error (-EPROBE_DEFER included),
defer or fail as before, and a supplier that is merely late is waited
for, never dropped. A PHY that is enabled but fails to probe holds
every DCP that lists it until deferred probing gives up, as before: a
failsafe dcpext then joins as an unusable pipe, with no route.

dcp_typec_routes_disable_dev() and the new single-route disable share
one helper, which builds and applies one changeset.

The topology tests apply an overlay with an available and a disabled
PHY and an available and a disabled crossbar. They check the per-route
decision, which routes registration skips, and that a skipped route
ends up disabled (the test reverts the changeset). They need
CONFIG_OF_OVERLAY; tests/topology.kunitconfig has what the topology
suite needs:

  tools/testing/kunit/kunit.py run --arch=arm64 \
	--kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Give the left-back port (ATC0, typec2) the display routes the other two
ports have: DP alt mode and USB4 DP tunnels through dcpext0 and dcpext2,
and tunnels only through dcpext1.

- Each DCP gets route@2 to a new typec2 endpoint, the ATC0 PHY's DP
  output (DPTX PHY 0) and the left-back crossbar's controls, named
  typec2 and typec2-dpin0..3, with the crossbar sources it uses on the
  other ports (dcpext0 0, dcpext1 2, dcpext2 4).
- dcpext1's route is apple,tunnel-only: hpm0, like hpm1 and hpm2, has
  TYPEC_MUX_MAX_DEVS (3) mode-switch providers with the PHY, dcpext0
  and dcpext2.
- The three routes are in apple,connector-group 1, so their
  connectors come after the existing six: DP-1..DP-6 keep their ports and
  pipelines, and the left-back port's are DP-7 (dcpext0), DP-8
  (dcpext2) and DP-9 (dcpext1).
- The inventory's atc0_dpxbar is enabled with ATC0's always-on and
  common domains, as atc1_dpxbar, and the PHY gets the four
  ATC0_COMMON_DP tunnel clock gates, as J716c's atc0_phy.
- Every DCP now lists the left-back PHY and crossbar. A route whose PHY
  or crossbar node is disabled is left out, but a PHY that is enabled
  and fails to probe holds every dcpext until deferred probing gives up
  (about 10 s); they then join as unusable pipes with no route, so the
  panel works and no external display does, on any port. The header
  comment says so.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Describe the disabled device group a boot producer may hand to Linux only
after releasing its debug/USB ownership and supplying per-machine PHY
tables. Keep shared providers outside the group.

Signed-off-by: Diljit Singh <hey@djdev.me>
The left-back port can still belong to the debug producer, and its static
PHY tables do not match every J714s ADT. Remove those tables and the static
ownership assertion. Keep the ATC0 devices, power domains and crossbar
disabled until the producer exports its own ADT values and enables the
complete handoff group.

Keep LSTX reserved until that transaction releases it. Existing ports and
their shared AUSS, GPIO and CIO reset providers remain available. Older
producers safely leave the new port disabled.

Signed-off-by: Diljit Singh <hey@djdev.me>
The core chosen schema is closed, so an extra schema cannot make its
vendor property valid. Move the group into an explicitly compatible
firmware node with a required device list and a closed binding. Keep the
existing ownership and disabled-device rules intact.

Signed-off-by: Diljit Singh <hey@djdev.me>
Nothing in the J714s ATC0 handoff is specific to that board or port: it
is a group of a Type-C port's devices that stays disabled until the boot
producer releases the port it may be using. Rename the binding to
apple,atc-handoff so other boards whose producer's USB port sits on an
ATC can use it, and name the port's PHY with apple,phy, so the producer
does not have to find it among the devices.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
@Isaac-Duarte

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Both code points are addressed in fc40a06.

  • apple,connector-group: it is now honoured wherever the DT has it, with no warning and no SoC check. On T6050 each port/pipeline pair still takes its pass (tunnel-only pairs after the others in each group). Elsewhere a port's routes share its connectors, and those connectors take the first pass of the port's largest group. Without the property, nothing changes anywhere. dcp_typec_fixed_crtcs() itself (the root-compatible check) predates this PR and is unchanged here. Moving it to the fabric's compatible or a fabric property seems like its own change. The binding text no longer says the property is ignored on other SoCs, and the topology test now also checks a port's shared-connector pass.
  • Handoff name: a new commit on top of Dj's renames the binding to apple,atc-handoff (Documentation/devicetree/bindings/firmware/apple,atc-handoff.yaml) and adds a required apple,phy phandle next to apple,devices. The J714s node keeps its /firmware/atc0-handoff path but uses the new compatible. The matching aura change finds the interface by compatible instead of by path, takes the PHY from apple,phy (it must be in the group, and the group may hold no other PHY), and adds two refusal cases: apple,phy missing, and apple,phy naming a non-PHY member. The patch on top of drm: apple: isolate an experimental T8140 external display profile #278 (9526e6a2) is below. @DjDeveloperr, do you want to take it into drm: apple: isolate an experimental T8140 external display profile #278, or should I open it separately? The rest of aura's handoff is still J714s/T6050-specific: the apple,j714s root check, port 0 and the GPIO77 release. I left that alone. Generalising it seems best done when a second board needs it.
aura: find the ATC handoff by its generic compatible
From cbadacd7658d5d817b0c3911d27366bcf7af0122 Mon Sep 17 00:00:00 2001
From: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Date: Thu, 19 Nov 2026 11:56:10 -0700
Subject: [PATCH] kboot: find the ATC handoff by its generic compatible

The Linux binding is now apple,atc-handoff, not specific to one board
or port, and names the port's PHY with apple,phy. Find the interface by
compatible and take the PHY from apple,phy: it must be in the group, and
the group may hold no other PHY.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
---
 docs/j714s-atc0-handoff.md  |  6 +++---
 src/kboot.c                 |  4 ++--
 src/kboot_atc.c             | 12 ++++++++----
 tests/atc0_handoff_cases.py |  3 +++
 tests/atc0_handoff_host.c   |  3 +--
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/docs/j714s-atc0-handoff.md b/docs/j714s-atc0-handoff.md
index 608d0bf6..abcba29c 100644
--- a/docs/j714s-atc0-handoff.md
+++ b/docs/j714s-atc0-handoff.md
@@ -1,8 +1,8 @@
 # J714s ATC0 ownership handoff
 
 The Linux left-back USB-C description starts disabled. The
-`apple,j714s-atc0-handoff` node at `/firmware/atc0-handoff` lists the 27
-ATC0 power, PHY, USB, HPM,
+`apple,atc-handoff` node at `/firmware/atc0-handoff` names the ATC0 PHY in
+`apple,phy` and lists the 27 ATC0 power, PHY, USB, HPM,
 router, tunnel and crossbar nodes in `apple,devices` that may be enabled together. Shared AUSS,
 CIO reset and AOP GPIO providers are not members. GPIO77 remains reserved.
 An older producer leaves this port disabled; the existing two ports still work.
@@ -25,7 +25,7 @@ activation. This probe is read-only and never powers, resets or stops a device.
 
 Only the known kernel DT buffer or registered hibernation copy is eligible.
 All group handles must be valid, unique and explicitly disabled. The group
-must contain the ATC0 PHY and router; its LSTX reference must identify pin77,
+must contain the ATC0 PHY named by `apple,phy`, no other PHY, and the router; its LSTX reference must identify pin77,
 which must still be reserved. An already-enabled or malformed group refuses
 the next-stage boot, including a repeated handoff against an activated tree.
 
diff --git a/src/kboot.c b/src/kboot.c
index f6001c35..4a2b8c0f 100644
--- a/src/kboot.c
+++ b/src/kboot.c
@@ -12032,8 +12032,8 @@ int kboot_finalize_atc0(bool usb_stopped, bool debug_reserved)
     if (!next_stage.entry || !size || chip_id != T6050 ||
         fdt_node_check_compatible(fdt, 0, "apple,j714s"))
         return 0;
-    int handoff = fdt_path_offset(fdt, "/firmware/atc0-handoff");
-    if (handoff < 0 || fdt_node_check_compatible(fdt, handoff, "apple,j714s-atc0-handoff"))
+    int handoff = fdt_node_offset_by_compatible(fdt, -1, "apple,atc-handoff");
+    if (handoff < 0)
         return 0;
     if (!fdt_getprop(fdt, handoff, "apple,devices", NULL))
         return -1;
diff --git a/src/kboot_atc.c b/src/kboot_atc.c
index 61f470a5..3b6611d8 100644
--- a/src/kboot_atc.c
+++ b/src/kboot_atc.c
@@ -1215,9 +1215,13 @@ int kboot_handoff_atc0(void *dt, int capacity, bool safe)
 
     if (chip_id != T6050 || fdt_node_check_compatible(dt, 0, "apple,j714s"))
         return 0;
-    int handoff = fdt_path_offset(dt, "/firmware/atc0-handoff");
-    if (handoff < 0 || fdt_node_check_compatible(dt, handoff, "apple,j714s-atc0-handoff"))
+    int handoff = fdt_node_offset_by_compatible(dt, -1, "apple,atc-handoff");
+    if (handoff < 0)
         return 0;
+    const fdt32_t *phy_prop = fdt_getprop(dt, handoff, "apple,phy", &len);
+    if (!phy_prop || len != 4)
+        return -1;
+    phy_handle = fdt32_to_cpu(*phy_prop);
     const fdt32_t *group = fdt_getprop(dt, handoff, "apple,devices", &len);
     if (!group || len <= 0 || len % 4 || len > (int)sizeof(handles))
         return -1;
@@ -1234,10 +1238,10 @@ int kboot_handoff_atc0(void *dt, int capacity, bool safe)
                 return -1;
         if (!fdt_node_check_compatible(dt, node, "apple,t6050-combo-phy")) {
             const fdt32_t *port = fdt_getprop(dt, node, "apple,port-index", &slen);
-            if (phy >= 0 || !port || slen != 4 || fdt32_to_cpu(*port))
+            /* The named PHY (port 0) is the group's only one */
+            if (handle != phy_handle || !port || slen != 4 || fdt32_to_cpu(*port))
                 return -1;
             phy = node;
-            phy_handle = handle;
         }
         if (!fdt_node_check_compatible(dt, node, "apple,t6050-usb4-acio")) {
             if (router >= 0)
diff --git a/tests/atc0_handoff_cases.py b/tests/atc0_handoff_cases.py
index 0fab49f9..fb5cb120 100644
--- a/tests/atc0_handoff_cases.py
+++ b/tests/atc0_handoff_cases.py
@@ -159,6 +159,9 @@ case('bad-phandle', 'allow', -1, mutate=lambda f: put(f, interface, prop, ['0',
 case('duplicate-phandle', 'allow', -1, mutate=lambda f: put(f, interface, prop, [members[1], *members[1:]]))
 case('already-enabled', 'allow', -1, mutate=lambda f: put(f, phy, 'status', ['okay'], 's'))
 case('missing-phy', 'allow', -1, mutate=lambda f: put(f, phy, 'apple,port-index', ['1']))
+case('no-named-phy', 'allow', -1, mutate=lambda f: subprocess.run(
+    ['fdtput', '-d', str(f), interface, 'apple,phy'], check=True))
+case('wrong-named-phy', 'allow', -1, mutate=lambda f: put(f, interface, 'apple,phy', [members[0]]))
 case('dangling-phandle', 'allow', -1, mutate=lambda f: put(f, interface, prop, ['deadbeef', *members[1:]]))
 case('malformed-list', 'allow', -1, mutate=lambda f: put(f, interface, prop, ['1'], 'bx'))
 case('reused-tree', 'allow', -1, base=enabled)
diff --git a/tests/atc0_handoff_host.c b/tests/atc0_handoff_host.c
index 2a4283bb..0639f108 100644
--- a/tests/atc0_handoff_host.c
+++ b/tests/atc0_handoff_host.c
@@ -297,10 +297,9 @@ int main(int argc, char **argv)
     int expected = argc > 7 ? strtol(argv[7], NULL, 0) : 0;
     printf("kboot_handoff_atc0: %d (expected %d)\n", ret, expected);
     CHECK(ret == expected);
-    int handoff = fdt_path_offset(dt, "/firmware/atc0-handoff");
+    int handoff = fdt_node_offset_by_compatible(dt, -1, "apple,atc-handoff");
     bool expected_activation =
         chip_id == 0x6050 && !fdt_node_check_compatible(dt, 0, "apple,j714s") && handoff >= 0 &&
-        !fdt_node_check_compatible(dt, handoff, "apple,j714s-atc0-handoff") &&
         fdt_getprop(dt, handoff, "apple,devices", NULL);
     if (!allow || ret || !expected_activation)
         CHECK(!memcmp(before, dt, cap));
-- 
2.56.1

Checks: local CI (host-tests and dt-checks) passes with the branch merged onto integration/aurora 6ae9c3c, with no new DT warnings. The DRM KUnit suites pass under qemu arm64, 178/179 (the one skip is an existing CONFIG_UCLAMP_TASK test), including topology 6/6. The aura host harness builds with ASan/UBSan. I haven't run its ADT-driven cases because I don't have a J714s ADT dump.

The hardware row on this head is next. I can do USB3, the TB dock and DP alt mode on left-back, plus the DP-1..DP-6 names. I can't do the debug-USB boot, because I don't have a second machine to act as the debug host.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks. Both points are done: apple,connector-group is honoured wherever the DT has it, and apple,atc-handoff with a required apple,phy is generic. Moving dcp_typec_fixed_crtcs() off the root compatible as its own change is fine. We will track that separately.

Remaining rows on a J714s, this head plus aura #278 with your patch:

  • A USB3 device on left-back enumerates at 5 Gb/s or more (lsusb -t).
  • A Thunderbolt dock on left-back: boltctl list shows it authorized, its devices appear in lspci -t, and unplug/replug x3 re-enumerates each time.
  • A DP alt-mode monitor on left-back modesets as DP-7 or later, and DP-1..DP-6 are unchanged.

The debug-USB boot needs a machine whose loader debug link is on left-back, so we will ask for it on such a rig rather than from you.

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.

3 participants