Skip to content

accel/ane: Add the Apple Neural Engine driver - #155

Merged
RyanTheTide merged 26 commits into
aurora-silicon:aurora-wipfrom
joshuaswarren:ane-driver-aurora
Oct 8, 2026
Merged

RyanTheTide merged 26 commits into
aurora-silicon:aurora-wipfrom
joshuaswarren:ane-driver-aurora

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

This adds the Apple Neural Engine (ANE) driver and its device-tree nodes, as asked on #65. It sits on top of #65 (the mailbox change), so the first two commits here are #65's.

What it adds

  • drivers/accel/ane/: one DRM accel driver (DRM_ACCEL_ANE) that builds two modules. ane handles the M1 family (T8103, T600x). ane_t6021 handles the M2 family (T6020, T6021, T6022, T8112).
  • include/uapi/drm/ane_accel.h: the userspace interface ((GPL-2.0-only WITH Linux-syscall-note) OR MIT). It has a version/caps ioctl (DRM_IOCTL_ANE_GET_CAPS), rejects nonzero pad and reserved fields, and uses DRM_ANE_ prefixed macros.
  • The apple,ane binding, and a T8112 ANE mailbox binding.
  • ANE nodes for t8103, t600x (die 0) and t602x (die 0), enabled. The t8112 node is added disabled, because no base M2 has run it yet.

Firmware

M1-family chips need no firmware from Linux: iBoot loads it. The M2-family driver loads its firmware with request_firmware() and runs it from its own memory. It no longer depends on iBoot's preloaded copy, so the t602x nodes are safe to leave enabled. The kernel does not ship that firmware. A distribution installs it: on Omarchy the omarchy-ane package fetches it from Apple's macOS 13.5 restore image at install and checks it against a pinned hash.

Testing

  • The same driver code ships today as DKMS modules (omarchy-ane v0.4.0). The whole Parakeet speech encoder runs bit-exact with those modules on an M1 (T8103), an M1 Max (T6001) and an M2 Max (T6021).
  • This in-tree build, M2 Max (T6021): I built a kernel from this branch with the stock Asahi config and booted it once through a GRUB one-shot entry (the stock kernel stayed the default and was booted first as the fallback). The in-tree ane_t6021 bound the ANE, and the hand-installed module was not loaded. The add, mul, relu and matvec checks pass, the whole Parakeet encoder is bit-exact in three runs, DRM_IOCTL_ANE_GET_CAPS returns the expected values, and nonzero pad fields return -EINVAL. The ANE device tree node in this boot came from the board tree in the boot image, not from this branch's nodes.
  • This in-tree driver code, M1 Max (T6001): I built the ane module from this branch out of tree against the stock kernel's headers and loaded it in place of the packaged module. GET_CAPS works (ABI 1, nonzero flags return -EINVAL), an add runs bit-exact on its own tensor layout, and the whole Parakeet encoder is bit-exact. The packaged module was restored afterwards.
  • It has not run on T8103 (M1) or on the untested chips (T6000, T6002, T6020, T6022, T8112). The device tree nodes in this branch have not been booted on any machine. I did not test display, GPU or Wi-Fi beyond a short boot on the M2 Max.
  • Build and style checks: both modules compile for arm64, checkpatch --strict reports 0 errors on the series, and dtbs_check adds no new findings across the 111 Apple device trees.
  • One warning appears in the M2 Max boot log from the aurora base, not from the ANE: iommu_setup_default_domain on three DARTs that no device tree node uses.

The T6021 (M2 Max) ANE coprocessor mailbox is an ASC mailbox, but only
one of its interrupts is known: the Apple device tree gives the ANE a
single interrupt line. The binding requires the four ASC mailbox
interrupts in a fixed order, so a node for this mailbox fails
dtbs_check.

Add the apple,t6021-ane-mailbox compatible with the apple,asc-mailbox-v4
fallback. For it, recv-not-empty is the only required interrupt;
send-empty, send-not-empty and recv-empty may follow in that order.
Without send-empty, the OS must poll the FIFO status before it sends.

The other variants keep their constraints. The four-interrupt rule moves
into a condition that excludes the ANE and AOP setup mailboxes, and the
AOP setup mailbox states its minimum of two interrupts, which the
top-level limit gave it before.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The T6021 (M2 Max) ANE coprocessor mailbox has one known AIC line, which
the device tree names recv-not-empty. apple-mailbox insists on a
send-empty IRQ as well, so it cannot bind that mailbox.

