Skip to content
Draft
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
80 changes: 80 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-ane.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The T6050 Neural Engine (ane0 in t6050-peripherals.dtsi), for any board
* that includes this after t6050-peripherals.dtsi. iBoot preloads the
* personalized firmware (ADT ane0 segment-ranges, TEXT 0xc0000 and DATA
* 0x2ac000 bytes). The boot loader fills the two reservations from that
* boot's ADT, renames them to their physical addresses and enables them; a
* boot without that hand-off leaves ane0 disabled, and the ANE driver leaves
* the engine off unless the preloaded firmware is one it knows.
*
* This describes die 0's engine only. The second die of an M5 Ultra has its
* own engine, DARTs and power state, which are not described yet.
*/

#ifndef __T6050_ANE_DTSI__
#define __T6050_ANE_DTSI__

/ {
reserved-memory {
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";
};
};
};

&ane0 {
memory-region = <&ane_fw_text>, <&ane_fw_data>;
memory-region-names = "firmware-text", "firmware-data";
status = "okay";
};

&ane0_dart {
status = "okay";
};

&ane0_dart1 {
status = "okay";
};

&ane0_dart2 {
status = "okay";
};

&ps_ane_sys {
status = "okay";
};

/*
* ANE_SYS's parents in the ADT power tree are FAB8_SOC and FAB9_SOC, and
* FAB8_SOC's is FAB0_PIOGW. The firmware keeps these fabrics up (the Secure
* Enclave and the camera sit behind them too), so Linux only holds a vote on
* them and never switches them. A board that already enables them for its
* Secure Enclave or camera ends up with the same nodes.
*/
&ps_fab0_piogw {
apple,firmware-owned;
status = "okay";
};

&ps_fab8_soc {
apple,firmware-owned;
status = "okay";
};

&ps_fab9_soc {
apple,firmware-owned;
status = "okay";
};

#endif /* __T6050_ANE_DTSI__ */
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

/dts-v1/;

#define T6050_J714C
Expand Down
46 changes: 3 additions & 43 deletions arch/arm64/boot/dts/apple/t6050-j714s-ane.dtsi
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The J714s Neural Engine. iBoot preloads the personalized firmware (ADT ane0
* segment-ranges, TEXT 0xc0000 and DATA 0x2ac000 bytes). The boot loader fills
* the two reservations from that boot's ADT, renames them to their physical
* addresses and enables them; until then the ANE driver leaves the engine off.
* The Neural Engine is described for every T6050 board in t6050-ane.dtsi.
* This name is kept for board files that still include it.
*/

/ {
reserved-memory {
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";
};
};
};

&ane0 {
memory-region = <&ane_fw_text>, <&ane_fw_data>;
memory-region-names = "firmware-text", "firmware-data";
status = "okay";
};

&ane0_dart {
status = "okay";
};

&ane0_dart1 {
status = "okay";
};

&ane0_dart2 {
status = "okay";
};

&ps_ane_sys {
status = "okay";
};
#include "t6050-ane.dtsi"
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
#include "t6050-j714s-dpaudio.dtsi"

/* The Neural Engine, started only after the boot loader's preload hand-off */
#include "t6050-j714s-ane.dtsi"
#include "t6050-ane.dtsi"
#include "t6050-j714s-sleep.dtsi"
#include "t6050-j714s-sleep-soc.dtsi"
#include "t6050-j714s-sleep-adt.dtsi"
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

/dts-v1/;

#include <dt-bindings/leds/common.h>
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j873s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

/dts-v1/;

#include "t6050-max.dtsi"
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k114s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

#include "t6050-k114-k116.dtsi"

/ {
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k116c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

#include "t6050-k114-k116.dtsi"

/ {
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k116s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* Copyright The Asahi Linux Contributors
*/

/* The Neural Engine (t6050-ane.dtsi, through t6050-peripherals.dtsi) */
#define T6050_ANE

#include "t6050-k114-k116.dtsi"

/ {
Expand Down
9 changes: 9 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3355,6 +3355,7 @@
compatible = "apple,t6050-dart", "apple,t8110-dart";
reg = <0x5 0x9800000 0x0 0xc000>,
<0x5 0x9810000 0x0 0x4000>;
reg-names = "dart", "dapf";
interrupts = <AIC_IRQ 0 955 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
power-domains = <&ps_ane_sys>;
Expand Down Expand Up @@ -3702,3 +3703,11 @@
status = "disabled";
};
};

/*
* The Neural Engine's firmware reservations and enables. A board whose engine
* is described defines T6050_ANE before including this file.
*/
#ifdef T6050_ANE
#include "t6050-ane.dtsi"
#endif
Loading