Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
42e94c2
dt-bindings: mailbox: apple,mailbox: Allow the ANE mailbox variant
joshuaswarren Oct 2, 2026
5e51767
soc: apple: mailbox: Make the send-empty IRQ optional (poll TX)
joshuaswarren Oct 2, 2026
88af787
dt-bindings: npu: apple,ane: Add the Apple Neural Engine
joshuaswarren Oct 2, 2026
7a18e9d
dt-bindings: mailbox: apple,mailbox: Add the T8112 ANE mailbox
joshuaswarren Oct 2, 2026
35a0882
accel/ane: Add the Apple Neural Engine driver
joshuaswarren Oct 2, 2026
f790ae9
arm64: dts: apple: t8103: Add the ANE, its DARTs and power states
joshuaswarren Oct 2, 2026
148d9ac
arm64: dts: apple: t600x: Add the die 0 ANE, its DARTs and power states
joshuaswarren Oct 2, 2026
534ae22
arm64: dts: apple: t602x: Add the die 0 ANE
joshuaswarren Oct 2, 2026
aa12551
arm64: dts: apple: t8112: Add the ANE, disabled
joshuaswarren Oct 2, 2026
b74fa4d
accel/ane: Bind only the M1 family in the ane module
joshuaswarren Oct 2, 2026
cfb77b6
accel/ane: Clean up the UAPI and add DRM_IOCTL_ANE_GET_CAPS
joshuaswarren Oct 2, 2026
332e297
accel/ane: Parenthesize the register macro arguments
joshuaswarren Oct 2, 2026
52d07a5
accel/ane: Comment the memory barriers and the mutexes
joshuaswarren Oct 2, 2026
ee1732f
accel/ane: Use kzalloc_obj()
joshuaswarren Oct 2, 2026
ef85342
accel/ane: Fix the remaining coding style issues
joshuaswarren Oct 2, 2026
2cdb92d
accel/ane: Declare the M2 ANE firmware files
joshuaswarren Oct 2, 2026
b5e8553
accel/ane: Add the ane_stats counters and ane_timeline
joshuaswarren Oct 2, 2026
59823d3
arm64: dts: apple: t600x: drop the ANE set5 power state
Oct 2, 2026
cf7a897
arm64: dts: apple: enable the ANE only on the M1 Max and M2 Max
Oct 2, 2026
679d820
arm64: dts: apple: t8112: disable the ANE power states with the ANE
Oct 2, 2026
e987e57
accel/ane: t6021: stop logging boot progress at emergency level
Oct 2, 2026
4e315c4
accel/ane: t6021: keep one MODULE_LICENSE and MODULE_DESCRIPTION
Oct 2, 2026
f227145
accel/ane: Log register and address tracing at debug level
joshuaswarren Oct 2, 2026
0a8b54f
accel/ane: Power the ANE off when it is idle
joshuaswarren Oct 3, 2026
3631665
accel/ane: Map a buffer object with one DART TLB sync
joshuaswarren Oct 3, 2026
efe6e35
arm64: dts: apple: enable the ANE on t8103, t6000 and t6020
joshuaswarren Oct 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Documentation/ABI/testing/sysfs-class-accel-ane
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
What: /sys/class/accel/accel<idx>/device/ane_stats
Date: October 2026
KernelVersion: 7.1
Contact: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Description:
Cumulative Apple Neural Engine (ANE) producer counters for
this device, one ASCII "key value" pair per line, mode
0444 (readable without root):

busy_ns: nanoseconds the engine was busy since the
device was bound, sampled with a consistent
close/open snapshot. A busy period opens
when the first submission lands on an idle
engine and closes when the last one
completes; its whole span folds once at
close, and overlapping submissions share
the period, so a serialized engine
(ane.ko, behind engine_lock) reports
sum(end - start) and a parallel engine
(ane_t6021) reports the union, never the
sum. The show callback adds the live tail
of the still-open period, so the value
advances while engine work is in flight.

