From 5df028340f3262210f5f186d584838105dfa330f Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:08:17 +1100 Subject: [PATCH 1/3] arm64: dts: apple: t8132: enable the Neural Engine on every M4 board Every T8132 has the ANE; the DT enabled it, with its three DARTs, on the J713 only, the board it was first run on (#1952). The node's resources and power domains are the SoC's, and the driver binds only when the loader hands off the firmware preload (aura#260 does so for any apple,t8132-ane node), so enable it in the SoC file and drop the J713 copy. The J713's DT is unchanged. Not tested on the J604, J715, J623/J624 or J773g (desk audit, lane SPEC-M3M4). Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/t8132-j713.dts | 16 ---------------- arch/arm64/boot/dts/apple/t8132-peripherals.dtsi | 13 +++++++------ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j713.dts b/arch/arm64/boot/dts/apple/t8132-j713.dts index 440ecff14d4a1..cfaa76f22c4a7 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713.dts +++ b/arch/arm64/boot/dts/apple/t8132-j713.dts @@ -293,19 +293,3 @@ phys = <&atcphy1 PHY_TYPE_USB3>; phy-names = "cio"; }; - -&ane_dart0 { - status = "okay"; -}; - -&ane_dart1 { - status = "okay"; -}; - -&ane_dart2 { - status = "okay"; -}; - -&ane { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t8132-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8132-peripherals.dtsi index 47cac2a1376e1..d4d47bed0d1e4 100644 --- a/arch/arm64/boot/dts/apple/t8132-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-peripherals.dtsi @@ -149,7 +149,7 @@ power-domains = <&ps_ane_sys>; /* Include firmware identity MMIO pages below the preload DVAs. */ apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; + status = "okay"; }; ane_dart1: iommu@501820000 { @@ -160,7 +160,7 @@ interrupts = ; power-domains = <&ps_ane_sys>; apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; + status = "okay"; }; ane_dart2: iommu@501840000 { @@ -171,7 +171,7 @@ interrupts = ; power-domains = <&ps_ane_sys>; apple,dma-range = <0x0 0x0 0x400 0x0>; - status = "disabled"; + status = "okay"; }; dart_ane_companion3: filter@501810000 { @@ -344,8 +344,9 @@ }; /* - * ADT-derived only: keep disabled until an M4 owner qualifies the H16 - * backend and the loader hands off reserved TEXT/DATA preloads. + * Every M4 has the engine. The driver runs it only when the loader + * hands off the reserved TEXT/DATA preloads (memory-region and + * apple,firmware-iovas); without them it refuses to bind. */ ane: ane@500000000 { compatible = "apple,t8132-ane"; @@ -374,7 +375,7 @@ /bits/ 64 <0x302668000 0x302668003>; /* Default layout; the loader supplies per-boot physical reservations. */ apple,firmware-iovas = /bits/ 64 <0x10000000000 0x100000c0000>; - status = "disabled"; + status = "okay"; }; scaler0: scaler@505000000 { From cb64329683336cf616313d34b0d1757ca7af835e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:08:48 +1100 Subject: [PATCH 2/3] arm64: dts: apple: t8132-j713-j715: give the J715 the J713's sleep, enclave and display power wiring The J715 (MacBook Air 15", M4) is the J713 board with a larger panel and six amps; its ADT matches the J713's apart from the radio island and the ATC PHY trims (t8132-j715.dts). Yet the deep-sleep controller, both cluster power gates, the SEP (which Touch ID's match path needs, and the J715 DT already enables the Mesa sensor), the DCP and external-DCP power gating, the USB4/DCP DART clock-protection slices, the radio port's CLKREQ and the ACIO PHY links sat in t8132-j713.dts only, with "tested on this machine only" as the reason. Move them unchanged into the shared J713/J715 file. The J713 DT compiles to the same tree (dtc -s output identical before and after). Not tested on a J715: needs a J715 boot, Touch ID enroll, and an s2r cycle with and without a dock. Co-Authored-By: Claude Opus 5.5 --- .../arm64/boot/dts/apple/t8132-j713-j715.dtsi | 147 ++++++++++++++++++ arch/arm64/boot/dts/apple/t8132-j713.dts | 144 ----------------- 2 files changed, 147 insertions(+), 144 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi index 3e1417dabb3a1..f6e7d1b167651 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi @@ -329,3 +329,150 @@ &avd { status = "okay"; }; + +/* + * Deep sleep: brought up on the J713; the J715 is the same board (same ADT + * apart from the radio island and the ATC PHY trims). + */ +&sleep { + status = "okay"; +}; + +/* Deep sleep needs both CPU clusters' power gates; iBoot enables E's only. */ +&cluster_pwrgate { + status = "okay"; +}; + +/* The enclave must take the sleep request, so its driver has to bind. */ +&sep_dart { + status = "okay"; +}; + +/* Only named: the sleep's last refusal reads its state to see the enclave gate. */ +&ps_sep { + apple,firmware-owned; + status = "okay"; +}; + +&sep { + /* + * Without a domain the driver tells the enclave at .suspend, and a sleep + * refused after that finds it gated with its mailbox gone. + */ + power-domains = <&ps_sep>, <&ps_gpio>; + status = "okay"; +}; + +/* + * The DCP powers its display domains down while blanked + * (appledrm.power_gate_ms): the clock protection slices of its DARTs, as the + * ADT has them, and the internal pipe's PMC interface. + */ +&dcp_dart { + apple,clock-protection = <&ps_prot 42>; +}; + +&disp0_dart { + apple,clock-protection = <&ps_prot 8>; +}; + +&dcp { + apple,pmc-interface = <&pmc_disp0>; +}; + +/* + * Each external DCP powers its CPU, front-end and system domains off around + * a deep sleep. The system domains have a bus bridge in front of their + * block: its link words are 0x800104 past the start of the block's disp-3 + * registers (reg 4 of the external DCP). + */ +&ps_dispext0_sys { + apple,consumer-switched; + apple,bridge-link = <&dcpext0 4 0x800104>; +}; + +&ps_dispext0_fe { + apple,consumer-switched; +}; + +&ps_dispext0_cpu { + apple,consumer-switched; + /* Power-gate retention workaround, as macOS sets it while off. */ + apple,retention-workaround = <0x256cc 0x3 0x3>, <0x256f0 0x3 0x0>; +}; + +&ps_dispext1_sys { + apple,consumer-switched; + apple,bridge-link = <&dcpext1 4 0x800104>; +}; + +&ps_dispext1_fe { + apple,consumer-switched; +}; + +&ps_dispext1_cpu { + apple,consumer-switched; + /* Power-gate retention workaround, as macOS sets it while off. */ + apple,retention-workaround = <0x25b4c 0x3 0x3>, <0x25b70 0x3 0x0>; +}; + +/* + * A deep sleep with a dock attached powers these off: their hosts (the ACIO + * NHIs, the tunneled PCIe ports and the external DCPs) take them down and + * restore them, with these clock protection slices. + */ +&usb4_0_dart { + apple,clock-protection = <&ps_prot 15>; +}; + +&usb4_1_dart { + apple,clock-protection = <&ps_prot 19>; +}; + +&usb4_0_pcie_dart { + apple,clock-protection = <&ps_prot 14>; +}; + +&usb4_1_pcie_dart { + apple,clock-protection = <&ps_prot 18>; +}; + +&dcpext0_dart { + apple,clock-protection = <&ps_prot 5>; +}; + +&dispext0_dart { + apple,clock-protection = <&ps_prot 4>; +}; + +&dcpext1_dart { + apple,clock-protection = <&ps_prot 30>; +}; + +&dispext1_dart { + apple,clock-protection = <&ps_prot 29>; +}; + +/* Native radio recovery is required before admitting system sleep. */ +&pcie0 { + status = "okay"; +}; + +&dart_apcie0 { + status = "okay"; +}; + +&port00 { + clkreq-gpios = <&pinctrl_ap 160 GPIO_ACTIVE_LOW>; +}; + +/* Each ACIO host powers its Type-C PHY down and up around a deep sleep with a dock. */ +&usb4_0_acio { + phys = <&atcphy0 PHY_TYPE_USB3>; + phy-names = "cio"; +}; + +&usb4_1_acio { + phys = <&atcphy1 PHY_TYPE_USB3>; + phy-names = "cio"; +}; diff --git a/arch/arm64/boot/dts/apple/t8132-j713.dts b/arch/arm64/boot/dts/apple/t8132-j713.dts index cfaa76f22c4a7..150affc93f0ff 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713.dts +++ b/arch/arm64/boot/dts/apple/t8132-j713.dts @@ -78,36 +78,6 @@ apple,machine-kind = "MacBook Air"; }; -/* Deep sleep has been brought up and tested on this machine only. */ -&sleep { - status = "okay"; -}; - -/* Deep sleep needs both CPU clusters' power gates; iBoot enables E's only. */ -&cluster_pwrgate { - status = "okay"; -}; - -/* The enclave must take the sleep request, so its driver has to bind. */ -&sep_dart { - status = "okay"; -}; - -/* Only named: the sleep's last refusal reads its state to see the enclave gate. */ -&ps_sep { - apple,firmware-owned; - status = "okay"; -}; - -&sep { - /* - * Without a domain the driver tells the enclave at .suspend, and a sleep - * refused after that finds it gated with its mailbox gone. - */ - power-domains = <&ps_sep>, <&ps_gpio>; - status = "okay"; -}; - /* * The four SN012776 speaker amps, held in hardware shutdown until the sound * card enables them (ADT /arm-io/i2c3/audio-speaker at 0x38 and its @@ -179,117 +149,3 @@ */ firmware-name = "apple/mesacal-j713.bin", "apple/msrk-j713.bin"; }; - -/* - * The DCP powers its display domains down while blanked - * (appledrm.power_gate_ms): the clock protection slices of its DARTs, as the - * ADT has them, and the internal pipe's PMC interface. - */ -&dcp_dart { - apple,clock-protection = <&ps_prot 42>; -}; - -&disp0_dart { - apple,clock-protection = <&ps_prot 8>; -}; - -&dcp { - apple,pmc-interface = <&pmc_disp0>; -}; - -/* - * Each external DCP powers its CPU, front-end and system domains off around - * a deep sleep. The system domains have a bus bridge in front of their - * block: its link words are 0x800104 past the start of the block's disp-3 - * registers (reg 4 of the external DCP). - */ -&ps_dispext0_sys { - apple,consumer-switched; - apple,bridge-link = <&dcpext0 4 0x800104>; -}; - -&ps_dispext0_fe { - apple,consumer-switched; -}; - -&ps_dispext0_cpu { - apple,consumer-switched; - /* Power-gate retention workaround, as macOS sets it while off. */ - apple,retention-workaround = <0x256cc 0x3 0x3>, <0x256f0 0x3 0x0>; -}; - -&ps_dispext1_sys { - apple,consumer-switched; - apple,bridge-link = <&dcpext1 4 0x800104>; -}; - -&ps_dispext1_fe { - apple,consumer-switched; -}; - -&ps_dispext1_cpu { - apple,consumer-switched; - /* Power-gate retention workaround, as macOS sets it while off. */ - apple,retention-workaround = <0x25b4c 0x3 0x3>, <0x25b70 0x3 0x0>; -}; - -/* - * A deep sleep with a dock attached powers these off: their hosts (the ACIO - * NHIs, the tunneled PCIe ports and the external DCPs) take them down and - * restore them, with these clock protection slices. - */ -&usb4_0_dart { - apple,clock-protection = <&ps_prot 15>; -}; - -&usb4_1_dart { - apple,clock-protection = <&ps_prot 19>; -}; - -&usb4_0_pcie_dart { - apple,clock-protection = <&ps_prot 14>; -}; - -&usb4_1_pcie_dart { - apple,clock-protection = <&ps_prot 18>; -}; - -&dcpext0_dart { - apple,clock-protection = <&ps_prot 5>; -}; - -&dispext0_dart { - apple,clock-protection = <&ps_prot 4>; -}; - -&dcpext1_dart { - apple,clock-protection = <&ps_prot 30>; -}; - -&dispext1_dart { - apple,clock-protection = <&ps_prot 29>; -}; - -/* Native radio recovery is required before admitting system sleep. */ -&pcie0 { - status = "okay"; -}; - -&dart_apcie0 { - status = "okay"; -}; - -&port00 { - clkreq-gpios = <&pinctrl_ap 160 GPIO_ACTIVE_LOW>; -}; - -/* Each ACIO host powers its Type-C PHY down and up around a deep sleep with a dock. */ -&usb4_0_acio { - phys = <&atcphy0 PHY_TYPE_USB3>; - phy-names = "cio"; -}; - -&usb4_1_acio { - phys = <&atcphy1 PHY_TYPE_USB3>; - phy-names = "cio"; -}; From e2e91097021cc37df11fe8d7f9905679d5e2a194 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:18:05 +1100 Subject: [PATCH 3/3] arm64: dts: apple: t8132: enable the Secure Enclave on every M4 board Every T8132 has the SEP, and its driver must bind on every board: the enclave takes the deep-sleep request, and Touch ID (the J604 and the Airs have the sensor enabled) and the secure storage paths go through it. The DT enabled the SEP and its DART only in the J713/J715 board file, so the J604, the iMacs and the Mac mini never bound it. Enable both in the SoC file, give the SEP its power domains there, and mark the enclave's power state firmware-owned in the SoC power tree. The J713/J715 ownership file still leaves ps_sep off for the legacy-loader adapter, so the board file keeps one line turning it back on. J713 and J715 compile to the same tree apart from dropping explicit status = "okay" lines (decompiled and compared). Not tested on the J604, J623/J624 or J773g: needs a boot with the SEP bound on each, and a Touch ID enroll on the J604. Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi | 17 +---------------- arch/arm64/boot/dts/apple/t8132-pmgr.dtsi | 2 ++ arch/arm64/boot/dts/apple/t8132.dtsi | 10 ++++++++-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi index f6e7d1b167651..3f501aa4c2b64 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi @@ -343,23 +343,8 @@ status = "okay"; }; -/* The enclave must take the sleep request, so its driver has to bind. */ -&sep_dart { - status = "okay"; -}; - -/* Only named: the sleep's last refusal reads its state to see the enclave gate. */ +/* The ownership file above leaves the enclave domain off; the SEP needs it. */ &ps_sep { - apple,firmware-owned; - status = "okay"; -}; - -&sep { - /* - * Without a domain the driver tells the enclave at .suspend, and a sleep - * refused after that finds it gated with its mailbox gone. - */ - power-domains = <&ps_sep>, <&ps_gpio>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/t8132-pmgr.dtsi b/arch/arm64/boot/dts/apple/t8132-pmgr.dtsi index 0dafc59196507..003a462404505 100644 --- a/arch/arm64/boot/dts/apple/t8132-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-pmgr.dtsi @@ -901,6 +901,8 @@ #reset-cells = <0>; label = "sep"; apple,always-on; + /* Only named: the sleep's last refusal reads its state to see the enclave gate. */ + apple,firmware-owned; }; /* The ISP's own power states, children of ISP_SYS */ diff --git a/arch/arm64/boot/dts/apple/t8132.dtsi b/arch/arm64/boot/dts/apple/t8132.dtsi index 2351ddcb98cd8..c09548a2d019f 100644 --- a/arch/arm64/boot/dts/apple/t8132.dtsi +++ b/arch/arm64/boot/dts/apple/t8132.dtsi @@ -817,16 +817,22 @@ #iommu-cells = <1>; apple,dma-range = /bits/ 64 <0x10000004000 0xffff0000>; apple,dma-offset = /bits/ 64 <0x0>; - status = "disabled"; }; + /* + * Every M4 has the enclave. Its driver must bind on every board: + * the enclave takes the deep-sleep request, and Touch ID and the + * secure storage paths go through it. Without a domain the driver + * tells the enclave at .suspend, and a sleep refused after that + * finds it gated with its mailbox gone. + */ sep: sep@3aa600000 { compatible = "apple,sep"; reg = <0x3 0xaa600000 0x0 0x88000>; mboxes = <&sep_mbox>; mbox-names = "mbox"; iommus = <&sep_dart 0>; - status = "disabled"; + power-domains = <&ps_sep>, <&ps_gpio>; }; sep_mbox: mbox@3aa608000 {