From 1f4da1ec68eef4aeb9d766570f308756b5e8b26f Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 23:34:07 +1100 Subject: [PATCH 1/2] arm64: dts: apple: t8142: Neural Engine, video encoder and JPEG on every M5 The Neural Engine (with its three DARTs and ANE_SYS power state), the video encoder (two DARTs, VENC power tree) and both JPEG engines (DART, JPG power state) are SoC blocks: the J704, J813 and J815 ADTs give the same addresses, interrupts and power gates for ane, dart-ane, ave, dart-ave, jpeg0, jpeg1 and dart-jpeg. Only the J815 enabled all three and the J813 only the encoder (twice); the J704 had none of them. Turn them on in t8142-peripherals.dtsi and drop the per-board enables. The ANE and the encoder run firmware that iBoot preloads: the boot loader hands the preload over by compatible and disables the node when the ADT has none, so a board without a preload keeps them off. Every DART keeps its engine's power domain. The JPEG engines need no firmware. J815: no change in the built tree beyond status "okay" becoming implicit. J813: gains the Neural Engine and both JPEG engines. J704: gains all three. The ANE and JPEG enables on J815 come from m0d16l14n1's 33d8f13414be9 and c3c1417eadb1c. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t8142-j813.dts | 82 ------------------- arch/arm64/boot/dts/apple/t8142-j815.dts | 82 ------------------- .../boot/dts/apple/t8142-peripherals.dtsi | 30 +++---- 3 files changed, 10 insertions(+), 184 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8142-j813.dts b/arch/arm64/boot/dts/apple/t8142-j813.dts index fe9e3b8ce77db..5dc6ebcb4d2d3 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813.dts +++ b/arch/arm64/boot/dts/apple/t8142-j813.dts @@ -253,47 +253,6 @@ }; }; -/* - * The video encoder, its two DARTs and the VENC power tree. The J813 ADT has - * the same ave and dart-ave as the J815. The boot loader hands over iBoot's - * preloaded firmware, or disables the encoder when there is none. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - /* Unexposed chassis port instances remain described and disabled. */ /* @@ -304,47 +263,6 @@ status = "okay"; }; -/* - * Video encoder: ADT ave ("ave2", pre-loaded) behind dart-ave, the same - * addresses, interrupts and power states as on the J815. aura hands over the - * preloaded firmware or disables the node. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - #include "t8142-j813-sep.dtsi" #include "t8142-j813-j815-sleep.dtsi" diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index c45d185c87c4c..6906adcc56eb8 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -389,85 +389,3 @@ &mcc { status = "okay"; }; - -/* - * Video encoder: ADT ave behind dart-ave (DART + CPUDART). aura hands over the - * preloaded 26A428 firmware (memory regions, CRCs in /chosen) or disables the - * node when the ADT has no preload. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - -/* - * The Neural Engine. It stays off until the first request: the firmware is - * started then, from the preload, and system sleep cycles it cold. - */ -&ps_ane_sys { - status = "okay"; -}; - -&ane_dart0 { - status = "okay"; -}; - -&ane_dart1 { - status = "okay"; -}; - -&ane_dart2 { - status = "okay"; -}; - -&ane { - status = "okay"; -}; - -/* Both JPEG engines and their DART. */ -&ps_jpg { - status = "okay"; -}; - -&jpeg_dart { - status = "okay"; -}; - -&jpeg0 { - status = "okay"; -}; - -&jpeg1 { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi index 949f6da167a89..bb0d0599a4fb2 100644 --- a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi @@ -164,7 +164,6 @@ power-domains = <&ps_ane_sys>; /* The firmware DVAs reach 0x100_xxxx_xxxx. */ apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; }; ane_dart1: iommu@421820000 { @@ -175,7 +174,6 @@ interrupts = ; power-domains = <&ps_ane_sys>; apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; }; ane_dart2: iommu@421840000 { @@ -186,7 +184,6 @@ interrupts = ; power-domains = <&ps_ane_sys>; apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; }; /* @@ -195,6 +192,9 @@ * boot loader hands the preload over as firmware-text and firmware-data. * PWGATE is the ADT's reg[2] (PMGR +0x24000) + 0x3640, measured under * macOS 27.2.1. + * Every T8142 board has it (same ane/dart-ane in the J704, J813 and J815 + * ADTs), so it is on by default; the boot loader hands the preload over + * by this compatible and disables the node when the ADT has none. */ ane: ane@420000000 { compatible = "apple,t8142-ane"; @@ -213,7 +213,6 @@ 0x3807002e8 0x3807002eb 0x38070c008 0x38070c00b 0x582668000 0x582668003>; - status = "disabled"; }; scaler0_dart: iommu@305260000 { @@ -226,7 +225,10 @@ status = "disabled"; }; - /* ADT dart-jpeg: one DART for both engines, jpeg0 on SID 0, jpeg1 on SID 1. */ + /* + * ADT dart-jpeg: one DART for both engines, jpeg0 on SID 0, jpeg1 on SID 1. + * The JPEG engines need no firmware and are on every T8142 board. + */ jpeg_dart: iommu@301020000 { compatible = "apple,t8142-dart", "apple,t8110-dart"; reg = <0x3 0x1020000 0x0 0xc000>; @@ -235,7 +237,6 @@ /* ADT vm-base 0x100_0000_0000, vm-size 0x300_0000_0000 */ apple,dma-range = <0x100 0x0 0x300 0x0>; power-domains = <&ps_jpg>; - status = "disabled"; }; /* @@ -248,7 +249,6 @@ interrupts = ; iommus = <&jpeg_dart 0>; power-domains = <&ps_jpg>; - status = "disabled"; }; jpeg1: jpeg@301060000 { @@ -257,7 +257,6 @@ interrupts = ; iommus = <&jpeg_dart 1>; power-domains = <&ps_jpg>; - status = "disabled"; }; apr_dart: iommu@3a1020000 { @@ -562,7 +561,6 @@ #power-domain-cells = <0>; #reset-cells = <0>; label = "jpg"; - status = "disabled"; }; /* ADT pmgr device ANE_SYS (id 73), parent AFISOCNI3 (no power state). */ @@ -572,7 +570,6 @@ #power-domain-cells = <0>; #reset-cells = <0>; label = "ane_sys"; - status = "disabled"; }; ps_msr: power-controller@2a8 { @@ -604,7 +601,6 @@ #power-domain-cells = <0>; #reset-cells = <0>; label = "venc_sys"; - status = "disabled"; }; ps_venc_dma: power-controller@8000 { @@ -614,7 +610,6 @@ #reset-cells = <0>; label = "venc_dma"; power-domains = <&ps_venc_sys>; - status = "disabled"; }; ps_venc_pipe4: power-controller@8008 { @@ -624,7 +619,6 @@ #reset-cells = <0>; label = "venc_pipe4"; power-domains = <&ps_venc_dma>; - status = "disabled"; }; ps_venc_pipe5: power-controller@8010 { @@ -634,7 +628,6 @@ #reset-cells = <0>; label = "venc_pipe5"; power-domains = <&ps_venc_dma>; - status = "disabled"; }; ps_venc_me0: power-controller@8018 { @@ -644,7 +637,6 @@ #reset-cells = <0>; label = "venc_me0"; power-domains = <&ps_venc_dma>; - status = "disabled"; }; ps_venc_me1: power-controller@8020 { @@ -654,7 +646,6 @@ #reset-cells = <0>; label = "venc_me1"; power-domains = <&ps_venc_me0>; - status = "disabled"; }; }; @@ -726,7 +717,9 @@ * preloaded by iBoot and handed over by the boot loader, which adds the * memory regions. dart-ave is two DARTs (DART and CPUDART) on one IRQ; * stream 12 carries the temporal filter engines and must translate - * through the encoder's domain, not bypass. + * through the encoder's domain, not bypass. On by default (same ave and + * dart-ave in the J704, J813 and J815 ADTs); the boot loader disables + * the encoder when the ADT has no preload. */ ave_dart0: iommu@281080000 { compatible = "apple,t8142-dart", "apple,t8110-dart"; @@ -735,7 +728,6 @@ power-domains = <&ps_venc_sys>; #iommu-cells = <1>; apple,dma-range = <0x100 0x00004000 0x0 0xffffc000>; - status = "disabled"; }; ave_dart1: iommu@2810a0000 { @@ -745,7 +737,6 @@ power-domains = <&ps_venc_sys>; #iommu-cells = <1>; apple,dma-range = <0x100 0x00004000 0x0 0xffffc000>; - status = "disabled"; }; ave: video-codec@281100000 { @@ -764,7 +755,6 @@ power-domain-names = "dma", "pipe4", "pipe5", "me0", "me1"; iommus = <&ave_dart0 0>, <&ave_dart0 12>, <&ave_dart1 0>, <&ave_dart1 12>; - status = "disabled"; }; scaler0: scaler@305000000 { From 95dda1cb24ebdc38f5bf03057c713f376d2373e4 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 00:06:23 +1100 Subject: [PATCH 2/2] arm64: dts: apple: t8142: CPU idle, PMU and cluster power gate on every M5 The CPU cluster power-gate enables, the CPU PMU and the PSCI retention idle state are CPU/PMGR facts of the T8142, not of a board: the J704, J813 and J815 ADTs have the same /cpus and the same pmgr. They were only described for the MacBook Airs (cluster_pwrgate in t8142-j813.dts alone, cpu_pmu enabled per board, the idle states in the Air-only t8142-j813-psci-idle.dtsi), so on the MacBook Pro 14" (J704) the boot P core never powered down in WFI, perf had no hardware counters and cpuidle-psci had no state under aura's PSCI monitor. Move cluster_pwrgate into t8142.dtsi (as t8140.dtsi already has it), enable cpu_pmu there, and rename t8142-j813-psci-idle.dtsi to t8142-psci-idle.dtsi, included from t8142.dtsi. Without a /psci node cpuidle-psci does not probe, as before. J813: unchanged. J815: gains cluster_pwrgate. J704: gains cluster_pwrgate, the PMU and the retention idle state. cluster_pwrgate is gig3m's (c58ab8cecaf96). Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi | 1 - arch/arm64/boot/dts/apple/t8142-j813.dts | 18 ------------------ arch/arm64/boot/dts/apple/t8142-j815.dts | 4 ---- ...813-psci-idle.dtsi => t8142-psci-idle.dtsi} | 0 arch/arm64/boot/dts/apple/t8142.dtsi | 15 ++++++++++++++- drivers/cpuidle/cpuidle-apple.c | 2 +- 6 files changed, 15 insertions(+), 25 deletions(-) rename arch/arm64/boot/dts/apple/{t8142-j813-psci-idle.dtsi => t8142-psci-idle.dtsi} (100%) diff --git a/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi b/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi index f07cf01fded72..d9a5302512b29 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi @@ -344,7 +344,6 @@ }; }; -#include "t8142-j813-psci-idle.dtsi" #include "t8142-j813-nvme.dtsi" #include "t8142-j813-power.dtsi" diff --git a/arch/arm64/boot/dts/apple/t8142-j813.dts b/arch/arm64/boot/dts/apple/t8142-j813.dts index 5dc6ebcb4d2d3..794205d86204a 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813.dts +++ b/arch/arm64/boot/dts/apple/t8142-j813.dts @@ -109,10 +109,6 @@ status = "okay"; }; -&cpu_pmu { - status = "okay"; -}; - &dockchannel { status = "okay"; }; @@ -239,20 +235,6 @@ }; }; -&{/soc} { - /* - * The CPU clusters' power-gate enables, in /arm-io/pmgr reg[34]: E at - * +0x0 and P at +0x60, the offsets T8132 has and the two words - * AppleT8142PMGR's restoreHW sets. iBoot leaves P's clear, and the - * boot core (P core 0) then never powers down in WFI. - */ - cluster_pwrgate: power-gate@380724000 { - compatible = "apple,t8142-cluster-pwrgate", "apple,cluster-pwrgate"; - reg = <0x3 0x80724000 0x0 0x4>, - <0x3 0x80724060 0x0 0x4>; - }; -}; - /* Unexposed chassis port instances remain described and disabled. */ /* diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index 6906adcc56eb8..9231b466acb82 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -114,10 +114,6 @@ status = "okay"; }; -&cpu_pmu { - status = "okay"; -}; - &dockchannel { status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/t8142-j813-psci-idle.dtsi b/arch/arm64/boot/dts/apple/t8142-psci-idle.dtsi similarity index 100% rename from arch/arm64/boot/dts/apple/t8142-j813-psci-idle.dtsi rename to arch/arm64/boot/dts/apple/t8142-psci-idle.dtsi diff --git a/arch/arm64/boot/dts/apple/t8142.dtsi b/arch/arm64/boot/dts/apple/t8142.dtsi index 11bddbb4ed350..381d3bcf000a5 100644 --- a/arch/arm64/boot/dts/apple/t8142.dtsi +++ b/arch/arm64/boot/dts/apple/t8142.dtsi @@ -129,7 +129,6 @@ }; cpu_pmu: pmu { - status = "disabled"; compatible = "apple,t8142-pmu"; interrupt-parent = <&aic>; /* The AIC raises both clusters' PMU FIQs as this one, as on T8140. */ @@ -167,6 +166,19 @@ * the ways and allocation before the kernel, so the driver only * checks that and flushes the cache on shutdown. */ + /* + * The CPU clusters' power-gate enables, in /arm-io/pmgr reg[34]: E at + * +0x0 and P at +0x60, the offsets T8132 has and the two words + * AppleT8142PMGR's restoreHW sets. iBoot leaves P's clear, and the + * boot core (P core 0) then never powers down in WFI. Same pmgr in + * the J704, J813 and J815 ADTs. + */ + cluster_pwrgate: power-gate@380724000 { + compatible = "apple,t8142-cluster-pwrgate", "apple,cluster-pwrgate"; + reg = <0x3 0x80724000 0x0 0x4>, + <0x3 0x80724060 0x0 0x4>; + }; + mcc: memory-controller@220000000 { compatible = "apple,t8142-mcc", "apple,t8140-mcc"; reg = <0x2 0x20000000 0x0 0x4000>, @@ -289,3 +301,4 @@ }; #include "t8142-peripherals.dtsi" +#include "t8142-psci-idle.dtsi" diff --git a/drivers/cpuidle/cpuidle-apple.c b/drivers/cpuidle/cpuidle-apple.c index 09554f74cbce8..9bfd19a7a2029 100644 --- a/drivers/cpuidle/cpuidle-apple.c +++ b/drivers/cpuidle/cpuidle-apple.c @@ -194,7 +194,7 @@ static int __init apple_cpuidle_init(void) /* * T8142 under aura's PSCI monitor idles through cpuidle-psci - * (t8142-j813-psci-idle.dtsi). Raw aura has no /psci node and would + * (t8142-psci-idle.dtsi). Raw aura has no /psci node and would * otherwise have no cpuidle driver, so s2idle never freezes the tick. */ if (of_machine_is_compatible("apple,t8142")) {