Look send-empty up with platform_get_irq_byname_optional(). When the
node has none (-ENXIO), do not request it, and let apple_mbox_send()
wait for FIFO space by polling the A2I control register, the way its
atomic path already does (100 us steps, 500 ms timeout, under tx_lock).
Any other lookup error still fails the probe with -ENODEV.

A mailbox whose node names send-empty takes the old path unchanged: the
IRQ is requested at the same point with the same flags and name, and a
non-atomic send still sleeps on tx_empty. All 71 apple-mailbox nodes in
arch/arm64/boot/dts/apple name send-empty today.

The Rust wrapper (RUST_APPLE_MAILBOX) needs no change. It only calls
apple_mbox_get_byname(), apple_mbox_start(), apple_mbox_send() and
apple_mbox_stop(), and never reads the IRQ fields, so a Rust client
gets the poll through apple_mbox_send().

An equivalent change ran on an M2 Max lab kernel (Asahi 7.1.13 base)
from 2026-09-24 to 2026-09-30, where apple-mailbox bound the
one-interrupt ANE mailbox. The FIFO-full poll itself did not run there:
with the ANE firmware in use (from macOS 13.5), the host sends no
mailbox message after probe.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add a binding for the Neural Engine (ANE) of the Apple T8103 (M1), T6000
(M1 Pro, Max and Ultra), T6020, T6021, T6022 (M2 Pro, Max and Ultra) and
T8112 (M2). These are the compatibles that the ane and ane_t6021 drivers
match.

On T8103 and T6000 the node has the engine register window, one
interrupt, the three ANE DARTs and five power domains. On T602x a
coprocessor runs the ANE firmware, so the node also has the PMGR and
power state windows, eight power domains, the coprocessor reset and
mailbox, and an IOVA-only reservation for the firmware entry alias. The
T8112 node has the T602x windows plus the two eFuse words that give the
SoC revision to the firmware, seven power domains and the mailbox.

The schema goes in npu/ with the other neural processing units, and in
the ARM/APPLE MACHINE SUPPORT entry with the other Apple bindings.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The T8112 (M2) ANE coprocessor has an ASC mailbox at the same offset in
its block as the T6021 ANE, and the Apple device tree also gives that
ANE a single interrupt line (520).

Add apple,t8112-ane-mailbox to the ANE mailbox variant, with the same
interrupt rules as apple,t6021-ane-mailbox.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add a DRM accel driver for the Apple Neural Engine (ANE). One Kconfig
symbol, DRM_ACCEL_ANE, builds two modules from this directory:

- ane binds apple,t8103-ane and apple,t6000-ane (M1, and die 0 of the
  M1 Pro, Max and Ultra). Linux starts no ANE firmware on these SoCs:
  the host writes task descriptors to the engine's task queue and maps
  the buffers through the three ANE DARTs (ABI 1, DRM_IOCTL_ANE_SUBMIT).
- ane_t6021 binds apple,t6020-ane, apple,t6021-ane, apple,t6022-ane and
  apple,t8112-ane (M2 Pro, Max and Ultra die 0, and M2). On these SoCs
  Linux must start the ANE coprocessor. The driver loads the firmware
  with request_firmware(), checks it against a SHA-256 pin, copies it
  to its own DMA memory, starts the coprocessor, and sends LOAD, CREATE
  and CALL commands on the firmware's command ring (ABI 2,
  DRM_IOCTL_ANE_PROG_LOAD, DRM_IOCTL_ANE_PROC_CREATE and
  DRM_IOCTL_ANE_EXEC).

Both register /dev/accel/accel*. include/uapi/drm/ane_accel.h has the
ioctls of both ABIs, and the DRM major version tells userspace which ABI
the device has.

The sources are those of the out-of-tree omarchy-ane driver at tag
v0.4.0 (16d13ef52dc6), which started from the ane driver of
Eileen Yoon. The move changes only the build glue: the SPDX comment
style, the include path of the UAPI header, an include of drm.h and the
Linux-syscall-note in the UAPI header, and the module version, which the
out-of-tree build took from git describe (MODULE_VERSION and one log
line). Compiled for arm64, every object has the same code as the
out-of-tree build, except for the argument list of that log line.

The out-of-tree build of this code ran on T8103 (M1), T6001 (M1 Max) and
T6021 (M2 Max) with linux-asahi 7.1.13. T6000, T6002, T6020, T6022 and
T8112 have not run it. ane also matches apple,t6020-ane and
apple,t6021-ane and refuses them at probe; ane_t6021 binds them.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the M1 Neural Engine: the engine window at 0x26bc04000, the
three ANE DARTs, and the ane_base and ane_set1..5 power states
(ane_sys_cpu -> ane_base -> ane_set1..5). apple-dart owns the DARTs and
the engine maps through their IOMMU domain.

