Repository navigation
J873g: USB3 on the front ports (T8152 in the ATC PHY driver, M6 Mac mini) - #1799
Conversation
fb8edd9 to
2fddae2
Compare
|
Heads-up: this stack (#1798, #1799, #1800) now conflicts with integration/aurora in 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. |
2fddae2 to
e2555c5
Compare
|
Rebased onto the refreshed #1797 (ceade2e, on integration/aurora 292773f). The branch is now e2555c5 (was 2fddae2) and merges cleanly again.
The testing lines in the description are updated: |
e2555c5 to
814b959
Compare
|
Rebased onto the refreshed #1797 (d87e41e, on integration/aurora 514ae1f). The branch is now 814b959 (was e2555c5) and merges cleanly again. One commit is new: arm64: configs: asahi: build the T8152 ACIOPHY USB3 PHY. #1939 added With #1797 and the three J873g PRs, at 514ae1f: |
814b959 to
b6c31d8
Compare
|
Rebased onto the refreshed #1797 (bbfdefa, on integration/aurora 0abc2f3). The branch is now b6c31d8 (was 814b959) and merges cleanly again. 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. |
|
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. 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 |
1906255 to
6e2ae8b
Compare
|
Thanks. I've done the second point. The head is now
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 |
|
Thanks for cleaning up the comments and commit messages. The description by registers and steps reads well. The plan for |
6655b2d to
78a6311
Compare
|
The
Two things came up only on hardware:
Tests on the J873g (exact head):
|
|
Thanks for the |
|
@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! |
78a6311 to
2603161
Compare
|
@RyanTheTide thanks. All eight are rebased onto integration/aurora
#1797 ( Conflicts, all small:
Two host tests that are new on integration,
Both tests now pass at every commit of every branch. Apart from these fixture lines and the context lines around the conflicts, Checks on every head:
None of these heads have been booted on hardware yet. Assisted-by: LLM (Claude:Opus 5.5) |
|
@DjDeveloperr J873g row on the exact head
Still owed: the J813 (T8142) no-regression row for the shared Assisted-by: LLM (Claude:Opus 5.5) |
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>
641f9d7 to
cc82020
Compare
|
@DjDeveloperr reworked for your #2178 review (no Apple tables in history, no regression with an older aura). The head is
J873g rows on this exact head, on the M6's default command line:
The J813 no-regression row for the shared 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 cc820203214e
Blockers:
- 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. drivers/phy/apple/atc.c(§1 / §5 shared-path regression evidence): Still missing a non-T8152 Mac no-regression hardware row covering the sharedatc.cpaths (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.- PR body (§5 structure): Add the required
Tested:line (atcc820203214e, updating the stale641f9d7e1b05heading) andRisk:line (door type and affected Macs), as flagged bypr-textandpr-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 againstmain. - 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 hardcodedapple,tunable-*tables and added theatcphy2 = &atc2_phyalias forauraADT copy.drivers/phy/apple/atc.c: setatcphy_hw_t8152.optional_tunables = true; counted missingcommon-aasss_missingon T8152 inatcphy_load_tunables(); gated non-OFF/non-USB2 modes inatcphy_configure()to return-EOPNOTSUPPbefore touching any registers or settingmode_dirty, preserving USB2 host bring-up on older bootloaders.drivers/phy/apple/atc-test.c: addedatcphy_test_t8152_no_tunablesverifying 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_aonapple,always-onjustified). - §4 Clean-room & attribution: commits (
Thomas Glanzmann, humanSigned-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-headcc820203214eJ873g rows PASS (both withaura#498at 10000M and with enrolledaura 1.0.0b14USB2 fallback, 0 failed units / 0 DART faults / 0 new kernel errors); non-T8152atc.cregression row and PR bodyTested:/Risk:lines still needed. - §6 Naming: PASS (
aura, no legacy naming regressions).
- §1 No model gating: code PASS (
- 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#1799because USB2 fallback without tunables is verified.
|
@DjDeveloperr the J813 (T8142) no-regression row for the shared
With the J873g rows on this head (issuecomment-7133226152), both of your §5 points are covered. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH at cc820203214e
Blockers:
- §4 / §5 PR body: remove the trailing
Assisted-by:line at the bottom of the PR description and addTested:(referencing exact headcc820203214e) andRisk:lines sopr-textandpr-readinessare clean.
Checked:
- Blocker 2 (§1 / §5 shared
atc.cnon-T8152 regression row) is now resolved: the exact-headcc820203214eJ813 (T8142) A/B row vs basedaa9e2de18bdpasses 10000Muasenumeration, 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 greendt-checks/host-tests, this is ready for immediateAPPROVEas soon as the PR description is updated andpr-textgoes green.
Evidence
- Exact head:
cc820203214ec9232f03c3f8a81948f7dc980d8c(OPEN,isDraft: false,MERGEABLE). - Hardware rows: J873g (
#issuecomment-7133226152), J813 A/B (#issuecomment-7138850000/ 17:15Z).
|
@DjDeveloperr done: the description has no |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at cc820203214e
Blockers: none
Checked:
- §4 / §5 PR body cleanup verified:
Assisted-by:footer removed, structured withWhat,Tested, andRisk, andpr-textis green; all 3 commits carry human author/committer (Thomas Glanzmann) andSigned-off-by:with zero attribution and no hardcoded Apple ADT tables. - §1 / §5 exact-head
cc820203214ehardware evidence complete: J873g rows (#issuecomment-7133226152, both 10000M withaura#498and graceful USB2 fallback on olderaura) plus J813 (T8142) A/B no-regression row covering sharedatc.cpaths (10000M uas, identical checksums, 8 s deep-sleep wake, software replug, 0 failed units, 0 DART faults, 0 new kernel errors). aurora-silicon/aura#498is 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).
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>
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 atcc820203214e: a USB 3 SSD stick at 10000M through deep sleep and a PD-controller replug, the same as on the basedaa9e2de18bd. 0 failed units, 0 DART faults.Risk: one-way door (new DT binding) · J873g (T8152); the shared
atc.cpaths 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:apple,t8152-atcphyandapple,fixed-usb3, the PHY's power domains, and its common-a, common-b and lane0-usb tunable groups.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:
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-usb3marks 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.cstructures get the new fields.atcphy2alias.usb2gets the PHY as itsusb3-phyand dropsmaximum-speed = "high-speed".Things to know
phy-apple-atcand the PSD and power-state providers. If the PHY isn't built, the front ports lose USB2 as well.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.atcphy2alias. With an older loader the front ports run USB2, as before this PR.Evidence
Testing
Rows on the exact head
cc820203214e: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.daa9e2de18bdfor the sharedatc.cpaths, issuecomment-7138926643. A USB 3.2 SSD stick runs at 10000M withuasthrough an 8 s deep sleep and a PD-controller replug, with identical checksums and lines on both kernels; 0 failed units, 0 DART faults.phy-apple-atc*43/43, includingatcphy_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:
rmmod/modprobe phy-apple-atc: the three switchable domains go off and on again, and the hub comes back on USB2 and USB3.phy-apple-atc*: 41/41, includingphy-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.shagainst 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.--strictis clean.cc @Acelogic @RyanTheTide @DjDeveloperr @LiamRay10