Skip to content

arm64: dts: apple: enable the J813 front USB4 port - #2238

Open
sithglan wants to merge 5 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-usb4-front
Open

sithglan wants to merge 5 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-usb4-front

Conversation

@sithglan

@sithglan sithglan commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The J813 front USB-C port does not work with a USB4 device: a USB4 NVMe enclosure that works on the rear port enumerates neither as USB4 nor as USB on the front port. The front connector's PD controller enters USB4 by itself (DATA_STATUS bit 23, USB4 connection), but only the rear port's ACIO1 router and PCIe-C tunnel are described, so nothing takes the link over.

This describes ACIO0 like ACIO1, with the values of the ADT acio0, acio-cpu0, dart-acio0, apciec0 and dart-apciec0 nodes: router 0x401ac0000, mailbox 0x401108000, NHI, DARTs, PCIe-C 0x404000000 with ECAM 0x1c50000000 and its MSI slice at vector 96 (AIC 1837, which gives the window base 1741 like every other J813 PCIe node), CIO reset line 0, LSTX AOP pin 19 and the ATC0 power states. Device tree only: the T8142 router, PCIe-C and CIO reset support from #2142 handles the second port unchanged, and aura fills the tunables and the DROM for every /arm-io/acioN through the usb4-0-* aliases.

Depends on #2142: this branch is #2142's head (13483df) plus one commit, "arm64: dts: apple: enable the J813 front USB4 port". Please review only that commit here.

Hardware: J813 / T8142, UGREEN USB4 enclosure (vendor 0x00b8, device 0x2463), Samsung 980 PRO 2 TB.

Validation:

  • checkpatch --strict clean. apple-dt-check.sh against Enable native rear-port USB4 and PCIe storage on J813 #2142's head: no new or removed warnings (137 DTBs).
  • Tested on the full J813 stack that carries Enable native rear-port USB4 and PCIe storage on J813 #2142 (7.3.0 kernel with T8142: suspend-to-RAM with J813 device and USB-C display recovery #2135 + Enable native rear-port USB4 and PCIe storage on J813 #2142): unchanged kernel and modules, only the DTB rebuilt with this commit on top. There the commit spells the PCIe-C alias usb4_0_pcie, because the enrolled aura predates aura#302; this PR uses usb4-0-pcie like Enable native rear-port USB4 and PCIe storage on J813 #2142's usb4-1-pcie and needs aura#302 in the same way. Apart from that alias name, the tested commit and this one are identical.
  • Front port at boot: authorized USB4 link at 20 Gb/s x 2 lanes, IOMMU protection, NVMe on PCIe domain 1 with MSI-X; 4 GiB direct read 2.2-3.3 GB/s; 64 MiB direct-read checksums at 0, 1 GiB and 1 TiB identical to the rear-port reference.
  • Hot-plug into the front port after boot, unplug from the front port, and moving the enclosure between front and rear in both directions.
  • Both ports at once, both ways round: enclosure on one port (USB4), a USB 3 hub with an Ethernet adapter on the other.
  • Deep sleep with the enclosure on the front port: an open disk refuses the sleep before the port changes (link and checksums kept); actual 8 s and 20 s sleeps with the idle enclosure reconnect it automatically, with the checksums and the J813 health checks (all CPUs, internal display, GPU clear/readback, Bluetooth, Wi-Fi, internal storage) passing after each wake.
  • SMART media and error-log counts stay zero, no host writes.

Scope: USB4 DisplayPort tunnels stay disabled, as on the rear port. The unplug and sleep-entry messages "tunnel reset acknowledgment timed out" / "Failed to lock pipehandler" and the IRQ-affinity messages appear on the front port exactly as they already do on the rear port.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

Allow the five ACIO register windows, LSTX GPIO and router firmware
tunables used by T8142. Describe its native PCIe-C compatible and
require the shared MSI vector base. Include the T8142 pinctrl fallback
chain used by the AOP LSTX pin.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Contributor Author