The ane driver binds these nodes. They equal, property for property
with phandles compared by target path, the live device tree of a
MacBook Pro 13" M1 (j293) on which the out-of-tree build of the same
driver code was bound on 2026-09-30 (linux-asahi 7.1.13): 80 properties
over the ane node, its DARTs and the eight ANE power states.

Enabled: Linux starts no ANE firmware on T8103. Until the ane module
loads, apple-dart binds the three DARTs and apple-pmgr-pwrstate
registers the new states, as on that machine.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the die 0 Neural Engine of the M1 Pro, Max and Ultra: the
engine window at 0x285c04000, the three ANE DARTs, and the ane_set0,
ane_base and ane_set1..5 power states (ane_sys_cpu -> ane_set0 ->
ane_base -> ane_set1..5). ane_set5 is described but the ane node does
not use it: it lies past the end of the ADT ANE pmgr range (0xc02c).
The states are added on die 0 only; the M1 Ultra die 1 ANE stays
undescribed. The pmgr window already spans 0x1c000 here, so it covers
0xc000..0xc030 without change.

These nodes equal the packaged omarchy-ane device-tree overlay that
booted on a MacBook Pro 16" M1 Max (j316c) on 2026-09-30 (linux-asahi
7.1.13): the out-of-tree build of the ane driver bound at 285c04000.ane
and an inference smoke test matched its reference output hash. Property
for property, with phandles compared by target path, the subtree is
identical. One name differs: the overlay calls the node ane@284000000
(the ADT engine block base), which dtc W=1 flags (simple_bus_reg)
because reg starts at 0x285c04000. It is ane@285c04000 here. The driver
matches on the compatible.

Enabled: Linux starts no ANE firmware on T6000. Until the ane module
loads, apple-dart binds the three DARTs and apple-pmgr-pwrstate
registers the new states, as on that machine. The M1 Pro and M1 Ultra
share this die 0 block; only the M1 Max has run it.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the die 0 Neural Engine of the M2 Pro, Max and Ultra: the whole
32 MiB engine range at 0x284000000 plus the PMGR state words and the SET
window, IRQ 884, three ANE DARTs, the eight existing ANE power states
with ane_cpu as the reset, the ANE coprocessor mailbox at 0x285408000,
and an IOVA-only reservation for the firmware entry alias (16 MiB at
0x10000000000 in the ANE DART domain).

The shared die 0 file uses apple,t6021-ane. t6020.dtsi and t6022.dtsi
change it to apple,t6020-ane and apple,t6022-ane, because ane_t6021 has
per-SoC data, for example the SoC revision it gives the firmware.

The Apple device tree gives the ANE one interrupt line, so the mailbox
names only recv-not-empty, and apple-mailbox polls for TX space.
ane_dart0 is in the always-on pmp domain, as in the tree that booted;
ane_sys was never booted for this DART.

The nodes are enabled. By default ane_t6021 runs the firmware from its
own memory (fw_alias_reserved=0), so it needs no reserved-memory node
from the bootloader, and it does not start the mailbox
(hello_wait_ms=0). The memory-region is an IOVA reservation only.

Tested with the out-of-tree build of the same driver code: a MacBook Pro
14" M2 Max (j414c) ran linux-asahi 7.1.13 with these node values from an
overlay and the packaged m1n1 1.6.1, and its test programs gave
bit-exact results. That tree had two differences: the mailbox also named
a placeholder send-empty line (AIC 1833), which the stock apple-mailbox
needs, and the nodes came from an overlay. Earlier runs on the same
machine used a one-interrupt mailbox node with a poll-TX apple-mailbox.

Not tested: this kernel tree was not booted, and no M2 Pro or M2 Ultra
ran these nodes. Their values are from the macOS 13.5 device trees of
those machines, which give the same die 0 ANE values as the M2 Max.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the M2 Neural Engine: the whole 32 MiB engine range at
0x26a000000 plus the PMGR window, the SET window and the two eFuse words
that give the SoC revision to the firmware, IRQ 520, three ANE DARTs
(IRQ 521, in ane_sys), the ANE coprocessor mailbox at 0x26b408000, and
the seven ANE power states ane_sys_cpu, ane_td, ane_base and ane_set1..4
(0xc008..0xc038). ane_sys_cpu is a child of ane_sys, and each later
state is a child of the one before.

