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
c74dd43 to
6589921
Compare
|
Rebased again for the merges of #1800 and #2139 (c74dd43 → 6589921). The PR conflicted with #2139's AVD DART in Shape: #2486, then "Merge integration/aurora b10280c into the J873g USB4 stack", then the 22 commits.
Checks:
M6 boot at 6589921, plus #2873's commit (one boot, enclosure on back-right):
Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review on 65899212d5076a84842b714675638e641a833575:
Moving J873g rear USB4 onto tipd + atc.c CIO mode and dropping apple-t8152-port.c is the right architecture, and live CI (dt-checks, host-tests, kunit, rust-build, source, DWC3/ATC) is green. However, there are multiple hard §1–§5 blockers and real driver bugs that prevent merge:
-
§4 HARD BLOCKER — Commit missing
Signed-off-by::- Commit
[3/31]c831c1da7001a31d7ebf1ee7bb48ce1265f8ea97("spmi: apple: read the fault queue before the shared ack, limit gen4 mask writes", authored by Joshua Warren) has noSigned-off-by:trailer. Every commit in a PR must carry a humanSigned-off-by:.
- Commit
-
Unmerged multi-PR stack & mid-branch merge commit:
- This branch bundles 31 commits across four still-open PRs —
#1743(open draft, including unsigned-offc831c1da7001),#2486(open),#1799(open), and a partial 2-of-5 cherry-pick of#2142(open) — plus a mid-branch merge commit (778819fa9c35). - Prerequisite PRs must be finalized/merged first, and
#2178rebased linearly ontointegration/aurorawith only its own commits.
- This branch bundles 31 commits across four still-open PRs —
-
§1 / §3 / §4 HARD BLOCKER — Hardcoded Apple ADT tuning tables (including per-device calibration) and Apple DROM blobs in DTSI:
arch/arm64/boot/dts/apple/t8152-j873-usb4.dtsi(+1,317 lines) embeds complete Apple ADT tunable tables (apple,tunable-rc,apple,tunable-pcie-adapter,apple,tunable-router-ap-fw, ACIO/PCIe-C DARTapple,tunable,apple,tunable-nhi, PCIe-Cdebug/fabric/rc) AND literalapple,thunderbolt-dromblobs containing"Apple Inc."/"iOS"copied from the J873g ADT for all three routers.arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi(+1,123 lines) embeds full ATC0/1/2/3 PHY tunable tables from one machine's ADT, while commit1aa9c872359bexplicitly notes "Some of them differ between the four ATCs of the same machine, so they likely carry per-device calibration."- Per-unit calibration and Apple ADT tunables/DROMs must come from the machine via
auraat boot (asaura#302andaura#435do), not be committed into public DTSI files.
-
Driver error-unwind & lifetime bugs:
drivers/gpu/drm/apple/t8152_atc.c(atc_port_init()/t8152_atc_init()): When a DCP sees an active bootloader display on porti,atc_port_init()callsphy_power_on(port->phy)with no error-path unwind. If a later portj > ireturns-EPROBE_DEFER(e.g., fromdevm_of_phy_optional_get()before its ATC PHY probes) or fails,t8152_atc_init()exits without callingphy_power_off(port[i].phy)and beforeatc_owner[port[i].index]is set. On probe retry,phy_power_on()runs a second time, leakingphy->power_countsoatc_deactivate()never dropspower_countto 0 anddisplay_ownedremains stucktruepermanently (wedging USB4 on that port). Unwindphy_power_on()ont8152_atc_init()failure/deferral (or deferphy_power_on()until after all ports are initialized and ownership is committed).drivers/gpu/drm/apple/t8152_typec.c:t8152_typec_port_register()registers globaltypec_mux_devinstances parented to the first probing DCP'sstruct device *dev, even though the switches are intended to outlive individual DCP bindings until module unload (dcp_unregister()). Unbinding that first DCP leaves active mux devices parented to an unbound platform device.t8152_typec_port_disable()allocatesstruct of_changesetwithkzalloc()and intentionally leaks it while mutating live DTstatus.
drivers/reset/reset-apple-cio.c(t8152_cio_deassert()): Replace magic constants (0x68,0x6c,id < 2 ? 3 : 12,192000) with named register/mask/timeout constants matchingt8142_cio_deassert().drivers/iommu/apple-dart.c(apple_dart_hw_reset()): Minor redundancy:cold_gen3_pciesetscold_gen3_sids = U32_MAX, causingenable_streamsword 0 to be written twice (once before bypass setup on SIDs 253/255, and again in the0..7loop) and bits0..31to be set twice instream_map.sidmap.
-
§5 — Live-head verification & cross-SoC regression coverage:
- The
65899212d507boot row included an extra unmerged commit (#2873) rather than testing the exact PR head cleanly, did not re-run the USB4 NVMe replug/checksum matrix on65899212d507, and omitted kernel build string, SELinux mode,0 AVC denials, and full kernel error audit. - Because this series modifies shared
atc.c,apple-dart.c,pcie-apple.c,spmi-apple-controller.c, andthunderbolt/apple.c, please include no-regression verification on another Mac generation once the stack is unstacked and rebased.
- The
Assisted-by: LLM (Gemini 4 Neon)
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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 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. 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 tunables are the groups of the ADT's atc-phy2 node (26A434) that apply to USB3 on lane 0, in the order they are applied: 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 machine, so they likely carry per-device calibration. There is no atcphy2 alias, as the loader's ATC tunable copy would replace them with values for another PHY layout. 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>
6589921 to
54cf84e
Compare
|
Rebased for the merge of #2873 (6589921 → 54cf84e). The PR conflicted with it in
Your review points from 11-23 are still open. This push only clears the conflict. Assisted-by: LLM (Claude:Opus 5.5) |
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 ADT tunables and DMA window. 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 CIO tunables of the ADT's atc-phyN groups, at the PHY blocks they apply to: the common defaults before the lanes are powered up, the fabric, PLL and remaining common groups after them, then each lane's groups. They are the lists the earlier port monitor applied, with which a rear port trained USB4. 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, including the router, NHI, DART and PCIe-C tunables and the router DROMs, whose UID field is the port index. 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>
54cf84e to
c0ff6ed
Compare
|
@DjDeveloperr on your point 4 (driver bugs). The head is
Checks at this head:
Points 1-3 and 5 (the stack, the in-tree ADT tables and DROMs, and the rows) are unchanged. Assisted-by: LLM (Claude:Opus 5.5) |
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 #1800, #1743 and #1797. It also carries these commits unchanged:
atc.ccomes from there;Review the top 16 commits.
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)