Repository navigation
arm64: dts: apple: describe the T603x Neural Engine, enabled; accel/ane: T603x clean refusal - #2331
RyanTheTide wants to merge 10 commits into
Conversation
The M3 generation's Neural Engine (T8122, T6030 and T6031; T6034 and both dies of T6032 carry the T6031 engine) is an RTKit coprocessor behind an ASC wrapper, like the SIO of the same wrapper revision: its ASC mailbox is described as its own node, the engine keeps one interrupt of its own, and it uses the five ANE power states (system, CPU, MPM, TD, base) of the T6041/T8132 engines. Add apple,t8122-ane, apple,t6030-ane and apple,t6031-ane, their ane-type values (0xb0, 0xc0, 0xe0, as the hardware description gives them) and the window names they use, named after the M4 windows of the same location and size. H15 nodes take a mailbox, so move the "mboxes: false" of the H16/H17 engines into a block of its own. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
No M3 device tree describes the Neural Engine. Add it to the SoC peripherals files, next to the other media engines: the engine, its ASC mailbox and its three DARTs on T8122, T6030 and T6031 (and so T6034), and both engines of T6032. Add the four ANE power states under ANE_SYS that the T8122 and T6030 PMGR files lack (T6031 already has them); on T8122 ANE_BASE depends on both ANE_TD and ANE_CPU, on T6030 on ANE_TD only. Every value comes from the hardware description of each board (all T8122, T6030, T6031, T6034 and T6032 boards agree per SoC) and our own capture of a J615 under macOS 27.2. The mailbox sits at the ASC + 0x8000 and its interrupts are ordered as on the SIO, which has the same ASC wrapper and whose mailbox is already described. On T6032 the second die's hardware description points one auxiliary window at the first die's copy, which that die's bus cannot address, so that window is left out there. Everything stays disabled: the accel/ane driver has no H15 support yet, and enabled ANE DART nodes were reported to hang an M3 Pro at boot in the omarchy-ane H15 bring-up work by Joshua Warren and testers, whose experimental overlays this follows. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Early note on this draft (no full review yet):
Assisted-by: LLM (Claude:Opus 5.5) |
|
Status check at head
What blocks the merge:
Once the body is reworded and the PR is marked ready, a maintainer review of the binding and DTS is requested. Everything stays |
|
Closing for now: the nodes stay disabled with no M3 driver in sight; this comes back together with the H15 driver once the start sequence is known. |
|
Reopened and kept as a draft; the comment above lists what it still needs before review. cc @niteria |
|
Hardware validation offer for this PR on M3 Max. Both M3 Max (t6031) community hosts have been waiting on one thing — the What you get: a tarball with a 7.3.0-ane2331-ARCH kernel, the matching board What we need: install it, boot it, and run the ladder one rung at a time — Time: ~15 minutes plus a reboot. If a boot hangs, the opt-in file is the Packet (prerelease m3max-ane-packet-1 on joshuaswarren/omarchy-ane): |
|
What. An independent reconciliation of the T8122 (M3) ANE node: our own Tested. Desk reconciliation, values only (no hardware run yet):
Risk. Two observations, both low:
Not yet. No hardware run on our side or in this PR yet: the first m3air run Questions for the first M3 run:
|
5247281 to
a029d61
Compare
a029d61 to
5247281
Compare
|
Ryan, I force-pushed this branch by mistake at 22:05 UTC today, and the title and body changed with it. I put the branch back to 5247281 at 22:15 UTC and restored the title and body as you left them. Nothing else here was touched. Sorry for the noise. What I had pushed was a rebase onto main that drops the T8122 parts, since those landed separately in 0c01afd and 0882c53. If that is any use to you, it is on |
|
Hi Ryan — this set has been open since Nov 22 with no review yet. What is left before it can merge? If a real M3 run would help: we have an M3 Max in hand and can exercise the Neural Engine device-tree path end to end on our side and report back the results here. Happy to provide anything else the review needs. |
Bring the branch up to current main, which now carries the T8122 (J615) H15 bring-up from 3082. The T8122 half of this branch is superseded, so conflicts resolve toward main and only the T603x description remains.
Enable the T6030, T6031 and T6032 ANE nodes, their DARTs and their mailboxes, per the DT policy that the tree describes all present hardware with status okay. The matching driver platform stays unqualified for T603x, so probe refuses the start before touching resources, power or MMIO, logs the refusal and leaves the engine idle; the DT is not the gate. The iBoot preload happens on T603x the same as on T8122 (observed in the ADT on J514s), so the nodes carry apple,firmware-preloaded. PMGR gets apple,no-auto-pm on ps_ane_sys and ps_ane_cpu, the same fix 3082 shipped for the J615 CPU-stop failure: AUTO_ENABLE must not gate the ANE CPU behind the cold-started firmware. drivers/accel/ane: fail cleanly on T603x Add t6030/t6031 of-match entries pointing at unqualified platforms. ane_fw_platform_preflight checks boot_qualified first and returns -EOPNOTSUPP before any resource, power or MMIO access, so the engine probes, logs the refusal and stays idle.
The merged shared clause still carried t8122 and forbade apple,firmware-preloaded. T8122 has its own clause from main now, so the group shrinks to t6030/t6031, firmware-preloaded becomes required like the other preloaded H15 parts, and the stale t8122 duplicate clause goes away.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Row:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approving at 7c34ba8e. The code is right. The new T6030/T6031 match data carry no build profile, so ane_fw_platform_preflight() refuses at the first check with -EOPNOTSUPP, before any resource, DMA, power or MMIO access, and accel_ane stays unloaded on T603x. The binding, the PMGR additions (ANE_SYS/ANE_CPU with apple,no-auto-pm, as on T8122) and the per-SoC values match the PR body's table.
It still needs rows before merge, because the nodes are enabled, so the DARTs and the ASC mailbox now probe on every T603x Mac:
- T6030: the J514s run above booted a 7.2.11 kernel with the out-of-tree
ane_h15module, so it shows the DT shape works, not this kernel. It needs a boot of this head merged withmain(kernel and DTB): the DARTs and mailbox bind with no faults,accel_anelogs only the one refusal line, and there are no other new kernel errors. I'm requesting it on our J516s. - T6031/T6034/T6032: these nodes are enabled with no M3 Max run yet, and the binding says T6031 is unverified. An M3 Max boot of the same tree, with the same checks, settles it. You offered one on 12-01; please post it here.
|
J516s (M3 Pro, T6030, 27.2 stub) boot row at
|
|
One blocker the 12-02 approval missed. Commits 3523d66 ("describe the T603x Neural Engine, enabled") and 54098d5 ("model T603x on the preloaded H15 contract") have no Signed-off-by, and their author name is the placeholder To fix it, recreate those two commits with the real author name and that author's sign-off, keeping the same trees, on a new branch. Then open it as a replacement PR, or reset this PR's branch to it if Ryan agrees. The branch also conflicts with main again (since 12-02 11:35). The code review and the J514s and J516s rows stay valid for the same trees. |
# Conflicts: # Documentation/devicetree/bindings/npu/apple,ane.yaml # drivers/accel/ane/ane_fw_platform.c # drivers/accel/ane/ane_fw_platform.h
RyanTheTide
left a comment
There was a problem hiding this comment.
The merged binding rejects every T6030 and T6031 node. The existing compatible exclusion omits both new compatibles, so it forbids apple,ane-type and apple,firmware-preloaded while the new H15 branch requires both. T6030 also both requires and forbids apple,dapf-ranges. Include the new compatibles in the exclusion and validate the T603x DTBs against the corrected binding.
DjDeveloperr
left a comment
There was a problem hiding this comment.
I agree with Ryan's review. Two things block this merge at 2bda8f1b. The rest of the merge is right.
- Binding. The
not: contains:list atDocumentation/devicetree/bindings/npu/apple,ane.yaml:525-546needsapple,t6030-aneandapple,t6031-ane. Without them,make ARCH=arm64 LLVM=1 CHECK_DTBS=yover the 7 T603x DTBs (j514s, j516s, j514c, j516c, j514m, j516m, j575d) gives 20npu/apple,ane.yaml"False schema does not allow" errors. Hosted dt-checks passed at7c34ba8e. With the two lines added afterapple,t8132-aneI get 0 errors, anddt_binding_check DT_SCHEMA_FILES=npu/apple,ane.yamlstill passes. - Sign-offs (the 20:00 comment).
3523d666and54098d59still have no Signed-off-by and the authoruser.email. checkpatch reports "Missing Signed-off-by" on both, and the merge keeps them in history. Recreate them on a new branch with the real author and sign-off, keeping the same trees, and put the binding fix on top. Open that as the replacement PR, or reset this branch to it if Ryan agrees.
Checked and fine at this head:
ane_fw_platform.c/.hkeep main'sane_t8112_platformandane_fw_preload_handoff()and the T6030/T6031 stubs, each defined once. The match table keeps both sides.- T603x still stops in
ane_fw_platform_preflight()with-EOPNOTSUPPbefore any resource, power or MMIO access.ane_rtclient_platform()returns the SoC's own platform first, so the J516s row still covers the runtime. - The
apple,firmware-iovasandapple,ane-typeunions are right. - The other six files match a plain three-way merge. A merge with current main (
36de64e3) is clean and leaves this PR's files unchanged. - A W=1 clang arm64 compile of
ane_fw_platform.o,ane_t6021_rtclient_main.o,ane_fw_cold.oandane_h16_backend.ogives 0 warnings. The T8112/T8122 DTBs give 0apple,ane.yamlerrors.
Still owed from the 12-02 approval: an M3 Max (T6031/T6034/T6032) boot row.
maralcbr
left a comment
There was a problem hiding this comment.
Requesting changes at 2bda8f1b. The refusal path in ane_rtclient_init() / ane_fw_platform_preflight() is clean and T6031/T6034/T6032 DTBs parse cleanly with dtc, but there are several blocking issues beyond the dt-checks failure (FAILURE at 2bda8f1b):
Blocking
-
Binding rejects all 7 T603x DTBs (
Documentation/devicetree/bindings/npu/apple,ane.yaml:525-546):
As Ryan and DjDeveloperr noted,apple,t6030-aneandapple,t6031-aneare missing from thenot: contains:exclusion list, which forbidsapple,ane-type,apple,firmware-preloaded,apple,dapf-ranges, andapple,firmware-iovasin direct contradiction to the new T603x clauses (lines 562-617).dt-checksfailed on2bda8f1b. -
Schema regressions and stale T8122 example in
Documentation/devicetree/bindings/npu/apple,ane.yaml:lines 548-560: Splittingmboxes: falseinto its ownallOfblock droppedapple,t8122-ane, which previously hadmboxes: falseonmain. Please restoreapple,t8122-aneto that list.lines 895-918: Adds a leftoverapple,t8122-aneexample from before T8122 landed separately. It omitsapple,firmware-preloadedandapple,dapf-ranges(bothrequiredforapple,t8122-aneatlines 471-474) and carriesmboxes = <&ane_mbox>;, only escapingdt_binding_checkbecausestatus = "disabled"causesdt-validateto skip it. Since this PR is T603x-only, please drop it or replace it with a valid T6030 example.lines 584-585:memory-region: falseandmemory-region-names: falsecontradict the preloaded-firmware contract on T6030 (t6030-peripherals.dtsi:571-572setsapple,firmware-preloaded;andapple,firmware-iovaswith/* Default layout; the loader supplies per-boot physical reservations. */). Unliket8122/t6041/t8132, this schema would reject bootloader-injectedmemory-regionreservations.
-
Wrong
.socvalues (drivers/accel/ane/ane_fw_platform.c:149-155):
ane_t6030_platformsets.soc = 0xc0andane_t6031_platformsets.soc = 0xe0. Every other platform inane_fw_platform.cputs the Apple SoC ID in.soc(0x8122,0x8112,0x6040,0x8132,0x8140,0x6050,0x8142) and the firmware generation ID in.ane_type(0xb0,0x80, etc.). As written, preflight logsANE boot unqualified for SoC 0xc0instead of0x6030/0x6031. Please set.soc = 0x6030, .ane_type = 0xc0and.soc = 0x6031, .ane_type = 0xe0. -
Missing
Signed-off-byand placeholder authoruser.email:
As DjDeveloperr flagged,3523d666,54098d59(and merge commit31bbcb95) carryAuthor: user.emailwith noSigned-off-by:. Please recreate/rebase cleanly onmainwith real author metadata and sign-offs.
Question / Hardware Row
mboxescontract andane*_mboxidle power: The PR body says "the preloaded-firmware contract main already models for T8122 (apple,firmware-preloaded, nomboxes)", yetapple,ane.yaml:587-590requiresmboxesand all three DTSIs addane*_mbox(status = "okay",power-domains = <&ps_ane_cpu>). Onmain,t8122has noane_mboxnode (the H15 AP-direct backend accessesengine + 0x1408000directly). Withane*_mboxenabled andanerefusing probe (-EOPNOTSUPP),apple-mailboxbinds andsync_state()remains pending on all 5 ANE domains (as seen in the J516s row) whileps_ane_sys/ps_ane_cpucarryapple,no-auto-pm;. Please clarify whether T603x should dropane*_mboxto matcht8122(and avoid keepingps_ane_cpu/ps_ane_syspowered at idle), or align the PR description and verify idle/sleep behavior.- M3 Max (T6031/T6034/T6032) boot row: Still owed at head once rebased/fixed, since the T6031/T6032 DARTs and mailboxes are
status = "okay".
Non-blocking
ane_dart0/1/2omitapple,dma-range = <0x0 0x0 0x400 0x0>;(used ont8122andt8132for firmware identity MMIO pages below preload DVAs); inert whileanerefuses probe, worth aligning before enabling the backend.- Minor doc/comment cleanup:
t6030-peripherals.dtsi:543still readsADT-derived only;apple,ane.yaml:185omitsT6030in theapple,dapf-rangescount description;ane_fw_platform.c:143comment mentionsaux-0 + 0x2b6cwhile DAPF record 2 is0x350726c6c(aux-0 + 0x2c6c— double-check if distinct registers or typo).
|
Thanks for catching the missing sign-off and placeholder author on those two commits. Opened clean replacement PR #4022 rebased onto current |
|
#4022 (same change, recreated with the right author and sign-offs) is the one to keep. This can be closed in its favour once its author agrees; the points raised here that still apply are in the review there. |
Problem. No T603x device tree describes the Neural Engine. T6030 (J514s, J516s), T6031/T6034 (J514c, J516c, J514m, J516m) and T6032 (J575d) all have one (two on J575d), but there is no
anenode, no ANE DARTs, no ANE mailbox, and on T6030 onlyANE_SYSof the five ANE power states exists. The binding has no T603x compatible either.Change.
apple,t6030-aneandapple,t6031-aneon the preloaded-firmware contract main already models for T8122 (apple,firmware-preloaded, nomboxes). Require the fiveapple,dapf-rangesrecords and allowapple,firmware-iovas(adding0x100000b0000for T6030 14.7__DATA) onapple,t6030-ane; keep bothfalseonapple,t6031-aneuntil T6031/T6034/T6032 hardware verification. T6034 and T6032 report the sameapple,ane-typeas T6031 and reuseapple,t6031-ane.status = "okay". On T6030 (t6030-peripherals.dtsi), populate the five live-verified J514sapple,dapf-rangesrecords andapple,firmware-iovas = <0x10000000000 0x100000b0000>. T6034 gets the nodes throught6031.dtsi; T6032 gets both dies' engines int6032-peripherals.dtsi. The T6030 PMGR file getsANE_MPM,ANE_CPU,ANE_TDandANE_BASE(T6031 already had them), andANE_SYS/ANE_CPUcarryapple,no-auto-pm, matching T8122.boot_qualified = falsefor the T603x SoC ids, soaccel_aneprobes, returns-EOPNOTSUPP, and leaves the device idle. No hang, no partial start, no DT gate.Tested:
7c34ba8e| 14" MacBook Pro M3 Pro (J514s, T6030) | PASS — booted 7.2.11 in 53 s (omarchy-m-test: 36 pass, 6 fail, 47 skipped, 0 regressions vs known-good baseline); the live T6030 DT shape (apple,no-auto-pmonANE_SYS/ANE_CPU, fiveapple,dapf-ranges,apple,firmware-iovas = <0x10000000000 0x100000b0000>) passed full H15 cold-boot bring-up on J514s (RTKit-2419.140.12.release):SCRATCH7 = 0x08042006READY in 5 ms, 8-channel IPC table published in 2 ms,SCRATCH3cleared in 0 ms, 8 startupSHAREDMALLOCallocations served, andPRINT_ENABLE(0x04),START(0x00),CONFIG_GET(0x03, tick rate0x16e3600= 24 MHz), andRESOURCE_INFO(0x22) all returnedack=0in 0 ms with 0 DART faults.aurora-silicon/linux:apple-build,host-tests,KUnit ane-boot ane-pm, anddt-checks(dt_binding_check+CHECK_DTBSacross all 141 DTBs).Risk: Low (two-way door; reverts cleanly without userspace or ABI impact). Affects T6030, T6031, T6034, and T6032 Macs only. The in-tree
accel_anedriver refuses T603x with-EOPNOTSUPPbefore touching power domains or hardware registers, so unmodified boots leave the ANE idle.Per-SoC values (ADT of each board)
apple,dapf-ranges(live J514s ADTdart-ane/dapf-instance-0):<0x350700498 0x35070049b>,<0x35070c000 0x35070c01b>,<0x350726c6c 0x350726c6f>,<0x2c9468000 0x2c9468003>,<0x292468000 0x292468003>.engine, so they aren't repeated.pmgrare named after the M4 (T8132/T6041) windows at the same place with the same size. aux-1 is the MCC window (the ADT node hasfunction-mcc_dataset). Their role on H15 is not established.dart_ane*_companion3on T6030 and T6031.ANE-SYS-DART).