The values are those of the omarchy-ane T8112 overlay. Its sources are
the /arm-io/ane and /arm-io/dart-ane nodes of the macOS 13.5 and 27.0
device trees, which are the same on j413, j415, j473 and j493, and the
power-on order of the macOS 13.5 ANE kext. The mailbox sits at the same
offset in the ANE block as on T6021 and names only recv-not-empty (the
ANE interrupt); the overlay adds a placeholder send-empty line, which
this tree does not need because apple-mailbox polls for TX.

The mailbox, the DARTs and the ane node stay disabled: no T8112 has run
the ane_t6021 driver or booted these nodes. The other ANE nodes in this
series have the values of trees that ran the driver on an M1, an M1 Max
or an M2 Max. A board or overlay that tests the driver enables the five
nodes.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The ane module matched apple,t6020-ane and apple,t6021-ane, but it
refused to bind both: T6020 had no proven SET-block base, and T6021
bound only with the allow_unqualified module parameter. The M2 family
does not use the host-driven task manager of this module. Its
coprocessor runs the ANE firmware, and the ane_t6021 module drives it
for T6020, T6021, T6022 and T8112.

The two entries made udev load both modules for every T602x ANE node,
and the ane probe, when it ran first, failed with -ENODEV and logged an
error.

Remove the two entries and their SoC descriptors. Every remaining SoC
has proven constants, so also remove the qualification tiers and the
allow_unqualified parameter, and get the descriptor with
of_device_get_match_data().

Each compatible of the apple,ane binding, and each ANE node in the
apple device trees, now matches exactly one of the two match tables.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Prepare include/uapi/drm/ane_accel.h for a stable in-tree ABI.

Prefix every macro of the header with DRM_ANE_, as other DRM UAPI
headers do: ANE_TILE_COUNT, ANE_FIFO_NID and ANE_CMD_GRAN become
DRM_ANE_TILE_COUNT, DRM_ANE_FIFO_NID and DRM_ANE_CMD_GRAN,
ANE_ABI_MAJOR and ANE_ABI_M2_MAJOR become DRM_ANE_ABI_V1 and
DRM_ANE_ABI_V2, and ANE_M2_MAX_BINDS becomes DRM_ANE_MAX_BINDS.
ANE_M2_MAX_SECTIONS was 16, but the driver accepts at most 9 sections
(ids 1 to 9). It becomes DRM_ANE_MAX_SECTIONS with the value 9, and a
BUILD_BUG_ON() keeps it equal to the firmware LOAD record count.

Add DRM_IOCTL_ANE_GET_CAPS (number 0x00, free until now) to both
drivers. It reports the ABI version, the chip family (H13 or H14), and
the size of each array entry that PROG_LOAD and EXEC read through a
user pointer. Its flags field has no defined flag and must be zero. Its
size field gives the number of bytes that the driver filled in, so the
structure can grow at its end.

Reject a nonzero pad or reserved field with -EINVAL in every ioctl:
BO_INIT and BO_FREE on ABI version 2 (ABI version 1 already did), the
pad of PROG_LOAD, of each generic bind and of EXEC, and the flags and
reserved fields of each EXEC buffer. The field drm_ane_exec_io.dma was
already reserved: the driver gives the firmware the address of
bo_handle. Rename it to reserved. Add kernel-doc for every structure.

Keep one header with an explicit ABI version, not one header per ABI.
The two drivers share the DRM driver name, the accel node, the
BO_INIT/BO_FREE structures and the ioctl number space. One header per
ABI would either duplicate the shared structures under two names or
need a third header for them, and it would let the two headers give
one ioctl number to two structures. Userspace already supports both
ABI versions from one binary and selects by the version major. The
version is explicit: DRM_IOCTL_VERSION major and
drm_ane_get_caps.abi_version both report DRM_ANE_ABI_V1 or
DRM_ANE_ABI_V2, an ioctl number is never reused, and a driver rejects
the ioctls of the other version.

The ioctl numbers and the layout of every existing structure do not
change: an aarch64 offsetof()/sizeof() check of the old and new header
gives identical values for all existing structures, fields and ioctl
command values. Userspace that left a pad field of BO_FREE or of a
generic bind uninitialised can now get -EINVAL on ABI version 2.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
checkpatch --strict reports 27 MACRO_ARG_PRECEDENCE checks for the task
manager and task queue register macros. Put each macro argument in
parentheses.

No functional change: all callers pass simple expressions, and the
non-debug sections of all seven objects are byte-identical before and
after this change (arm64, gcc 12.2.0).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
checkpatch reports a MEMORY_BARRIER warning for the four barriers
without a comment, and an UNCOMMENTED_DEFINITION check for the three
mutexes. Say what each barrier orders and what each mutex protects.

