Skip to content

accel/ane: T8142 (M5) Neural Engine, enabled on J815 - #1883

Merged
DjDeveloperr merged 8 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-ane
Nov 14, 2026
Merged

DjDeveloperr merged 8 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-ane

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The M5 (T8142) Neural Engine on the H17 staged backend, as T8140 runs it, and enabled on J815.

  1. dt-bindings: apple,t8142-ane (ane-type 0x210, four DAPF records, T8140's interrupts, a preload in reserved memory, the T6050 form's power domains) and apple,t8142-ane-dart.
  2. accel/ane: the T8142 platform from the ADT ("ane,t8132exclave", ANE_SYS at PMGR +0x2e8, ANE_CPU +0xc000 and ANE_TDBASE +0xc008 as on T8140); the hand-off check hashes the handed-over TEXT even when its layout is not the platform's and logs both; then the macOS 27.0 (26A428) stub preload measured on a J815 (TEXT 0xc0000, DATA 0x2ac000, T8140's layout).
  3. iommu: apple-dart: the three ANE DARTs take the cold ANE profile as apple,t8142-ane-dart, at their own revision 0x204 (T8140's are 0x203).
  4. accel/ane: T8142: measured under aura's hypervisor on a J815 running macOS 27.2.1 (26B131) with a cold model load, power-up, first program and power-down traced: PWGATE PMGR +0x27640 (request +0xc, acknowledge +0x30, as T8140), scratch cells from +0x1880028 (as T6050), DART revision 0x204 with 16 streams (SIDs 1-7 the exclave's, 10 and 13 bypassed), and T8140's power-down order. So EXCLAVE_MODE_STOP before a clean stop, the engine parked until its first request and cycled cold across system sleep, the preload pinned by the 26A428 TEXT digest.
  5. t8142.dtsi / t8142-j815.dts: ANE_SYS, the three DARTs (IRQ 752) and the engine (IRQs 751/764, PWGATE, firmware IOVAs, four DAPF ranges), enabled on J815.

Tested on J815 (7.3.0, integration/aurora, iBoot preload of the 26A428 stub): the engine binds and parks behind its three cold DARTs, the firmware boots on the first request, and an H17 program from Apple's compiler loads; its process is created and torn down (H17 LOAD, CREATE, TERMINATE and UNLOAD all status 0, with #1882). Execution checked against a reference: the 960x540 program of an open camera-denoise network (compiled for H17 by macOS's ANE compiler) run over a seeded 1920x1080 NV12 frame gives luma within 1 of the macOS CPU reference output on 100.00% of pixels, with chroma untouched (the raw input matches the reference on only 14.5%, so a run that does nothing cannot pass); about 26-32 ms per frame. Across system sleep: with the engine in use, one s2idle cycle (about 23 s): the firmware is stopped and the engine powered down for the sleep, parked on resume, brought up cold on the next request, and the same frame again matches the reference. The 640x360 program also runs in the live camera pipeline. The ANE KUnit suites pass except program_add128_slots_test, which already fails on integration/aurora (see #1790). checkpatch --strict clean; CHECK_DTBS clean for J815, J813 and J704 on the touched schemas.

Open: a 960x540 program's 63 MiB scratch is one physically contiguous allocation (ane_fw_alloc_mem), which the default 64 MiB CMA could not give (ENOMEM); a larger CMA works around it for now, mapping scattered pages behind the DART would fix it. Tested with cma=256M.

Part of the J815 (MacBook Air 15-inch, M5, T8142) bring-up: board results are summarised in discussion #135.

Assisted-by: Claude Opus 5.5

The M5's ANE is the H17 engine (ADT "ane,t8132exclave", ane-type 0x210)
with four DAPF records, T8140's interrupts and a preload in reserved
memory. Its PWGATE is a window of its own, so it takes the power
domains the T6050 form does.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The M5's ANE DARTs are T8140's cold ANE DARTs at revision 0x204.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The M5's ANE is the H17 engine again (ADT "ane,t8132exclave", ane-type
0x210), exclave-assigned and preloaded by iBoot. From the T8142 ADT:
ANE_SYS at PMGR +0x2e8 (pmgr device 73), ANE_CPU +0xc000 and ANE_TDBASE
+0xc008 as on T8140, four DAPF records, and a preload of TEXT 0xbc000
and DATA 0x2b0000 at 0x100_0000_0000 / 0x100_000b_c000.

Its PWGATE window, scratch cells, DART revision and TEXT digest are not
measured yet. Give ane_t8142_platform a zero TEXT pin that never
matches: with a loader hand-off the driver only logs it and leaves the
engine alone.

