Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4700e91
accel/ane: prepare H16 UUID submission and validate original HWX
RyanTheTide Oct 31, 2026
49e4eef
accel/ane: validate H16 preload identity and plan private load resources
RyanTheTide Oct 31, 2026
a371a27
Merge accepted H16 execute dependency ancestry
RyanTheTide Oct 31, 2026
39e9085
dt-bindings: npu: apple,ane: describe DAPF ranges
RyanTheTide Oct 31, 2026
7d68969
arm64: dts: apple: describe T6040 ANE cold-boot mappings
RyanTheTide Oct 31, 2026
ab45a5d
arm64: dts: apple: add J616s ANE test tree
RyanTheTide Oct 31, 2026
0a3bdfc
accel/ane: add shared H16/H17 firmware ring transport
RyanTheTide Oct 31, 2026
e7b895d
arm64: dts: apple: retain J616s tether setup in ANE test tree
RyanTheTide Oct 31, 2026
4a08e30
accel/ane: resolve H16 resource authority from the program contract
RyanTheTide Oct 31, 2026
8f9cd9c
fixup! accel/ane: add shared H16/H17 firmware ring transport
RyanTheTide Oct 31, 2026
6db2f7f
Merge H16 test DT dependency
RyanTheTide Oct 31, 2026
2464a17
Merge H16 preload validation dependency
RyanTheTide Oct 31, 2026
004d39b
accel/ane: add staged H16 cold boot diagnostics
RyanTheTide Oct 31, 2026
e8f8e90
accel/ane: cover H16 management and failure paths
RyanTheTide Oct 31, 2026
a9a995f
accel/ane: acknowledge H16 native allocation release
RyanTheTide Oct 31, 2026
ac7d36f
accel/ane: log H16 power-prefix and refusal checkpoints
RyanTheTide Oct 31, 2026
0f0ac98
Merge H16 cold-boot stack (ane/h16-cold-boot, #720)
RyanTheTide Oct 31, 2026
121a89e
Merge shared transport fixup (ane/fw-transport, #706)
RyanTheTide Oct 31, 2026
15b6b3d
accel/ane: give the H16 HWX test fixture the task prologue
RyanTheTide Oct 31, 2026
f3b22a5
accel/ane: index H16 EXECUTE resources within their class
RyanTheTide Oct 31, 2026
6dc2bf3
accel/ane: add the H16 program load, execute and teardown sequence
RyanTheTide Oct 31, 2026
7a99542
accel/ane: add the H16 program stage and its ABI 3 accel node
RyanTheTide Oct 31, 2026
789c072
selftests: drivers/ane: run the pinned H16 add-128 program twice
RyanTheTide Oct 31, 2026
6f2e564
accel/ane: stage H16 bring-up from debugfs and accept loader-describe…
RyanTheTide Oct 31, 2026
373104b
accel/ane: name H16 EXECUTE buffers by their generic section IDs
RyanTheTide Oct 31, 2026
e5916ae
arm64: dts: apple: t6040: keep all ANE DAPF ranges 64 bit
RyanTheTide Oct 31, 2026
644e5f0
accel/ane: choose the H16 firmware build from a profile table
RyanTheTide Nov 1, 2026
aeba177
accel/ane: pair H16 HWX tensors with their surfaces by name
RyanTheTide Nov 1, 2026
46b9e4d
selftests: drivers/ane: build the H16 LOAD sections from the HWX
RyanTheTide Nov 1, 2026
d88f4e5
accel/ane: load the pinned add-128 program in the H16 KUnit suite
RyanTheTide Nov 1, 2026
80274a9
accel/ane: reuse the H16 command arena after each completed request
RyanTheTide Nov 1, 2026
49bafc7
dt-bindings: npu: apple,ane: give the T6041 ANE stream 0 only
RyanTheTide Nov 1, 2026
cac97f0
arm64: dts: apple: t6040: describe the ANE power states and stream 0
RyanTheTide Nov 1, 2026
f4500c6
Merge aurora-wip into the H16 first-inference branch
RyanTheTide Nov 1, 2026
a9ac98d
accel/ane: add the H16 26.6.2 (25G83) firmware profile
RyanTheTide Nov 1, 2026
0764969
accel/ane: put the H16 DART and DAPF registers in a per-revision table
RyanTheTide Nov 1, 2026
4063481
accel/ane: write the T6041 ANE DAPF bank at map
RyanTheTide Nov 1, 2026
992dbda
accel/ane: let the H16 accel node open
RyanTheTide Nov 1, 2026
f678f4c
accel/ane: let the last H16 task end the task stream
RyanTheTide Nov 1, 2026
da30e77
accel/ane: run linked H16 programs and load them one after another
RyanTheTide Nov 1, 2026
78e6907
Merge aurora-wip 757fc07a into ane/h16-first-inference
RyanTheTide Nov 1, 2026
7040ae9
accel/ane: map the H16 firmware heap tail before boot
RyanTheTide Nov 1, 2026
df11bfb
accel/ane: queue the first H16 EXECUTE of every program, boot included
RyanTheTide Nov 1, 2026
916532b
accel/ane: describe whole H16 surface sections and print the firmware…
RyanTheTide Nov 1, 2026
085586e
accel/ane: bring the H16 engine up at probe when the loader handed of…
RyanTheTide Nov 1, 2026
a53bbd9
arm64: dts: apple: t6040-j616s: enable the ANE
RyanTheTide Nov 1, 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
395 changes: 376 additions & 19 deletions Documentation/accel/apple-ane.rst

Large diffs are not rendered by default.

71 changes: 61 additions & 10 deletions Documentation/devicetree/bindings/npu/apple,ane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ properties:

iommus:
description:
Stream 0 of each of the three DARTs, followed on T6041 by stream 11 of
each, which the ANE's MPM uses.
Stream 0 of each of the three DARTs. On T6041 the ANE's MPM also uses
stream 11 of each DART; the firmware drives that stream itself and it
is not described here.
minItems: 3
maxItems: 6
maxItems: 3

power-domains:
description:
Expand Down Expand Up @@ -119,7 +120,24 @@ properties:
description:
Device addresses of the preloaded TEXT and DATA segments. Their sizes
are 0xc0000 and 0x2ac000 bytes respectively. The bootloader supplies
this property together with the physical reservations.
the physical reservations. The device addresses are fixed by the
firmware layout and may be described statically.

apple,dapf-ranges:
$ref: /schemas/types.yaml#/definitions/uint64-matrix
minItems: 4
maxItems: 4
items:
items:
- description: Physical start address, inclusive
- description: Physical end address, inclusive
description:
Four DART address protection filter (DAPF) ranges, in hardware record
order. Each pair contains inclusive 64-bit physical bounds, not a
base and length. The same records apply to all three ANE DARTs.
Firmware accesses these registers through identity mappings of the
containing 16 KiB pages in its private domain. These are MMIO ranges,
not allocatable DMA memory or additional preload segments.

apple,ane-type:
$ref: /schemas/types.yaml#/definitions/uint32
Expand Down Expand Up @@ -243,8 +261,6 @@ allOf:
- const: aux-2
- const: aux-3
- const: aux-4
iommus:
minItems: 6
power-domains:
minItems: 5
maxItems: 5
Expand All @@ -253,10 +269,7 @@ allOf:
required:
- apple,ane-type
- apple,firmware-preloaded
else:
properties:
iommus:
maxItems: 3
- apple,dapf-ranges
- if:
properties:
compatible:
Expand Down Expand Up @@ -293,6 +306,7 @@ allOf:
apple,ane-type: false
apple,firmware-preloaded: false
apple,exclave-assigned: false
apple,dapf-ranges: false
required:
- interrupt-names

Expand Down Expand Up @@ -428,3 +442,40 @@ examples:
memory-region = <&ane_alias_iova>;
};
};

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

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

