Skip to content

accel/ane: support M3 Max (T6031) H15 27.2 ANE on shared H16 backend - #4361

Open
Acelogic wants to merge 4 commits into
mainfrom
feat/t6031-ane-bringup
Open

Acelogic wants to merge 4 commits into
mainfrom
feat/t6031-ane-bringup

Conversation

@Acelogic

@Acelogic Acelogic commented Dec 4, 2026

Copy link
Copy Markdown
Member

What

Bring up the Apple M3 Max (T6031) H15 Neural Engine on macOS 27.2 (26B123) using the shared AP-direct H16 backend, matching T8122 (#3082) and T6030 (#4342). Companion Stage 2 preload handoff: aurora-silicon/aura#676.

Refs #4330.

  • Bindings (f774a3d2453b): Move the memory-region: false and memory-region-names: false prohibitions out of the shared T6030/T6031 block into the unqualified T6030-only block, and allow apple,dapf-ranges, apple,firmware-iovas, and bootloader-supplied firmware-text/firmware-data reservations on apple,t6031-ane while requiring the matched pair of phandles, names, IOVAs, and five DAPF ranges whenever a handoff supplies reservations or names (keeping static T6031/T6032 board DTBs valid).
  • Driver & KUnit (54aef60d2851):
    • Add bool require_cold_boot to struct ane_fw_platform and enforce /chosen/apple,ane-cold-boot in ane_fw_platform_preflight() before driver registration or ANE power acquisition.
    • Allow disjoint DAPF records sharing one 16 KiB page in ane_h16_backend.c (rejecting overlapping byte ranges and deduplicating 16 KiB identity MMIO mappings), since T6031 places ps_ane_sys (+0x520) and ps_ane_mpm..ps_ane_base (+0x5a0..+0x5c3) in the same PMGR page (0x292280000).
    • Qualify ane_t6031_platform with the six ADT register windows (engine, pmgr, aux-0, aux-1, aux-3, aux-4), the five 0x500-block PMGR power words (0x520, 0x5a8, 0x5a0, 0x5b8, 0x5c0), DART rev 0x0200 (ane_h15_mmio_t8122), five DAPF records at DART0 + 0x4000, 27.2 26B123 (TEXT 0xc8000, DATA 0x2a4000), and cold-sleep recovery (no PWGATE write required on T6031).
    • Add the J516c 27.2 26B123 cross-boot preload pin (ane_h15_patchbay_26b123_t6031, cells GKTS/ECAP/ARcM/ABOI/ZSOI at 0x65f0/0x66e3/0x67b8/0x6815/0x6825, SHA-256 fd8e477a...), ane_t6031_platform_test, and T6031 preload profile validation in KUnit.
  • Devicetree (9a170f847fc0): Mark t6031-peripherals.dtsi &ane0 dma-coherent, add the five live J516c ADT dapf-instance-0 records and default apple,firmware-iovas (0x10000000000, 0x100000c8000) while keeping &ane0 disabled in the SoC dtsi, and enable &ane0_dart0, &ane0_dart1, &ane0_dart2, and &ane0 on t6031-j516c.dts (keeping &ane0_mbox disabled).

Tested

  • Exact PR head 9a170f847fc0c7a8d9690431fae35d4ece845c0f (drivers/accel/ane tree 2072476917248329279b77d6319e18223b181bea, arch/arm64/boot/dts/apple tree cd9446116171c31b339767c8622b1bbd3e258767) tested natively on J516c (16-inch MacBook Pro, M3 Max T6031, H15, macOS 27.2 26B123 stub):
    • Artifacts: ane_t6021.ko SHA-256 31601cc1a6a5047883f46e06f74152bbf11269643ea6d13d86c7912b1c05bd94 (ELF Build ID c4e2da7fe7dfb1e3c16ddac8b6b6c212cea4d310), t6031-j516c.dtb SHA-256 45f0886c77aafc348fb2852504e7734278bc6fe6b2cf9e55c6903e88059c7452, paired aura#676 (e36a6fd3) aura.bin SHA-256 1ade8dde668876b499c0c31e12aab3578411b5933cdc577c026ceb9213f6358e.
    • Slot B — Paired Cold-Boot Positive Control + Cross-Boot Digest + s2idle + Live Post-Wake Cold Restart (Stage 2 SHA-256 6ee612b6761e3120f31f8277e06f07005e568ebd7e9994bd5116c994688ffd00):
      • Verified across two independent cold boots: /chosen/apple,ane-cold-boot = raw-no-xnu-ane-untouched-v1, ane-firmware-text@10000c34000 (800 KiB nomap), ane-firmware-data@100016f0000 (2704 KiB nomap), apple,firmware-iovas = <0x10000000000 0x100000c8000>.
      • All 3 ANE DARTs (3c9800000, 3c9810000, 3c9820000) probed at version 0200 (PARAMS3 = 2a2a0200).
      • Boot auto-probe accepted H16 preload identity H15 T6031 27.2 26B123 J516c, mapped 4 deduplicated identity MMIO pages (292280000, 292828000, 38d468000, 40a468000), wrote and read back 5/5 DAPF records, reached H16 READY 8042006 0 (0 restarts, 5 SHAREDMALLOC allocations, startup acks 4/0/3/22 all 0, CONFIG_GET tick 16e3600 0), initialized /dev/accel/accel0 (ABI 3, chip_family=15), and parked cleanly on idle (runtime_status=suspended, all 5 domains ane_base, ane_td, ane_cpu, ane_mpm, ane_sys at off-0).
      • Pre-sleep DRM_IOCTL_ANE_GET_CAPS: flags=0 size=32 abi=3 chip_family=15 section_size=16 bind_size=0 exec_io_size=16 rsv=0.
      • s2idle (rtcwake -m freeze -s 8, RC=0, suspend_stats/success 0 -> 1): clean wake, post-wake GET_CAPS identical, live post-wake runtime-PM cold restart (power/control = on) verified (H16 DAPF records matching 5 5, H16 READY 8042006 0, 5/5 SHAREDMALLOC reuse, H16 ANE: booted again from the preload on runtime wake, up for a request in 19 ms, 0 programs replayed, 0 restarts), and clean re-park (power/control = auto -> suspended, all 5 domains off-0), zero DART/ANE faults.
    • Slot A — No-Handoff Negative Control (Stage 2 without ANE handoff + exact PR DTB, SHA-256 ddbc780ca314a685b50f1daf8243ef4e157fea1e44d187070cb9da6c29ed7bc3):
      • Boot auto-probe and explicit modprobe ane_t6021 both refused cleanly before driver registration or power acquisition (platform 3c8000000.ane: ANE: cold-boot ownership evidence missing; refusing preload boot, modprobe returned -ENODEV / No such device). 3c8000000.ane stayed unbound, /dev/accel was not created, and ane_base, ane_td, ane_cpu, ane_mpm remained off-0 before and after modprobe.
  • Static & build checks: native ARM64 make W=1 M=drivers/accel/ane modules (0 warnings in all modified files) and scripts/checkpatch.pl --strict --git origin/main..HEAD (0 errors, 0 warnings, 0 checks across all 3 commits).

Risk

Risk: two-way · T6031 (M3 Max) — plain revert removes T6031 ANE qualification and returns ane_t6031_platform to preflight refusal. Disjoint same-page DAPF deduplication preserves existing behavior on all SoCs with distinct DAPF pages; unverified T6031/T6034/T6032 boards remain disabled in t6031-peripherals.dtsi and t6032-peripherals.dtsi.

Not yet

  • J514c, J514m, J516m, T6034, and T6032 (M3 Ultra) preload pins and board enables.
  • H15 HWX inference execution on J516c (awaits an H15 HWX fixture or H15 lowering in mil-hwx-compiler).

… T6031

Move the memory-region and memory-region-names prohibitions out of the
shared T6030/T6031 block into the T6030-only block and allow
apple,dapf-ranges, apple,firmware-iovas, and bootloader-supplied
TEXT/DATA preload reservations on apple,t6031-ane.

Require the matched pair of memory-region phandles, ordered
memory-region-names, apple,firmware-iovas, and five apple,dapf-ranges
entries whenever a handoff supplies reservations or their names, while
keeping static T6031/T6032 board DTBs valid.

Signed-off-by: Acelogic <miguelc4600@gmail.com>
Bring up the Apple M3 Max (T6031) H15 Neural Engine on macOS 27.2
(26B123) using the shared AP-direct H16 backend:

- Add require_cold_boot to struct ane_fw_platform and enforce
  /chosen/apple,ane-cold-boot in ane_fw_platform_preflight() before
  power acquisition.
- Allow disjoint DAPF records sharing one 16 KiB page in
  ane_h16_backend.c (rejecting overlapping byte ranges and deduplicating
  16 KiB identity MMIO mappings), since T6031 places ps_ane_sys (+0x520)
  and ps_ane_mpm..ps_ane_base (+0x5a0..+0x5c3) in the same PMGR page.
- Qualify ane_t6031_platform with the six ADT register windows (engine,
  pmgr, aux-0, aux-1, aux-3, aux-4), the five 0x500-block PMGR power
  words, DART rev 0x0200 (ane_h15_mmio_t8122), five DAPF records at
  DART0 + 0x4000, the J516c 27.2 (26B123) preload pin
  (GKTS/ECAP/ARcM/ABOI/ZSOI), and cold-sleep recovery.
- Add ane_t6031_platform_test and T6031 preload profile validation to
  KUnit.

Signed-off-by: Acelogic <miguelc4600@gmail.com>
Mark ane0 dma-coherent in t6031-peripherals.dtsi and add the five live
J516c ADT dapf-instance-0 records and default 27.2 firmware IOVAs
(TEXT 0x10000000000, DATA 0x100000c8000), leaving the SoC node disabled
for unverified boards.

Enable ane0_dart0, ane0_dart1, ane0_dart2, and ane0 on t6031-j516c.dts
while keeping ane0_mbox disabled.

Signed-off-by: Acelogic <miguelc4600@gmail.com>
@Acelogic
Acelogic requested review from a team as code owners December 4, 2026 21:21
@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Merge readiness at db3f0c20: not ready yet

Check Detail
CI at head ok 11 checks passed
Review no needs one approving review from Core, Omarchy Mac or Aurora Maintainers (not the author)
Requested changes ok none
Hardware row at head ok comment at db3f0c20
Conflicts no merge conflicts with main: merge it in (no force push)
PR text ok Risk: two-way · T6031 (M3 Max) — plain revert removes T6031 ANE qualification and returns anet6031platform to preflight refusal. Disjoint same-page DAPF deduplication preserves existing behavior on all SoCs with distinct DAPF pages; unverified T6031/T6034/T6032 boards remain disabled in t6031-peripherals.dtsi and t6032-peripherals.dtsi.

Areas: area:media, area:platform

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

@aurora-silicon-review aurora-silicon-review Bot 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 9a170f8

Checked: The J516c, J514c and J516s DTBs compiled. The affected binding accepts the static boards and the complete J516c handoff. It rejects one reservation, missing or swapped names, missing IOVAs and missing DAPF ranges. The isolated schema tool's performance-domains diagnostic is present on base too.

Checked: The shared DAPF replay on GCC and Clang accepts five disjoint records in four pages and maps each page once. Overlapping inclusive endpoints and records spanning a page are refused. The cold-boot ownership check precedes the driver's resource and power acquisition. The author supplied J516c cold-boot, no-handoff refusal and s2idle receipts.

Follow-ups: The T6031 hardware path pairs with aurora-silicon/aura#676. If #4342 lands first, keep both T6030 and T6031 handoff conditions when resolving the shared binding and platform table.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 4, 2026
@satchlj

satchlj commented Dec 4, 2026

Copy link
Copy Markdown
Member

Hardware regression verification on J775c (Mac Studio M5 Max, T6050, H17 ANE, 27.2 system firmware / 27.0 OS stub, default kernel command line, MTE enabled) at exact head 9a170f847fc0 paired with aurora-silicon/aura#676 (2cc1b30af19a):

  • Artifacts: ane_t6021.ko SHA-256 cb5be8a128480f7c3bea22f798c0f5728830fe66b2d4972927e0fef6c50ec26e, vmlinuz SHA-256 bf5522621c01484b441b1a6be63c2efe3ecfbd64a784463c1b6d4ee8a2ff3fe5, Stage 2 aura#676 (2cc1b30a) aura.bin SHA-256 fdfe3b3729f4454c6d3386f397693648a2865ff74a7f512d2a7bc4a705dc8f24.
  • DT handoff & probe: /chosen/apple,ane-cold-boot = raw-no-xnu-ane-untouched-v1, ane-firmware-text@10000d4c000 (768 KiB nomap non-reusable), ane-firmware-data@1000154c000 (2736 KiB nomap non-reusable), /soc/ane@508000000 memory-region-names = "firmware-text", "firmware-data", apple,firmware-iovas = <0x10000000000 0x100000c0000>; H17 ANE: firmware 27.0 26A428, TEXT code sha256 f8141439… (code pin), ANE probe: raw-boot evidence and cold child power verified; no writes, [drm] Initialized ane 3.2.0 for 508000000.ane on minor 0, /dev/accel/accel0 (ABI 3, H17).
  • Pre-sleep live inference & idle park: ANE map: reserved preload, SID0 on three DARTs, DAPF verified, H17 ANE: first bring-up for a request: 0; unet-320 (model.hwx, 20 runs) loaded in 12.7 ms, p50 2507.5 µs — PASS, output SHA-256 cee9dbb85edcc593156512da11a8524397f2c472dc039d3b88f26ea4bb594f83 bit-identical to reference; clean idle park (runtime_status=suspended, ane_sys off-0).
  • s2idle & post-wake inference: 2/2 RTC s2idle cycles (rtcwake -m mem -s 15 + -s 10, suspend_stats 2/0); post-wake unet-320 (20 runs) loaded in 11.8 ms, p50 2388.8 µs — PASS, bit-identical output SHA-256 cee9dbb8…; clean idle re-park (runtime_status=suspended, ane_sys off-0).
  • Regression checks: 0 failed systemd units, 0 SELinux AVC denials, 0 kernel/DART/ANE faults.

T6031 27.2 (26B123) preloaded ANE firmware has a 0xc8000-byte __TEXT
segment, exceeding the 0xc0000 H16 default cap in
ane_h16_preload_test.c (PRELOAD_TEST_TEXT_MAX), which caused
ane-h16-preload.preload_profiles_test to fail in KUnit CI.

Raise PRELOAD_TEST_TEXT_MAX to 0xc8000 so the synthetic fixture buffer
covers every registered preload profile while leaving all existing
ANE_H16_PRELOAD_TEXT_SIZE assertions unchanged.

Signed-off-by: Acelogic <miguelc4600@gmail.com>
@Acelogic

Acelogic commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Pushed db3f0c20 (KUnit-only fix in drivers/accel/ane/ane_h16_preload_test.c, raising PRELOAD_TEST_TEXT_MAX from 0xc0000 to 0xc8000 for T6031 27.2's 0xc8000 __TEXT segment so ane-h16-preload.preload_profiles_test passes). Zero changes to driver code, bindings, or DTS relative to 9a170f84 (the J516c and J775c tested ane_t6021.ko and DTB are unchanged); CI re-running now.

Head Board Artifacts Result
db3f0c20 (KUnit-only on 9a170f84) J516c (MacBook Pro 16" M3 Max, T6031) Unchanged ane_t6021.ko (31601cc1…) + t6031-j516c.dtb (45f0886c…) + aura#676 (2cc1b30a) PASS — cold-boot H16 READY 8042006 0, /dev/accel/accel0 ABI 3, s2idle freeze/wake + post-wake RPM restart, clean idle off-0, Slot A negative control -ENODEV

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 4, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

@Acelogic, I reproduced the one conflict at db3f0c2017c7 on both main c1f128742108 and newer main a944d533a79c. Both branches append to arch/arm64/boot/dts/apple/t6031-j516c.dts. Please forward-merge main into your branch. For that file, keep main’s version byte-for-byte, including the dcpext0 alias and all three USB-C routes, then append these blocks:

&ane0_dart0 {
	status = "okay";
};

&ane0_dart1 {
	status = "okay";
};

&ane0_dart2 {
	status = "okay";
};

&ane0 {
	status = "okay";
};

The resolved board blob is b9c11d4e6cc7ffc21016ca6c79d768bcaa0a81ff, and the scratch merge tree on a944d533a79c is dd81bdfcf40e85b208bca9e6fcb6361a42e50497. The mailbox stays disabled. I compiled the J516c devicetree and compared the effective nodes by path, resolving phandles. ANE and its DARTs match the tested ANE configuration, and dcpext0 and its routes match main.

The resolved ANE source subtree is byte-identical to db3f0c2017c7; compared with the J516c/J775c tested 9a170f847fc0, the only change inside that subtree is the preload KUnit fixture. The ANE binding and t6031-peripherals.dtsi also match both heads. Main’s t6031-dcp.dtsi is byte-identical to the scratch result. The combined board DTB changes.

Aura #676 landed as 231d59c11706. Its J516c ANE receipt, J775c shared-path receipt, and #4359 J516c display receipt cover the two paths separately. Before landing, please capture one combined J516c check on the forward-merged kernel and merged Aura, with cold ANE probe, idle park/restart after s2idle, and external USB-C display. The new head also needs its checks and independent approval.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 4, 2026

This branch has not been deployed

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

Labels

area:media Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) merge-conflict Conflicts with the base branch (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