Repository navigation
J873g: USB4 on the rear USB-C ports through tipd and atc.c (T8152 routers, PCIe-C, M6 Mac mini) - #2178
J873g: USB4 on the rear USB-C ports through tipd and atc.c (T8152 routers, PCIe-C, M6 Mac mini)#2178sithglan wants to merge 31 commits into
Conversation
b8297ab to
b43bc99
Compare
b43bc99 to
adcda13
Compare
c4bf8ff to
9a3c8b7
Compare
|
Rebased onto the refreshed #2176 (6b1ffb1, on integration/aurora 0abc2f3). It is now 9a3c8b7 (was adcda13); the old branch no longer merged.
Testing on 0abc2f3:
|
|
Thanks for the USB4 bring-up; working on all three ports with hotplug is great. In this tree we select behaviour by a hardware description, not by the machine or SoC it was tried on. A few new lines do the opposite:
We are happy to help review a reworked version. |
9a3c8b7 to
756f397
Compare
756f397 to
d134970
Compare
|
Thanks. Two of the three points are done, and the stack is rebased onto the current #2176, #2139 and #2142 (head
Checks on this head:
This head has not run on the J873g yet. The routers now depend on the mailbox interrupts firing in that order, which the M6 run will confirm. One owner of the PD controllers. I agree, and the tree already has the owner:
The port monitor and |
d134970 to
11efada
Compare
11efada to
ffa5579
Compare
|
Two changes since my last comment. The head is now
The stack is rebased onto the current #2176 and #2139 (with #1797's USB DART comment underneath). The tipd/ATC convergence for the port monitor follows. |
ffa5579 to
d4e28e5
Compare
The two front USB-C ports of the Mac mini (2026, J873g) sit behind an on-board USB3 hub. The hub's SuperSpeed lanes are wired to the Type-C PHY of the SoC's ATC2 directly, without a Type-C mux or port controller in between, so that PHY only ever runs one fixed USB3 configuration. Describe the T8152 variant in that role, with a boolean apple,fixed-usb3 that marks such a port: the PHY runs USB3 on lane 0 from probe on, ignores mux and orientation changes and provides only the USB3 PHY of its controller. The controller's USB2 side and reset stay with the bootloader, so the T8152 PHY has no #reset-cells and no Type-C switch properties. The PHY is described by its core and pipehandler banks. On T8152 the core bank also holds the USB controller's DARTs, and the PHY's power and reset block sits behind them. It needs four power domains, listed in the order they are powered up: the ATC's USB_AON power state, its common PSD service and its COMMON_DP_0 and COMMON_DP_1 power states. The other variants keep their single power domain and #reset-cells. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873g front ports reach their on-board USB3 hub through ATC2's Type-C PHY, wired to the hub without a Type-C mux. So far the hub ran at USB2 only: the bootloader leaves the PHY powered down and the PIPE on the controller's dummy PHY. Support the T8152 PHY in that role in the shared ATC driver. T8152 shares the T8142 generation's power and reset block, tunables and PIPE handler, with a different layout: the USB controller's DARTs sit at 0x20000 and 0x40000 of the ATC window, so the power and reset block follows at 0x60000, its lane swap is bit 1 there, and the reset the power-up releases first is a separate always-on sync reset at 0x60030. The crossbar is at 0x4c and the USB3 mode's existing setting, USB3+DP with single PMA 0x008, gives the value 0x110; there is no lane mode register to program. Describe this in the match data, with zero for the layout of the other SoCs, and leave the power-up and power-down, the tunables, the crossbar and the PIPE switch to the existing code. What remains T8152 code: - Lane 0 is powered up on its own after the common-a tunables (LFPS receivers, sleep, clamp, AHB reset) and down again with the PHY. Without it the lane registers stay in AHB reset, drop the lane tunables and the PHY never reports PIPE PhyStatus. The crossbar is set right after, before the remaining tunables, as in the T8152 sequence. - While the PIPE moves to the PHY, the BIST overrides hold lane 0's PIPE reset and power-down, stepping from P2 to P3, and the non-selected PHY override is released under them. The T8152 PIPE handler takes the lock request but does not acknowledge it: with the controller out of reset, no acknowledge came within 150 ms in either direction, while the PIPE moved to USB3 and back to the dummy PHY under the request. So T8152 changes the PIPE under the request without waiting for the acknowledge; otherwise every USB3 start fails. A fixed-USB3 port, apple,fixed-usb3, is a host by construction. Probe maps only the core and PIPE windows, the core without claiming it as it holds the DARTs, powers the PHY's power domains in the order they are listed and brings the PHY up in USB3. It registers only the USB3 PHY: no reset controller, Type-C mux or switch, as the controller's reset and USB2 side stay with the bootloader. The PIPE is routed when the controller powers the USB3 PHY on, after its core reset, which also sets the PHY up again after a power-off. If that fails the host starts with its PIPE parked, so the hub keeps USB2. The tunables come from the bootloader, which copies them from the Mac's own ADT. A loader that copies none must not take USB2 away: the PHY's consumers (the controller, and the display and Type-C drivers on the rear ports) would wait for it forever. So T8152 has optional tunables: the PHY probes without them, with common-a counted among the ones the lanes need, and refuses every mode but USB2, before a register is written. The hub then runs at USB2, as it did before this driver. The T8152 register sequence is the one of the earlier standalone driver, with which the hub enumerated at 10 Gb/s. The other SoCs keep their register accesses: the new layout fields are zero for them, and the new code runs for T8152 or a fixed-USB3 port only. KUnit cases check the T8152 crossbar, lane and power block accesses, and that a T8152 PHY without tunables refuses USB3, USB3+DP, USB4, Thunderbolt and DisplayPort without writing a register. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The two front USB-C ports sit behind an on-board VL822 hub on usb-drd2. The hub's USB2 side is on the controller's eUSB2 PHY, which the loader sets up, and its USB3 side on ATC2's Type-C PHY, wired directly without a Type-C mux. So far the controller was limited to high speed and the hub ran at USB2 only. Describe ATC2's PHY as an apple,t8152-atcphy with apple,fixed-usb3, hand it to usb-drd2 as its USB3 PHY and drop the controller's high-speed limit. Nothing changes for usb-drd1 (the back-left port). The PHY's power domains are ATC2's USB_AON, COMMON_DP_0 and COMMON_DP_1 PMGR power states, in a new node for the ATCs' block of PMGR states at 0x308290000, and its common domain, PSD service 57 (ADT clock-gates 57). The T8152 USB3 bring-up runs the power states without automatic power management, so they are marked apple,no-auto-pm. The PHY's tunables are the groups of the ADT's atc-phy2 node that apply to USB3 on lane 0: the common and PLL defaults as common-a, the fabric, PLL and USBC0 groups as common-b and the lane 0 groups as lane0-usb. Some of them differ between the four ATCs of the same Mac, so they are calibration: the bootloader copies them from the Mac's own ADT, through the atcphy2 alias (aurora-silicon/aura#498). With a loader that copies none, the PHY runs USB2 only. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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>
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>
Each T8152 USB4 router's coprocessor has a 0x80-byte mailbox window with the counted FIFOs of the SMC mailbox, at offset 0x80 of its register block. Describe it with apple,t8152-smc-mailbox as the fallback, so the SMC mailbox's match data serves it, and with its send-empty and recv-not-empty interrupts. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8152 CIO reset block resets the rear USB4 routers of the J873g. It has a request and an acknowledge register instead of T8142's control register, so it gets its own compatible. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8152 CIO reset block requests a router reset in register 0x68 and acknowledges it in 0x6c. Wait for the router's pair of busy bits to clear, request, wait for the acknowledgment and clear it. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The DARTs of the J873g rear USB4 routers (NHI streams) and of their PCIe-C tunnels are Gen3 DARTs like the display ones, but start unlocked with inactive streams. Each has its own slot in the shared TLB invalidation aperture and its DMA window. Their tunables are the ADT's (dart-acioN, dart-apciecN), which the bootloader copies into the node, so the binding does not require them in a device tree. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The DARTs of the T8152 USB4 routers and their PCIe-C tunnels are Gen3 DARTs that, unlike the display ones, the bootloader leaves unlocked with inactive streams, as it does the AVD instance. Extend the AVD instance's cold Gen3 setup to them: version 0x300, their tunables and inactive streams, then clear the streams, apply the tunables and invalidate through the Gen3 TLBI aperture before translation is enabled. Domains use the same two-level 16K tables inside a single 64 GiB DMA window. The streams the operating system sets up now come from a mask per instance: - AVD DART (apple,t8152-avd-dart): streams 0-2, the decoder's, with its 16 streams and its power domain checked as before. Its stream enable becomes a read-modify-write like the others', and other stream IDs are refused when a consumer attaches. - ACIO DART (apple,t8152-acio-dart): 32 streams, NHI streams 0-11 and 16-27. - PCIe-C DART (apple,t8152-pciec-dart): translated streams 0-252, with 253 and 255 in bypass for host transactions and MSI writes to the AIC (the ADT reserves them), firmware's stream 254 preserved, 16K pages, 42-bit addresses; it must be tunnelled and have its power domain. Without the bypass on 255, NVMe completions were polled and the DART faulted at the AIC. Each DART invalidates through the TLBI slot its "tlbi" resource names. The slot has to be the port's own: with port 3's slot on port 1's DART, reads returned wrong data with DART faults. The locked display DARTs and all other Gen3 instances stay as they were. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The PCIe-C ports tunnelled through the J873g rear USB4 routers are laid out like T8142's: Intr2AXI MSI slices, the T6050 tunnel controls, and no port reset of their own. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8152 tunnelled PCIe-C ports use the T6050 tunnel controls with the Intr2AXI MSI path, like T8142, and their MSI slices are checked the same way: from msi-ranges and apple,msi-vector-base alone. The J873g's three bridges use 0x60 (CIO0, ECAM 0x1c50000000), 0x80 (CIO1, 0x1c60000000) and 0xc0 (CIO3, 0x1c80000000) of the window at AIC 1879. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Add the T8152 ACIO and NHI. The T8152 router CPU is started by a reconfiguration request through its mailbox, so it has no cpu window. A second range maps the shared Gen3 TLB invalidation aperture for the router's DART. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8152 router is a Type 7 MXWrap-v2p3 that a reconfiguration request starts through its counted mailbox. Its DP IN path is not qualified. Release the CIO domains in reverse order and suspend each one synchronously, because deleting the device link only queues an idle request: the PHY reset and the next router start need them cold. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873g's three rear USB-C ports have T8152 ATC PHYs behind a Type-C mux, with a USB4 router behind each. Linux runs them in CIO (USB4) mode only for now: their DisplayPort alt mode is still driven by the display controllers, and their USB2 side by the bootloader. Allow a T8152 PHY without apple,fixed-usb3 for such a port: its core bank alone (the power and reset block at 0x60000 is part of it, and the display controllers map the same bank), the orientation and mode switches with port@0 to the connector's SuperSpeed port, the ATC's four power domains in power-up order, and the common and lane CIO tunables. The display controller takes the PHY through its DisplayPort PHY. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873g's three rear USB-C ports have T8152 ATC PHYs with a USB4 router behind each. Their DisplayPort alt mode is still programmed by the display driver (drm/apple's T8152 code), and their USB2 side is the bootloader's. Run such a PHY in CIO mode for a USB4 partner and leave it to the display driver otherwise, as a Type-C port of its own kind (cio_only, selected by the T8152 match data for a PHY without apple,fixed-usb3). The Type-C port driver sets the mux before it starts the router and after it stops it, as on T8142. CIO mode uses the T8152 layout of the fixed-USB3 support: the power and reset block at 0x60000 with the sync reset at 0x60030, the crossbar at 0x4c (USB4 0, USB4 swapped 1), no lane mode register. It differs from USB3 in that both lanes are powered up, one after the other, between the common-a tunables and the others (LFPS receivers 0x1e24 bits 12/16 and 14/18, then the lane controls at 0x1e18 and 0x1e1c out of sleep, unclamped and out of AHB reset), and in that a reversed plug sets the lane swap (bit 1 of 0x60008) next to the swapped crossbar, where T8142 leaves it clear. On the way down AUX is clamped (0x1e24 bit 10, sleeps 6 and 8 cleared) and both lanes' LFPS receivers are dropped before the lanes, as the T8152 CIO shutdown does: these always-on controls keep their state while the common block is off. The lanes are only touched while the register bus (0x60000 bit 3) is out of reset. This is the sequence the earlier port monitor ran, with which a rear port trained USB4 at 2 x 20 Gb/s and carried an NVMe enclosure at 16 GT/s x4. The PHY's four power domains (USB_AON, the common PSD service, DP_0, DP_1) are attached without device links. They are held while the PHY runs CIO mode, and dropped synchronously after the CIO shutdown, so that the common block goes cold before the next partner: a training from a powered common block asserted in the router's firmware. The PHY and the display driver take turns, explicitly: - The display driver powers the PHY's DP PHY on before it touches the PHY and off when it has let go of it. The DP PHY holds the domains for it and keeps CIO mode out: a USB4 mode change fails with -ETIMEDOUT, and the mux declares its timeouts transient, so the port driver retries until the display is gone. A DP PHY power-on in CIO mode fails with -EBUSY. - Either takes the PHY only when its power and reset block is as its power-up leaves it (0x60000 = 0x4, no sleep acknowledged, sync reset 0); CIO mode is refused otherwise. - A display the bootloader started has all four domains on and a busy block at probe. Its domains are then held for the display driver, which takes the PHY over, until its DP PHY goes off. Once DisplayPort moves into this driver, the DP PHY programs it itself, both modes switch under the PHY's lock and this arbitration goes away. Thunderbolt alt mode is refused on these ports for now: the T8152 routers have only been run with USB4 partners. The other SoCs are unchanged: the new paths are taken for a cio_only PHY or the T8152 generation only, and T8152 now sets has_usb4, which a fixed-USB3 port's tunable list does not consult. KUnit cases check the CIO lanes, crossbar and swap in both orientations, the power-down, the idle test and which Type-C states ask for CIO. The DCP host-test fixtures that compile the power-up and power-down get the new field. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
A rear USB-C port's ATC PHY is also its USB4 PHY, run by the ATC PHY driver, which powers the PHY. Give each usb-c port node the port's PHY in DisplayPort use (PHY_TYPE_DP): a DCP powers it while it drives the PHY, from before a cold start until the PHY is powered down, and the PHY driver keeps the PHY powered and out of USB4 meanwhile. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The T8152 DCPs powered a rear USB-C port's ATC PHY themselves: before a cold start they set the port's USB_AON, DP_0 and DP_1 PMGR power states (PS +0x100, +0, +0x20) to 0xf and its common PSD service to 0, and after a power-down they set back those that had been off. The same PHY now runs CIO mode for USB4, through the ATC PHY driver, which powers it through the PMGR and PSD power domain drivers. With two writers of the same states, one would switch off what the other uses, or leave the power domain drivers believing a domain on that is off. Take the PHY through the port's DP PHY instead (the usb-c node's phys): power it on before the cold start's first PHY access and off once the PHY is powered down. The PHY driver then holds the PHY's power domains and keeps it out of USB4; while the PHY runs USB4 the power-on fails with -EBUSY and the cold start with it. A display the bootloader left running is kept powered by the PHY driver from its probe; the DCP that adopts it powers the DP PHY on at once and so takes that over. A port whose common block runs but whose DP PHY cannot be powered is in USB4, not a bootloader display: the power and reset block (CFG +0x60000) reads 0x1b in both. The PMGR and PSD state registers are still read to tell whether the PHY can be looked at. The DisplayPort programming itself is unchanged. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The three rear USB-C ports' ATC PHYs (ADT atc-phy0, 1 and 3) were only known to the display controllers, as register windows they program and power themselves. Describe them as T8152 Type-C PHYs, which the ATC PHY driver runs in CIO mode for USB4: - their core windows (0x403000000, 0x40b000000, 0x413000000, 0x84000 each, also mapped by the display controllers); - the orientation and mode switches, linked to the SuperSpeed port (port@1) of the port's usb-c-connector; - their power domains, in power-up order: the ATC's USB_AON, its common PSD service (55, 56, 58) and its COMMON_DP_0/1 power states, new nodes next to ATC2's. The USB_AON states are kept on, as ATC2's: they hold the rear USB controllers' state the loader set up; - the atcphy0, 1 and 3 aliases, through which the bootloader copies each PHY's CIO tunables from the Mac's own ADT (atc-phyN groups, aurora-silicon/aura#498): the common defaults before the lanes are powered up, the fabric, PLL and remaining common groups after them, then each lane's groups. Without them the PHY runs no CIO mode. The display controllers' usb-c port nodes take the PHYs through their DP PHY, which powers them while a controller drives the port. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
A reboot or power-off shuts the PCIe-C host and the router's and the tunnel's DARTs down before the router, while a started router still runs over them. With the J873g's rear ports, the earlier port monitor stopped the routers from a reboot notifier for this. Without a port monitor, do that in the router driver: for routers whose match data asks for it (T8152), stop a started router from a reboot notifier, as the port driver does for an unplugged cable, and refuse a new start from then on. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe the three rear USB4 routers (ADT acio0, acio1, acio3) with their mailboxes, NHI, ACIO DARTs, PCIe-C tunnels and their DARTs, the CIO reset block, the PSD services they need and the LSTX pins. Generated from the J873g ADT. The router, NHI, DART and PCIe-C tunables and the routers' DROMs are not in the device tree: they are per Mac (a DROM carries the host router's UID), so the bootloader copies them from the Mac's own ADT (aurora-silicon/aura#498), through the usb4-N-acio, -pcie-adapter, -nhi and -pcie aliases (ADT acio0, 1 and 3, apciecN), and the DARTs' by their address. With a loader that copies none, the routers, NHIs and PCIe-C ports refuse to start. Each router coprocessor's mailbox has apple,t8152-smc-mailbox as its fallback and the two interrupts of the ADT's acio-cpuN node, which list send-empty first, as the SMC mailbox's do. Each router's Thunderbolt switch (its port@1) is linked to the USB4 port (port@4) of its port's usb-c-connector, as on the J813: the PD controller driver sets the port's ATC PHY to CIO mode and then starts the router with the cable's EUDO and orientation, and stops the router before it takes the PHY out of CIO mode. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Every enabled DART must name the power state of the engine it serves (scripts/dtc/apple-dart-pd-check.py). The three rear routers' NHI DARTs named none. A DART sits inside its router, so it takes the router's first PSD service (59, 60 and 62: ADT acioN power-gates), the one the router powers up first and down last. The router populates the DART only once it is powered and its firmware is ready, and removes it before it powers down, so the DART's vote never holds the router on after a stop. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
da3173d to
1b969ed
Compare
|
@DjDeveloperr thanks. The head is 2. No tables in history. The table removal is folded into the commits that added the tables, and the separate removal commit is gone.
3. Older aura: the ATC PHYs no longer fail their probe. This is in #1799's "phy: apple: atc: add T8152 for a fixed-USB3 port".
J873g rows on this exact head, with the M6's default command line:
4.
1. The stack is unchanged: it waits for #1743, #2486, #1799 and #2142. Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: HOLD at 1b969ed3f444
Blockers:
- §4 PR body attribution (
PR body): Delete the trailing attribution line at the bottom of the PR description (also flagged bypr-text). All 31 commits themselves are clean (human author/committer and humanSigned-off-by:only). - Unmerged multi-PR stack, merge commit &
aura#498dependency (50d8d75faa47..3287c55d219c, mergedafefeb2ba1e): Still bundles 31 commits across four open PRs (#1743draft,#2486draft,#1799open, 2 commits from#2142open) plus mid-branch merge commitdafefeb2ba1e, and requiresaurora-silicon/aura#498(open) for J873g tunables/DROMs. Land the prerequisite PRs andaura#498first, then rebase#2178linearly ontomainwith only its own commits. - §5 PR body template & remaining hardware rows (
PR body): Add the requiredTested:(Macs at head SHA + result) andRisk:(one-way/two-way door + affected Macs) lines to the PR body, and post the remaining exact-head J873g USB4 NVMe PCIe-tunnel (replug, flip, checksums) and DP/USB4 switch rows plus a non-T8152 (M1–M5) USB4 regression row covering the sharedatc.c,apple-dart.c,pcie-apple.c, andthunderbolt/apple.cchanges once rebased.
Checked:
- Verified both code/history blockers from
da3173dfb4c9are resolved: all 31 commits and the full 38-file diff carry zero in-tree Apple ADT tunable tables or literal DROM blobs, anddrivers/phy/apple/atc.c(optional_tunables+atcphy_configure()gate +atcphy_test_t8152_no_tunablesindrivers/phy/apple/atc-test.c) now degrades safely to USB2-only without probe deferral on olderaura. - Checked §1–§6 across commits, full diff, PR title/body, live 12/12 CI checks,
aurora-silicon/aura#498,#1743,#2486,#1799,#2142, and the1b969ed3f444J873g dual-bootloader hardware rows.
Evidence
- Head & CI:
1b969ed3f4446d2762f8e7ebae7b63948c3088f8(OPEN,MERGEABLE,BLOCKED); all 12/12 checks green (dt-checks,host-tests,kunitx3,source,rust-build,DWC3/ATCx3,pr-text,pr-readiness).pr-textemitted warnings for the missingTested:/Risk:lines and the trailing attribution line in the PR body. - Resolved — §4 Clean-room in history: Scanned all 31 commits and the final diff. Tunable removal is folded into
cc129b6f0f7c,c61cdee06824, ande251b2ceb140, and the example tunable lines are removed fromDocumentation/devicetree/bindings/phy/apple,atcphy.yaml(b620188b20ae,8148fc35b924). Only[00]DROM placeholders and bootloader aliases (atcphy{0..3},usb4-{0,1,3}-*) remain. - Resolved — §1 Older-
aurafallback (drivers/phy/apple/atc.c:4473-4475,7007-7009,8714,drivers/phy/apple/atc-test.c:1557-1576):atcphy_hw_t8152sets.optional_tunables = true, countsapple,tunable-common-atowardss_missingonATCPHY_GENERATION_T8152, and refuses non-OFF/USB2 modes with-EOPNOTSUPPbefore touching registers. Confirmed on J873g at1b969ed3f444with enrolledaura(1.0.0b14-gd7f5a487): 4/4 PHYs bind in USB2-only mode, front USB2 hub/keyboard and 3/3tipdports + HDMI work, 0/3 routers bind (-EINVAL), 0 deferred devices, 0 failed units, 0 DART faults. (Non-blocking nit: checking!atcphy->ss_tunablesat the top ofatcphy_cio_start()indrivers/phy/apple/atc.c:5617beforeatcphy_cio_pds_on()would avoid power-cycling the four domains and loggingCIO mode failed: -95on an older bootloader.) - Dependencies:
aurora-silicon/aura#498(46c6d9b47308, OPEN),aurora-silicon/linux#1743(3aa7b99a6fe4, OPEN draft),#2486(f9ad98d1d5d6, OPEN draft),#1799(cc820203214e, OPEN),#2142(a42e7dccf46c, OPEN). - §6 Naming: Clean across all commits, PR title/body, and diff.
USB4 on the three rear USB-C ports of the M6 Mac mini (J873g, T8152), through the Type-C stack. This is the last step of the order agreed above.
tipdowns the PD controllers,atc.cruns the ports' ATC PHYs in CIO mode, and the routers start from the Type-C state, as on the J813 (#2142). There is no private port monitor any more.Stacking. Stacked on #2486, which is on #1743 (#1797, #1800 and #2459 have merged), through a merge of integration/aurora
3cd5e0bb7671. It also carries these commits unchanged (same patches as the PRs' current heads):atc.ccomes from there;Review the top 17 commits.
Needs aurora-silicon/aura#498. The J873g's USB4 and ATC PHY tunables and the routers' DROMs are no longer in the device tree: the bootloader copies them from the Mac's own ADT, as on the J813 (#2142 with aura#302/#435). With an older loader nothing is filled, and the drivers refuse the ports instead of running them untuned.
Carried from the earlier version, unchanged
"apple,t8152-cio-mailbox", "apple,t8152-smc-mailbox", with the two interrupts of its ADTacio-cpuNnode.thunderbolt/appleT8152 support. The CIO power domains go through pmdomain: apple: T8152 PSD services as power domains #2459 and return to cold when unused.Reworked
usb4-portbinding is gone.New
phy: apple: atc: run the T8152 Type-C ports in CIO modeapple,fixed-usb3is a CIO-only Type-C port. It uses J873g: USB3 on the front ports (T8152 in the ATC PHY driver, M6 Mac mini) #1799's T8152 layout: power/reset block at 0x60000, sync reset at 0x60030, crossbar at 0x4c.phy_power_on/phy_power_off) instead of writing the PMGR/PSD registers itself, so genpd is the only power path.-ETIMEDOUT, which tipd retries. While CIO runs, the DP power-on returns-EBUSY.atc.c.thunderbolt: apple: stop the T8152 routers before a reboot: a running router is stopped before PCIe and DART shut down. The earlier port monitor showed this is needed.port@1to the PHY's mux and switch, andport@4to the router;apple-t8152-port.cand its config line are removed.Testing (M6, this tree)
The USB4 host-to-host and display rows, from one boot of this tree:
atc.cbrought the PHY up in CIO mode, and router ACIO0 started.401178080.mailbox-recvcounted 25 and-send0.atc.c. 6 of 6 DPMS off/on cycles pass.Checks:
--strictis clean on the new code.phy-apple-atc*: 45/45, including 4 new T8152 CIO cases.tools/asahi/run-host-tests.py: 427/427.apple-dt-check.shagainst J873g: rear USB-C PD controllers through tipd, DisplayPort alt mode from Type-C (M6 Mac mini) #2486: 0 new warnings, and all 9 changed bindings pass.USB4 NVMe enclosure (Samsung 980 PRO in a Ugreen enclosure, back-right, this head):
Not covered: system sleep (the J873g has none), DP tunnelling over USB4 and two enclosures at once.
cc @Acelogic @RyanTheTide @DjDeveloperr @LiamRay10
Assisted-by: LLM (Claude:Opus 5.5)