ane@484000000 {
compatible = "apple,t6041-ane";
reg = <0x4 0x84000000 0x0 0x2000000>,
<0x5 0x02280000 0x0 0x18000>,
<0x5 0x022a0000 0x0 0x4000>,
<0x5 0x003c0000 0x0 0x30000>,
<0x2 0x12000000 0x0 0xff4000>,
<0x5 0x22000000 0x0 0x2000000>,
<0x5 0x08374000 0x0 0x4000>;
reg-names = "engine", "pmgr", "aux-0", "aux-1", "aux-2",
"aux-3", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1054 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&ane_dart0 0>, <&ane_dart1 0>, <&ane_dart2 0>;
power-domains = <&ps_ane_sys>, <&ps_ane_cpu>, <&ps_ane_mpm>,
<&ps_ane_td>, <&ps_ane_base>;
apple,ane-type = <0x110>;
apple,firmware-preloaded;
apple,dapf-ranges = /bits/ 64 <0x5022803c0 0x5022803c3>,
/bits/ 64 <0x50228c000 0x50228c01b>,
/bits/ 64 <0x581668000 0x581668003>,
/bits/ 64 <0x28a668000 0x28a668003>;
memory-region = <&ane_fw_text>, <&ane_fw_data>;
memory-region-names = "firmware-text", "firmware-data";
apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>;
status = "disabled";
};
};
43 changes: 43 additions & 0 deletions arch/arm64/boot/dts/apple/t6040-j616s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@
ranges;
/* The loader adds its own reservations */