Comments only. The non-debug sections of all seven objects are
byte-identical before and after this change, except the line number in
the one __dyndbg entry of ane_t6021_rtclient_main.o (arm64, gcc 12.2.0).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
checkpatch reports seven ALLOC_WITH_SIZEOF warnings and one
ALLOC_SIZEOF_STRUCT check. Allocate the single objects with
kzalloc_obj(), which uses GFP_KERNEL when no flags are given.

No functional change: kzalloc_obj() expands to kzalloc() of the same
size and flags, and the non-debug sections of all seven objects are
byte-identical before and after this change (arm64, gcc 12.2.0).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Fix the style issues that checkpatch --strict reports and that need no
change to the generated code:

 - join the split MODULE_PARM_DESC() strings of ane_t6021_fwload.c
   (SPLIT_STRING),
 - wrap three lines longer than 100 columns (LONG_LINE,
   LONG_LINE_STRING),
 - move two multi-line trailing comments in ane_t6021_boot.h and one
   after a #define above the code they describe (BLOCK_COMMENT_STYLE),
 - use ARRAY_SIZE(), min_t() and BIT() (ARRAY_SIZE, MINMAX, BIT_MACRO),
 - add braces to the unbalanced if/else statements (BRACES),
 - remove a pair of unnecessary parentheses (UNNECESSARY_PARENTHESES),
 - do not end a line with an open parenthesis (OPEN_ENDED_LINE),
 - reword a comment that checkpatch reads as a fall-through annotation
   (PREFER_FALLTHROUGH).

No functional change: the non-debug sections of all seven objects are
byte-identical before and after this change (arm64, gcc 12.2.0).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ane_t6021 loads apple/ane/t602x_ane0_fw_selene_rc4x.macho on T602x and
apple/ane/h14_ane_fw_bia_j4xx.macho on T8112. Declare both with
MODULE_FIRMWARE() and keep each name in one macro.

The firmware is a distribution concern: omarchy-ane-firmware-fetch
installs these files under /lib/firmware/apple/ane. When
request_firmware() fails, name the file and how to install it.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add producer-side statistics to both ANE drivers.

/sys/class/accel/accel<N>/device/ane_stats is a read-only (0444) file
with two cumulative counters, one "key value" pair per line:

- busy_ns: the nanoseconds the engine was busy since bind. A busy
  period opens when the first submission arrives on an idle engine and
  closes when the last one completes. Overlapping submissions share a
  period, so busy_ns is the union of the submit-to-completion windows,
  not their sum. ane serializes submissions behind engine_lock, so
  there the union is the sum. A read adds the time of the open period,
  so the value also increases while work is in flight.
- jobs: the completed engine submissions since bind. ane counts each
  ANE_SUBMIT. ane_t6021 counts only CSNE_CMD_PROCEDURE_CALL. The
  control-plane commands on the same path and the boot transport are
  not engine work and do not count. A submission that fails still
  completes its begin/complete pair, so the counters stay balanced.

Documentation/ABI/testing/sysfs-class-accel-ane describes the file.

The ane_timeline debugfs file shows the latest submissions from a ring
that the driver allocates at probe: seq, submit_ns, start_ns, end_ns,
tasks, rc and tmst. Each slot has a sequence number, so a reader skips
a slot that is in flight or that a later submission reuses. ane
records the raw TM tick as tmst. ane_t6021 has no host TM path and
records 0. Both drivers create the file with drm_debugfs_add_file().

The producer uses atomics only. It does not allocate, lock or format.
A transition sentinel in the inflight count keeps the fold of one busy
period and the start of the next apart. The next period starts at or
after the fold end of the previous one.

Both modules have a read-only stats parameter, default 1, that the
driver reads at probe. With stats=0, or when the ring allocation
fails, the driver creates no stats files and the submission path skips
the counters.