jobs: completed engine submissions since the
device was bound. On ane.ko every ANE_SUBMIT
counts (one per libane ane_exec, N per
ane_exec_loop). On ane_t6021 only
CSNE_CMD_PROCEDURE_CALL counts (one per
engine PROCEDURE_CALL); the control-plane
exchanges that ride the same path
(LOAD_PROGRAM, CREATE_PROCESS,
CH_PROPERTY_WRITE, install-time CONFIG_GET)
and the boot transport are not engine
work and are not counted. A submission
that completes with an error still
completes its begin/complete pair, so the
counter stays balanced.

Neither counter resets while the device is bound.

The file exists only when the module parameter
ane.stats / ane_t6021.stats (default 1) is set at
probe. With stats=0 the driver creates no stats files
and the submission hot path skips the counters.

Users: performance samplers that compute engine utilization
and job rate from the two counters.


47 changes: 43 additions & 4 deletions Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ properties:
- apple,t6020-asc-mailbox
- const: apple,asc-mailbox-v4

- description:
The T6021 and T8112 ANE coprocessor mailboxes are ASC mailboxes.
Only their recv-not-empty interrupt is known.
items:
- enum:
- apple,t6021-ane-mailbox
- apple,t8112-ane-mailbox
- const: apple,asc-mailbox-v4

- description:
AOP setup-port mailbox with a separate register layout.
const: apple,t8140-aop-setup-mailbox
Expand All @@ -62,11 +71,11 @@ properties:
maxItems: 1

interrupts:
minItems: 2
minItems: 1
maxItems: 4

interrupt-names:
minItems: 2
minItems: 1
maxItems: 4

iommus:
Expand Down Expand Up @@ -95,6 +104,7 @@ allOf:
then:
properties:
interrupts:
minItems: 2
maxItems: 2
interrupt-names:
items:
Expand All @@ -104,6 +114,37 @@ allOf:
- iommus
- apple,dma-range
else:
properties:
iommus: false
apple,dma-range: false

- if:
properties:
compatible:
contains:
enum:
- apple,t6021-ane-mailbox
- apple,t8112-ane-mailbox
then:
properties:
interrupt-names:
minItems: 1
items:
- const: recv-not-empty
- const: send-empty
- const: send-not-empty
- const: recv-empty

- if:
properties:
compatible:
not:
contains:
enum:
- apple,t6021-ane-mailbox
- apple,t8112-ane-mailbox
- apple,t8140-aop-setup-mailbox
then:
properties:
interrupts:
minItems: 4
Expand All @@ -113,8 +154,6 @@ allOf:
- const: send-not-empty
- const: recv-empty
- const: recv-not-empty
iommus: false
apple,dma-range: false

required:
- compatible
Expand Down
198 changes: 198 additions & 0 deletions Documentation/devicetree/bindings/npu/apple,ane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/npu/apple,ane.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple Neural Engine

maintainers:
- Joshua Warren <816217+joshuaswarren@users.noreply.github.com>

description:
The Apple Neural Engine (ANE) is the neural network accelerator of Apple
SoCs. It accesses memory through three DARTs. On T8103 and T6000 the host
drives the engine through its register window. On T602x and T8112 a
coprocessor runs the ANE firmware and the host talks to it through an ASC
mailbox.

properties:
compatible:
enum:
- apple,t8103-ane
- apple,t6000-ane
- apple,t6020-ane
- apple,t6021-ane
- apple,t6022-ane
- apple,t8112-ane

reg:
minItems: 1
items:
- description: Engine registers. On T602x and T8112 this is the whole
ANE block, including the coprocessor.
- description: Power manager (PMGR) registers of the ANE
- description: ANE power state registers in the PMGR
- description: eFuse words that give the SoC revision to the ANE
firmware

reg-names:
minItems: 1
items:
- const: engine
- const: pmgr
- const: set
- const: fuse

interrupts:
maxItems: 1

interrupt-names:
items:
- const: ane

iommus:
maxItems: 3