The hand-off check now hashes the handed-over TEXT even when its layout
is not the platform's, and logs that layout next to the digest, so one
boot of a new SoC or firmware reports both.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Under aura on a J815 with the macOS 27.0 (26A428) stub, iBoot preloads
the ANE TEXT 0xc0000 and DATA 0x2ac000 at 0x100_0000_0000 and
0x100_000c_0000, T8140's layout (the 27.2 host's ADT shows 0xbc000 and
0x2b0000). Use it, and keep the measured TEXT digest next to the zero
pin until the PWGATE window, scratch cells and DART revision are known.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The M5's three ANE DARTs are T8140's: 16 streams, the exclave's streams
inherited from iBoot, SID0 the only one the kernel attaches. They are
revision 0x204 (PARAMS_8 0x2a2a0204, measured on a J815) where T8140's
are 0x203. Give apple,t8142-ane-dart the cold ANE profile and check for
its own revision.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Measured under aura's hypervisor on a J815 running macOS 27.2.1 (26B131),
with a cold model load, the power-up, the first program and the
power-down traced:

- PWGATE is PMGR +0x27640 (the ADT's ane reg[2] + 0x3640): request +0xc
  (0 release, 3 gate), acknowledge +0x30, as on T8140.
- The scratch cells start at +0x1880028, as on T6050.
- The DARTs are revision 0x204 (PARAMS_8 0x2a2a0204), 16 streams; the
  ADT gives SIDs 1-7 to the exclave and bypasses 10 and 13.
- Four DAPF records, the DT's.
- macOS powers the engine down in T8140's order: sub-block, PWGATE
  request 3, acknowledge 0, CPU, then ANE_SYS.

So T8142 runs as T8140 does: EXCLAVE_MODE_STOP before a clean stop, the
engine parked until its first request and cycled cold across system
sleep, the preload pinned by the 26A428 TEXT digest measured on a J815.

Tested on a J815 (7.3.0, integration/aurora, iBoot preload of the 26A428
stub): the engine binds and parks behind its three cold DARTs, the
firmware boots on the first request, and an H17 program from Apple's
compiler loads and its process is created and torn down (H17 LOAD,
CREATE, TERMINATE and UNLOAD all status 0, with the H17 HWX validator
change for zin_ane_compiler 10.205 programs). The ANE KUnit suites pass
but for program_add128_slots_test, which fails on integration/aurora
already. A frame through the engine is not yet compared against a
reference.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Describe ANE_SYS (pmgr device 73, +0x2e8), the three ANE DARTs
(0x421800000, 0x421820000, 0x421840000, IRQ 752, vm range
0x0-0x400_0000_0000) and the engine: its registers, the PMGR window and
PWGATE (PMGR +0x27640), IRQs 751 and 764, the firmware IOVAs and four
DAPF ranges, disabled.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1
m0d16l14n1 marked this pull request as ready for review November 14, 2026 06:47

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed. The T8142 platform data, match entries and DT are new and J815-only. The two shared hunks:

  • apple-dart.c: cold_ane and the 0x204 cold revision apply only to apple,t8142-ane-dart. T8140 keeps 0x203, and T6050 DARTs never take the cold path.
  • ane_fw_cold.c: the hand-off now hashes TEXT even when the preload layout differs. text_ok is still ranges_valid && digest == pin, so acceptance is unchanged on T8140 and T6050; a mismatch only adds one log line.

The reference-checked execution and the s2idle cycle are good evidence. The contiguous-scratch CMA limit for the 960x540 program is a fair follow-up.

dt-checks and host-tests are green on this head. Base drift doesn't touch these files. Approving and merging. Heads-up: #1880 and #1881 append at the same places in t8142-j815.dts and t8142-peripherals.dtsi, so they will need a rebase after this.

@DjDeveloperr
DjDeveloperr merged commit 2bc6694 into aurora-silicon:integration/aurora Nov 14, 2026
2 checks passed
DjDeveloperr pushed a commit to aurora-silicon/aura that referenced this pull request Nov 17, 2026
/arm-io/ane on the M5 MacBook Airs (J813, J815) is pre-loaded by iBoot
with a __TEXT and a __DATA segment, as on T8140. List apple,t8142-ane so
an M5 ANE node gets both reserved and its firmware IOVAs.

Tested on J815 (MacBook Air 15" M5) with the macOS 27.0 (26A428) and
27.2 (26B123) stubs, on v1.0.0b13.1 plus this change: the kernel's
T8142 ANE driver (aurora-silicon/linux#1883) finds both regions at
0x100_0000_0000, verifies the TEXT and runs an H17 program whose output
matches macOS's (1080p frame, luma 100% within 1).

Signed-off-by: Nick <nekreshen@yandex.ru>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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