Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
117 changes: 96 additions & 21 deletions Documentation/devicetree/bindings/npu/apple,ane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ description:
its CPU, MPM and task domains depend on the ANE system domain, and its
base domain depends on the task domain. T6050 follows the T8140 model,
with five DAPF ranges. Interrupt roles on T6041, T6050 and T8140 are not
yet established.
yet established. T8132 has a single H16 engine, two interrupts, six
register windows (no second-engine aux-3), and five DAPF records. Its
virtual ANE-SYS-V gate resolves to the ANE system domain; ANE-SYS-V-PMP
is a firmware notification gate with no physical PMGR power state.

properties:
compatible:
Expand All @@ -34,6 +37,7 @@ properties:
- apple,t6041-ane
- apple,t6050-ane
- apple,t8112-ane
- apple,t8132-ane
- apple,t8140-ane
- apple,t8142-ane
- items:
Expand Down Expand Up @@ -97,8 +101,9 @@ properties:
description:
The power states the engine needs, five on T8103, six on T6000 with
ANE level control (including PMP report SRAM), eight on
T602x, seven on T8112 and one system domain on T8140. T6041 may add
a sixth, "perf", a performance floor (such as the SoC rail floor)
T602x, seven on T8112, five on T6041 and T8132 (system, CPU, MPM, TD
and base) and one system domain on T8140.
T6041 may add a sixth, "perf", a performance floor (such as the SoC rail floor)
that the driver holds only while requests are in flight.
minItems: 1
maxItems: 8
Expand All @@ -120,8 +125,8 @@ properties:
maxItems: 2
description:
On T602x, the IOVA-only reservation of the firmware entry alias.
On T6041, T6050 and T8140, bootloader-provided physical TEXT and DATA preload
reservations in that order. Each reservation must have no-map, must
On T6041, T6050, T8132 and T8140, bootloader-provided physical TEXT
and DATA preload reservations in that order. Each reservation must have no-map, must
not be reusable, and must remain reserved until reboot. Physical
addresses vary per boot and must not be hard-coded in a board DTS.

Expand Down Expand Up @@ -150,8 +155,8 @@ properties:
- description: Physical start address, inclusive
- description: Physical end address, inclusive
description:
Four (five on T6050) DART address protection filter (DAPF) ranges, in
hardware record order. Each pair contains inclusive 64-bit physical
Four (five on T6050 and T8132) 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,
Expand All @@ -170,7 +175,7 @@ properties:

apple,ane-type:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0x110, 0x200]
enum: [0x100, 0x110, 0x200]
description: Firmware generation identifier supplied by the bootloader

apple,firmware-preloaded:
Expand Down Expand Up @@ -277,6 +282,7 @@ allOf:
enum:
- apple,t6041-ane
- apple,t6050-ane
- apple,t8132-ane
- apple,t8140-ane
- apple,t8142-ane
required:
Expand Down Expand Up @@ -330,6 +336,36 @@ allOf:
- apple,ane-type
- apple,firmware-preloaded
- apple,dapf-ranges
- if:
properties:
compatible:
const: apple,t8132-ane
then:
properties:
interrupts:
minItems: 2
reg:
minItems: 6
maxItems: 6
reg-names:
items:
- const: engine
- const: pmgr
- const: aux-0
- const: aux-1
- const: aux-2
- const: aux-4
power-domains:
minItems: 5
maxItems: 5
apple,ane-type:
const: 0x100
apple,dapf-ranges:
minItems: 5
required:
- apple,ane-type
- apple,firmware-preloaded
- apple,dapf-ranges
- if:
properties:
compatible:
Expand All @@ -353,6 +389,7 @@ allOf:
- apple,t6041-ane
- apple,t6050-ane
- apple,t8142-ane
- apple,t8132-ane
then:
properties:
interrupt-names: false
Expand Down Expand Up @@ -448,14 +485,16 @@ allOf:
- if:
properties:
compatible:
contains:
enum:
- apple,t8140-ane
- apple,t6041-ane
- apple,t6050-ane
- apple,t6001-ane
- apple,t8142-ane
else:
not:
contains:
enum:
- apple,t8140-ane
- apple,t6041-ane
- apple,t6050-ane
- apple,t8132-ane
- apple,t6001-ane
- apple,t8142-ane
then:
properties:
power-domains:
minItems: 5
Expand All @@ -477,11 +516,12 @@ allOf:
- if:
properties:
compatible:
contains:
enum:
- apple,t6001-ane
- apple,t6050-ane
else:
not:
contains:
enum:
- apple,t6001-ane
- apple,t6050-ane
then:
properties:
clocks: false

Expand Down Expand Up @@ -599,3 +639,38 @@ examples:
status = "disabled";
};
};

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

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

ane@500000000 {
compatible = "apple,t8132-ane";
reg = <0x5 0x00000000 0x0 0x2000000>,
<0x3 0x80700000 0x0 0x18000>,
<0x3 0x80724000 0x0 0x4000>,
<0x3 0x803c0000 0x0 0x30000>,
<0x2 0x11000000 0x0 0xff4000>,
<0x3 0x882c8000 0x0 0x4000>;
reg-names = "engine", "pmgr", "aux-0", "aux-1", "aux-2", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 629 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 642 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 = <0x100>;
apple,firmware-preloaded;
apple,dapf-ranges = /bits/ 64 <0x48d668000 0x48d668003>,
/bits/ 64 <0x38070c000 0x38070c01b>,
/bits/ 64 <0x380700570 0x380700573>,
/bits/ 64 <0x3807273cc 0x3807273cf>,
/bits/ 64 <0x302668000 0x302668003>;
apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>;
status = "disabled";
};
};
10 changes: 5 additions & 5 deletions arch/arm64/boot/dts/apple/t8132-j713-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
};

