Skip to content
Merged
97 changes: 90 additions & 7 deletions Documentation/devicetree/bindings/npu/apple,ane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ description:
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. T8122
is a firmware notification gate with no physical PMGR power state.
The M3 generation (H15, that is T8122, T6030 and T6031, the T6031 engine also on
T6034 and on both dies of T6032) has an RTKit coprocessor behind an ASC
wrapper whose ASC mailbox is a separate node, one interrupt of its own,
the five ANE power domains and, after the engine and PMGR windows, the
auxiliary windows the hardware description lists for it, named after the
M4 windows of the same location and size. T8122
has a single H15 engine, one interrupt, three register windows (engine,
pmgr, aux-0), five ANE power domains, five DAPF records, and preloaded
firmware. On T8112 the boot loader may also hand over the firmware iBoot
Expand All @@ -40,6 +46,8 @@ properties:
- apple,t6020-ane
- apple,t6021-ane
- apple,t6022-ane
- apple,t6030-ane
- apple,t6031-ane
- apple,t6041-ane
- apple,t6050-ane
- apple,t8112-ane
Expand Down Expand Up @@ -116,7 +124,7 @@ 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, five on T6041 and T8132 (system, CPU, MPM, TD
T602x, seven on T8112, five on T6041, T8132 and H15 (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.
Expand Down Expand Up @@ -155,12 +163,13 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint64-array
items:
- enum: [0x800000000, 0x10000000000]
- enum: [0x8000d8000, 0x100000bc000, 0x100000c0000, 0x100000c8000]
- enum: [0x8000d8000, 0x100000b0000, 0x100000bc000, 0x100000c0000, 0x100000c8000]
description:
Device addresses of the preloaded TEXT and DATA segments. The bootloader
supplies the physical reservations. The device addresses are fixed by the
firmware layout (TEXT at 0x10000000000; DATA at 0x100000bc000 on T8132
27.2, 0x100000c0000 on H16/H17 26.x, or 0x100000c8000 on T8122 27.2;
firmware layout (TEXT at 0x10000000000; DATA at 0x100000b0000 on T6030
14.7, 0x100000bc000 on T8132 27.2, 0x100000c0000 on H16/H17 26.x, or
0x100000c8000 on T8122 27.2;
on T8112 27.2 TEXT at 0x800000000 and DATA at 0x8000d8000) and may be
described statically.

Expand Down Expand Up @@ -193,7 +202,7 @@ properties:

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

dma-coherent:
Expand Down Expand Up @@ -488,13 +497,14 @@ allOf:
- apple,t8122-ane
- apple,t8142-ane
- apple,t8132-ane
- apple,t6030-ane
- apple,t6031-ane
then:
properties:
interrupt-names: false
iommus:
minItems: 3
resets: false
mboxes: false
else:
properties:
interrupts:
Expand Down Expand Up @@ -525,6 +535,8 @@ allOf:
- apple,t8122-ane
- apple,t8142-ane
- apple,t8132-ane
- apple,t6030-ane
- apple,t6031-ane
then:
properties:
memory-region:
Expand All @@ -535,6 +547,77 @@ allOf:
apple,firmware-preloaded: false
apple,dapf-ranges: false

- if:
properties:
compatible:
contains:
enum:
- apple,t8140-ane
- apple,t6041-ane
- apple,t6050-ane
- apple,t8122-ane
- apple,t8142-ane
- apple,t8132-ane
then:
properties:
mboxes: false

- if:
properties:
compatible:
contains:
enum:
- apple,t6030-ane
- apple,t6031-ane
then:
properties:
reg:
minItems: 5
maxItems: 6
reg-names:
minItems: 5
maxItems: 6
items:
enum: [engine, pmgr, aux-0, aux-1, aux-2, aux-3, aux-4]
interrupts:
maxItems: 1
power-domains:
minItems: 5
maxItems: 5
memory-region: false
memory-region-names: false
apple,exclave-assigned: false
required:
- mboxes
- apple,ane-type
- apple,firmware-preloaded
- if:
properties:
compatible:
const: apple,t6030-ane
then:
properties:
reg:
minItems: 6
apple,ane-type:
const: 0xc0
apple,dapf-ranges:
minItems: 5
required:
- apple,dapf-ranges
- if:
properties:
compatible:
const: apple,t6031-ane
then:
properties:
reg:
minItems: 5
apple,ane-type:
const: 0xe0
apple,firmware-iovas: false
apple,dapf-ranges: false

- if:
properties:
compatible:
Expand Down
83 changes: 83 additions & 0 deletions arch/arm64/boot/dts/apple/t6030-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,89 @@
iommus = <&dart_apr0 1>, <&dart_apr1 1>;
};

ane_dart0: iommu@309800000 {
compatible = "apple,t6030-dart", "apple,t8110-dart";
reg = <0x3 0x09800000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 577 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ane_dart1: iommu@309810000 {
compatible = "apple,t6030-dart", "apple,t8110-dart";
reg = <0x3 0x09810000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 577 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ane_dart2: iommu@309820000 {
compatible = "apple,t6030-dart", "apple,t8110-dart";
reg = <0x3 0x09820000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 577 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

/*
* The ANE's ASC (ADT "iop,ascwrap-v6": engine + 0x1400000, 0x6c000) has
* its mailbox at the ASC + 0x8000, as on the SIO of the same wrapper
* revision. The ADT lists the four mailbox interrupts in the SIO's order.
*/
ane_mbox: mailbox@309408000 {
compatible = "apple,t6030-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x3 0x09408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 558 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 559 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 560 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 561 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
power-domains = <&ps_ane_cpu>;
status = "disabled";
};

/*
* H15 Neural Engine, ADT-derived only. The ADT's two ASC windows lie inside
* "engine" and are not repeated. iBoot preloads the ANE firmware on T6030
* the way it does on T8122, so the node marks itself preloaded; the driver
* stays unqualified on T603x and refuses to start, logging the refusal.
*/
ane: ane@308000000 {
compatible = "apple,t6030-ane";
reg = <0x3 0x08000000 0x0 0x2000000>,
<0x3 0x50700000 0x0 0x18000>,
<0x3 0x50724000 0x0 0x4000>,
<0x3 0x503c0000 0x0 0x24000>,
<0x2 0x11000000 0x0 0xf74000>,
<0x3 0x642c8000 0x0 0x4000>;
reg-names = "engine", "pmgr", "aux-0", "aux-1", "aux-2", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 576 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>;
mboxes = <&ane_mbox>;
apple,ane-type = <0xc0>;
apple,firmware-preloaded;
/* ADT dapf-instance-0: inclusive CPU addresses, in record order. */
apple,dapf-ranges = /bits/ 64 <0x350700498 0x35070049b>,
/bits/ 64 <0x35070c000 0x35070c01b>,
/bits/ 64 <0x350726c6c 0x350726c6f>,
/bits/ 64 <0x2c9468000 0x2c9468003>,
/bits/ 64 <0x292468000 0x292468003>;
/* Default layout; the loader supplies per-boot physical reservations. */
apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000b0000>;
status = "disabled";
};
};

&usb4_0_pcie_tunnel {
Expand Down
39 changes: 39 additions & 0 deletions arch/arm64/boot/dts/apple/t6030-pmgr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "ane_sys";
apple,no-auto-pm;
};

ps_scodec: power-controller@4a0 {
Expand Down Expand Up @@ -1272,6 +1273,44 @@
power-domains = <&ps_venc_me0>;
};

/* These states serve only the ANE. */
ps_ane_mpm: power-controller@c000 {
compatible = "apple,t6030-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0xc000 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "ane_mpm";
power-domains = <&ps_ane_sys>;
};

ps_ane_cpu: power-controller@c008 {
compatible = "apple,t6030-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0xc008 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "ane_cpu";
apple,no-auto-pm;
power-domains = <&ps_ane_sys>;
};

ps_ane_td: power-controller@c010 {
compatible = "apple,t6030-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0xc010 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "ane_td";
power-domains = <&ps_ane_sys>;
};

ps_ane_base: power-controller@c018 {
compatible = "apple,t6030-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0xc018 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "ane_base";
power-domains = <&ps_ane_td>;
};

ps_disp_cpu: power-controller@10000 {
compatible = "apple,t6030-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0x10000 4>;
Expand Down
75 changes: 75 additions & 0 deletions arch/arm64/boot/dts/apple/t6031-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -860,4 +860,79 @@
status = "disabled";
};

ane0_dart0: iommu@3c9800000 {
compatible = "apple,t6031-dart", "apple,t8110-dart";
reg = <0x3 0xc9800000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 984 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ane0_dart1: iommu@3c9810000 {
compatible = "apple,t6031-dart", "apple,t8110-dart";
reg = <0x3 0xc9810000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 984 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

ane0_dart2: iommu@3c9820000 {
compatible = "apple,t6031-dart", "apple,t8110-dart";
reg = <0x3 0xc9820000 0x0 0x4000>;
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 984 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&ps_ane_sys>;
status = "disabled";
};

/*
* The ANE's ASC (ADT "iop,ascwrap-v6": engine + 0x1400000, 0x6c000) has
* its mailbox at the ASC + 0x8000, as on the SIO of the same wrapper
* revision. The ADT lists the four mailbox interrupts in the SIO's order.
*/
ane0_mbox: mailbox@3c9408000 {
compatible = "apple,t6031-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x3 0xc9408000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 964 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 965 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 966 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 967 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
power-domains = <&ps_ane_cpu>;
status = "disabled";
};

/*
* H15 Neural Engine, ADT-derived only. The ADT's two ASC windows lie inside
* "engine" and are not repeated. iBoot preloads the ANE firmware on T6031
* the way it does on T8122, so the node marks itself preloaded; the driver
* stays unqualified on T603x and refuses to start, logging the refusal.
*/
ane0: ane@3c8000000 {
compatible = "apple,t6031-ane";
reg = <0x3 0xc8000000 0x0 0x2000000>,
<0x2 0x92280000 0x0 0x10000>,
<0x2 0x92290000 0x0 0x4000>,
<0x2 0x903c0000 0x0 0x30000>,
<0x4 0x04000000 0x0 0x2000000>,
<0x2 0xa02dc000 0x0 0x4000>;
reg-names = "engine", "pmgr", "aux-0", "aux-1", "aux-3", "aux-4";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 0 983 IRQ_TYPE_LEVEL_HIGH>;
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>;
mboxes = <&ane0_mbox>;
apple,ane-type = <0xe0>;
apple,firmware-preloaded;
status = "disabled";
};
};
Loading
Loading