Skip to content

J873g: USB3 on the front ports (T8152 in the ATC PHY driver, M6 Mac mini) - #1799

Merged
RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
sithglan:thomas/j873-usb3
Nov 24, 2026
Merged

RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
sithglan:thomas/j873-usb3

Conversation

@sithglan

@sithglan sithglan commented Nov 13, 2026 •

Copy link
Copy Markdown

What: USB3 on the J873g's (M6 Mac mini) front USB-C ports: the VL822 hub's SuperSpeed side through ATC2's PHY, with T8152 added to the shared ATC PHY driver as a fixed-USB3 port, plus its power domains and device tree. The PHY's tunables come from the bootloader (aurora-silicon/aura#498); without them the PHY runs USB2 only.
Tested: J873g M6 Mac mini at cc820203214e: front hub at 10000M with aura#498, and the USB2-only fallback with the enrolled aura (nothing deferred). J813 M5 Air at cc820203214e: a USB 3 SSD stick at 10000M through deep sleep and a PD-controller replug, the same as on the base daa9e2de18bd. 0 failed units, 0 DART faults.
Risk: one-way door (new DT binding) · J873g (T8152); the shared atc.c paths run on every Mac with an ATC PHY (checked unaffected on the J813).
Not yet: suspend and kexec on the J873g (it cannot suspend yet, #2385).

Details

Three commits on integration/aurora daa9e2de18bd. #1797 (the J873g's aurora-wip merge, which brings #1205's USB2 hosts) and #2459 (T8152 PSD power domains) have merged, so this is no longer stacked on them.

The J873g's (Mac mini M6, T8152) front USB-C ports sit behind an on-board VL822 hub on ATC2. With #1205 the hub's USB2 side works through usb-drd2. This adds its USB3 side in the shared ATC PHY driver:

  1. dt-bindings: phy: apple,atcphy: add the T8152 fixed-USB3 PHY. Adds apple,t8152-atcphy and apple,fixed-usb3, the PHY's power domains, and its common-a, common-b and lane0-usb tunable groups.
  2. phy: apple: atc: add T8152 for a fixed-USB3 port.
    • Layout in the match data. The T8152 match data reuses the T8142 PIPE handler fields. Three new layout fields are zero for every other SoC:

      • cfg_offset: the power and reset block is at 0x60000, behind the controller's DARTs.
      • lane_swap: bit 1 there.
      • sync_reset: the sync reset at 0x60030.

      Crossbar 0x110 is the existing USB3 setting. T8152 has no lane-mode register to write.

    • T8152-specific code:

      • lane 0's explicit power-up and power-down;
      • the crossbar write right after the power-up;
      • the BIST hold of lane 0's PIPE reset and power-down while the PIPE switches.
    • PIPE lock. The T8152 PIPE handler never acknowledges the lock. The PIPE changes under the request without waiting for an acknowledge (pipe_lock_unacked).

    • apple,fixed-usb3 marks a host-only port. Only the USB3 PHY is registered: no reset controller, Type-C mux or switch. The PIPE is routed when dwc3 powers the PHY on.

    • Power through genpd: ATC2's USB_AON and COMMON_DP_0/1 via pmgr-pwrstate, and PSD service 57 via pmdomain: apple: T8152 PSD services as power domains #2459.

    • Without tunables (a loader that copies none) the PHY still probes and refuses every mode but USB2, so the front ports keep USB2 and nothing waits for the PHY (optional_tunables, with common-a counted among the lane tunables on T8152).

    • Tests: KUnit cases, including a T8152 PHY without tunables refusing USB3, USB3+DP, USB4, TBT and DP before any register write, and the host-test fixtures that copy atc.c structures get the new fields.

  3. arm64: dts: apple: j873: USB3 on the front ports. Adds ATC2's power states, its PSD service and the PHY node with the atcphy2 alias. usb2 gets the PHY as its usb3-phy and drops maximum-speed = "high-speed".

Things to know

  • The front controller now waits for phy-apple-atc and the PSD and power-state providers. If the PHY isn't built, the front ports lose USB2 as well.
  • USB_AON is apple,always-on. It holds the USB controller's reset and the PIPE handler state that the loader sets up. Switched off (for example, by unloading the PHY driver while USB_AON was still switchable), the controller stays in reset until the next boot.
  • aura's J873 USB prep has to run first, as it does today. It powers USB_AON and the USB PSD, sets up the eUSB2 PHY in host mode, takes the DWC3 out of reset and releases the VL822 reset line.
  • Needs kboot: T8152: copy the USB-C tunables and router DROMs from the ADT aura#498 for USB3. The PHY's tunables are per Mac (one row differs between the four ATCs), so they are not in the device tree: the bootloader copies them from the Mac's own ADT through the atcphy2 alias. With an older loader the front ports run USB2, as before this PR.
  • Suspend and kexec are not exercised; the J873g can't suspend yet (wifi: apple: centauri: Quiesce Alpha for sleep on every N1 board #2385).
Evidence

Testing

Rows on the exact head cc820203214e:

  • J873g, issuecomment-7133226152. With kboot: T8152: copy the USB-C tunables and router DROMs from the ADT aura#498 (46c6d9b4, one-shot trial), atc2's tables come from the ADT (8, 77 and 55 rows), and the front hub runs at 10000M with the keyboard on its USB2 side. With the enrolled aura (d7f5a487, no tables), the PHY probes: "SuperSpeed tunables missing, USB2 only", "Host starts without USB3", and the keyboard works. Both boots: 0 failed units, 0 DART faults, no deferred devices, no kernel error lines beyond the base.
  • J813 (T8142) A/B against the base daa9e2de18bd for the shared atc.c paths, issuecomment-7138926643. A USB 3.2 SSD stick runs at 10000M with uas through an 8 s deep sleep and a PD-controller replug, with identical checksums and lines on both kernels; 0 failed units, 0 DART faults.
  • KUnit phy-apple-atc* 43/43, including atcphy_test_t8152_no_tunables. dt-checks against the base: 0 new warnings.

Earlier rows (M6, on #1797 + #2459 before they merged, the head before the tunables moved to aura):

Restacked on 2026-11-22 onto #1797 e9724fe, which gives the USB DARTs ATC1_USB/ATC2_USB. The ATC PMGR node now holds those two states next to ATC2's DP and USB_AON states. That tree, as part of #2178's head, booted on the J873g with the front hub, keyboard and receiver as before.

Earlier rows:

  • The front xHCI has a 480M and a 10000M root. The VL822 appears on both, at 480M and at 10000M ("new SuperSpeed Plus Gen 2x1"). The keyboard and mouse behind it work, and the back-left controller is unchanged.
  • 5 dwc3 unbind/bind cycles: the hub comes back at 10000M each time.
  • Controller unbound, rmmod/modprobe phy-apple-atc: the three switchable domains go off and on again, and the hub comes back on USB2 and USB3.
  • PIPE lock: a test build that waited up to 150 ms got no acknowledge in 8 tries, in either direction, while the switch itself worked. With atc.c's 1 ms wait as a hard failure, every USB3 start failed.
  • KUnit phy-apple-atc*: 41/41, including phy-apple-atc-t8152. It covers the crossbar, lane 0 up and down, the power block at 0x60000/0x60030 with the DART words left untouched, and the unacknowledged lock.
  • tools/asahi/run-host-tests.py: 427/427.
  • scripts/dtc/apple-dt-check.sh against Merge aurora-wip 210c8f6e into integration/aurora (J873g NVMe, 10GbE, power off, USB2, audio) #1797 (ec172bbcc1ed): 0 new and 0 removed warnings (137 DTBs). Both changed bindings pass dt_binding_check.
  • Image, modules and DTBs build (LLVM 22). checkpatch --strict is clean.

cc @Acelogic @RyanTheTide @DjDeveloperr @LiamRay10

@DjDeveloperr

Copy link
Copy Markdown

Heads-up: this stack (#1798, #1799, #1800) now conflicts with integration/aurora in drivers/soc/apple/mailbox.c. The conflict comes in through #1797's merge commit a761a62, which brings aurora-wip's T8152 AOP and J873 ANS mailbox matches. It collides with 41c359d and 788441e on integration, which receive the T6050 GPU mailboxes by interrupt.

Could you refresh #1797 onto the current integration/aurora and rebase the three on it? When resolving, please keep those two commits' interrupt-driven receive path as it is. We'll review the listed commits once the stack is mergeable again.

@sithglan

Copy link
Copy Markdown
Author

Rebased onto the refreshed #1797 (ceade2e, on integration/aurora 292773f). The branch is now e2555c5 (was 2fddae2) and merges cleanly again.

git range-diff shows the three commits unchanged.

The testing lines in the description are updated: apple-dt-check.sh against 292773f shows 0 new CHECK_DTBS warnings (8 fewer) and every changed binding passes, and the host tests pass 323/323, both with #1797 and all three J873g PRs. Not booted on the M6 at the new base yet.

@sithglan

Copy link
Copy Markdown
Author

Rebased onto the refreshed #1797 (d87e41e, on integration/aurora 514ae1f). The branch is now 814b959 (was e2555c5) and merges cleanly again. git range-diff shows the three commits unchanged.

One commit is new: arm64: configs: asahi: build the T8152 ACIOPHY USB3 PHY. #1939 added hardware-defaults-tests, which requires every native driver option in asahi.config, and it failed on PHY_APPLE_ACIOPHY_USB3. defconfig plus asahi.config now resolves it to =m.

With #1797 and the three J873g PRs, at 514ae1f: apple-dt-check.sh shows 0 new CHECK_DTBS warnings (8 fewer) and every changed binding passes, and the host tests pass 321/321. The description is updated. Not booted on the M6 at the new base yet.

@sithglan

Copy link
Copy Markdown
Author

Rebased onto the refreshed #1797 (bbfdefa, on integration/aurora 0abc2f3). The branch is now b6c31d8 (was 814b959) and merges cleanly again. git range-diff shows the four commits unchanged.

Booted on the M6 with the rebased stack: "apple-aciophy-usb3 383000000.phy: USB3 up", and both front-port hubs run at 10000 Mb/s. DT and host checks are as on #1797.

@RyanTheTide

Copy link
Copy Markdown

Thanks for getting USB3 up on the M6 front ports. 10 Gbit/s to the hub is a nice result.

Two things before this can go in. First, we avoid a second implementation of a mechanism the tree already has. drivers/phy/apple/aciophy-usb3.c (the CFG 0x60000 power-down/reset sequence, the tunable application and the lane power-up) repeats the ATC PHY bring-up that drivers/phy/apple/atc.c owns. Please extend atc.c instead: add T8152 match data, plus a fixed-USB3 mode for a port wired straight to a device with no Type-C mux, selected by a DT property on the PHY node. Then other ports and boards wired the same way get it for free.

Second, the file header and the comment near line 148 name macOS driver classes and functions. Please describe the sequence by its registers and steps only, with no reference to macOS internals.

When it lives in atc.c, we can run no-regression rows for the shared PHY path on our M1 Pro / M2 / M4 Pro / A18 Pro.

@sithglan
sithglan force-pushed the thomas/j873-usb3 branch 2 times, most recently from 1906255 to 6e2ae8b Compare November 19, 2026 18:27
@sithglan

Copy link
Copy Markdown
Author

Thanks. I've done the second point. The head is now 6e2ae8b6f4e0, on #1797's new head:

  • The aciophy-usb3.c file header now describes the bring-up by its steps: the power-down/reset release, the efuse/PLL tunables, crossbar 0x110, the remaining tunables, the PHY reset release, then the PIPE handler switch under the BIST overrides.
  • The lane 0 up/down, BIST override and PIPE switch comments now say what the code does, with no macOS class or function names.
  • I removed the same names from the two commit messages, the tunable comment in t8152-j873-usb.dtsi and the PR description.

No functional change: the driver builds with no W=1 warnings, and the diff is comments only.

I agree with the first point, moving the PHY into atc.c, and it's next: T8152 match data, plus a fixed-USB3 mode selected by a property on the PHY node, reusing atc.c's power-down/reset, tunable and lane power-up code. The T8152-specific parts are crossbar 0x110, the BIST hold around the PIPE handler switch, and lane 0's explicit power-up. It also needs the ATC's PMGR power states and PSD domain as real power domains rather than registers the PHY writes itself, which is the same PSD provider question I raised on #1797. Because it changes the bring-up path, I'll test it on the M6 before pushing.

@RyanTheTide

Copy link
Copy Markdown

Thanks for cleaning up the comments and commit messages. The description by registers and steps reads well. The plan for atc.c sounds right to us: T8152 match data, a fixed-USB3 mode selected by a PHY-node property, and only crossbar 0x110, the BIST hold and lane 0's explicit power-up as T8152-specific code. The power-domain question is the same one as on #1797, so the shared PSD provider there should cover it. When the atc.c version is pushed, we'll run no-regression rows for the shared PHY path.

@sithglan
sithglan force-pushed the thomas/j873-usb3 branch 2 times, most recently from 6655b2d to 78a6311 Compare November 19, 2026 21:49
@sithglan sithglan changed the title J873g: USB3 on the front ports (T8152 ACIOPHY, M6 Mac mini) J873g: USB3 on the front ports (T8152 in the ATC PHY driver, M6 Mac mini) Nov 19, 2026
@sithglan

Copy link
Copy Markdown
Author

The atc.c version is pushed. The head is now 78a6311eeeb6 (was 6655b2d6d0df). It is #1797 plus #2459's two PSD commits, unchanged, plus three commits. The standalone aciophy-usb3.c driver and its config line are gone.

phy: apple: atc: add T8152 for a fixed-USB3 port

  • Match data atcphy_hw_t8152. It uses the T8142 PIPE handler fields. Three new layout fields are zero for every other SoC:

    • cfg_offset: the power and reset block sits at 0x60000, behind the controller's DARTs.
    • lane_swap: bit 1 there.
    • sync_reset: 0x60030, released first and asserted last.

    Crossbar 0x110 is atc.c's existing USB3 setting. T8152 has no lane-mode register to write.

  • T8152 code is limited to the three pieces you listed: lane 0's explicit power-up (with its power-down when the PHY powers down), the crossbar write right after it, and the BIST hold while the PIPE switches.

  • apple,fixed-usb3 selects a host-only port. Only the USB3 PHY is registered: no reset controller, mux or switch. The PIPE is routed when dwc3 powers the PHY on.

  • Power goes through genpd: ATC2's USB_AON and COMMON_DP_0/1 through pmgr-pwrstate, and PSD service 57 through pmdomain: apple: T8152 PSD services as power domains #2459.

Two things came up only on hardware:

  • The T8152 PIPE handler never acknowledges the PIPE lock. With atc.c's 1 ms wait, every USB3 start failed and the hub stayed on USB2. In a test build that waited 150 ms, no acknowledge came in 8 tries, in either direction, while the PIPE still moved to USB3 and back under the request. So T8152 sets the request and does not wait (pipe_lock_unacked). That is what the old driver did, in effect: it waited 150 ms and then went on.
  • USB_AON is apple,always-on. I unbound the controller and unloaded phy-apple-atc, so genpd switched all four domains off. After reloading, dwc3 failed with "this is not a DesignWare USB3 DRD Core": the controller's reset and the PIPE handler state that the loader sets up are in that domain. With USB_AON kept on, the other three domains go off and on, and the hub comes back on both USB2 and USB3.

Tests on the J873g (exact head):

  • The VL822 enumerates at 480M and at 10000M ("new SuperSpeed Plus Gen 2x1"). The keyboard and mouse behind it work, and the back-left controller is unchanged.
  • 5 dwc3 unbind/bind cycles: USB3 at 10000M each time.
  • rmmod/modprobe phy-apple-atc: the hub comes back on USB2 and USB3.
  • KUnit phy-apple-atc*: 41/41, including the new phy-apple-atc-t8152 cases. They check the crossbar, lane 0 up and down, that the power block goes to 0x60000/0x60030 while the DART words at 0x20000/0x20008 stay untouched, and the unacknowledged lock.
  • apple-dt-check.sh against Merge aurora-wip 210c8f6e into integration/aurora (J873g NVMe, 10GbE, power off, USB2, audio) #1797 (ec172bbcc1ed): 0 new and 0 removed warnings over 137 DTBs. Both changed bindings pass.
  • tools/asahi/run-host-tests.py: 427/427. The host-test fixtures that copy atc.c structures now have the new fields, and the units for the older generations get T8152 stubs that assert.
  • checkpatch --strict is clean.

@RyanTheTide

Copy link
Copy Markdown

Thanks for the atc.c port. With aciophy-usb3.c and its config line gone, T8152 as match data plus apple,fixed-usb3 on the PHY node, and only lane 0's power-up, crossbar 0x110 and the BIST hold as T8152 code, this resolves our duplication point. Recording the unacknowledged PIPE lock and the USB_AON loss as measured on the J873g is the kind of reason we like next to a hardware difference. Since this changes the shared ATC path, we will run no-regression rows on our M1 Pro, M2, M4 Pro and A18 Pro (USB3 enumeration, a plug cycle, s2idle) and post them here.

@RyanTheTide

Copy link
Copy Markdown

@sithglan, a tidy-up pass over the open PRs here. These of yours need something:

If any of these are no longer needed, closing them helps; otherwise a merge or rebase onto integration/aurora is usually all they need. Thanks!

@sithglan

Copy link
Copy Markdown
Author

@RyanTheTide thanks. All eight are rebased onto integration/aurora d1b022dc34fb and GitHub reports each of them as mergeable:

PR new head stacked on
#1799 2603161c3e00 #1797
#1800 31f34f5d87e7 #1797
#2486 2880a16f6e74 #1800
#2178 82291cc244a6 #2486
#2749 bbd6690155a0 #1800
#2139 6a2bbe86dfa1 integration/aurora
#2142 b28768e3debc integration/aurora
#2238 bada74cc817b #2142

#1797 (7f2d14f96a69): the J873g PRs stack on it, so I merged integration/aurora d1b022dc34fb into it, as a merge commit with no conflicts. Its diff against integration is unchanged.

Conflicts, all small:

Two host tests that are new on integration, bcm4377-radio-sids and atc-t8132-usb3, copy apple-dart.c and atc.c structures. With the stacks they failed to compile on the new fields. Each fixture gets those fields in the commit that adds them:

  • apple_dart_hw.gen3, in "support the locked Gen3 DARTs";
  • cold_gen3 and its stream fields, in the two cold-DART commits;
  • fixed_usb3, cfg_offset, sync_reset and atcphy_cfg(), plus a stub for the T8152-only lane power-down, in "add T8152 for a fixed-USB3 port";
  • cio_only, in the CIO-mode commit.

Both tests now pass at every commit of every branch. Apart from these fixture lines and the context lines around the conflicts, git range-diff shows no change.

Checks on every head:

None of these heads have been booted on hardware yet.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Author

@DjDeveloperr J873g row on the exact head 641f9d7e1b05 (your point 2).

  • Kernel 7.3.0-aurora-j873-r1799+, built from this head, on the M6's default command line. SELinux is disabled on this install.
  • Front ports: usb-drd2's USB3 root (bus 4) has the front hub, 05ac:8010 "USB3.1 Hub", at 10000M. Its USB2 side (bus 3) has 05ac:800f at 480M, with a keyboard (Keychron K1) at 12M behind it.
  • Rebind of the controller (382430000.usb, dwc3 unbind and bind): the hub was back at 10000M after 2 s, and the USB2 hub and keyboard came back too. No new kernel lines.
  • Counts: 0 failed units, 0 AVC denials (SELinux disabled), 0 DART faults. The kernel error lines are the base's: compared with integration/aurora b10280c04c2d booted the same way, there are no new ones.

Still owed: the J813 (T8142) no-regression row for the shared atc.c paths. It needs a plain USB 3 device on a J813 port.

Assisted-by: LLM (Claude:Opus 5.5)

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
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>
@sithglan
sithglan requested review from a team as code owners November 24, 2026 13:40
@sithglan

sithglan commented Nov 24, 2026 •

Copy link
Copy Markdown
Author

@DjDeveloperr reworked for your #2178 review (no Apple tables in history, no regression with an older aura). The head is cc820203214e; it is still three commits on daa9e2de18bd.

  • dt-bindings: the T8152 example no longer has tunable lines. They were the first rows of the real atc2 tables.
  • phy: apple: atc: T8152 gets optional_tunables, with common-a counted among the lane tunables. Without the loader's tables the PHY probes and refuses every mode but USB2, before a register is written, so the controller and the other consumers never wait for it.
    • New KUnit case atcphy_test_t8152_no_tunables: USB3, USB3+DP, USB4, TBT and DP are refused with no register write. A mutant without the gate fails it.
    • The phy-apple-atc* suites pass 43/43 (arm64 QEMU).
  • DTS: atc2's tables are gone, and the atcphy2 alias takes their place. The bootloader copies the tables from the Mac's own ADT (kboot: T8152: copy the USB-C tunables and router DROMs from the ADT aura#498); one ATC row differs between the four PHYs of the same Mac, so it is calibration.
  • Checks: dt-checks against the base show 0 new warnings on 138 DTBs and the binding passes. checkpatch --strict reports nothing new; the atc.c commit has the same 3 warnings as before.

J873g rows on this exact head, on the M6's default command line:

aura#498 (1.0.0b15-g46c6d9b4, one-shot trial) enrolled aura (1.0.0b14-gd7f5a487, copies no tables)
atc2 tables in the live DT common-a 8, common-b 77, lane0-usb 55 rows (as the removed ones) none
PHY bound bound: "SuperSpeed tunables missing, USB2 only", "Host starts without USB3: -95"
Front ports 05ac:8010 hub at 10000M, keyboard on the USB2 side keyboard on the USB2 hub at 480M, no USB3 hub (as before this PR)
Counts 0 failed units, 0 AVC (SELinux disabled), 0 DART faults, no kernel error lines beyond the base the same, and no deferred devices

The J813 no-regression row for the shared atc.c paths is still owed. It needs a USB 3 device on a J813 port.

Assisted-by: LLM (Claude:Opus 5.5)

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at cc820203: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok in the PR body at cc820203
Conflicts ok none
PR text ok Risk: one-way · (new DT binding) · J873g (T8152); the shared atc.c paths run on every Mac with an ATC PHY (checked unaffected on the J813).

Areas: area:bringup, area:gpu, area:usb

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: HOLD at cc820203214e

Blockers:

  1. PR body (§4 attribution): Delete the AI attribution footer line at the bottom of the PR description (also flagged by pr-text). Commits, PR title, and diff are already clean.
  2. drivers/phy/apple/atc.c (§1 / §5 shared-path regression evidence): Still missing a non-T8152 Mac no-regression hardware row covering the shared atc.c paths (atcphy_power_on, atcphy_power_off, atcphy_configure, atcphy_configure_lanes, atcphy_pipehandler_lock, atcphy_usb3_set_mode, atcphy_load_tunables, atcphy_probe), e.g. J813 (T8142) or M1 Pro / M2 / M4 Pro / A18 Pro covering USB3 enumeration and plug/unplug.
  3. PR body (§5 structure): Add the required Tested: line (at cc820203214e, updating the stale 641f9d7e1b05 heading) and Risk: line (door type and affected Macs), as flagged by pr-text and pr-readiness.

Checked: Re-reviewed the interdiff from 641f9d7e1b05 to cc820203214e, full 3-commit diff, commit metadata, PR body, CI checks, and aurora-silicon/aura#498. The driver, binding, DTS, and KUnit code changes are clean with no code blockers; removing hardcoded tunable tables and adding optional_tunables makes the aura#498 dependency non-blocking (graceful USB2 fallback verified on J873g).

Evidence
  • Head: cc820203214ec9232f03c3f8a81948f7dc980d8c (06bbe5bfc139, f349ba7e0511, cc820203214e), mergeable against main.
  • Interdiff (641f9d7e1b05 -> cc820203214e):
    • Documentation/devicetree/bindings/phy/apple,atcphy.yaml: removed example tunable values copied from ADT.
    • arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi: removed hardcoded apple,tunable-* tables and added the atcphy2 = &atc2_phy alias for aura ADT copy.
    • drivers/phy/apple/atc.c: set atcphy_hw_t8152.optional_tunables = true; counted missing common-a as ss_missing on T8152 in atcphy_load_tunables(); gated non-OFF/non-USB2 modes in atcphy_configure() to return -EOPNOTSUPP before touching any registers or setting mode_dirty, preserving USB2 host bring-up on older bootloaders.
    • drivers/phy/apple/atc-test.c: added atcphy_test_t8152_no_tunables verifying refusal of USB3, USB3+DP, USB4, TBT, and DP with zero register writes (43/43 KUnit cases reported passing).
  • Checklist (§1-§6):
    • §1 No model gating: code PASS (apple,t8152-atcphy + apple,fixed-usb3); multi-Mac regression row still owed.
    • §2 Production-ready: PASS (default cmdline, no hacks, graceful fallback when tunables are absent).
    • §3 Safety: PASS (hardcoded calibration tables removed; ps_atc2_usb_aon apple,always-on justified).
    • §4 Clean-room & attribution: commits (Thomas Glanzmann, human Signed-off-by: only), title, and diff PASS; PR body FAIL due to AI attribution footer.
    • §5 Evidence: CI green (dt-checks, host-tests, pr-text, readiness); exact-head cc820203214e J873g rows PASS (both with aura#498 at 10000M and with enrolled aura 1.0.0b14 USB2 fallback, 0 failed units / 0 DART faults / 0 new kernel errors); non-T8152 atc.c regression row and PR body Tested:/Risk: lines still needed.
    • §6 Naming: PASS (aura, no legacy naming regressions).
  • Dependency note: aurora-silicon/aura#498 (46c6d9b47308, OPEN, CI green) is needed at runtime for J873g front-port USB3, but is non-blocking for merging #1799 because USB2 fallback without tunables is verified.

@sithglan

Copy link
Copy Markdown
Author

@DjDeveloperr the J813 (T8142) no-regression row for the shared atc.c paths (your point 1), with a USB 3 device on the rear port.

  • Kernels, built the same way:
    • this PR's head cc820203214e (7.3.0-aurora-j813-pr1799b+);
    • its base, integration/aurora daa9e2de18bd (7.3.0-aurora-j813-base1799+).
  • Each was booted once through the J813's enrolled aura (1.0.0b12-g693083b4), default command line. SELinux is not enabled on this install.
  • Device: SSK USB 3.2 SSD flash drive (2109:0715, uas) on the rear USB-C port (ATC1, PD controller sn201202x 1-0a).
base daa9e2de18bd this PR cc820203214e
Enumeration 10000M, uas 10000M, uas
64 MiB checksum / 1 GiB direct read 911bb12ba9925d4e / 358 MB/s 911bb12ba9925d4e / 357 MB/s
Deep sleep 8 s (PMU alarm wake) woke after 10.5 s; back at 10000M, same checksum woke after 9.9 s; back at 10000M, same checksum
Kernel lines over the sleep xhci re-registers both buses; one phy-apple-atc 40b000000.phy: Failed to lock pipehandler the same lines, the same one Failed to lock pipehandler
Software replug (sn201202x 1-0a unbind and bind) back at 10000M, same checksum, 357 MB/s back at 10000M, same checksum, 356 MB/s
Counts 0 failed units, 0 AVC (SELinux not enabled), 0 new kernel error lines, 0 DART faults the same

With the J873g rows on this head (issuecomment-7133226152), both of your §5 points are covered.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH at cc820203214e

Blockers:

  • §4 / §5 PR body: remove the trailing Assisted-by: line at the bottom of the PR description and add Tested: (referencing exact head cc820203214e) and Risk: lines so pr-text and pr-readiness are clean.

Checked:

  • Blocker 2 (§1 / §5 shared atc.c non-T8152 regression row) is now resolved: the exact-head cc820203214e J813 (T8142) A/B row vs base daa9e2de18bd passes 10000M uas enumeration, identical 64 MiB O_DIRECT checksums, 8 s deep-sleep wake, software replug, 0 failed units, 0 DART faults, and 0 new kernel errors.
  • Combined with the exact-head J873g rows (#issuecomment-7133226152), clean driver/DTS/binding/KUnit code, clean 3-commit metadata, and green dt-checks/host-tests, this is ready for immediate APPROVE as soon as the PR description is updated and pr-text goes green.
Evidence
  • Exact head: cc820203214ec9232f03c3f8a81948f7dc980d8c (OPEN, isDraft: false, MERGEABLE).
  • Hardware rows: J873g (#issuecomment-7133226152), J813 A/B (#issuecomment-7138850000 / 17:15Z).

@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@sithglan

Copy link
Copy Markdown
Author

@DjDeveloperr done: the description has no Assisted-by: line any more and follows the PR structure. What, Tested (J873g and J813 at cc820203214e), Risk (one-way door because of the new binding; the shared atc.c paths checked unaffected on the J813) and Not yet are at the top, with the details and the exact-head rows folded below.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at cc820203214e

Blockers: none

Checked:

  • §4 / §5 PR body cleanup verified: Assisted-by: footer removed, structured with What, Tested, and Risk, and pr-text is green; all 3 commits carry human author/committer (Thomas Glanzmann) and Signed-off-by: with zero attribution and no hardcoded Apple ADT tables.
  • §1 / §5 exact-head cc820203214e hardware evidence complete: J873g rows (#issuecomment-7133226152, both 10000M with aura#498 and graceful USB2 fallback on older aura) plus J813 (T8142) A/B no-regression row covering shared atc.c paths (10000M uas, identical checksums, 8 s deep-sleep wake, software replug, 0 failed units, 0 DART faults, 0 new kernel errors).
  • aurora-silicon/aura#498 is now merged, and all CI checks (dt-checks, host-tests, pr-text) are green.
Evidence
  • Exact head: cc820203214ec9232f03c3f8a81948f7dc980d8c (OPEN, isDraft: false, MERGEABLE, 4/4 CI checks passing).
  • Hardware rows: J873g (#issuecomment-7133226152), J813 A/B (17:15Z).

@RyanTheTide
RyanTheTide merged commit 85d0453 into aurora-silicon:main Nov 24, 2026
9 of 11 checks passed
sithglan added a commit to sithglan/aurora-linux that referenced this pull request Nov 24, 2026
main now carries aurora-silicon#1799 (06bbe5b, f349ba7, cc82020),
whose patches this branch already has as b620188, 2273dcf and
cc129b6 (same patch-ids). The seven files where this branch edits
aurora-silicon#1799's lines afterwards are merged against cc129b6 (the old base
plus aurora-silicon#1799; the integration merge below it touches none of them): six
keep this branch's version, since aurora-silicon#1799 is main's only change to them,
and drivers/phy/apple/atc.c also takes aurora-silicon#2868's two changes (a CIO link
survives the USB host stopping on every generation, T8152 included; a
drive-only DP request succeeds on PHYs without drive control).

The SPMI conflict is resolved in the aurora-silicon#2486 merge.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants