Skip to content

Apple M6 (T8152) audio plumbing: ADMAC and AOP hardware config (on top of #191) - #194

Open
joshuaswarren wants to merge 12 commits into
omacom:integration/aurorafrom
joshuaswarren:m6-audio-l1
Open

joshuaswarren wants to merge 12 commits into
omacom:integration/aurorafrom
joshuaswarren:m6-audio-l1

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

The first two pieces of audio on the Apple M6 (T8152) Mac mini: the audio DMA controller and the Always-On Processor hardware description. Two commits.

The first ten commits of this branch are #191 (the M6 base). Only the last two commits are new here: the diff of this PR shows the base too until #191 merges, then I rebase. Review the last two.

It is not needed for the release candidate, and there is no rush to review or merge it. This PR does not play audio.

Commits

# Commit Notes
11 dma: apple-admac: add T8152 (admac-evolution) support new admac_t8152_hw (evolved register layout, no global 0x28/0x2c write) and the apple,t8152-admac compatible
12 soc: apple: aop: add the T8152 (Mac mini) hardware config apple,t8152-aop, no setup port, three AFK endpoints; the binding makes the second mailbox optional

Measured, on an M6 Mac mini

  • Commit 11: the ADMAC for the base namespace binds and probes ("Audio DMA Controller").
  • Commit 12 (with an out-of-tree probe module, not this driver): RTKit v12 boots on the primary mailbox without the setup port; all three services start; 25 of 25 EPIC calls with the version 2 header were answered; the speaker, codec-out and codec-in devices attach and report power state idle.

Not measured

  • Any data transfer through the ADMAC: the channel registers did not answer a read-only probe made after boot.
  • The Rust aop.rs change on hardware (it compiles, it has not run), and audio data. The hpai, lpai and tap devices return an error on this machine.
  • The kernel's own make dtbs_check / dt_binding_check (a hand-run dt-validate of the board file gave 0 messages).
  • This branch was not booted.

Blocked

Compile receipt

arm64 clang, W=1, integration/aurora at 42672ed plus the 12 commits of this branch, defconfig: drivers/dma/apple-admac.o, the eight objects of #191 and apple/t8152-j873g.dtb all rc 0 with 0 warnings. drivers/soc/apple/aop.rs was compiled separately with CONFIG_RUST=y (rustc 1.93.1, bindgen 0.73.2): rc 0, 0 warnings, receipt in the first comment. It was not linked into a module or run. check-commits: Signed-off-by on all 12 commits; no checkpatch errors (warnings: long lines, the MAINTAINERS notice).

@joshuaswarren

Copy link
Copy Markdown
Author

Rust compile receipt for aop.rs (head 30c37988d0971e8856d41636cc0c8afce555004e, the 12 commits applied on integration/aurora 42672ed):

  • Toolchain: rustc 1.93.1, bindgen 0.73.2, clang/lld 22 (LLVM=1), ARCH=arm64, defconfig plus CONFIG_RUST=y and CONFIG_APPLE_AOP=m (this selects RUST_APPLE_RTKIT=y, RUST_APPLE_MAILBOX=y). CONFIG_RUSTC_VERSION=109301.
  • Command: make ... modules_prepare, then make drivers/soc/apple/aop.o.
  • Result: RUSTC [M] drivers/soc/apple/aop.o, rc 0, 0 warnings. The object contains the string apple,t8152-aop (2 hits), so the new match-table line was compiled in.

This replaces the "not compiled" line of the description: aop.rs compiles. It was not linked into a module or run. dt_binding_check was not run.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge within the stated bring-up limits.

Summary

Adds T8152 audio hardware descriptions on top of the M6 platform work:

  • T8152 USB ports start as fixed hosts or a fixed peripheral and request power before use.
  • T8152 DARTs can initialize when their hardware becomes available and flush through a shared doorbell.
  • T8152 storage controllers use the Apple NVMe and SART hardware paths.
  • T8152 audio hardware uses its evolved ADMAC layout and primary AOP mailbox.

This remains audio plumbing, not working audio playback. No builds or hardware tests were run during this review.

joshuaswarren accepted that a Gen3 DART locked by an error stays locked until reset because no supported unlock path is known. joshuaswarren also removed the unreachable USB sleep callbacks and retained the existing syscore behavior.

Reviews (7) · Last reviewed commit: "soc: apple: aop: add the T8152 (Mac mini..." · Reviewed by Greptile

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @joshuaswarren. Keeping this to the ADMAC and AOP entries on top of #191 is the right shape, and both read correctly against the drivers. A few things before merge:

  1. The AOP binding now lets a T8140 node drop its setup mailbox. apple,t8140-aop.yaml:35-45 adds minItems: 1 to mboxes and mbox-names for both compatibles, so a T8140 node with only mbox validates, but the driver opens setup by name on T8140 (aop.rs:2307, :2385-2386, :1816-1817) and fails to bind without it. A T8152 node with two mailboxes also validates. The als and audio children (:61-67) are T8140 schemas too, and a T8140 audio child under T8152 would fail, since source_ring() needs the setup port (aop.rs:1697-1699). Suggested fix: an allOf with if/then per compatible: T8140 keeps minItems: 2; T8152 gets maxItems: 1 on both lists and als: false, audio: false until T8152 schemas exist. Please run dt_binding_check on both changed bindings after that.
  2. #191 has to land first. This branch carries #191's ten commits, and they differ from the #191 head I reviewed (3d03eb3): seven files changed, several of them my earlier points. My required items there are still open, for example the dwc3 host-unplug state at dwc3-apple.c:678-680 and :727-728. Please push the updated series to #191 so I can re-review it there, then rebase this one to the two commits once it merges.
  3. Kernel CI hasn't run on this head. The only check is the pending Greptile review. compile-check doesn't build Rust objects, so the AOP change at this head has not been compiled anywhere yet: only the package build and KUnit compile aop.rs (CONFIG_APPLE_AOP is m in asahi.config:95 and y in aurora.kunitconfig:42). I'd like a green package build (a ci:build run, or the merge queue) before this merges.

Smaller things:

  • Split the bindings into their own commits. Both commits change a binding together with the driver, which checkpatch flags ("DT binding docs and includes should be a separate patch", Documentation/devicetree/bindings/submitting-patches.rst). The T8140 entries landed as separate dt-bindings: dma: apple,admac: … and dt-bindings: soc: apple: … commits, so please follow that.
  • "Clean checkpatch" in the PR body isn't accurate. check-commits.py gives a warning on every one of the twelve commits, one on each of the new two, and checkpatch also flags the 75-column limit at line 8 of the ADMAC commit message. They're advisory, but please correct the body.
  • Nit: the binding title (apple,t8140-aop.yaml:7) still says "Apple T8140 Always-On Processor"; "Apple T8140/T8152 Always-On Processor" would match the content now.

Checked and fine: admac_t8152_hw only differs from T8140 in set_unk28, which is used once, in admac_device_config (apple-admac.c:816-819), and the evolved layout comes from the same flag T8140 uses (:68-71). The T8152 AOP config takes the existing path with no boot-argument patch and no setup port: the CPU is started through the wrapper, then start() wakes RTKit and starts the AFK endpoints (aop.rs:2373-2398, :1373-1381). AFK init is sent without waiting for each endpoint (:424-426), so "back to back" holds, and with epic_v4: false calls use the version 2 header with the tag echoed (:896-905, :760-771). Locally, check-commits.py passes: all twelve commits are signed off, with checkpatch warnings only.

No in-tree DT uses apple,t8152-admac or apple,t8152-aop yet, so neither change does anything on any Mac we ship until the DT nodes land. Hardware evidence for the in-tree AOP driver itself (your measurements used an out-of-tree module), including an unbind on T8152 without a setup port, belongs with that later change, not this merge.

@joshuaswarren

Copy link
Copy Markdown
Author

Review at 30c3798: findings (last two commits only, as asked; read only, nothing built or booted by me, no dt_binding_check or dtbs_check run; I did not run the Rust build, I rely on the compile comment on this PR for that).

Checked and fine:

  • admac: struct admac_hw has two fields and admac_t8152_hw sets both (set_unk28 = false, evolved_layout = true, the T8140 layout without its global 0x28/0x2c write); the compatible is a stand-alone entry in the binding and in admac_of_match[], as it must be since it does not take the T8140 value of set_unk28.
  • aop: HW_CFG_T8152 follows the existing configs. setup_port: false skips both the setup queue (if cfg.setup_port at the queue construction) and the "setup" mailbox lookup; patch_bootargs: false means ec0p, aopt and alig are never read (the zeros are placeholders, as for T8140); epic_v4: false selects the version 2 sub-header the doc comment describes; required_endpoints lists three endpoints and the table entry and compatible string are in place.

Findings:

  1. apple,t8140-aop.yaml: mboxes and mbox-names are now minItems: 1 for both compatibles, so a T8140 node with only the primary mailbox passes the schema and then fails the probe (its config has setup_port: true), and a T8152 node with two mailboxes passes although the driver would ignore the second. Add an allOf with an if on the compatible: T8140 requires both entries, T8152 allows exactly one (maxItems: 1 for both properties).
  2. Nit: the /// T8152 (Mac mini) doc comment starts directly after the closing }; of HW_CFG_T8140; a blank line between them would match the other entries.

Not checked: the endpoint numbers and the "calls were all answered" statement in the doc comment (hardware results); the admac register behaviour on T8152.

@joshuaswarren

Copy link
Copy Markdown
Author

Review at 30c3798: findings (two commits: ADMAC and AOP)

Checked

  • ADMAC: admac_t8152_hw differs from admac_t8140_hw in set_unk28 = false, so a stand-alone table entry and compatible is right, not a fallback. The binding line is a stand-alone const; the binding example validates (hand-run dt-validate, dtschema 2026.9).
  • AOP, read in aop.rs at this head: setup_port: false gates the setup queue (AopData::new), setup_open() and the wake() / setup_finish_boot() branch, so probe takes data.start(). patch_bootargs: false leaves ec0p, aopt and alig unused (the T8140 entry has the same zeros). Children are registered by service name (aop-audio becomes audio), not by endpoint number, so the different endpoint numbers on T8152 need no other change. required_endpoints [0x20, 0x21, 0x22] is what start_afk() checks.
  • I did not compile aop.rs. The receipt in the comment above is the only compile evidence; I did not reproduce it.

Findings

  1. Binding: mboxes and mbox-names now have minItems: 1 for both compatibles. A apple,t8140-aop node with only the primary mailbox passes: I wrote a minimal T8140 node with one mailbox and ran dt-validate against the binding at this head, and it returned no message (with power-domains removed it reports the missing property, so the node was checked). A T8140 probe without the setup mailbox then fails in Mailbox::new_byname("setup"). Add allOf with if on apple,t8140-aop requiring minItems: 2, and maxItems: 1 for apple,t8152-aop.
  2. ADMAC commit text: it says the evolved layout matches "at every register we compared" and also that the channel registers did not answer a read-only probe. evolved_layout changes exactly one thing, the channel register base (REG_CHAN_BASE). So evolved_layout = true for T8152 is unconfirmed on hardware, and only probe and bind are measured. Say that in the commit text.

Smaller

  • apple,t8140-aop.yaml has no examples:, so dt_binding_check checks nothing of the node for either compatible. Add one with a T8152 node (one mailbox).
  • checkpatch on the two new commits: COMMIT_LOG_LONG_LINE (commit 11), DT_SPLIT_BINDING_PATCH (both: binding and driver in one commit). No errors. The PR text says "clean checkpatch".

Not checked

No compile of aop.rs or apple-admac.c at this head, no boot, no audio path. The first ten commits are #191 and are not reviewed here.

@joshuaswarren

Copy link
Copy Markdown
Author

New head 64b97d50bedce95eed2f432ebe0cff9b5f7ab874, rebased on the fixed #191 head c9d88a5d8fb390d8b61f5d2154f456aa81edfc78. Per finding of the review (issuecomment-6370055613):

  1. aop binding mailboxes. apple,t8140-aop now requires two entries of mboxes and mbox-names; apple,t8152-aop allows exactly one of each (an allOf with an if on the compatible). The commit message says so.
  2. Blank line between HW_CFG_T8140 and the T8152 doc comment.

Compile receipts for the new head: arm64 clang W=1, apple-admac.o, the eight objects of #191 and t8152-j873g.dtb, rc 0, 0 warnings; and aop.o with CONFIG_RUST=y (rustc 1.93.1, bindgen 0.73.2), rc 0, 0 warnings. dt_binding_check was not run.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 64b97d5 for the last two commits (ADMAC and AOP), with the notes below. Not booted, and I did not reproduce the compile receipts.

Checked

  • AOP binding. The earlier finding is fixed. I built the schema from the three files of this head (apple,t8140-aop.yaml and the two it references) and validated four minimal nodes with dt-validate (dtschema 2026.9): apple,t8140-aop with two mailboxes passes; with one it fails (mbox-names ... is too short); apple,t8152-aop with one passes; with two it fails (mbox-names ... is too long).
  • HW_CFG_T8152: setup_port: false skips the setup queue and the setup mailbox lookup, patch_bootargs: false leaves ec0p, aopt and alig unused, epic_v4: false selects the version 2 header, and the match-table line is in place. The blank line before the doc comment is there.
  • ADMAC: admac_t8152_hw differs from admac_t8140_hw in set_unk28 = false, so a stand-alone entry is right. Its binding example validates.

Notes (not blocking)

  • The ADMAC commit text says the evolved layout matches at every register compared, and also that the channel registers did not answer a read-only probe. evolved_layout changes the channel register base (REG_CHAN_BASE), so evolved_layout = true for T8152 is not confirmed on hardware; the commit text could say so.
  • apple,t8140-aop.yaml has no examples:, so dt_binding_check checks no node of it.
  • checkpatch on the two commits: COMMIT_LOG_LONG_LINE and DT_SPLIT_BINDING_PATCH. No errors.

Not checked

No compile of aop.rs or apple-admac.c, no boot, no audio path. The first ten commits are #191.

Comment thread drivers/usb/dwc3/dwc3-apple.c Resolved
Comment thread drivers/pmdomain/apple/pmgr-psd.c Resolved
Comment thread drivers/iommu/apple-dart.c Resolved
The T8152 GPIO block has the same layout as the T8140 one. Match
"apple,t8152-pinctrl" with the T8140 hardware data.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
T8152 has a SART with a new register layout: the per-entry config,
physical address and size registers sit at 0x00, 0x60 and 0xc0. Add the
operations for it and match "apple,t8152-sart". The binding lists the
new compatible as a stand-alone entry.

Measured on an M6 Mac mini with an earlier form of this change: the
machine boots and runs its root file system from NVMe, which uses this
SART. This version is compile-checked only.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
On T8152 the queue setup registers (admin queue, IO queues, the linear
submission queue control) live at different offsets, and a few of them
accept writes but read back zero. Add a register translation for that
layout, skip the read-back checks that cannot work, and describe the
controller with a new hardware data block matched by
"apple,t8152-nvme-ans2".

The ANS is a virtual PMGR device on this SoC and has no reset line, so
the hardware data block carries a no_reset_control flag. Only T8152 skips
the reset lookup. Every other SoC still requires a reset control and
fails the probe without one, as before.

The binding gets the new compatible. On T8152 the resets, power-domains
and power-domain-names properties are not required, and the controller
has two register regions (the NVMMU registers live in the first one).

Measured on an M6 Mac mini with an earlier form of this change: the
machine boots and runs its root file system from NVMe. This version is
compile-checked only.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 64b97d5 for the last two commits (admac, aop). Read only: nothing built or booted by me, no dt_binding_check or dtbs_check run; I rely on the compile comments on this PR for the C and Rust builds.

Re-checked my findings:

  1. apple,t8140-aop.yaml now has an allOf with an if on the compatible: apple,t8140-aop requires both mailboxes and both names, every other compatible (T8152) is limited to one of each.
  2. The blank line between HW_CFG_T8140 and the /// T8152 (Mac mini) doc comment is there.

I did not re-read the admac code or the rest of aop.rs at this head; the author reports that only the binding and the blank line changed, and I checked those two plus the HW_CFG_T8152 table entry.

@joshuaswarren

Copy link
Copy Markdown
Author

Rebased on the fixed #191 head 9af182774f886303e4c85497549f64498551dd03: head efe48a3f7dd3df613dd71c3fd25b683df2571a09, the two commits unchanged. Compile check at this head, arm64 clang W=1: apple-admac.o, the eight objects of #191 and t8152-j873g.dtb, all rc 0, 0 warnings; aop.o with CONFIG_RUST=y (rustc 1.93.1, bindgen 0.73.2): rc 0, 0 warnings.

Comment thread drivers/usb/dwc3/dwc3-apple.c Resolved
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at efe48a3 for the last two commits (rebased only). Read only: nothing built or booted by me. The admac commit has the same diff as at 30c3798 and 64b97d5 (compared after dropping the index lines). The aop commit is the content I GREENed at 64b97d5 (the allOf if on the compatible for the mailboxes, the blank line before the /// T8152 comment, HW_CFG_T8152 and the table entry); only the hunk context moved with the rebase (the table macro now carries MODULE_OF_TABLE in the context). I did not re-read the rest of aop.rs; the author reports the Rust compile with CONFIG_RUST=y.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at efe48a3 for the last two commits (ADMAC and AOP).

The two commits are the same as at 64b97d50 (I compared the commit patches line by line: no difference); only the base changed.

Checked

  • dtcheck.sh (dtschema 2026.9) on a tree with this head's board file and the AOP and ADMAC bindings: dt-validate of t8152-j873g.dts rc 0, 0 lines; the ADMAC binding example validates.
  • The AOP binding keeps the allOf I tested at the previous head (T8140 needs two mailboxes, T8152 exactly one); the binding file is unchanged.
  • Notes from my earlier comment still apply and do not block: the ADMAC commit text could say that evolved_layout = true for T8152 is not confirmed on hardware, and apple,t8140-aop.yaml has no examples:.

Not checked

No compile of aop.rs or apple-admac.c at this head (I did not reproduce the receipts), no boot, no audio path. The first ten commits are #191.

@joshuaswarren

Copy link
Copy Markdown
Author

Summary for a maintainer, at head efe48a3f7dd3df613dd71c3fd25b683df2571a09:

Comment thread drivers/usb/dwc3/dwc3-apple.c Resolved
@joshuaswarren

Copy link
Copy Markdown
Author

New head ed5dcf95838046db33e7f12790e0d164d939388c (rebased on the same base as the other M6 PRs, plus the fixes for the Greptile and reviewer findings; every Greptile thread of the previous heads has a reply with the commit and is resolved).

Receipts at this head (CT-local, arm64 clang W=1, 16K pages, PCIE_APPLE=m, USB4_APPLE_SOC=m): apple-admac.o, the eight objects of #191, t8152-j873g.dtb, and aop.o with CONFIG_RUST=y (one warning in rust/kernel/dma_fence.rs, not in this PR), rc 0, 0 warnings in this PR's files. dtcheck.sh (dtschema 2026.9) on the board file: dtc -@ 0 warning lines, dt-validate 0 lines, the binding examples print only the baseline message of display/apple,dcp-typec-routes.yaml. Changes since the last GREEN: a failing phy_init() or phy_power_on() in dwc3_apple_core_start() now goes through dwc3_apple_core_stop(); the PSD parents (ps_atcN_usb_aon, ps_atcN_usb); iommus exactly four; the host-only lists skipped for a fixed peripheral; the Gen3 doorbell guarded for non-arm64 builds; a locked Gen3 DART no longer takes the range flush through TLB_CMD; the PSD group power-off restores the stopped slots. Not run: a boot, the kernel's own make dtbs_check.

Comment thread drivers/iommu/apple-dart.c Resolved
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at ed5dcf9

Read: the twelve commits against the ones I reviewed at efe48a3, compared per commit as diffs with the hash lines removed. The two commits of this PR (apple-admac T8152 support and the AOP T8152 hardware config) are identical (0 differing lines). The ten base commits are the #191 head b8943e8, where I posted the delta review. Not run: build; the author's compile and dt receipts are not reproduced. Merge still needs CI and a second non-author GREEN.

Comment thread drivers/pmdomain/apple/pmgr-psd.c Resolved
On T8152 the ATC USB blocks (and the GPU) are behind a per-slot service
request in the power state director, on top of the normal PMGR power
states. Expose each slot, or a group of slots that must come up together,
as a generic power domain. Power-on writes the slot request and waits for
the acknowledge; power-off requests state 6 in reverse order.

Add the devicetree binding.

When a power-on request times out, the slot that timed out is put back to idle with the slots before it, because its acknowledge was not seen but it may still start.

When a group power-off fails, every slot is put back to its active state, including a slot whose off request timed out and may still finish stopping, because genpd keeps the domain marked on after a failed power-off and would skip power_on at the next resume.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The fixed host ports on T8152 need only the USB2 part of the PHY. Add a
driver that applies the bootloader-supplied calibration, handles host and
device mode, and leaves the USB3 and USB4 lanes alone.

Add the devicetree binding.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
A hub with the Apple ID 05ac:800f sits behind the front ports of the M6
Mac mini. Add that ID to the hub quirk table with
HUB_QUIRK_DISABLE_AUTOSUSPEND so the kernel keeps it powered.

The match is on the vendor and product ID alone. Every hub with this ID
loses autosuspend, not only the one on this machine. The constant is
named after the ID, USB_PRODUCT_APPLE_HUB_800F, because the ID is
Apple's and the part behind it was not identified from the descriptor.

This quirk was not measured on its own: it only keeps the hub awake.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add a peripherals fragment to the M6 Mac mini board file: the always-on
GPIO controller with the reset hog for the front-port USB hub, and the
four PSD service slots for the USB ports.

The NVMe controller, its mailbox and its address filter are not described
here. The NVMe node needs a mailbox driver change that is not in this
tree yet.

The fragment holds only addresses, interrupt numbers and wiring. The boot
loader adds the register tunables that some blocks need. The PMGR power
domains are not described yet, so nodes that need them are left out.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add the DART of the Apple M6 (T8152), a third-generation DART whose
topology is fixed by the hardware. Its streams are described by static
parameters instead of being probed, and it takes no MMIO access until the
first use, because the block can be power gated behind the ATC USB
domains.

The binding requires a second register region (the TLB invalidate
doorbell) for the T8152 compatible only.

The change adds:
- the apple,t8152-dart compatible and its hardware description;
- static topology and "first use" initialisation of every DART;
- the Gen3 TLB invalidate and the fault handler;
- the reset path for DARTs that the boot loader leaves locked.

A DART that the boot loader leaves locked is held powered for its
lifetime. That applies to Gen3 hardware only. The other generations keep
their behaviour. The first-use initialisation re-reads the parameters and fails if the
page size differs from the one assumed at probe. It runs under a spinlock, and
every function it calls is non-sleeping (register accesses and an atomic
poll).

Measured on an M6 Mac mini with the earlier form of this change: the
display controller DART attaches locked on every boot. This version is
rebased on current integration/aurora and was compile-checked only. The
USB DART paths need the T8152 PSD power domains and were not run on
their own.

The doorbell store and the TLBI of the Gen3 invalidate are arm64 instructions: they are built only with CONFIG_ARM64, and other architectures (COMPILE_TEST) get a stub that returns -EOPNOTSUPP. A locked Gen3 DART no longer takes the range flush through TLB_CMD, which Gen3 does not accept; it uses the full-stream Gen3 callback.

Gen3 does not take commands through TLB_CMD, so the unlock after a lock-on-error exception is not sent there: the DART logs once that this is not supported. The stale-exception drain of a reset does not read 0x704 on Gen3, like the fault handler.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add the apple,t8152-dwc3 compatible to the Apple dwc3 glue. The ATC ports
of the M6 (T8152) controller never switch roles through the Type-C
controller. The glue starts the controller as a fixed host, with or
without a hub child, or as a fixed peripheral when the node sets
dr_mode = "peripheral".

The T8152 profile is USB2 only: it needs maximum-speed = "high-speed",
takes no reset line, and its USB3 PHY is optional. The calibration lists
come from the device tree (apple,tunable-* properties that the boot loader
fills in at runtime; the binding does not require them in the board file) and are applied to the register windows in a fixed order after
the core is reset. The pipe handler is set up for the selected role.

The apple,t8103-dwc3 paths keep their behaviour. The controller stays a
syscore device while it runs, as before: no separate suspend or resume
path is added for T8152.

The earlier form of this change ran on an M6 Mac mini USB2 front port.
This version is rebased on current integration/aurora and was
compile-checked only. SuperSpeed does not train yet and is not part of
this change.

A fixed peripheral does not require the host-only calibration lists at probe, since it never applies them. The binding lists exactly four iommus entries, two stream IDs on each of two DARTs.

If the T8152 USB2 PHY fails to initialise or power on during core start, the failure goes through the same shutdown as a failed core init, so the reset and syscore flags set earlier are cleared again.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the power management blocks and the USB controllers of the Mac
mini (M6, J873) next to the peripherals fragment:
- the two PMGR blocks and their power domains, in t8152-j873-pmgr.dtsi;
- for each of the four USB ports (usb0, usb1, usb2 and usb3 of the SoC):
  two DART instances, the USB2 PHY and the dwc3 controller.

The register windows, interrupts and DART tunables are the values of the
Apple device tree of the machine. The boot loader adds the apple,tunable-*
lists of the USB2 PHY and the controller at runtime.

The bindings list the apple,t8152-pmgr and apple,t8152-pmgr-pwrstate
compatibles, and the dwc3 and USB2 PHY bindings take the tunable lists as
optional, because the boot loader adds them.

The fragment is a plain description of the hardware. The ports that the
change describes run USB2 only: SuperSpeed and USB4 are not part of it.

This commit compiles to a device tree blob with dtc without warnings. It
was not booted. The bring-up it comes from enumerated the front-port USB2
hub and a USB disk at 480 Mb/s.

The four PSD service slots get their PMGR domains (the aon and the port domain of their port) as parents, so genpd powers them before the slot request.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 77ee947

The two commits above the #191 head are identical to the ones I cleared at efe48a3f (compared as diffs with the hash lines removed). The base changed, so I re-ran the device tree and binding check with this PR's files on top of the new base: dtcheck.sh (dtschema 2026.9) on a tree that carries these changes with the other stacked PRs, dtc -@ 0 warning lines, dt-validate of the board file 0 lines, 73 examples with only the baseline message.

Not checked: compile receipts, hardware. Merge still needs CI and the owner's word.

The T8152 audio ADMAC is the same evolved family as the T8140 one: the
vendor driver for it matches the evolved register map at every register we
compared and never writes the global 0x28/0x2c pair, so the new variant sets
evolved_layout and clears set_unk28.

On an M6 Mac mini the base-ns ADMAC binds and probes ("Audio DMA
Controller"). No data transfer is tested; the channel registers did not
answer a read-only probe made after boot.

Not needed for the release candidate.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add apple,t8152-aop. Unlike T8140 it has no setup port: the CPU is started
through the wrapper and RTKit boots on the primary mailbox, with three AFK
endpoints (0x20 SPUApp, 0x21 wakehint, 0x22 aop-audio) announced with EPIC
sub-header version 2. The binding requires two mailboxes for T8140 and allows exactly one for T8152.

MEASURED on an M6 Mac mini, with an out-of-tree probe module: RTKit v12
boots on the primary mailbox without the setup port; all three services
start; 25 of 25 EPIC calls with the version 2 header were answered; the
speaker, codec-out and codec-in devices attach and report power state idle.
NOT measured: audio data transfer, the hpai/lpai/tap devices (they return
an error on this machine).
BLOCKED: this patch alone does not play audio, see the audio driver patch.

Not needed for the release candidate.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

New head 7d52ab5f72b2b2cc9b369fdb355c13f823135884: rebased on the new #191 head 9fbb3568 (only the PSD power-on rollback of the base changed); the commits of this PR are unchanged. The stack objects build with rc 0 and 0 warnings (arm64 clang W=1, 16K pages).

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 7d52ab5

Read: the commits of this head against my last GREEN head ed5dcf9, compared per commit as diffs with the hash lines removed. The two commits of this PR (apple-admac T8152 support, AOP T8152 hardware config) are identical. The ten base commits are the #191 head 9fbb356, where I posted the delta review (PSD power-on rollback includes the failed slot, PSD power-off restores every slot, Gen3 DART drain and unlock changes). Not run: build; the author's compile and dt receipts are not reproduced. Merge still needs CI and a second non-author GREEN.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 7d52ab5

The commits above the #191 head are identical to the ones I cleared at 77ee9476 (compared as diffs with the hash lines removed); the head moved because the #191 base changed (one hunk in the PSD power-on rollback, reviewed in #191). The device tree and binding results at 77ee9476 stand.

Not checked: compile receipts and hardware. Merge still needs CI and the owner's word.

@joshuaswarren

Copy link
Copy Markdown
Author

Status at head 7d52ab5f72b2b2cc9b369fdb355c13f823135884: two independent reviews GREEN at this exact head, all Greptile threads replied and resolved, arm64 clang W=1 compile of the touched objects rc 0 with 0 warnings, device-tree schema check 0 messages. Not done: a boot on hardware, CI. Needs a maintainer's CI approval and merge. Not needed for the release candidate.

@joshuaswarren

Copy link
Copy Markdown
Author

Note

🤖 GPT-6.1 Terra responding on behalf of joshuaswarren

I prepared the requested binding and commit split on a separate branch at 50fdabf50806e49c441d74b9177c6dfb01b51eb0. It keeps #191 as the base, separates each binding from its driver, updates the AOP title, and rejects T8140 audio and ALS children on T8152.

The PR head is unchanged. The branch still needs a fresh compile and CI at its exact head. I will update the stack after #191 lands.

@joshuaswarren

joshuaswarren commented Nov 5, 2026 •

Copy link
Copy Markdown
Author

[Joshua's agent] Waiting on #191 and exact-head compile/CI for the published split at 50fdabf; it diverges from the current PR head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants