Skip to content

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

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

satchlj wants to merge 23 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>
The apple,pcie binding now requires apple,msi-vector-base on
apple,t8122-pciec bridges, which T6030's USB4 PCIe-C also is. Give it the
slice the driver already assigns to this ECAM aperture (0x730000000:
vectors 32..63), so the node validates; the T6030 path does not read it.

Signed-off-by: Satya Benson <satya@benson.earth>
… slice shapes

The previous commit ("name the PCIe-C bridge's MSI vector base") was wrong
to say the T6030 path does not read apple,msi-vector-base. apple_msi_init()
corrects the old global window (AIC 1342, 512 vectors) only when the
property is absent. With the property added and msi-ranges still describing
the global window, the slice check refuses and the J514s/J516s PCIe-C bridge
fails to probe ("invalid or missing MSI slice"). Found by Ryan Murray.

Describe the bridge as T6040's are: its own 32-vector slice,
msi-ranges = <&aic AIC_IRQ 1374 IRQ_TYPE_EDGE_RISING 32> with
apple,msi-vector-base = <32>. The legacy correction stays for the shared
bootloader DTs that still carry the global window and no base.

Move the slice decision into apple_pciec_msi_slice() in pcie-apple-t8122.h,
unchanged in behaviour, so a host test can cover the three T6030 shapes:
legacy without the property (corrected), per-slice (accepted), and the
global window with a base (refused), plus a misplaced line, a foreign base
and T6040's shape.

Signed-off-by: Satya Benson <satya@benson.earth>
A slice another bridge already owns failed the probe through
invalid_slice, as -EINVAL with "invalid or missing MSI slice". The claim
has said which vectors are taken; return its -EBUSY instead (Ryan Murray's
review).

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: Ryan, you're right about 42d2e45, thank you. I checked it against apple_msi_init(): the legacy correction runs only when apple,msi-vector-base is absent. With <32> added and msi-ranges still on the global window (AIC 1342 x 512), apple_t6030_msi_slice_valid() refuses, and the J514s/J516s PCIe-C bridge would fail probe. That commit's message claimed T6030 doesn't read the property, which was wrong.

New commits (no history rewrite):

Checked locally: the host test passes, and j514s/j516s built with the tree's dtc validate against apple,pcie.yaml with no pcie@730000000 complaint. Not checked: an actual T6030 PCIe-C probe. I have no T6030 rig, so that probe row is owed by someone who has one.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Review at 599992a (non-author, draft). The only commit of its own over #1490's current head is e75274d (the J615 DTS); the other three are #1490's latest commits under new SHAs. No blocker in the DT; one consistency point.

  • With the PR's tree, t8122-j613.dts and t8122-j615.dts both compile, and every usb4/ACIO/PCIe-C node and alias in the two DTBs is identical, so the J615 gets exactly the J613's description on the same routers.

Points to consider:

  • J613 and J615 now differ only in the /delete-node/ &usb_otg0: thunderbolt: apple: enable the J613 USB4 host-to-host path #1490 keeps the J613's node ("keep the USB2 OTG node", c44f39a) because no loader version on record needs it removed, and this commit removes the J615's for the same stated reason it was dropped on the J613. The two boards share t8122-j613-j615.dtsi and the same Stage 2; they should get the same answer. Unless a J615 boot shows a current loader pruning the ATC0 suppliers, dropping the /delete-node/ keeps them aligned.
  • The six usb4-* aliases are now written out identically in both board files; moving them into t8122-j613-j615.dtsi would keep them from drifting.
  • A J615 row is still missing (tunnel enumeration on both ports), as the body says.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: CI on 599992a is green. host-tests (job 137381222178) ran the new test through the full runner, its first real run: ok pcie-apple-msi-slice-tests (0.1s). dt-checks passes too. A T6030 PCIe-C probe on hardware is still owed.

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