/*
* The loader must fill reg from ane0 segment-ranges, rename each
* node to match its physical address and enable it. Leave these
* disabled until then; allocating replacement memory would lose
* the personalized preload. TEXT is 0xc0000 bytes and DATA is
* 0x2ac000 bytes. Neither segment may be reclaimed before reboot.
*/
ane_fw_text: ane-firmware-text@0 {
compatible = "apple,asc-mem";
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

ane_fw_data: ane-firmware-data@0 {
compatible = "apple,asc-mem";
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

/*
* iBoot loads the ISP firmware below the kernel's memory. Its
* segments are the ADT's isp0 segment-ranges (macOS 26.6.2,
Expand Down Expand Up @@ -4730,3 +4751,25 @@

#undef J616S_DELETE_FAN_TRIPS
#undef J616S_DELETE_FAN_MAPS

/*
* Proven on the J616s (MobileNetV1 top-1 16/16). The ANE stays idle until
* the loader fills and enables the two preload reservations above.
*/
&ane0_dart0 {
status = "okay";
};

&ane0_dart1 {
status = "okay";
};

&ane0_dart2 {
status = "okay";
};

&ane {
memory-region = <&ane_fw_text>, <&ane_fw_data>;
memory-region-names = "firmware-text", "firmware-data";
status = "okay";
};
7 changes: 0 additions & 7 deletions arch/arm64/boot/dts/apple/t6040-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@
label = "fab4_soc";
power-domains = <&ps_afc>;
apple,always-on;
status = "disabled";
};

ps_sio_cpu: power-controller@130 {
Expand Down Expand Up @@ -1057,7 +1056,6 @@
#reset-cells = <0>;
label = "ane_sys";
power-domains = <&ps_fab5_soc>, <&ps_fab4_soc>;
status = "disabled";
};

};
Expand Down Expand Up @@ -1835,7 +1833,6 @@
label = "fab5_soc";
power-domains = <&ps_afi>;
apple,always-on;
status = "disabled";
};

