Repository navigation
accel/ane: support M3 (T8122) H15 27.2 ANE on shared H16 backend - #3082
Conversation
Document apple,t8122-ane (single H15 engine, ane-type 0xb0, one interrupt, three register windows engine/pmgr/aux-0, five ANE power domains, five DAPF records, and preloaded firmware) and allow the T8122 27.2 DATA IOVA (0x100000c8000) and T8132 27.2 DATA IOVA (0x100000bc000) in apple,firmware-iovas. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Add the four ANE sub-block PMGR power states (ane_mpm, ane_cpu, ane_td, ane_base), three ANE DARTs (311800000/311810000/311820000), and the /soc/ane@310000000 node (disabled at SoC level) to T8122, and enable them on J615 (M3 Air). Mark ps_ane_sys and ps_ane_cpu with apple,no-auto-pm so PMGR does not set AUTO_ENABLE behind the cold-started ANE firmware during startup. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Wire T8122 (M3, H15 on macOS 27.2 / 26B123) directly into the shared AP-direct H16 backend and HWX validator without chip or firmware gates: - Replace fixed H16/H17 HWX descriptor branches with a data-driven target table supporting H15 (0x890/0x8b0 record offsets, 8 header words, trailer BAR 5, no perf record, zero-prologue task descriptors) and 1-byte/4-byte-header task relocation. - Guard optional CE setup when build->ce == 0 (T8122 has no CE block) and enable switch_safe program switching for chip_family >= 15. - Add ane_t8122_platform, ane_h15_mmio_t8122 (DART rev 2.0, 5 DAPF records at DART0+0x4000), ane_h15_build_t8122_26b123 (ASC wrapper at +0x1400044, scratch at +0x1840050, 27.2 firmware-requested table, preload tail heap, 2 ms power-gate hold, cold restart + program replay across sleep), and the J615 26B123 cross-boot preload digest pin. - Add KUnit coverage for the T8122 platform definition, zero-CE H15 boot path, and H15 HWX validation/relocation. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
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: FINISH at abf39d86
Blockers:
- CI at
abf39d86:dt-checksis stillIN_PROGRESS(and re-queuedreadiness/pr-textruns after the PR body update are stillQUEUED). No code, safety, or policy blockers found; ready to approve oncedt-checksand the readiness checks turn green atabf39d86.
Checked: §1–§4 and §6 pass; §5 exact-head hardware rows present for J615 (T8122/H15) and J616s (T6040/H16) at abf39d86; full diff, DT bindings/DTS, aurora-silicon/aura#505 handoff ABI, MMIO/DMA/bounds safety, cross-SoC regression impact, and commit DCO/metadata verified; CI partially complete (host-tests green, dt-checks running).
Evidence
- Commits & attribution (§4, §6): All 3 commits (
0c01afde5108,0882c538809a,abf39d86cf87) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and matchingSigned-off-by:. Zero banned names or attribution trailers in commits, diff, PR title, or PR body. - Bindings & DT (
Documentation/devicetree/bindings/npu/apple,ane.yaml,arch/arm64/boot/dts/apple/t8122-{pmgr,peripherals}.dtsi,t8122-j615.dts):apple,t8122-aneschema constraints (interrupts: maxItems 1, 3regwindowsengine/pmgr/aux-0, 5power-domains,apple,ane-type = 0xb0, 5apple,dapf-ranges,apple,firmware-preloaded) matcht8122-peripherals.dtsiandane_t8122_platform.ps_ane_mpm(0xc000),ps_ane_cpu(0xc008),ps_ane_td(0xc010), andps_ane_base(0xc018) fit withinpmgr(0x2d0700000, size0x14000), matchane_t8122_power_words, and match DAPF records 1–2 (0x2d0700438..0x2d070043b,0x2d070c000..0x2d070c01b).apple,no-auto-pmonps_ane_sysandps_ane_cpuaffects only active ANE power-on; unused domains on other T8122 boards (j613,j504,j433,j434) remain off.- All 5
apple,dapf-rangesare valid inclusive ranges on 5 distinct 16 KiB pages withinapple,dma-range = <0x0 0x0 0x400 0x0>.ane_dart0 + 0x4000 = 0x311804000matches disableddart_ane_companion3with no driver conflict.
- Firmware handoff ABI (
aurora-silicon/aura#505at9af9fcfb):auramatches"apple,t8122-ane", checkspre-loaded == 1on/arm-io/aneor childiop-ane-nub, reserves 16 KiB-alignedno-mapregions in 64-bit/reserved-memory(present int8122-jxxx.dtsi), and populatesmemory-region,memory-region-names = "firmware-text", "firmware-data", andapple,firmware-iovas = <0x10000000000 0x100000c8000>.ane_fw_preload_check()andane_h16_preload_identity()double-read stability check + patchbay normalization (GKTS,ECAP,ARcM,ABOI,ZSOI,zero_start == zero_end == 0x2a4000) + SHA-256 digest pin run before any MMIO, DMA, power, or CPU release. Note: iflinux#3082lands beforeaura#505, J615 safely refuses probe with-ENODATAbefore touching hardware (same behavior ast8132-j713.dts).
- Driver safety & bounds (
drivers/accel/ane/):struct hwx_targetinane_h16_hwx.cpreserves H16 (0x8a0/0x8c0, 9 header words, trailer BAR 4, perf record, tight end) and H17 (allow_zero_prologue,allow_stabs_note,allow_slot5_table,allow_zero_scratch_text_flags) behavior byte-for-byte while adding H15 (0x890/0x8b0, 8 header words, trailer BAR 5, no perf record).ane_hx_task_stream_validate_hdr()checks!fixed_header_wordsandwords >= fixed_header_wordsbefore indexing(fixed_header_words - 1) * 4;hwx_relocations_in_payload()runs only after structural validation passes.ane_h16_custom_bars()bounds-checksprogram_offsetagainst0x890,0x8b0,0x8a0, and0x8c0before reads, and LOAD enforcesp->hwx.subtype == s->transport->soc->hwx_subtype.ane_h16_prepare()skips CE only whenf->ce == 0;ane_fw_transport_switch_safe()(chip_family >= 15) leaves H16/H17 unchanged and does not affect H13/H14 drivers.
- Cross-SoC impact: T8132/T604x (H16) and T8140/T605x/T8142 (H17) paths unchanged (regression-verified on J616s M4 Pro); T603x and T8152 untouched; non-J615 T8122 boards keep
&anedisabled. - Non-blocking nits (follow-up only):
Documentation/devicetree/bindings/npu/apple,ane.yaml:284-298: consider addingapple,t8122-aneto theif: memory-region -> then: required [memory-region-names, apple,firmware-iovas]schema block (and mentioning T8122 in thepower-domains/memory-regiondescriptions).drivers/accel/ane/ane_h16_program.c:430-437: comment aboveane_h16_custom_bars()still mentions only0x8a0/0x8c0rather than0x890/0x8b0.- §5 regression rows: when updating/re-running if needed, including the explicit regression triad (
0 SELinux denials, 0 failed units, 0 new kernel errors) on the J615/J616s rows keeps them completely self-contained.
|
Additional exact-head regression-triad confirmation at
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at abf39d86
Blockers: none
Checked: All 4 CI checks (dt-checks, host-tests, readiness / readiness, pr-text / pr-text) are now green at abf39d86cf87 and exact-head J615 (T8122/H15) + J616s (T6040/H16) hardware rows with the full regression triad (Enforcing, 0 SELinux denials, 0 failed units, 0 new kernel errors) are recorded. Code, DT bindings/DTS, aura#505 ABI, cross-SoC non-regression, and policy/attribution checks already passed in the prior audit at this exact head.
Evidence
- Head:
abf39d86cf87d8e82fb23e3b929cea59beb287b1(OPEN, non-draft,MERGEABLE) - CI:
dt-checksSUCCESS,host-testsSUCCESS,readiness / readinessSUCCESS,pr-text / pr-textSUCCESS - Hardware evidence: J615 (T8122/H15 27.2) + J616s (T6040/H16 regression) at
abf39d86cf87, full regression triad PASS
What
Bring up the Apple M3 (T8122) H15 Neural Engine on macOS 27.2 (26B123) using the shared AP-direct H16 backend and HWX validator, with no chip or firmware gates and default kernel command line:
0c01afde5108): Documentapple,t8122-ane(single H15 engine,ane-type = 0xb0, one interrupt, three register windowsengine/pmgr/aux-0, five ANE power domains, five DAPF records, preloaded firmware) and allow the T8122 27.2 (0x100000c8000) and T8132 27.2 (0x100000bc000) DATA IOVAs inapple,firmware-iovas.0882c538809a): Add the four ANE sub-block PMGR states (ane_mpm,ane_cpu,ane_td,ane_base), three ANE DARTs (311800000/311810000/311820000), and/soc/ane@310000000(disabled at SoC level) to T8122, and enable them on J615 (M3 Air). Markps_ane_sysandps_ane_cpuwithapple,no-auto-pmso PMGR does not setAUTO_ENABLEbehind the cold-started firmware (clearingAUTO_ENABLEfixes the 3/3-ESHUTDOWNCPU stop during startupSHAREDMALLOC). Companion Stage 2 preload handoff: kboot: hand off preloaded ANE firmware on T8122 (M3) aura#505 (supersedes the disabled T8122 portion of arm64: dts: apple: describe the T603x Neural Engine, enabled; accel/ane: T603x clean refusal #2331).abf39d86cf87):struct hwx_targettable supporting H15 (0x890/0x8b0record offsets, 8 header words, trailer BAR 5, no perf record, zero-prologue task descriptors) and 1-byte/4-byte-header task relocation.build->ce == 0and enableswitch_safeprogram switching forchip_family >= 15.ane_t8122_platform,ane_h15_mmio_t8122(DART rev 2.0, 5 DAPF records atDART0 + 0x4000),ane_h15_build_t8122_26b123(ASC wrapper+0x1400044, scratch+0x1840050, 27.2 firmware-requested channel table, preload tail heap, 2 ms power-gate hold, cold restart + program replay across sleep), and the J615 26B123 cross-boot preload digest pin.ane_t8122_platform, zero-CE H15 boot, and H15 HWX validation/relocation.Tested
7.3.0-aurora-fleet85) atabf39d86cf87: PASS — cold boot to/dev/accel/accel0(H15, ABI 3,programs switch within one firmware boot) in 11.7 ms (0 restarts, 0 DART faults, 0 warnings);h15-add128x200 128/128 exact (max 0 ulp, p50 163.4 us);h15-mul128x100 switch 128/128 exact (p50 162.8 us); switch-back x20 exact (p50 160.7 us); 2x 15 s RTCs2idlecold-restart + program replay (11-12 ms resume, 0 restarts, outputs identical, 324/324 EXECUTEs,quarantined=0,error=0); dynamicaura#505Stage 2 handoff PASS (12.2 ms boot,h15-add128x50 exact, p50 159.0 us).7.3.0-aurora-fleet87) atabf39d86cf87: PASS —add128x100 16384/16384 exact (max 0 ulp, p50 180.8 us);MobileNetV128-task linked top-1 16/16 OK (p50 0.273 ms, firmware 0.242 ms).abf39d86cf87:drivers/accel/ane/boot.kunitconfig272/272 PASS (incl.hwx_h15_testandane_h16_t8122_no_ce_test);checkpatch.pl --strict --git aurora/main..HEAD0 errors / 0 warnings / 0 checks;dt_binding_checkandCHECK_DTBS=y apple/t8122-j615.dtb0 warnings; ARM64W=1module builds againstfleet85andfleet870 warnings.Risk
Two-way door (plain revert removes T8122/H15 support). Affects T8122 (M3 Air J615) and shared AP-direct ANE Macs (M4/M4 Pro/A18 Pro/M5; regression-verified on J616s M4 Pro). H16/H17 HWX descriptor geometry is preserved identically in
hwx_targets[]. On T8122,apple,no-auto-pmapplies only tops_ane_sysandps_ane_cpuwhile powered on for the ANE, and/soc/ane@310000000remains disabled at the SoC level for boards without a verified preload pin.Not yet
mil-hwx-compiler.Root-cause summary and detailed hardware metrics
Root cause of earlier J615 H15 RUN hangs and startup stops
RUN: Earlier bring-up probes mapped the ANE engine aperture with posteddevm_ioremap()instead ofdevm_ioremap_np(), omitted the 5 identity DAPF MMIO mappings in DART, omittedIOMMU_CACHEon TEXT/DATA, and omitted the0x14000writable heap tail (0x1000036c000..0x10000380000). Using the sharedane_h16_backend(which usesioremap_np, identity-maps all DAPF pages, maps TEXT/DATA withIOMMU_CACHE, and maps the preload heap tail) eliminated the wedge completely.-ESHUTDOWN(CPU_CONTROL=0, STATUS=0x30002a) duringSHAREDMALLOC: Unlike T8132 (wherepmgr-pwrstatesetsno_auto_enable) and T6041 (whereane_sysleavesAUTO_ENABLEclear), T8122 hadBIT(28)(APPLE_PMGR_AUTO_ENABLE) set on bothps_ane_sys(0x1f0023ff) andps_ane_cpu(0x1f0003ff), gating the ANE CPU 7-10 ms afterRUN. Addingapple,no-auto-pm;to both DT nodes clearedBIT(28)(0x0f0023ff/0x0f0003ff) and brought startup to 11.7 ms with 0 restarts.TEXT(0xc8000) is 100% byte-identical andDATA(0x2a4000) differs in only 16 bytes total (GKTS8 B at0x6850andECAP8 B at0x6943), soane_h15_preload_26b123_j615pins the full image with an empty zero range (zero_start = zero_end = 0x2a4000).Hardware metrics
h15-row3, 324 EXECUTEs):firmwaremean 156.3 us (min 96.3 us, max 300.9 us),ioctlmean 159.6 us,copy_inmean 1.6 us,copy_outmean 1.0 us,gate_openmean 0.6 us,gate_closemean 0.0 us (2 ms hold active),irq_wakeups=0,irq_timeouts=0.s2idlecold resume: Cycle 1:domains off 14.6-15.4 s,firmware ready 11 ms, first program ready 12 ms, 1 programs replayed, 0 restarts. Cycle 2:domains off 14.6-15.9 s,firmware ready 11 ms, first program ready 11 ms, 1 programs replayed, 0 restarts.j616s-reg3, H16 regression):add128100/100 exact (16384/16384, p50 180.8 us),MobileNetV1top-1 16/16 OK (p50 0.273 ms, firmware mean 0.242 ms).