power-domains:
description:
The power states the engine needs, five on T8103 and T6000, eight on
T602x and seven on T8112.
minItems: 5
maxItems: 8

resets:
maxItems: 1
description: Reset of the ANE coprocessor

mboxes:
maxItems: 1
description: Mailbox of the ANE coprocessor

memory-region:
maxItems: 1
description:
IOVA-only reservation of the firmware entry alias in the ANE DART
address space.

required:
- compatible
- reg
- reg-names
- interrupts
- interrupt-names
- iommus
- power-domains

allOf:
- if:
properties:
compatible:
contains:
enum:
- apple,t8103-ane
- apple,t6000-ane
then:
properties:
reg:
maxItems: 1
reg-names:
maxItems: 1
power-domains:
maxItems: 5
resets: false
mboxes: false
memory-region: false

- if:
properties:
compatible:
contains:
enum:
- apple,t6020-ane
- apple,t6021-ane
- apple,t6022-ane
then:
properties:
reg:
minItems: 3
maxItems: 3
reg-names:
minItems: 3
maxItems: 3
power-domains:
minItems: 8
required:
- resets
- mboxes
- memory-region

- if:
properties:
compatible:
contains:
const: apple,t8112-ane
then:
properties:
reg:
minItems: 4
reg-names:
minItems: 4
power-domains:
minItems: 7
maxItems: 7
resets: false
memory-region: false
required:
- mboxes

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>

soc {
#address-cells = <2>;
#size-cells = <2>;

ane@26bc04000 {
compatible = "apple,t8103-ane";
reg = <0x2 0x6bc04000 0x0 0x24000>;
reg-names = "engine";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 416 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "ane";
iommus = <&ane_dart0 0>, <&ane_dart1 0>, <&ane_dart2 0>;
power-domains = <&ps_ane_set1>, <&ps_ane_set2>,
<&ps_ane_set3>, <&ps_ane_set4>, <&ps_ane_set5>;
};
};

- |
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>

soc {
#address-cells = <2>;
#size-cells = <2>;

ane@284000000 {
compatible = "apple,t6021-ane";
reg = <0x2 0x84000000 0x0 0x2000000>,
<0x2 0x8e080000 0x0 0x4034>,
<0x2 0x8e08c000 0x0 0x4000>;
reg-names = "engine", "pmgr", "set";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 884 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "ane";
iommus = <&ane_dart0 0>, <&ane_dart1 0>, <&ane_dart2 0>;
power-domains = <&ps_ane_sys_mpm>, <&ps_ane_td>,
<&ps_ane_base>, <&ps_ane_set1>, <&ps_ane_set2>,
<&ps_ane_set3>, <&ps_ane_set4>, <&ps_ane_cpu>;
resets = <&ps_ane_cpu>;
mboxes = <&ane_mbox>;
memory-region = <&ane_alias_iova>;
};
};
11 changes: 11 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2570,6 +2570,7 @@ F: Documentation/devicetree/bindings/leds/backlight/apple,dwi-bl.yaml
F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
F: Documentation/devicetree/bindings/mfd/apple,smc.yaml
F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml
F: Documentation/devicetree/bindings/npu/apple,ane.yaml
F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml
F: Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml
Expand Down Expand Up @@ -7897,6 +7898,16 @@ S: Maintained
F: drivers/soc/ti/smartreflex.c
F: include/linux/power/smartreflex.h

DRM ACCEL DRIVER FOR APPLE NEURAL ENGINE
M: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
L: asahi@lists.linux.dev
L: dri-devel@lists.freedesktop.org
S: Maintained
F: Documentation/ABI/testing/sysfs-class-accel-ane
F: Documentation/devicetree/bindings/npu/apple,ane.yaml
F: drivers/accel/ane/
F: include/uapi/drm/ane_accel.h

DRM ACCEL DRIVERS FOR INTEL VPU
M: Maciej Falkowski <maciej.falkowski@linux.intel.com>
M: Karol Wachowski <karol.wachowski@linux.intel.com>
Expand Down
Loading