Skip to content

arm64: dts: apple: t8122-j615: describe the USB4 PCIe-C tunnels (stacked on #1490) - #2812

Draft
satchlj wants to merge 20 commits into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j615-usb4-pciec-tunnels-20261122
Draft

satchlj wants to merge 20 commits into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j615-usb4-pciec-tunnels-20261122

Conversation

@satchlj

@satchlj satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

Split out of #1490 at Ryan's request: the J615 (MacBook Air 15-inch, M3) DTS for the USB4 PCIe-C tunnels, with the J615 /delete-node/ &usb_otg0. The commit is Ryan's, carried unchanged (author, committer, dates, message).

Stacked on #1490. The DTS uses #1490's t8122-usb4.dtsi, so this branch is #1490's head (ca0bc8d) plus this one commit. Review and merge #1490 first.

Not run on hardware. There is no J615 row behind it; the J613 rows on #1490 don't cover J615.

Open from #1490's review: the /delete-node/ &usb_otg0 here has no loader version on record that needs it (#1490 dropped the J613 copy for that reason). Ryan's call to keep or drop it.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

satchlj and others added 20 commits November 10, 2026 16:21
Describe the existing four-range format used by the T8122 router.

Signed-off-by: Satya Benson <satya@benson.earth>
Read target, actual, busy and automatic state after release. Do not
override shared votes; let the caller quarantine restart when power-off
is unproven.

Signed-off-by: Satya Benson <satya@benson.earth>
Keep the two J613 ECAM windows in disjoint 32-vector slices of the ADT
AIC window.

Signed-off-by: Satya Benson <satya@benson.earth>
Use RUN with explicit pre-RTKit LSTX and strict firmware readiness;
disable DP tunnelling. Own power references and require a witnessed off
boundary before restart. Order PD, NHI and role/PHY shutdown. Keep the
T8122 session coordinator scoped to J613. The sequence was inferred from
the T6030 generation, not a J613 macOS restart trace, then exercised on
J613 hardware. Suspend coordination is carried from the trial but is not
hardware qualified; sleep remains outside admission.

Signed-off-by: Satya Benson <satya@benson.earth>
Use saved J613 ADT windows, interrupts and tuning. Populate the root
tunnel containers dynamically and include them only on J613. Own all
four ACIO domains. Drop the disabled unused OTG node whose shared
PHY/DARTs older Stage 2 loaders otherwise prune. Both J613 firmware
profiles inherit the repair.

Signed-off-by: Satya Benson <satya@benson.earth>
Compile the production function with missing and foreign domains, regmap
errors and each status bit independently injected. Extract provider
masks rather than duplicating register constants.

Signed-off-by: Satya Benson <satya@benson.earth>
Use one aperture selector for PCIe-C admission and its negative tests.
Reject unknown apertures rather than borrowing another bridge slice.

Signed-off-by: Satya Benson <satya@benson.earth>
The Apple NHI driver calls tb_apple_sleep_quiesce() from the Thunderbolt
core. With CONFIG_USB4=m and CONFIG_USB4_APPLE_SOC=m, these are separate
modules and modpost rejects thunderbolt_apple.ko with an undefined symbol.

Export the existing helper to GPL modules so the modular configuration
links. No quiesce behavior or hardware register access changes.

Validated with the J613 production configuration, LLVM 18 Image/modules/
DTBs build and modpost, plus strict checkpatch.

Signed-off-by: Satya Benson <satya@benson.earth>
Describe the T8122 PCIe-C compatible and its eight named resources,
and the ACIO post-init power-domain providers. Use valid hyphenated
names for the six new J613 USB4 aliases, retaining their node targets
and the inherited legacy aliases.

The renamed PCIe-C aliases require the legacy-first lookup fallback
in aurora-silicon/aura#273, built and adopted with the new DTBs.
Do not roll these DTBs out with an older incompatible Stage 2.

Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Satya Benson <satya@benson.earth>
Some USB4 routers must be stopped by the Type-C port driver, in a fixed
order ahead of the USB role and the PHY, before tasks freeze and at
shutdown. Others stop on their own. Let the provider say which it is in
its switch description, and give port drivers
typec_thunderbolt_switch_pd_ordered_stop() to ask, so they no longer have
to guess from the machine they run on.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8122 router policy (MxWrap RUN, explicit LSTX, strict firmware-ready
admission, witnessed power-off) was only taken on apple,j613. Every other
T8122 Mac with the same router - the 15-inch MacBook Air (J615), the
iMacs (J433/J434) and the MacBook Pro (J504) - fell back to the T8103
policy, which cannot start it.

What the policy needs is the router's MxWrap CPU block, which the device
tree names as the "cpu" resource. Take the T8122 policy whenever that
resource is described and keep the T8103 fallback otherwise (for example
an older loader's handoff tree without it).

The strict power cycle has to be stopped by the PD driver ahead of the
USB role and the PHY, so advertise that through the switch description
instead of letting the PD driver infer it from the machine.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The CD321x session stop before tasks freeze and at shutdown (ACIO, then
the USB role, then the PHY in safe mode) only ran on apple,j613. Run it
for whichever port's USB4/Thunderbolt switch asks for a port-driver stop
instead, and leave every other switch alone as before. The notifier is
registered for every CD321x and asks the switch on each suspend, because
the router may bind after the port.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Cover the suspend notifier with a router that stops on its own (nothing
is sent to it) and with one that asks the port to stop it (SLEEP before
the freeze, WAKE after it).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
pd_ordered_stop asks the Type-C port driver to stop the USB4 session
before tasks freeze and at shutdown. Only the SPMI SN201202x driver had a
.shutdown, so on the T8122 Macs whose CD321x sits on I2C (J433, J434,
J504) the router took the strict power cycle at device_shutdown with the
USB role and PHY still owned by the port.

Give the I2C driver the same .shutdown. The I2C driver also binds plain
TPS6598x parts, which have no struct cd321x around them, so
tipd_shutdown() now returns early for a port whose variant does not
embed one, and a KUnit case covers that.

On a PREPARE that fails, the PM core skips our POST_SUSPEND: clear
session_pm_armed on that path too so the state stays obvious.

Macs that take the T8122 router policy (ACIO node names "cpu", shared
t8122.dtsi): J433, J434, J504, J613, J615; their ports get the
PD-ordered sleep and shutdown stop.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The PCIe-C tunnel DARTs probe as devices of their own and sit inside the
ATC's CIO-PCIe block, which their tunnel's root port already names. Give
each DART the same power state so it is never probed or read while that
block is off. apple-dart-pd-check.py reported both as new findings on
the J613 and J615 DTBs; it reports none now.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8122 branch of the PCIe-C MSI check matched the machine and looked
each bridge's slice up in a table of ECAM apertures. Each PCIe-C node
already names its slice: apple,msi-vector-base gives the first vector it
owns in the shared window and msi-ranges that vector's AIC line. Check the
slice's shape from those (a 32-vector slice after the internal host's
vectors 0..31) and derive the window's AIC base from them, and select the
branch by the controller's match data instead of the machine.

The host test now reads the slices from the J613 DT and checks them, and
the shapes that must be refused, with the same helper.

Signed-off-by: Satya Benson <satya@benson.earth>
The node was deleted for older Stage 2 loaders that were said to prune
ATC0's shared suppliers through it, but no loader version doing that is
on record. Keep it, as the other T8122 boards do; it stays disabled.

Signed-off-by: Satya Benson <satya@benson.earth>
Two PCIe-C nodes naming the same apple,msi-vector-base would both pass
the slice check and program the same vectors of the shared window. Claim
each 32-vector slice when a bridge's MSI is set up and release it with the
device, so the second bridge fails with an error naming the slice. Also
refuse a vector base past 224, the window's last slice.

The host test checks that the J613 DT's PCIe-C bases are distinct.

Signed-off-by: Satya Benson <satya@benson.earth>
The T8122 PCIe-C driver takes each bridge's MSI slice from
apple,msi-vector-base. Require it for apple,t8122-pciec bridges, as a
multiple of 32 from 32 to 224 (the shared window after the internal host's
vectors 0..31).

Signed-off-by: Satya Benson <satya@benson.earth>
The J615 (MacBook Air 15-inch, M3) has the J613's two ATC ports on the
same T8122 routers. Give it the PCIe-C tunnel description and aliases
the J613 already has, and drop its unused, disabled USB2 OTG node so
older loaders do not prune the shared ATC0 suppliers.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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