ps_sbr: power-controller@448 {
Expand Down Expand Up @@ -1949,7 +1946,6 @@
#reset-cells = <0>;
label = "ane_mpm";
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ps_ane_cpu: power-controller@8 {
Expand All @@ -1959,7 +1955,6 @@
#reset-cells = <0>;
label = "ane_cpu";
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ps_ane_td: power-controller@10 {
Expand All @@ -1969,7 +1964,6 @@
#reset-cells = <0>;
label = "ane_td";
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ps_ane_base: power-controller@18 {
Expand All @@ -1979,7 +1973,6 @@
#reset-cells = <0>;
label = "ane_base";
power-domains = <&ps_ane_td>;
status = "disabled";
};
};

Expand Down
29 changes: 22 additions & 7 deletions arch/arm64/boot/dts/apple/t6040.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2000,7 +2000,8 @@
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1055 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
apple,dma-range = <0x100 0x0 0x300 0x0>;
/* Include firmware identity MMIO pages below the preload DVAs. */
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

Expand All @@ -2011,7 +2012,8 @@
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1055 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
apple,dma-range = <0x100 0x0 0x300 0x0>;
/* Include firmware identity MMIO pages below the preload DVAs. */
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

Expand All @@ -2022,7 +2024,8 @@
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1055 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
apple,dma-range = <0x100 0x0 0x300 0x0>;
/* Include firmware identity MMIO pages below the preload DVAs. */
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

Expand Down Expand Up @@ -2251,7 +2254,12 @@
status = "disabled";
};

/* Firmware interface support is required before enabling the ANE. */
/*
* Disabled until the H16 firmware path is proven on hardware. The
* loader fills the preload reservations and the firmware IOVAs from
* the ADT, so enabling it then only takes status = "okay" here and on
* the three DARTs.
*/
ane: ane@484000000 {
compatible = "apple,t6041-ane";
reg = <0x4 0x84000000 0x0 0x2000000>,
Expand All @@ -2265,13 +2273,20 @@
"aux-3", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1054 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&ane0_dart0 0>, <&ane0_dart1 0>, <&ane0_dart2 0>,
<&ane0_dart0 11>, <&ane0_dart1 11>, <&ane0_dart2 11>;
/* Stream 0 only: the MPM stream 11 is not given to the host. */
iommus = <&ane0_dart0 0>, <&ane0_dart1 0>, <&ane0_dart2 0>;
power-domains = <&ps_ane_sys>, <&ps_ane_cpu>, <&ps_ane_mpm>,
<&ps_ane_td>, <&ps_ane_base>;
apple,ane-type = <0x110>;
apple,firmware-preloaded;
/* TEXT/DATA reservations and IOVAs must come from iBoot. */
/* Inclusive DAPF bounds, in hardware record order. */
apple,dapf-ranges = /bits/ 64 <0x5022803c0 0x5022803c3>,
/bits/ 64 <0x50228c000 0x50228c01b>,
/bits/ 64 <0x581668000 0x581668003>,
/bits/ 64 <0x28a668000 0x28a668003>;
/* Default firmware layout; the loader rewrites it from the ADT. */
apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>;
/* The bootloader supplies the physical TEXT/DATA reservations. */
status = "disabled";
};

Expand Down
14 changes: 10 additions & 4 deletions drivers/accel/ane/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ config DRM_ACCEL_ANE
M1 (T8103), M1 Pro, Max and Ultra (T6000, T6001, T6002), M2
(T8112), or M2 Pro, Max and Ultra (T6020, T6021, T6022).
H16 (M4 Pro) and H17 are recognized for firmware preflight and
ownership refusal only; execution support is not available.
ownership refusal by default. A bound H16 device stays idle until
a bring-up stage is written to its debugfs control file. The last
stage, program, adds an ABI 3 accel node that loads one original
HWX program per firmware boot. H17 inference is not available.

The interface exposed to userspace is described in
include/uapi/drm/ane_accel.h.
Expand Down Expand Up @@ -47,11 +50,14 @@ config DRM_ACCEL_ANE_FW_KUNIT_TEST
tristate "KUnit tests for ANE firmware validation" if !KUNIT_ALL_TESTS
depends on DRM_ACCEL && KUNIT
select DRM_ACCEL_ANE_H16_VALIDATION
select DRM_KUNIT_TEST_HELPERS
default KUNIT_ALL_TESTS
help
Check preload ranges, 27.x channel and reply validation, RTKit
management ordering, H16 HWX/resource bounds, UUID retirement and
the H14 firmware allocation and program lifetime without hardware.
Check preload identity/ranges, 27.x channel and reply validation,
RTKit management ordering, H16 HWX/resource bounds, UUID retirement,
shared transport and bounded allocation, staged H16 cold boot, the H16
program lifecycle, opening the H16 accel node, and the H14 firmware
allocation and program lifetime without hardware.
These tests can run on architectures other than Apple arm64.

If unsure, say N.
Expand Down
11 changes: 8 additions & 3 deletions drivers/accel/ane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

obj-$(CONFIG_DRM_ACCEL_ANE) += ane.o ane_t6021.o
obj-$(CONFIG_DRM_ACCEL_ANE_PM_KUNIT_TEST) += ane_pm_test.o ane_t6021_pm_test.o ane_fw_ids_test.o
obj-$(CONFIG_DRM_ACCEL_ANE_H16_VALIDATION) += ane_h16_hwx.o
obj-$(CONFIG_DRM_ACCEL_ANE_H16_VALIDATION) += ane_h16_hwx.o ane_h16_preload.o ane_h16_load.o \
ane_h16_program.o
obj-$(CONFIG_DRM_ACCEL_ANE_KUNIT_TEST) += ane_drv_test.o
obj-$(CONFIG_DRM_ACCEL_ANE_FW_KUNIT_TEST) += ane_fw_platform_test.o \
ane_fw_protocol_test.o ane_h16_tasks_test.o ane_h16_execute_test.o ane_h16_pending_test.o ane_h16_hwx_test.o \
ane_t6021_lifetime_test.o
ane_fw_protocol_test.o ane_h16_tasks_test.o ane_h16_execute_test.o \
ane_fw_transport_test.o ane_h16_boot_test.o \
ane_h16_pending_test.o ane_h16_hwx_test.o ane_h16_preload_test.o \
ane_h16_program_test.o ane_h16_accel_test.o ane_t6021_lifetime_test.o

ane-y := \
ane_drv.o \
Expand All @@ -17,6 +20,8 @@ ane-y := \

ane_t6021-y := \
ane_fw_platform.o \
ane_h16_backend.o \
ane_h16_accel.o \
ane_t6021_rtclient_main.o \
ane_t6021_fwload.o \
ane_t6021_boot.o
Loading