Restacked on the updated #2142 (4ed06b3). It is now 6113f94 (was 300baa0); this commit is unchanged (git range-diff).

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I reviewed only the front-port commit. ACIO0 mirrors ACIO1 exactly: I diffed the two blocks, and only addresses, AIC numbers, the reset index, LSTX pin 19, the ATC0 domains, the PCI domain and the BAR windows differ. The MSI slice (1837 at vector 96) gives the same 1741 base as the rear and internal ports, so it holds under the current driver check and under the DT-derived one I asked for on #2142. The gpio-reserved-ranges update frees exactly pins 19 and 21. Approve once #2142 is in. Please add one front-port boot of this exact DTB with an aura that has aura#302: the tested build used usb4_0_pcie with an older aura.

T8142 uses the Intr2AXI controller layout but its three-cell AIC
interrupt specifier and MSI window differ from T6050. Match it natively.
This allows a tunnelled NVMe controller to allocate working MSI-X
interrupts.

For T8132 and T8142 the slice is checked against the device tree alone.
msi-ranges names the AIC input of global vector apple,msi-vector-base in
a linear window, so the window's AIC base is msi-ranges minus
apple,msi-vector-base, and the slice is checked by its shape: an
edge-rising SPI, 32 vectors, 32-aligned, above the internal port's
vectors and inside the 8-bit map target. This replaces T8132's table of
ECAM apertures and its AIC base 1506 behind a machine check. The T8132
trees give 1602 - 0x60 = 1634 - 0x80 = 1506, and every J813 PCIe node
gives 1741.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Use the qualified MxWrap startup sequence: CIO reset leaves the CPU
running, then RTKit readiness precedes the LSTX handoff. Admit native
T8142 PCIe-C hosts without a T6050 fallback. Keep DP IN disabled.

Deep sleep removes CIO power. Remove idle NVMe hierarchies before
stopping the router and request fresh cable state on resume. Refuse
sleep when a disk is open or another endpoint driver cannot be removed
safely. Extend the production-C admission tests with native T8142 and a
negative control.

The T8142 behaviours are named flags of its match data
(sleep_removes_domains, restart_on_wake, phy_shared_with_dwc3), so a later
SoC that behaves the same sets them instead of extending a comparison.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe ACIO1, its mailbox and LSTX pin, and the PCIe-C tunnel.
Populate both DARTs under their powered parents. Use connector port 4 so
the existing DisplayPort alternate-mode route can retain port 3. Name the
PCIe-C tunable alias usb4-1-pcie, as t6040-usb4.dtsi does; aura looks it
up under that spelling since aurora-silicon/aura#302.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Only the rear port's ACIO1 router and PCIe-C tunnel are described. The
front connector's PD controller enters USB4 by itself when a USB4 device
is attached (DATA_STATUS bit 23), and nothing in the kernel takes the link
over: a USB4 NVMe enclosure that works on the rear port shows up neither
as USB4 nor as USB on the front port.

Describe ACIO0 like ACIO1, with the values of the ADT acio0, acio-cpu0,
dart-acio0, apciec0 and dart-apciec0 nodes: router 0x401ac0000, mailbox
0x401108000, PCIe-C 0x404000000 with ECAM 0x1c50000000 and its MSI slice
at vector 96 (AIC 1837), CIO reset 0, LSTX AOP pin 19 and the ATC0 power
states 0x3c8, 0x3d0, 0x4d8 and 0x4e0. The bootloader fills the tunables
and the DROM through the usb4-0-* aliases, as for the rear port.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan force-pushed the thomas/j813-usb4-front branch from 6113f94 to f6ed2df Compare November 19, 2026 19:48
@sithglan

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Rebased onto #2142's new head 13483df0aa7f (now f6ed2df61ae9). The front-port commit is unchanged. #2142 no longer has a driver-side expected slice, and 1837 − 96 = 1741 passes the shape check.

Boot of this exact DTB on the J813 with aura 8b9c92ea + aura#302, chainloaded (details on #2142):

apple-dt-check.sh against #2142's head: 0 new and 0 removed warnings over 137 DTBs.

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.

2 participants