Testing: in the tree, this code is compile-verified only (arm64 W=1,
=m and =y, and checkpatch --strict). A host test of the accounting
through a kernel API shim passes. It includes a model check of all
orders of three jobs, with a preemption at each atomic operation. The
out-of-tree omarchy-ane driver with the same accounting passed the
hardware gates on T8103 (M1) and T6001 (M1 Max). That version read
max_end for the period start before it took the transition sentinel;
this commit reads it after. The T6021 (M2 Max) path is in test.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
Build the in-tree ANE driver (aurora-silicon/linux#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
The die 0 ANE power states that came with the ANE support in Joshua
Warren's aurora-silicon/linux#155 include ps_ane_set5 at 0xc030, but the
comment above them puts the end of the ANE's pmgr range at 0xc02c. The
ane node does not use it either: it lists set1 to set4, and the driver
takes its power domains from that list.

The node was still live on every M1 Pro, Max and Ultra. The pmgr driver
probes each enabled power-controller: it reads the register, sets the
auto-PM enable bit if the state is active, and genpd turns unused
domains off late in boot. Linux should not do any of that to a register
outside the block it describes.

Drop the node, and say in the comment why there is no set5.

Found in a review of omacom#155.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
The ANE support from Joshua Warren's aurora-silicon/linux#155 enables
the ANE on every chip that describes it except the M2 (T8112): the M1
(T8103) directly, and every M1 Pro/Max/Ultra (T6000/T6001/T6002) and
M2 Pro/Max/Ultra (T6020/T6021/T6022) through the shared die 0 files.
The driver has run on the M1 Max (T6001) and the M2 Max (T6021) only,
and these device tree nodes have not booted on any machine yet. On an
untested chip that means the ANE's DARTs, mailbox and power states
probe and touch the hardware on every boot, and the driver binds,
which on the M2 family starts the ANE firmware by default.

Make the ANE node, its DARTs and mailbox, and the power states added
for it default to disabled where they are described, and enable them
per SoC:

- t6001.dtsi enables them on the M1 Max: MacBook Pro j314c and j316c,
  and Mac Studio j375c.
- t6021.dtsi enables them on the M2 Max: MacBook Pro j414c and j416c,
  and Mac Studio j475c.
- t6000.dtsi and t6020.dtsi include those files, so they define
  APPLE_ANE_UNTESTED first and the M1 Pro and M2 Pro stay off.
- t6002 and t6022 (Ultra) build die 0 from the shared files and never
  see an enable, so they stay off.
- t8103.dtsi gets the same enable block behind a one-line
  APPLE_ANE_UNTESTED define, so enabling the M1 ANE after a supervised
  boot is a one-line deletion.

Power states that predate omacom#155 (ane_sys and ane_sys_cpu on t600x and
t8103, and the ANE states in t602x-pmgr.dtsi) keep their status. Where
the ANE stays off, each device tree is the pre-omacom#155 one plus disabled
nodes, apart from the inert ane-alias-iova reserved-memory entry on
t602x, which has no reg or size and is only read through the ANE's
memory-region. On the M1 Max and M2 Max the device tree is unchanged,
except that the t600x ANE power states now carry an explicit
status = "okay".

Found in a review of omacom#155.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
Joshua Warren's aurora-silicon/linux#155 adds the M2 (T8112) ANE with
its node, mailbox and DARTs disabled, since it has not run there. The
seven power states added for it (ane_sys_cpu, ane_td, ane_base and
ane_set1 to ane_set4) have no status, though, so they are live on every
boot of an M2 MacBook Air, 13" MacBook Pro or Mac mini. The pmgr driver
probes each of them: it reads the register, sets the auto-PM enable bit
if the state is active, and genpd turns unused domains off late in
boot. Nothing consumes them while the ANE is disabled.

Disable them as well, so the ANE and everything only it uses are off
together, and say so above them. ane_sys predates omacom#155 and keeps its
status.

Found in a review of omacom#155.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
The M2 ANE module from Joshua Warren's aurora-silicon/linux#155 logs its
probe and firmware boot progress with dev_emerg(). These lines came
from bring-up, where each one had to reach the console before the write
it announced. With fw_start on by default, an M2 Max now prints about
twenty emergency-level lines on every boot, which go to every console
and terminal regardless of loglevel and bury real emergencies.

Use the level each message deserves:

- the per-phase BOOT-PHASE markers and the probe register readouts
  (ane_cpu ACTUAL, PWGATE, the engine reads, staging and dispatch, the
  legacy ack and hello start) become dev_dbg(); dynamic debug still
  gets them for crash attribution;
- the outcome lines (sequence returned, done without a CPU start, the
  legacy hello result) become dev_info();
- the SCRATCH/RVBAR/tick dump, printed only when the ANE CPU was
  released but never reported READY, becomes dev_err().

The 30 ms drain after each phase marker is left as it is, and the
comment above it now says how to see the marker.

No other drivers/accel/ane code logs at emergency, alert or critical
level.

Found in a review of omacom#155.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
ane_t6021.ko is built from ane_t6021_rtclient_main.o,
ane_t6021_fwload.o and ane_t6021_boot.o, and each of the three carries
its own MODULE_LICENSE() and MODULE_DESCRIPTION(), so modinfo reports
three licenses and three descriptions for the one module. The comment
on the extra copies says the objects also link into an
ane_t6021_rtclient.ko, but the Makefile from Joshua Warren's
aurora-silicon/linux#155 builds no such module.