&ps_ane_sys {
status = "disabled";
status = "okay";
};

&ps_jpg {
Expand Down Expand Up @@ -517,19 +517,19 @@
};

&ps_ane_mpm {
status = "disabled";
status = "okay";
};

&ps_ane_cpu {
status = "disabled";
status = "okay";
};

&ps_ane_td {
status = "disabled";
status = "okay";
};

&ps_ane_base {
status = "disabled";
status = "okay";
};

&ps_disp_cpu {
Expand Down
16 changes: 16 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713.dts
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,19 @@
phys = <&atcphy1 PHY_TYPE_USB3>;
phy-names = "cio";
};

&ane_dart0 {
status = "okay";
};

&ane_dart1 {
status = "okay";
};

&ane_dart2 {
status = "okay";
};

&ane {
status = "okay";
};
68 changes: 68 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,40 @@
status = "disabled";
};

ane_dart0: iommu@501800000 {
compatible = "apple,t8132-dart", "apple,t8110-dart";
reg = <0x5 0x01800000 0x0 0xc000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 630 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
/* Include firmware identity MMIO pages below the preload DVAs. */
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

ane_dart1: iommu@501820000 {
compatible = "apple,t8132-dart", "apple,t8110-dart";
reg = <0x5 0x01820000 0x0 0xc000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 630 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

ane_dart2: iommu@501840000 {
compatible = "apple,t8132-dart", "apple,t8110-dart";
reg = <0x5 0x01840000 0x0 0xc000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 630 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
apple,dma-range = <0x0 0x0 0x400 0x0>;
status = "disabled";
};

dart_ane_companion3: filter@501810000 {
compatible = "apple,t8132-dapf", "apple,dapf";
reg = <0x5 0x01810000 0x0 0x4000>;
Expand Down Expand Up @@ -309,6 +343,40 @@
status = "disabled";
};

/*
* ADT-derived only: keep disabled until an M4 owner qualifies the H16
* backend and the loader hands off reserved TEXT/DATA preloads.
*/
ane: ane@500000000 {
compatible = "apple,t8132-ane";
reg = <0x5 0x00000000 0x0 0x2000000>,
<0x3 0x80700000 0x0 0x18000>,
<0x3 0x80724000 0x0 0x4000>,
<0x3 0x803c0000 0x0 0x30000>,
<0x2 0x11000000 0x0 0xff4000>,
<0x3 0x882c8000 0x0 0x4000>;
/* There is no second-engine aux-3 window on T8132. */
reg-names = "engine", "pmgr", "aux-0", "aux-1", "aux-2", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 629 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 642 IRQ_TYPE_LEVEL_HIGH>;
iommus = <&ane_dart0 0>, <&ane_dart1 0>, <&ane_dart2 0>;
/* The T6041 order: ANE_SYS, then the CPU, MPM, TD and base. */
power-domains = <&ps_ane_sys>, <&ps_ane_cpu>, <&ps_ane_mpm>,
<&ps_ane_td>, <&ps_ane_base>;
apple,ane-type = <0x100>;
apple,firmware-preloaded;
/* ADT dapf-instance-0: inclusive CPU addresses, in record order. */
apple,dapf-ranges = /bits/ 64 <0x48d668000 0x48d668003>,
/bits/ 64 <0x38070c000 0x38070c01b>,
/bits/ 64 <0x380700570 0x380700573>,
/bits/ 64 <0x3807273cc 0x3807273cf>,
/bits/ 64 <0x302668000 0x302668003>;
/* Default layout; the loader supplies per-boot physical reservations. */
apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>;
status = "disabled";
};

scaler0: scaler@505000000 {
compatible = "apple,t8132-scaler", "apple,scaler";
reg = <0x5 0x05000000 0x0 0x38000>,
Expand Down
2 changes: 1 addition & 1 deletion drivers/accel/ane/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config DRM_ACCEL_ANE
Choose this option if you have an Apple SoC with a Neural Engine:
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 (A18 Pro) are recognized for firmware preflight
H16 (M4 and M4 Pro) and H17 (A18 Pro) are recognized for firmware preflight
and ownership refusal by default. A bound H16 device stays idle until
a bring-up stage is written to its debugfs control file. H17 has a
staged cold-boot backend that requires loader ownership evidence and
Expand Down
3 changes: 1 addition & 2 deletions drivers/accel/ane/ane_fw_cold.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
#ifndef __ANE_FW_COLD_H__
#define __ANE_FW_COLD_H__

#include "ane_fw_platform.h"
#include "ane_fw_transport.h"

#define ANE_FW_DARTS 3
/* DAPF records: four on T8140, five on T6050. */
#define ANE_FW_DAPF_MAX 5

struct ane_fw_cold_state {
u32 sys, cpu, subblock, gate_request, gate_ack;
Expand Down
Loading
Loading