Skip to content
Merged
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
47 changes: 3 additions & 44 deletions arch/arm64/boot/dts/apple/t6050-j714s-ane.dtsi
Original file line number Diff line number Diff line change
@@ -1,48 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The Neural Engine of the J714s and the J716c, which share its layout. 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 @@ -674,7 +674,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"
/*
* The port controllers: the sleep's command rules, a reset and more probe tries after a failed
* probe, and for the USB-C ports LOCK's key, the board number reversed ("417J"; their debug mode
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 @@ -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 "t6050-max.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

/* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */
#define T6050_ATC2_USB4_ROUTER
/* ADT /arm-io/acio1: the left-front port's USB4/Thunderbolt router (t6050-k114-usb.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

/* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */
#define T6050_ATC2_USB4_ROUTER
/* ADT /arm-io/acio1: the left-front port's USB4/Thunderbolt router (t6050-k114-usb.dtsi) */
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3769,3 +3769,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