Keep the set next to module_init() in ane_t6021_rtclient_main.c and
drop the copies, and their comment, from the fwload and boot objects.
The MODULE_FIRMWARE() lines stay with the firmware loader.

Found in a review of omacom#155.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
The kernel now carries the in-tree Apple Neural Engine driver
(aurora-silicon/linux#155), switched on for the M1 Max and M2 Max only.
Add a Neural Engine step to the agent test plan: what passes on those
two, that every other Mac should show nothing, what to check when the
M2 firmware is or is not present, and the module_blacklist escape if a
Mac stops booting.

omarchy-ane-dkms builds the same module names into updates/dkms, which
modprobe prefers over the kernel's own. When it is installed, say so
rather than remove it: removing it also removes the M2 firmware it
fetched.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Your in-tree findings are fixed in omarchy-ane v0.4.2 (https://github.com/joshuaswarren/omarchy-ane/releases/tag/v0.4.2, tag on 545d059):

  • DKMS steps aside when the kernel ships drivers/accel/ane: dkms.conf sets BUILD_EXCLUSIVE_CONFIG="!CONFIG_DRM_ACCEL_ANE", so dkms build exits 77 for both modules and the in-tree module wins (9545c76). Tested with the real dkms on fake kernel trees (3.0.10, 3.4.3 and master); not yet on a real aurora package.
  • omarchy-ane-check detects kernel-own-DTB setups (a non-empty DTBS= in /etc/default/update-m1n1). It prints that overlay opt-ins have no effect there and no longer suggests an opt-in key. It also prints driver_source=intree|dkms|none (7018f6d).
  • Register tracing is dev_dbg in both drivers (85fe1b0, and f227145 on this branch).
  • set5 is dropped on t600x only. T8103 keeps it (34511e0; the same drop is in this branch's 59823d3).
  • In-tree rows now count for promotion. A row with driver_source=intree, its own driver bound, smoke 20/20 bit-exact and no faults is judged like a DKMS row, and a missing field counts as DKMS. A PROMOTE verdict on an in-tree row now also generates the change that enables that chip's node here (tools/aurora_dt.py, 7018f6d). The job that opens that PR needs a token for the fork, which is not configured yet, and the live path has only run against a stub gh.

A bug your boot made visible: on kernels with your device trees, the 0.4.1 overlays were refused by omarchy-ane-dt on t8103-j293, t6000-j314s, t6002-j375d and t8112-j413, because the overlay power states carried no status. They now set status = "okay" (34511e0).

chriskearney added a commit to chriskearney/aurora-linux that referenced this pull request Oct 3, 2026
linux-aurora 7.1.12.aurora2-11.31, built from fd04a98:
 - PCIe over Thunderbolt on M1 Pro/Max and M2 Pro/Max by default (#10)
   with the T600x DART window and dock readiness fixes;
 - igb and igc for Thunderbolt 3 and 4 dock Ethernet;
 - the MacBook Neo radios in the shared kernel (#11);
 - Neural Engine runtime PM (aurora-silicon/linux#155) and the ANE
   enabled on the M1, M1 Pro and M2 Pro.

The installer checks a MacBook Neo for its own Wi-Fi firmware, calibration
and country files and prints the Neo's sleep, Wi-Fi and Bluetooth limits.
The test plan covers dock PCIe on the Pro/Max chips with exact log lines,
the Neural Engine on the newly enabled chips, and a MacBook Neo step.

libfprint, aurora-touchid and m1n1-aurora are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
@chriskearney

Copy link
Copy Markdown
Contributor

@joshuaswarren, here are hardware results for 0a8b54f, "Power the ANE off when it is idle". Its commit message says measurements are pending, so here are two.

Kernel: our 11.31 (iconidentify/aurora-linux custom/sep 87e165c). It has your three new commits (f227145, 0a8b54f, 3631665) cherry-picked unchanged onto the #155 version we already ship. Apart from our kernel-only ane_stats.h, our tree matched yours at 4e315c4. The ANE is enabled on t8103 and t6000 for this run. Defaults apply (autosuspend_ms=1500).

Test: the same on both Macs. It uses omarchy-ane 160b209's packaging/omarchy-ane-smoke (the add fixture, 20 calls per run), with runtime PM read from sysfs and the domains from pm_genpd_summary:

J293 (M1, t8103) J314s (M1 Pro, t6000), first ANE run on an M1 Pro
Idle runtime_status suspended; all 8 ANE power domains off suspended; all 8 off
One smoke run 20/20 bit-exact; active during it, suspended again afterwards (within the test's 5 s window; not timed more finely) same
30 cycles (wait for suspend, then a 20-call smoke) 600/600 bit-exact; runtime_suspended_time keeps growing 600/600 bit-exact
4 concurrent smokes 4 × 20/20 bit-exact, autosuspended afterwards same
System suspend (s2idle, pm_test=devices) while runtime-suspended, then a smoke 20/20 bit-exact 20/20 bit-exact
Kernel log no errors, no DART faults same
Median call latency 0.034 ms 0.045 ms

On the strength of this, 11.31 enables the ANE on the M1 and M1 Pro. It also enables it on the M2 Pro, which shares the M2 Max's die-0 ANE. The M2 Pro hasn't run it yet; Wesley Grimes (J416s) is going to try it with the firmware. None of this measured power draw directly. It shows the domains switching off and the engine coming back correctly after every cycle.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i

The ANE node, its DARTs, its mailbox and the power states only it uses
are disabled on the M1 (T8103), the M1 Pro (T6000) and the M2 Pro
(T6020) behind APPLE_ANE_UNTESTED, because the driver had run only on
the M1 Max and the M2 Max. It has now run with this tree's own driver
on all three. Each chip has a passing row in the public community
dataset (promotion_check --remote: judged, driver_source=intree, 20
smoke calls that match the golden bit for bit, no ANE, DART or mailbox
fault):

  M1 (T8103)      row 3559e0f328ba
  M1 Pro (T6000)  row 6eb94f49985b
  M2 Pro (T6020)  row 3c9389040f51

Remove the define from t6000.dtsi, t6020.dtsi and t8103.dtsi. No file
defines it after this, so also remove the #ifndef APPLE_ANE_UNTESTED
guards in t6001.dtsi, t6021.dtsi and t8103.dtsi, and correct the
comments that said the ANE had not run on the M1 Pro and the M2 Pro.

The ANE is now enabled on the t8103 boards (j274, j293, j313, j456,
j457), the t6000 boards (j314s, j316s) and the t6020 boards (j414s,
j416s, j474s). The DTBs of the t6001, t6002, t6021, t6022 and t8112
boards do not change: t6002.dtsi and t6022.dtsi include neither
t6001.dtsi nor t6021.dtsi, so the ANE stays disabled on the M1 Ultra
(T6002), the M2 Ultra (T6022) and the M2 (T8112).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Three chips have judged passing in-tree community rows in the public dataset, so this branch now enables them: efe6e35 removes APPLE_ANE_UNTESTED from t8103.dtsi, t6000.dtsi and t6020.dtsi.

Chip Machine Row Result
t8103 M1 3559e0f328ba driver_source=intree, 20/20 bit-exact smoke calls, no ANE/DART/mailbox fault
t6000 M1 Pro 6eb94f49985b same
t6020 M2 Pro 3c9389040f51 same
  • DTBs that change (checked with dtbs_check on 23 boards, findings identical to base): t8103-j274/j293/j313/j456/j457, t6000-j314s/j316s and t6020-j414s/j416s/j474s. The ANE, its three DARTs and its power states go from disabled to okay (t6020 also gets its mailbox).
  • DTBs that do not change: t6001, t6021 (already on), t6002 (M1 Ultra), t6022 (M2 Ultra) and t8112 (M2). The ANE stays off on those.
  • Row source: promotion_check.py --remote in omarchy-ane, one passing row per chip.

@RyanTheTide
RyanTheTide merged commit 9e9e1b8 into aurora-silicon:aurora-wip Oct 8, 2026
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
Preserve the original review commits and retain subsequent published repairs where superseded.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
Preserve the original review commits and retain subsequent published repairs where superseded.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
Preserve the original review commits and retain subsequent published repairs where superseded.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
[follow-up to #155] accel/ane: retain live firmware buffers and EXEC references

Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
[depends on #155] arm64: apple: describe the disabled T8140 Neural Engine topology

Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide pushed a commit that referenced this pull request Oct 17, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 17, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 17, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 17, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 18, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 18, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 18, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 18, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 18, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
RyanTheTide pushed a commit that referenced this pull request Oct 19, 2026
Build the in-tree ANE driver (#155) as modules: ane
for the M1 family and ane_t6021 for the M2 family. It needs the DRM
accel core, which the release config already enables; name it here too
so the fragment matches the config the packages are built with.

Signed-off-by: Chris Kearney <chris@kearneymail.com>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
(cherry picked from commit 70d9fa1)
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.

3 participants