Repository navigation
Apple M6 (T8152) audio plumbing: ADMAC and AOP hardware config (on top of #191) - #194
joshuaswarren wants to merge 12 commits into
Conversation
|
Rust compile receipt for
This replaces the "not compiled" line of the description: |
[Medium impact] The reviewed changes appear safe to merge within the stated bring-up limits. SummaryAdds T8152 audio hardware descriptions on top of the M6 platform work:
This remains audio plumbing, not working audio playback. No builds or hardware tests were run during this review.
Reviews (7) · Last reviewed commit: "soc: apple: aop: add the T8152 (Mac mini..." · Reviewed by Greptile |
maralcbr
left a comment
There was a problem hiding this comment.
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:
- The AOP binding now lets a T8140 node drop its setup mailbox.
apple,t8140-aop.yaml:35-45addsminItems: 1tomboxesandmbox-namesfor both compatibles, so a T8140 node with onlymboxvalidates, but the driver openssetupby name on T8140 (aop.rs:2307,:2385-2386,:1816-1817) and fails to bind without it. A T8152 node with two mailboxes also validates. Thealsandaudiochildren (:61-67) are T8140 schemas too, and a T8140 audio child under T8152 would fail, sincesource_ring()needs the setup port (aop.rs:1697-1699). Suggested fix: anallOfwithif/thenper compatible: T8140 keepsminItems: 2; T8152 getsmaxItems: 1on both lists andals: false,audio: falseuntil T8152 schemas exist. Please rundt_binding_checkon both changed bindings after that. - #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 atdwc3-apple.c:678-680and: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. - 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_AOPisminasahi.config:95andyinaurora.kunitconfig:42). I'd like a green package build (aci:buildrun, 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 separatedt-bindings: dma: apple,admac: …anddt-bindings: soc: apple: …commits, so please follow that. - "Clean checkpatch" in the PR body isn't accurate.
check-commits.pygives 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.
|
Review at 30c3798: findings (last two commits only, as asked; read only, nothing built or booted by me, no Checked and fine:
Findings:
Not checked: the endpoint numbers and the "calls were all answered" statement in the doc comment (hardware results); the admac register behaviour on T8152. |
|
Review at 30c3798: findings (two commits: ADMAC and AOP) Checked
Findings
Smaller
Not checkedNo compile of |
30c3798 to
64b97d5
Compare
|
New head
Compile receipts for the new head: arm64 clang |
|
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
Notes (not blocking)
Not checkedNo compile of |
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>
|
GREEN at 64b97d5 for the last two commits (admac, aop). Read only: nothing built or booted by me, no Re-checked my findings:
I did not re-read the admac code or the rest of |
64b97d5 to
efe48a3
Compare
|
Rebased on the fixed #191 head |
|
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 |
|
GREEN at efe48a3 for the last two commits (ADMAC and AOP). The two commits are the same as at Checked
Not checkedNo compile of |
|
Summary for a maintainer, at head
|
efe48a3 to
14899c0
Compare
14899c0 to
ed5dcf9
Compare
|
New head Receipts at this head (CT-local, arm64 clang |
|
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. |
ed5dcf9 to
77ee947
Compare
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>
|
GREEN at 77ee947 The two commits above the #191 head are identical to the ones I cleared at 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>
77ee947 to
7d52ab5
Compare
|
New head |
|
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. |
|
GREEN at 7d52ab5 The commits above the #191 head are identical to the ones I cleared at Not checked: compile receipts and hardware. Merge still needs CI and the owner's word. |
|
Status at head |
|
Note 🤖 GPT-6.1 Terra responding on behalf of joshuaswarren I prepared the requested binding and commit split on a separate branch at 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. |
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
admac_t8152_hw(evolved register layout, no global 0x28/0x2c write) and theapple,t8152-admaccompatibleapple,t8152-aop, no setup port, three AFK endpoints; the binding makes the second mailbox optionalMeasured, on an M6 Mac mini
Not measured
aop.rschange on hardware (it compiles, it has not run), and audio data. Thehpai,lpaiandtapdevices return an error on this machine.make dtbs_check/dt_binding_check(a hand-rundt-validateof the board file gave 0 messages).Blocked
apple,t8152-ascwrap-v8-mailboxcompatible are separate changes that are not in this branch or in Apple M6 (T8152) Mac mini base: PMGR, USB2, DART, NVMe, board fragments #191.Compile receipt
arm64 clang,
W=1,integration/auroraat 42672ed plus the 12 commits of this branch, defconfig:drivers/dma/apple-admac.o, the eight objects of #191 andapple/t8152-j873g.dtball rc 0 with 0 warnings.drivers/soc/apple/aop.rswas compiled separately withCONFIG_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).