From 3afa738e70caeea1ce9dab850819f6299f659f69 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:41:08 +1100 Subject: [PATCH 01/79] arm64: dts: apple: t8103: Enable SIO on every board DisplayPort audio over the Type-C ports goes through dpaudio1, which the shared jxxx include enables on every T8103 board, but its only DMA provider, SIO, was enabled and aliased on the Mac mini alone. On the MacBook Air, MacBook Pro and both iMacs dpaudio1 therefore could not get its channel and never probed. Move the sio alias and the SIO enable into t8103-jxxx.dtsi, as t8112-jxxx.dtsi already does. The bootloader finds the node through the alias to fill in the SIO firmware parameters. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8103-j274.dts | 6 ------ arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts index 2d491408f32cb..c6fd6580f56b7 100644 --- a/arch/arm64/boot/dts/apple/t8103-j274.dts +++ b/arch/arm64/boot/dts/apple/t8103-j274.dts @@ -19,7 +19,6 @@ aliases { ethernet0 = ðernet0; - sio = &sio; }; }; @@ -27,11 +26,6 @@ apple,connector-type = "HDMI-A"; }; -/* remove once m1n1 enables sio nodes after setup */ -&sio { - status = "okay"; -}; - &dpaudio0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi index 77485eb85b0b3..40cf5bcfe4b13 100644 --- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi @@ -19,6 +19,7 @@ disp0-piodma = &disp0_piodma; serial0 = &serial0; serial2 = &serial2; + sio = &sio; wifi0 = &wifi0; atcphy0 = &atcphy0; atcphy1 = &atcphy1; @@ -221,6 +222,11 @@ }; }; +/* remove once m1n1 enables sio nodes after setup */ +&sio { + status = "okay"; +}; + &dpaudio1 { status = "okay"; }; From e5c07a943c632ca685e2ee5624dff5341bc58cd0 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:42 +1100 Subject: [PATCH 02/79] arm64: dts: apple: t8103: Alias the SEP on the iMacs Both iMacs enable the SEP but, unlike the MacBook Air and MacBook Pro, do not alias it. The bootloader finds the SEP through the sep alias to reserve its firmware memory and hand the node the sepfw region the driver needs to boot it, so on the iMacs the enabled SEP could never probe. Add the alias. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8103-j456.dts | 1 + arch/arm64/boot/dts/apple/t8103-j457.dts | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-j456.dts b/arch/arm64/boot/dts/apple/t8103-j456.dts index 740d6783d36c4..ca3499abc17a1 100644 --- a/arch/arm64/boot/dts/apple/t8103-j456.dts +++ b/arch/arm64/boot/dts/apple/t8103-j456.dts @@ -19,6 +19,7 @@ aliases { ethernet0 = ðernet0; + sep = &sep; }; }; diff --git a/arch/arm64/boot/dts/apple/t8103-j457.dts b/arch/arm64/boot/dts/apple/t8103-j457.dts index 5b0505e97d843..5933913088bca 100644 --- a/arch/arm64/boot/dts/apple/t8103-j457.dts +++ b/arch/arm64/boot/dts/apple/t8103-j457.dts @@ -19,6 +19,7 @@ aliases { ethernet0 = ðernet0; + sep = &sep; }; }; From 4343bf00a4d009e8a4d6837faa1f630191b51b58 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:42 +1100 Subject: [PATCH 03/79] arm64: dts: apple: t8112-j473: Drop overridden DCP and display properties The Mac mini disabled the DCP and set a one-entry display iommus list, then enabled the DCP and set the full two-entry list further down the same file. Drop the dead first overrides. The compiled tree does not change. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8112-j473.dts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8112-j473.dts b/arch/arm64/boot/dts/apple/t8112-j473.dts index e66816a66acad..3eb6ef49d5cc5 100644 --- a/arch/arm64/boot/dts/apple/t8112-j473.dts +++ b/arch/arm64/boot/dts/apple/t8112-j473.dts @@ -30,13 +30,6 @@ status = "okay"; }; -&dcp { - status = "disabled"; -}; - -&display { - iommus = <&dispext0_dart 0 0x0 0x0 0xf 0xffff0000>; -}; &dispext0_dart { status = "okay"; }; From 78e061a453f486b90ef10c5e9e6aee9b1a47b053 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:43 +1100 Subject: [PATCH 04/79] dt-bindings: dma: apple,sio: Add t8112 compatible and resets The T8112 device tree uses apple,t8112-sio with the apple,sio fallback. Every SIO node also takes its pmgr reset through resets; document it. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- Documentation/devicetree/bindings/dma/apple,sio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/apple,sio.yaml b/Documentation/devicetree/bindings/dma/apple,sio.yaml index 5b6baf0a14024..338342f860537 100644 --- a/Documentation/devicetree/bindings/dma/apple,sio.yaml +++ b/Documentation/devicetree/bindings/dma/apple,sio.yaml @@ -27,6 +27,7 @@ properties: - apple,t6000-sio - apple,t6030-sio - apple,t8103-sio + - apple,t8112-sio - const: apple,sio - description: T6041 firmware requires a generation-specific backend. const: apple,t6041-sio @@ -52,6 +53,9 @@ properties: power-domains: maxItems: 1 + resets: + maxItems: 1 + memory-region: minItems: 2 maxItems: 8 From 468a52f0b7cc5bb4d6f1985d47cce0ef16ab2a8c Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:44 +1100 Subject: [PATCH 05/79] dt-bindings: mux: apple,display-crossbar: Allow the t8103 fallback on t8112 The T8112 crossbars are compatible with the T8103 ones and the device tree lists apple,t8103-display-crossbar as their fallback. Allow that pair. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/mux/apple,display-crossbar.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/mux/apple,display-crossbar.yaml b/Documentation/devicetree/bindings/mux/apple,display-crossbar.yaml index 7e5dc22e28f33..71f9de57c3a88 100644 --- a/Documentation/devicetree/bindings/mux/apple,display-crossbar.yaml +++ b/Documentation/devicetree/bindings/mux/apple,display-crossbar.yaml @@ -19,13 +19,17 @@ allOf: properties: compatible: - enum: - - apple,t8103-display-crossbar - - apple,t8112-display-crossbar - - apple,t6000-display-crossbar - - apple,t6020-display-crossbar - - apple,t6041-display-crossbar - - apple,t8132-display-crossbar + oneOf: + - enum: + - apple,t8103-display-crossbar + - apple,t8112-display-crossbar + - apple,t6000-display-crossbar + - apple,t6020-display-crossbar + - apple,t6041-display-crossbar + - apple,t8132-display-crossbar + - items: + - const: apple,t8112-display-crossbar + - const: apple,t8103-display-crossbar reg: maxItems: 1 From 974d23f2ebc6dfdb6882bc358d35ae814bed5655 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:45 +1100 Subject: [PATCH 06/79] dt-bindings: gpu: apple,agx: Add t8103 and t8112 compatibles The M1 and M2 GPU nodes list an SoC-specific compatible ahead of the generation one: apple,agx-t8103 with apple,agx-g13g and apple,agx-t8112 with apple,agx-g14g. Document both pairs. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- Documentation/devicetree/bindings/gpu/apple,agx.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/gpu/apple,agx.yaml b/Documentation/devicetree/bindings/gpu/apple,agx.yaml index 9b5dc5b51241e..882756aa0067d 100644 --- a/Documentation/devicetree/bindings/gpu/apple,agx.yaml +++ b/Documentation/devicetree/bindings/gpu/apple,agx.yaml @@ -21,6 +21,12 @@ properties: - apple,agx-t6041 - apple,agx-t8132 - apple,agx-t8140 + - items: + - const: apple,agx-t8103 + - const: apple,agx-g13g + - items: + - const: apple,agx-t8112 + - const: apple,agx-g14g - items: - enum: - apple,agx-g13c From f3cae4f1063aa6cb4d18a415af7ceb5c6204366d Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:46 +1100 Subject: [PATCH 07/79] ASoC: dt-bindings: apple,macaudio: Add the remaining M1 and M2 boards Add the MacBook Air (j313, j413, j415), iMac (j456, j457), Mac mini (j473) and 13-inch MacBook Pro (j493) compatibles their device trees already use. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../devicetree/bindings/sound/apple,macaudio.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml index e593b7b6d68c4..d76c8a2396005 100644 --- a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml @@ -19,7 +19,14 @@ properties: - enum: - apple,j274-macaudio - apple,j293-macaudio + - apple,j313-macaudio - apple,j314-macaudio + - apple,j413-macaudio + - apple,j415-macaudio + - apple,j456-macaudio + - apple,j457-macaudio + - apple,j473-macaudio + - apple,j493-macaudio - apple,j614-macaudio - apple,j614-macaudio-jack - apple,j616-macaudio From e61aafa34bd2e18d447de69cde2937f6e3337628 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:44:46 +1100 Subject: [PATCH 08/79] ASoC: dt-bindings: ti,tas2770: Allow ti,tas2770 as fallback for ti,tas5770l The Apple boards with a TAS5770L describe it as "ti,tas5770l", "ti,tas2770", and the driver binds through the ti,tas2770 fallback. Allow that pair besides the single compatibles. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../devicetree/bindings/sound/ti,tas2770.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/ti,tas2770.yaml b/Documentation/devicetree/bindings/sound/ti,tas2770.yaml index 8d49fbcf0b9b7..48639192c075b 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas2770.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tas2770.yaml @@ -21,9 +21,13 @@ allOf: properties: compatible: - enum: - - ti,tas2770 - - ti,tas5770l # Apple variant + oneOf: + - enum: + - ti,tas2770 + - ti,tas5770l # Apple variant + - items: + - const: ti,tas5770l + - const: ti,tas2770 reg: maxItems: 1 From 3b43f7036b2773e5a48bd2c3a83854c0b2dabbab Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:27 +1100 Subject: [PATCH 09/79] dt-bindings: sound: Add Apple T6000 and T6020 DisplayPort audio The M1 and M2 Pro/Max/Ultra device trees describe a DisplayPort audio interface per display coprocessor, but no schema matched "apple,t6000-dpaudio" or "apple,t6020-dpaudio", so dtbs_check reported every node. Document them: a register window the host does not touch, one SIO DMA channel, one power domain and a graph port to the DCP that owns the audio service. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/sound/apple,t6000-dpaudio.yaml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/apple,t6000-dpaudio.yaml diff --git a/Documentation/devicetree/bindings/sound/apple,t6000-dpaudio.yaml b/Documentation/devicetree/bindings/sound/apple,t6000-dpaudio.yaml new file mode 100644 index 0000000000000..7c409d4ea2c72 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,t6000-dpaudio.yaml @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,t6000-dpaudio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple T6000 and T6020 DisplayPort audio + +maintainers: + - Ryan Murray + +description: | + Each display coprocessor (DCP) provides a DisplayPort/HDMI audio service. + Samples are fed to it by SIO DMA; the host does not access the register + window of the interface. The graph connects this interface to port 0 of + the display processor that owns the audio service. + +select: + properties: + compatible: + contains: + enum: + - apple,t6000-dpaudio + - apple,t6020-dpaudio + required: + - compatible + +properties: + compatible: + items: + - enum: + - apple,t6000-dpaudio + - apple,t6020-dpaudio + - const: apple,dpaudio + + reg: + maxItems: 1 + + dmas: + maxItems: 1 + + dma-names: + const: tx + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Connection to the display processor's audio service. + required: + - port@0 + +required: + - compatible + - reg + - dmas + - dma-names + - power-domains + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + audio-controller@39b500000 { + compatible = "apple,t6000-dpaudio", "apple,dpaudio"; + reg = <0x3 0x9b500000 0x0 0x4000>; + dmas = <&sio 0x64>; + dma-names = "tx"; + power-domains = <&ps_dpa0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + endpoint { + remote-endpoint = <&dcp_audio>; + }; + }; + }; + }; + }; From ced9efbf3d0e27dcff5530bcfb08be3595adc17e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:27 +1100 Subject: [PATCH 10/79] arm64: dts: apple: t600x: Drop reset-domains from dpaudio "reset-domains" is not a documented property and nothing reads it: the DisplayPort audio driver only uses the DMA channel, the power domain and the graph port. Remove it so the nodes match the binding. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t600x-die0.dtsi | 1 - arch/arm64/boot/dts/apple/t600x-dieX.dtsi | 4 ---- 2 files changed, 5 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t600x-die0.dtsi b/arch/arm64/boot/dts/apple/t600x-die0.dtsi index 8357258058339..8ccbc3e45971f 100644 --- a/arch/arm64/boot/dts/apple/t600x-die0.dtsi +++ b/arch/arm64/boot/dts/apple/t600x-die0.dtsi @@ -561,7 +561,6 @@ dmas = <&sio 0x64>; dma-names = "tx"; power-domains = <&ps_dpa0>; - reset-domains = <&ps_dpa0>; status = "disabled"; ports { diff --git a/arch/arm64/boot/dts/apple/t600x-dieX.dtsi b/arch/arm64/boot/dts/apple/t600x-dieX.dtsi index 0b0da1a4b066b..31223f4612c7d 100644 --- a/arch/arm64/boot/dts/apple/t600x-dieX.dtsi +++ b/arch/arm64/boot/dts/apple/t600x-dieX.dtsi @@ -381,7 +381,6 @@ dmas = <&DIE_NODE(sio) 0x66>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa1)>; - reset-domains = <&DIE_NODE(ps_dpa1)>; status = "disabled"; ports { @@ -402,7 +401,6 @@ dmas = <&DIE_NODE(sio) 0x68>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa2)>; - reset-domains = <&DIE_NODE(ps_dpa2)>; status = "disabled"; ports { @@ -426,7 +424,6 @@ dmas = <&DIE_NODE(sio) 0x6a>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa3)>; - reset-domains = <&DIE_NODE(ps_dpa3)>; status = "disabled"; ports { @@ -447,7 +444,6 @@ dmas = <&DIE_NODE(sio) 0x6c>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa4)>; - reset-domains = <&DIE_NODE(ps_dpa4)>; status = "disabled"; ports { From 1cac809f61c4714535247d215fb3eaa113da5036 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:28 +1100 Subject: [PATCH 11/79] arm64: dts: apple: t6002: Enable the ANE The die 0 neural engine of the M1 Ultra is the block the M1 Pro and M1 Max use, at the same addresses, with the same DARTs and power states. t6001.dtsi enables it on those, but t6002.dtsi does not include that file, so the ANE stayed disabled on the Mac Studio (M1 Ultra). Enable it in the same way, including the die 0 PMP report window for its clock-level requests. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6002.dtsi | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6002.dtsi b/arch/arm64/boot/dts/apple/t6002.dtsi index d34a03b374df5..d5226019d484d 100644 --- a/arch/arm64/boot/dts/apple/t6002.dtsi +++ b/arch/arm64/boot/dts/apple/t6002.dtsi @@ -380,3 +380,57 @@ }; #include "hwmon-common.dtsi" + +/* + * The die 0 ANE is the same block as on the M1 Pro and M1 Max, so enable it + * the way t6001.dtsi does: with its DARTs, the power states only it uses and + * the die 0 PMP report for its clock-level requests. + */ +&ane { + apple,performance-controller = <&pmp_report>; + power-domains = <&ps_ane_sys_cpu>, <&ps_ane_set1>, + <&ps_ane_set2>, <&ps_ane_set3>, <&ps_ane_set4>, <&ps_pms_sram>; + status = "okay"; +}; + +&ane_dart0 { + status = "okay"; +}; + +&ane_dart1 { + status = "okay"; +}; + +&ane_dart2 { + status = "okay"; +}; + +&ps_ane_base { + status = "okay"; +}; + +&ps_ane_set0 { + status = "okay"; +}; + +&ps_ane_set1 { + status = "okay"; +}; + +&ps_ane_set2 { + status = "okay"; +}; + +&ps_ane_set3 { + status = "okay"; +}; + +&ps_ane_set4 { + status = "okay"; +}; + +&pmp_report { + reg = <0x2 0x8e3c0000 0x0 0x20000>, + <0x2 0x85868000 0x0 0x4000>; + reg-names = "report", "ane-dvfs"; +}; From 5d43a45f4101c815e714c99f032f719659f95d6e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:29 +1100 Subject: [PATCH 12/79] dt-bindings: apple: Add T6020 SIO, PMP and PCIe GE compatibles The M2 Pro/Max/Ultra device trees use "apple,t6020-sio", "apple,t6020-pmp-v2", "apple,t6020-pmp-v2-report-entry" and "apple,t6020-pcie-ge", none of which the bindings list. Add them with the fallbacks the device trees already carry: "apple,sio", "apple,t6000-pmp-v2", "apple,t6000-pmp-v2-report-entry" and "apple,t6020-pcie". Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- Documentation/devicetree/bindings/dma/apple,sio.yaml | 1 + Documentation/devicetree/bindings/pci/apple,pcie.yaml | 3 +++ .../devicetree/bindings/power/apple,t8140-pmp-report.yaml | 3 +++ Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml | 3 +++ 4 files changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/apple,sio.yaml b/Documentation/devicetree/bindings/dma/apple,sio.yaml index 5b6baf0a14024..a5f97e7daacab 100644 --- a/Documentation/devicetree/bindings/dma/apple,sio.yaml +++ b/Documentation/devicetree/bindings/dma/apple,sio.yaml @@ -25,6 +25,7 @@ properties: - items: - enum: - apple,t6000-sio + - apple,t6020-sio - apple,t6030-sio - apple,t8103-sio - const: apple,sio diff --git a/Documentation/devicetree/bindings/pci/apple,pcie.yaml b/Documentation/devicetree/bindings/pci/apple,pcie.yaml index 3a499f802b8f6..d952c9f568cbf 100644 --- a/Documentation/devicetree/bindings/pci/apple,pcie.yaml +++ b/Documentation/devicetree/bindings/pci/apple,pcie.yaml @@ -61,6 +61,9 @@ properties: - apple,t8122-pcie - const: apple,t6020-pcie - const: apple,t6020-pcie + - items: + - const: apple,t6020-pcie-ge + - const: apple,t6020-pcie - const: apple,t8140-pcie - const: apple,t8132-pcie - const: apple,t8103-pciec diff --git a/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml b/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml index 9ca5d2c1777f3..6bf7e946e19af 100644 --- a/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml +++ b/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml @@ -96,6 +96,9 @@ patternProperties: properties: compatible: oneOf: + - items: + - const: apple,t6020-pmp-v2-report-entry + - const: apple,t6000-pmp-v2-report-entry - const: apple,t6000-pmp-v2-report-entry - const: apple,t8140-pmp-v2-report-entry - items: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml b/Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml index 7e104b9db314d..819ae52bcc16c 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml @@ -18,6 +18,9 @@ description: | properties: compatible: oneOf: + - items: + - const: apple,t6020-pmp-v2 + - const: apple,t6000-pmp-v2 - const: apple,t6000-pmp-v2 - items: - enum: From 4455d0330e178ef32950eb1006364bcc0f895dec Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:29 +1100 Subject: [PATCH 13/79] arm64: dts: apple: t602x: Use the documented compatible fallbacks The T6020 power states, I2C, pinctrl, SPI, watchdog, MCA, NCO, NVMe, SMC, SPMI and ADMAC nodes listed a third, generic "apple,*" compatible after their "apple,t8103-*" fallback. The bindings only allow the two-entry form, so dtbs_check reported around 370 warnings per board, most of them for the 245 power states. Drop the generic entry, as the T6041 and T8122 trees already do. Give the AOP ADMAC the "apple,t8103-admac" fallback the other ADMAC has. The drivers match the T8103 fallbacks with the same data. The loader appends the generic compatibles again on T602x machines for older kernels, so the device tree the kernel sees does not change. Also drop the unused "reset-domains" from the DisplayPort audio nodes. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t602x-die0.dtsi | 41 +- arch/arm64/boot/dts/apple/t602x-dieX.dtsi | 10 +- arch/arm64/boot/dts/apple/t602x-nvme.dtsi | 2 +- arch/arm64/boot/dts/apple/t602x-pmgr.dtsi | 490 +++++++++++----------- 4 files changed, 269 insertions(+), 274 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t602x-die0.dtsi b/arch/arm64/boot/dts/apple/t602x-die0.dtsi index 6001004903632..bc5388b0b40ff 100644 --- a/arch/arm64/boot/dts/apple/t602x-die0.dtsi +++ b/arch/arm64/boot/dts/apple/t602x-die0.dtsi @@ -67,7 +67,7 @@ }; nco: clock-controller@28e03c000 { - compatible = "apple,t6020-nco", "apple,t8103-nco", "apple,nco"; + compatible = "apple,t6020-nco", "apple,t8103-nco"; reg = <0x2 0x8e03c000 0x0 0x14000>; clocks = <&nco_clkref>; #clock-cells = <1>; @@ -307,7 +307,7 @@ }; nub_spmi0: spmi@29e114000 { - compatible = "apple,t6020-spmi", "apple,t8103-spmi", "apple,spmi"; + compatible = "apple,t6020-spmi", "apple,t8103-spmi"; reg = <0x2 0x9e114000 0x0 0x100>; #address-cells = <2>; #size-cells = <0>; @@ -364,7 +364,7 @@ }; wdt: watchdog@29e2c4000 { - compatible = "apple,t6020-wdt", "apple,t8103-wdt", "apple,wdt"; + compatible = "apple,t6020-wdt", "apple,t8103-wdt"; reg = <0x2 0x9e2c4000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -385,7 +385,7 @@ }; smc: smc@2a2400000 { - compatible = "apple,t6020-smc", "apple,t8103-smc", "apple,smc"; + compatible = "apple,t6020-smc", "apple,t8103-smc"; reg = <0x2 0xa2400000 0x0 0x4000>, <0x2 0xa3e00000 0x0 0x100000>; reg-names = "smc", "sram"; @@ -417,7 +417,7 @@ }; pinctrl_smc: pinctrl@2a2820000 { - compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl", "apple,pinctrl"; + compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl"; reg = <0x2 0xa2820000 0x0 0x4000>; gpio-controller; @@ -461,7 +461,7 @@ }; aop_admac: dma-controller@2a6980000 { - compatible = "apple,t6020-admac", "apple,admac"; + compatible = "apple,t6020-admac", "apple,t8103-admac"; reg = <0x2 0xa6980000 0x0 0x34000>; #dma-cells = <1>; dma-channels = <16>; @@ -755,7 +755,7 @@ }; i2c0: i2c@39b040000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b040000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -768,7 +768,7 @@ }; i2c1: i2c@39b044000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b044000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -782,7 +782,7 @@ }; i2c2: i2c@39b048000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b048000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -796,7 +796,7 @@ }; i2c3: i2c@39b04c000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b04c000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -810,7 +810,7 @@ }; i2c4: i2c@39b050000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b050000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -824,7 +824,7 @@ }; i2c5: i2c@39b054000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b054000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -838,7 +838,7 @@ }; i2c6: i2c@39b054000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b054000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -852,7 +852,7 @@ }; i2c7: i2c@39b054000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b054000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -866,7 +866,7 @@ }; i2c8: i2c@39b054000 { - compatible = "apple,t6020-i2c", "apple,t8103-i2c", "apple,i2c"; + compatible = "apple,t6020-i2c", "apple,t8103-i2c"; reg = <0x3 0x9b054000 0x0 0x4000>; clocks = <&clkref>; interrupt-parent = <&aic>; @@ -880,7 +880,7 @@ }; spi1: spi@39b104000 { - compatible = "apple,t6020-spi", "apple,t8103-spi", "apple,spi"; + compatible = "apple,t6020-spi", "apple,t8103-spi"; reg = <0x3 0x9b104000 0x0 0x4000>; interrupt-parent = <&aic>; interrupts = ; @@ -894,7 +894,7 @@ }; spi2: spi@39b108000 { - compatible = "apple,t6020-spi", "apple,t8103-spi", "apple,spi"; + compatible = "apple,t6020-spi", "apple,t8103-spi"; reg = <0x3 0x9b108000 0x0 0x4000>; interrupt-parent = <&aic>; interrupts = ; @@ -916,7 +916,7 @@ }; spi4: spi@39b110000 { - compatible = "apple,t6020-spi", "apple,t8103-spi", "apple,spi"; + compatible = "apple,t6020-spi", "apple,t8103-spi"; reg = <0x3 0x9b110000 0x0 0x4000>; interrupt-parent = <&aic>; interrupts = ; @@ -946,7 +946,7 @@ }; admac: dma-controller@39b400000 { - compatible = "apple,t6020-admac", "apple,t8103-admac", "apple,admac"; + compatible = "apple,t6020-admac", "apple,t8103-admac"; reg = <0x3 0x9b400000 0x0 0x34000>; #dma-cells = <1>; dma-channels = <16>; @@ -965,7 +965,6 @@ dmas = <&sio 0x64>; dma-names = "tx"; power-domains = <&ps_dpa0>; - reset-domains = <&ps_dpa0>; status = "disabled"; ports { @@ -981,7 +980,7 @@ }; mca: mca@39b600000 { - compatible = "apple,t6020-mca", "apple,t8103-mca", "apple,mca"; + compatible = "apple,t6020-mca", "apple,t8103-mca"; reg = <0x3 0x9b600000 0x0 0x10000>, <0x3 0x9b500000 0x0 0x20000>; clocks = <&nco 0>, <&nco 1>, <&nco 2>, <&nco 3>; diff --git a/arch/arm64/boot/dts/apple/t602x-dieX.dtsi b/arch/arm64/boot/dts/apple/t602x-dieX.dtsi index cb4907704b057..7a088fa931990 100644 --- a/arch/arm64/boot/dts/apple/t602x-dieX.dtsi +++ b/arch/arm64/boot/dts/apple/t602x-dieX.dtsi @@ -160,7 +160,7 @@ }; DIE_NODE(pinctrl_nub): pinctrl@29e1f0000 { - compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl", "apple,pinctrl"; + compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl"; reg = <0x2 0x9e1f0000 0x0 0x4000>; power-domains = <&DIE_NODE(ps_nub_gpio)>; @@ -189,7 +189,7 @@ }; DIE_NODE(pinctrl_aop): pinctrl@2a6820000 { - compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl", "apple,pinctrl"; + compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl"; reg = <0x2 0xa6820000 0x0 0x4000>; gpio-controller; @@ -315,7 +315,7 @@ }; DIE_NODE(pinctrl_ap): pinctrl@39b028000 { - compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl", "apple,pinctrl"; + compatible = "apple,t6020-pinctrl", "apple,t8103-pinctrl"; reg = <0x3 0x9b028000 0x0 0x4000>; interrupt-parent = <&aic>; @@ -371,7 +371,6 @@ dmas = <&DIE_NODE(sio) 0x66>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa1)>; - reset-domains = <&DIE_NODE(ps_dpa1)>; status = "disabled"; ports { @@ -392,7 +391,6 @@ dmas = <&DIE_NODE(sio) 0x68>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa2)>; - reset-domains = <&DIE_NODE(ps_dpa2)>; status = "disabled"; ports { @@ -416,7 +414,6 @@ dmas = <&DIE_NODE(sio) 0x6a>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa3)>; - reset-domains = <&DIE_NODE(ps_dpa3)>; status = "disabled"; ports { @@ -437,7 +434,6 @@ dmas = <&DIE_NODE(sio) 0x6c>; dma-names = "tx"; power-domains = <&DIE_NODE(ps_dpa4)>; - reset-domains = <&DIE_NODE(ps_dpa4)>; status = "disabled"; ports { diff --git a/arch/arm64/boot/dts/apple/t602x-nvme.dtsi b/arch/arm64/boot/dts/apple/t602x-nvme.dtsi index 3ca48ed070473..d1f4267a6cd20 100644 --- a/arch/arm64/boot/dts/apple/t602x-nvme.dtsi +++ b/arch/arm64/boot/dts/apple/t602x-nvme.dtsi @@ -27,7 +27,7 @@ }; DIE_NODE(nvme): nvme@34bcc0000 { - compatible = "apple,t6020-nvme-ans2", "apple,t8103-nvme-ans2", "apple,nvme-ans2"; + compatible = "apple,t6020-nvme-ans2", "apple,t8103-nvme-ans2"; reg = <0x3 0x4bcc0000 0x0 0x40000>, <0x3 0x47400000 0x0 0x4000>; reg-names = "nvme", "ans"; interrupt-parent = <&aic>; diff --git a/arch/arm64/boot/dts/apple/t602x-pmgr.dtsi b/arch/arm64/boot/dts/apple/t602x-pmgr.dtsi index fffd0ad79b9bb..81afb5ae0c9f9 100644 --- a/arch/arm64/boot/dts/apple/t602x-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t602x-pmgr.dtsi @@ -7,7 +7,7 @@ &DIE_NODE(pmgr) { DIE_NODE(ps_afi): power-controller@100 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x100 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -16,7 +16,7 @@ }; DIE_NODE(ps_aic): power-controller@108 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x108 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -25,7 +25,7 @@ }; DIE_NODE(ps_dwi): power-controller@110 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x110 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -33,7 +33,7 @@ }; DIE_NODE(ps_pms): power-controller@118 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x118 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -42,7 +42,7 @@ }; DIE_NODE(ps_gpio): power-controller@120 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x120 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -51,7 +51,7 @@ }; DIE_NODE(ps_soc_dpe): power-controller@128 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x128 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -60,7 +60,7 @@ }; DIE_NODE(ps_pms_c1ppt): power-controller@130 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x130 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -69,7 +69,7 @@ }; DIE_NODE(ps_pmgr_soc_ocla): power-controller@138 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x138 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -78,7 +78,7 @@ }; DIE_NODE(ps_amcc0): power-controller@168 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x168 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -87,7 +87,7 @@ }; DIE_NODE(ps_amcc2): power-controller@170 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x170 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -96,7 +96,7 @@ }; DIE_NODE(ps_dcs_00): power-controller@178 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x178 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -105,7 +105,7 @@ }; DIE_NODE(ps_dcs_01): power-controller@180 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x180 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -114,7 +114,7 @@ }; DIE_NODE(ps_dcs_02): power-controller@188 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x188 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -123,7 +123,7 @@ }; DIE_NODE(ps_dcs_03): power-controller@190 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x190 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -132,7 +132,7 @@ }; DIE_NODE(ps_dcs_08): power-controller@198 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x198 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -141,7 +141,7 @@ }; DIE_NODE(ps_dcs_09): power-controller@1a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -150,7 +150,7 @@ }; DIE_NODE(ps_dcs_10): power-controller@1a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -159,7 +159,7 @@ }; DIE_NODE(ps_dcs_11): power-controller@1b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -168,7 +168,7 @@ }; DIE_NODE(ps_afnc1_ioa): power-controller@1b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -178,7 +178,7 @@ }; DIE_NODE(ps_afc): power-controller@1d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1d0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -187,7 +187,7 @@ }; DIE_NODE(ps_afnc0_ioa): power-controller@1e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -197,7 +197,7 @@ }; DIE_NODE(ps_afnc1_ls): power-controller@1f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -207,7 +207,7 @@ }; DIE_NODE(ps_afnc0_ls): power-controller@1f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1f8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -217,7 +217,7 @@ }; DIE_NODE(ps_afnc1_lw0): power-controller@200 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x200 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -227,7 +227,7 @@ }; DIE_NODE(ps_afnc1_lw1): power-controller@208 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x208 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -237,7 +237,7 @@ }; DIE_NODE(ps_afnc1_lw2): power-controller@210 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x210 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -247,7 +247,7 @@ }; DIE_NODE(ps_afnc0_lw0): power-controller@218 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x218 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -257,7 +257,7 @@ }; DIE_NODE(ps_scodec): power-controller@220 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x220 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -266,7 +266,7 @@ }; DIE_NODE(ps_atc0_common): power-controller@228 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x228 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -275,7 +275,7 @@ }; DIE_NODE(ps_atc1_common): power-controller@230 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x230 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -284,7 +284,7 @@ }; DIE_NODE(ps_atc2_common): power-controller@238 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x238 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -293,7 +293,7 @@ }; DIE_NODE(ps_atc3_common): power-controller@240 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x240 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -302,7 +302,7 @@ }; DIE_NODE(ps_dispext1_sys): power-controller@248 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x248 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -311,7 +311,7 @@ }; DIE_NODE(ps_pms_bridge): power-controller@250 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x250 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -321,7 +321,7 @@ }; DIE_NODE(ps_dispext0_sys): power-controller@258 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x258 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -330,7 +330,7 @@ }; DIE_NODE(ps_ane_sys): power-controller@260 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x260 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -339,7 +339,7 @@ }; DIE_NODE(ps_avd_sys): power-controller@268 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x268 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -348,7 +348,7 @@ }; DIE_NODE(ps_atc0_cio): power-controller@270 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x270 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -357,7 +357,7 @@ }; DIE_NODE(ps_atc0_pcie): power-controller@278 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x278 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -369,7 +369,7 @@ }; DIE_NODE(ps_atc1_cio): power-controller@280 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x280 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -378,7 +378,7 @@ }; DIE_NODE(ps_atc1_pcie): power-controller@288 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x288 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -390,7 +390,7 @@ }; DIE_NODE(ps_atc2_cio): power-controller@290 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x290 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -399,7 +399,7 @@ }; DIE_NODE(ps_atc2_pcie): power-controller@298 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x298 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -411,7 +411,7 @@ }; DIE_NODE(ps_atc3_cio): power-controller@2a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2a0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -420,7 +420,7 @@ }; DIE_NODE(ps_atc3_pcie): power-controller@2a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2a8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -432,7 +432,7 @@ }; DIE_NODE(ps_dispext1_fe): power-controller@2b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2b0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -441,7 +441,7 @@ }; DIE_NODE(ps_dispext1_cpu0): power-controller@2b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2b8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -451,7 +451,7 @@ }; DIE_NODE(ps_dispext0_fe): power-controller@2c0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2c0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -461,7 +461,7 @@ /* PMP is only present on die 0 of the M2 Ultra */ DIE_NODE(ps_pmp): power-controller@2c8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2c8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -470,7 +470,7 @@ }; DIE_NODE(ps_pms_sram): power-controller@2d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2d0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -479,7 +479,7 @@ }; DIE_NODE(ps_dispext0_cpu0): power-controller@2d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2d8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -489,7 +489,7 @@ }; DIE_NODE(ps_ane_cpu): power-controller@2e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2e0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -498,7 +498,7 @@ }; DIE_NODE(ps_atc0_cio_pcie): power-controller@2e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -507,7 +507,7 @@ }; DIE_NODE(ps_atc0_cio_usb): power-controller@2f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -516,7 +516,7 @@ }; DIE_NODE(ps_atc1_cio_pcie): power-controller@2f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2f8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -525,7 +525,7 @@ }; DIE_NODE(ps_atc1_cio_usb): power-controller@300 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x300 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -534,7 +534,7 @@ }; DIE_NODE(ps_atc2_cio_pcie): power-controller@308 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x308 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -543,7 +543,7 @@ }; DIE_NODE(ps_atc2_cio_usb): power-controller@310 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x310 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -552,7 +552,7 @@ }; DIE_NODE(ps_atc3_cio_pcie): power-controller@318 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x318 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -561,7 +561,7 @@ }; DIE_NODE(ps_atc3_cio_usb): power-controller@320 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x320 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -570,7 +570,7 @@ }; DIE_NODE(ps_trace_fab): power-controller@390 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x390 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -578,7 +578,7 @@ }; DIE_NODE(ps_ane_sys_mpm): power-controller@4000 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4000 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -587,7 +587,7 @@ }; DIE_NODE(ps_ane_td): power-controller@4008 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4008 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -596,7 +596,7 @@ }; DIE_NODE(ps_ane_base): power-controller@4010 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4010 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -605,7 +605,7 @@ }; DIE_NODE(ps_ane_set1): power-controller@4018 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4018 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -614,7 +614,7 @@ }; DIE_NODE(ps_ane_set2): power-controller@4020 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4020 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -623,7 +623,7 @@ }; DIE_NODE(ps_ane_set3): power-controller@4028 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4028 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -632,7 +632,7 @@ }; DIE_NODE(ps_ane_set4): power-controller@4030 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4030 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -643,7 +643,7 @@ &DIE_NODE(pmgr_south) { DIE_NODE(ps_amcc4): power-controller@100 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x100 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -652,7 +652,7 @@ }; DIE_NODE(ps_amcc5): power-controller@108 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x108 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -661,7 +661,7 @@ }; DIE_NODE(ps_amcc6): power-controller@110 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x110 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -670,7 +670,7 @@ }; DIE_NODE(ps_amcc7): power-controller@118 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x118 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -679,7 +679,7 @@ }; DIE_NODE(ps_dcs_16): power-controller@120 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x120 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -688,7 +688,7 @@ }; DIE_NODE(ps_dcs_17): power-controller@128 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x128 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -697,7 +697,7 @@ }; DIE_NODE(ps_dcs_18): power-controller@130 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x130 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -706,7 +706,7 @@ }; DIE_NODE(ps_dcs_19): power-controller@138 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x138 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -715,7 +715,7 @@ }; DIE_NODE(ps_dcs_20): power-controller@140 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x140 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -724,7 +724,7 @@ }; DIE_NODE(ps_dcs_21): power-controller@148 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x148 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -733,7 +733,7 @@ }; DIE_NODE(ps_dcs_22): power-controller@150 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x150 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -742,7 +742,7 @@ }; DIE_NODE(ps_dcs_23): power-controller@158 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x158 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -751,7 +751,7 @@ }; DIE_NODE(ps_dcs_24): power-controller@160 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x160 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -760,7 +760,7 @@ }; DIE_NODE(ps_dcs_25): power-controller@168 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x168 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -769,7 +769,7 @@ }; DIE_NODE(ps_dcs_26): power-controller@170 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x170 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -778,7 +778,7 @@ }; DIE_NODE(ps_dcs_27): power-controller@178 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x178 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -787,7 +787,7 @@ }; DIE_NODE(ps_dcs_28): power-controller@180 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x180 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -796,7 +796,7 @@ }; DIE_NODE(ps_dcs_29): power-controller@188 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x188 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -805,7 +805,7 @@ }; DIE_NODE(ps_dcs_30): power-controller@190 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x190 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -814,7 +814,7 @@ }; DIE_NODE(ps_dcs_31): power-controller@198 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x198 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -823,7 +823,7 @@ }; DIE_NODE(ps_afnc4_ioa): power-controller@1a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -833,7 +833,7 @@ }; DIE_NODE(ps_afnc4_ls): power-controller@1a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -843,7 +843,7 @@ }; DIE_NODE(ps_afnc4_lw0): power-controller@1b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -853,7 +853,7 @@ }; DIE_NODE(ps_afnc5_ioa): power-controller@1b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -863,7 +863,7 @@ }; DIE_NODE(ps_afnc5_ls): power-controller@1c0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1c0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -873,7 +873,7 @@ }; DIE_NODE(ps_afnc5_lw0): power-controller@1c8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1c8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -883,7 +883,7 @@ }; DIE_NODE(ps_dispext2_sys): power-controller@1d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1d0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -891,7 +891,7 @@ }; DIE_NODE(ps_msr1): power-controller@1d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1d8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -899,7 +899,7 @@ }; DIE_NODE(ps_dispext2_fe): power-controller@1e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1e0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -908,7 +908,7 @@ }; DIE_NODE(ps_dispext2_cpu0): power-controller@1e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -918,7 +918,7 @@ }; DIE_NODE(ps_msr1_ase_core): power-controller@1f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -927,7 +927,7 @@ }; DIE_NODE(ps_dispext3_sys): power-controller@220 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x220 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -935,7 +935,7 @@ }; DIE_NODE(ps_venc1_sys): power-controller@228 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x228 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -943,7 +943,7 @@ }; DIE_NODE(ps_dispext3_fe): power-controller@230 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x230 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -952,7 +952,7 @@ }; DIE_NODE(ps_dispext3_cpu0): power-controller@238 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x238 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -962,7 +962,7 @@ }; DIE_NODE(ps_venc1_dma): power-controller@4000 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4000 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -971,7 +971,7 @@ }; DIE_NODE(ps_venc1_pipe4): power-controller@4008 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4008 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -980,7 +980,7 @@ }; DIE_NODE(ps_venc1_pipe5): power-controller@4010 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4010 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -989,7 +989,7 @@ }; DIE_NODE(ps_venc1_me0): power-controller@4018 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4018 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -998,7 +998,7 @@ }; DIE_NODE(ps_venc1_me1): power-controller@4020 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4020 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1009,7 +1009,7 @@ &DIE_NODE(pmgr_east) { DIE_NODE(ps_clvr_spmi0): power-controller@100 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x100 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1018,7 +1018,7 @@ }; DIE_NODE(ps_clvr_spmi1): power-controller@108 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x108 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1027,7 +1027,7 @@ }; DIE_NODE(ps_clvr_spmi2): power-controller@110 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x110 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1036,7 +1036,7 @@ }; DIE_NODE(ps_clvr_spmi3): power-controller@118 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x118 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1045,7 +1045,7 @@ }; DIE_NODE(ps_clvr_spmi4): power-controller@120 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x120 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1054,7 +1054,7 @@ }; DIE_NODE(ps_ispsens0): power-controller@128 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x128 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1062,7 +1062,7 @@ }; DIE_NODE(ps_ispsens1): power-controller@130 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x130 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1070,7 +1070,7 @@ }; DIE_NODE(ps_ispsens2): power-controller@138 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x138 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1078,7 +1078,7 @@ }; DIE_NODE(ps_ispsens3): power-controller@140 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x140 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1086,7 +1086,7 @@ }; DIE_NODE(ps_afnc6_ioa): power-controller@148 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x148 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1096,7 +1096,7 @@ }; DIE_NODE(ps_afnc6_ls): power-controller@150 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x150 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1106,7 +1106,7 @@ }; DIE_NODE(ps_afnc6_lw0): power-controller@158 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x158 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1116,7 +1116,7 @@ }; DIE_NODE(ps_afnc2_ioa): power-controller@160 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x160 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1126,7 +1126,7 @@ }; DIE_NODE(ps_afnc2_ls): power-controller@168 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x168 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1136,7 +1136,7 @@ }; DIE_NODE(ps_afnc2_lw0): power-controller@170 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x170 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1146,7 +1146,7 @@ }; DIE_NODE(ps_afnc2_lw1): power-controller@178 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x178 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1156,7 +1156,7 @@ }; DIE_NODE(ps_afnc3_ioa): power-controller@180 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x180 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1166,7 +1166,7 @@ }; DIE_NODE(ps_afnc3_ls): power-controller@188 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x188 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1176,7 +1176,7 @@ }; DIE_NODE(ps_afnc3_lw0): power-controller@190 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x190 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1186,7 +1186,7 @@ }; DIE_NODE(ps_apcie_gp): power-controller@198 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x198 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1195,7 +1195,7 @@ }; DIE_NODE(ps_apcie_st): power-controller@1a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1204,7 +1204,7 @@ }; DIE_NODE(ps_ans2): power-controller@1a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1a8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1213,7 +1213,7 @@ }; DIE_NODE(ps_disp0_sys): power-controller@1b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1222,7 +1222,7 @@ }; DIE_NODE(ps_jpg): power-controller@1b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1b8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1231,7 +1231,7 @@ }; DIE_NODE(ps_sio): power-controller@1c0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1c0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1240,7 +1240,7 @@ }; DIE_NODE(ps_isp_sys): power-controller@1c8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1c8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1250,7 +1250,7 @@ }; DIE_NODE(ps_disp0_fe): power-controller@1d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1d0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1259,7 +1259,7 @@ }; DIE_NODE(ps_disp0_cpu0): power-controller@1d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1d8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1269,7 +1269,7 @@ }; DIE_NODE(ps_sio_cpu): power-controller@1e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1e0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1278,7 +1278,7 @@ }; DIE_NODE(ps_fpwm0): power-controller@1e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1287,7 +1287,7 @@ }; DIE_NODE(ps_fpwm1): power-controller@1f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1296,7 +1296,7 @@ }; DIE_NODE(ps_fpwm2): power-controller@1f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x1f8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1305,7 +1305,7 @@ }; DIE_NODE(ps_i2c0): power-controller@200 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x200 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1314,7 +1314,7 @@ }; DIE_NODE(ps_i2c1): power-controller@208 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x208 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1323,7 +1323,7 @@ }; DIE_NODE(ps_i2c2): power-controller@210 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x210 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1332,7 +1332,7 @@ }; DIE_NODE(ps_i2c3): power-controller@218 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x218 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1341,7 +1341,7 @@ }; DIE_NODE(ps_i2c4): power-controller@220 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x220 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1350,7 +1350,7 @@ }; DIE_NODE(ps_i2c5): power-controller@228 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x228 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1359,7 +1359,7 @@ }; DIE_NODE(ps_i2c6): power-controller@230 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x230 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1368,7 +1368,7 @@ }; DIE_NODE(ps_i2c7): power-controller@238 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x238 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1377,7 +1377,7 @@ }; DIE_NODE(ps_i2c8): power-controller@240 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x240 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1386,7 +1386,7 @@ }; DIE_NODE(ps_spi_p): power-controller@248 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x248 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1395,7 +1395,7 @@ }; DIE_NODE(ps_sio_spmi0): power-controller@250 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x250 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1404,7 +1404,7 @@ }; DIE_NODE(ps_sio_spmi1): power-controller@258 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x258 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1413,7 +1413,7 @@ }; DIE_NODE(ps_sio_spmi2): power-controller@260 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x260 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1422,7 +1422,7 @@ }; DIE_NODE(ps_uart_p): power-controller@268 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x268 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1431,7 +1431,7 @@ }; DIE_NODE(ps_audio_p): power-controller@270 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x270 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1440,7 +1440,7 @@ }; DIE_NODE(ps_sio_adma): power-controller@278 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x278 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1449,7 +1449,7 @@ }; DIE_NODE(ps_aes): power-controller@280 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x280 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1459,7 +1459,7 @@ }; DIE_NODE(ps_dptx_phy_ps): power-controller@288 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x288 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1468,7 +1468,7 @@ }; DIE_NODE(ps_spi0): power-controller@2d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2d8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1477,7 +1477,7 @@ }; DIE_NODE(ps_spi1): power-controller@2e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2e0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1486,7 +1486,7 @@ }; DIE_NODE(ps_spi2): power-controller@2e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1495,7 +1495,7 @@ }; DIE_NODE(ps_spi3): power-controller@2f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1504,7 +1504,7 @@ }; DIE_NODE(ps_spi4): power-controller@2f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2f8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1513,7 +1513,7 @@ }; DIE_NODE(ps_spi5): power-controller@300 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x300 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1522,7 +1522,7 @@ }; DIE_NODE(ps_uart_n): power-controller@308 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x308 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1531,7 +1531,7 @@ }; DIE_NODE(ps_uart0): power-controller@310 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x310 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1540,7 +1540,7 @@ }; DIE_NODE(ps_amcc1): power-controller@318 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x318 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1549,7 +1549,7 @@ }; DIE_NODE(ps_amcc3): power-controller@320 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x320 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1558,7 +1558,7 @@ }; DIE_NODE(ps_dcs_04): power-controller@328 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x328 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1567,7 +1567,7 @@ }; DIE_NODE(ps_dcs_05): power-controller@330 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x330 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1576,7 +1576,7 @@ }; DIE_NODE(ps_dcs_06): power-controller@338 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x338 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1585,7 +1585,7 @@ }; DIE_NODE(ps_dcs_07): power-controller@340 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x340 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1594,7 +1594,7 @@ }; DIE_NODE(ps_dcs_12): power-controller@348 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x348 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1603,7 +1603,7 @@ }; DIE_NODE(ps_dcs_13): power-controller@350 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x350 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1612,7 +1612,7 @@ }; DIE_NODE(ps_dcs_14): power-controller@358 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x358 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1621,7 +1621,7 @@ }; DIE_NODE(ps_dcs_15): power-controller@360 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x360 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1630,7 +1630,7 @@ }; DIE_NODE(ps_uart1): power-controller@368 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x368 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1639,7 +1639,7 @@ }; DIE_NODE(ps_uart2): power-controller@370 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x370 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1648,7 +1648,7 @@ }; DIE_NODE(ps_uart3): power-controller@378 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x378 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1657,7 +1657,7 @@ }; DIE_NODE(ps_uart4): power-controller@380 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x380 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1666,7 +1666,7 @@ }; DIE_NODE(ps_uart5): power-controller@388 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x388 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1675,7 +1675,7 @@ }; DIE_NODE(ps_uart6): power-controller@390 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x390 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1684,7 +1684,7 @@ }; DIE_NODE(ps_mca0): power-controller@398 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x398 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1694,7 +1694,7 @@ }; DIE_NODE(ps_mca1): power-controller@3a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3a0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1704,7 +1704,7 @@ }; DIE_NODE(ps_mca2): power-controller@3a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3a8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1714,7 +1714,7 @@ }; DIE_NODE(ps_mca3): power-controller@3b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3b0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1724,7 +1724,7 @@ }; DIE_NODE(ps_dpa0): power-controller@3b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3b8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1733,7 +1733,7 @@ }; DIE_NODE(ps_dpa1): power-controller@3c0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3c0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1742,7 +1742,7 @@ }; DIE_NODE(ps_dpa2): power-controller@3c8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3c8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1751,7 +1751,7 @@ }; DIE_NODE(ps_dpa3): power-controller@3d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3d0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1760,7 +1760,7 @@ }; DIE_NODE(ps_msr0): power-controller@3d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3d8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1768,7 +1768,7 @@ }; DIE_NODE(ps_venc_sys): power-controller@3e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3e0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1776,7 +1776,7 @@ }; DIE_NODE(ps_dpa4): power-controller@3e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3e8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1785,7 +1785,7 @@ }; DIE_NODE(ps_msr0_ase_core): power-controller@3f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3f0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1794,7 +1794,7 @@ }; DIE_NODE(ps_apcie_gpshr_sys): power-controller@3f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x3f8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1803,7 +1803,7 @@ }; DIE_NODE(ps_apcie_st_sys): power-controller@408 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x408 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1812,7 +1812,7 @@ }; DIE_NODE(ps_apcie_st1_sys): power-controller@410 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x410 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1821,7 +1821,7 @@ }; DIE_NODE(ps_apcie_gp_sys): power-controller@418 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x418 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1831,7 +1831,7 @@ }; DIE_NODE(ps_apcie_ge_sys): power-controller@420 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x420 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1840,7 +1840,7 @@ }; DIE_NODE(ps_apcie_phy_sw): power-controller@428 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x428 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1849,7 +1849,7 @@ }; DIE_NODE(ps_sep): power-controller@c00 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xc00 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1866,7 +1866,7 @@ * have to enable/disable everything in the per-model DTs. */ DIE_NODE(ps_isp_cpu): power-controller@4000 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4000 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1876,7 +1876,7 @@ }; DIE_NODE(ps_isp_fe): power-controller@4008 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4008 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1885,7 +1885,7 @@ }; DIE_NODE(ps_dprx): power-controller@4010 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4010 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1894,7 +1894,7 @@ }; DIE_NODE(ps_isp_vis): power-controller@4018 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4018 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1903,7 +1903,7 @@ }; DIE_NODE(ps_isp_be): power-controller@4020 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4020 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1912,7 +1912,7 @@ }; DIE_NODE(ps_isp_raw): power-controller@4028 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4028 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1921,7 +1921,7 @@ }; DIE_NODE(ps_isp_clr): power-controller@4030 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x4030 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1930,7 +1930,7 @@ }; DIE_NODE(ps_venc_dma): power-controller@8000 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x8000 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1939,7 +1939,7 @@ }; DIE_NODE(ps_venc_pipe4): power-controller@8008 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x8008 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1948,7 +1948,7 @@ }; DIE_NODE(ps_venc_pipe5): power-controller@8010 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x8010 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1957,7 +1957,7 @@ }; DIE_NODE(ps_venc_me0): power-controller@8018 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x8018 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1966,7 +1966,7 @@ }; DIE_NODE(ps_venc_me1): power-controller@8020 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x8020 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1975,7 +1975,7 @@ }; DIE_NODE(ps_prores): power-controller@c000 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xc000 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1986,7 +1986,7 @@ &DIE_NODE(pmgr_mini) { DIE_NODE(ps_debug): power-controller@58 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x58 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -1995,7 +1995,7 @@ }; DIE_NODE(ps_nub_spmi0): power-controller@60 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x60 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2004,7 +2004,7 @@ }; DIE_NODE(ps_nub_spmi1): power-controller@68 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x68 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2013,7 +2013,7 @@ }; DIE_NODE(ps_nub_aon): power-controller@70 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x70 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2022,7 +2022,7 @@ }; DIE_NODE(ps_msg): power-controller@78 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x78 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2031,7 +2031,7 @@ }; DIE_NODE(ps_nub_gpio): power-controller@80 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x80 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2040,7 +2040,7 @@ }; DIE_NODE(ps_nub_fabric): power-controller@88 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x88 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2049,7 +2049,7 @@ }; DIE_NODE(ps_atc0_usb_aon): power-controller@90 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x90 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2058,7 +2058,7 @@ }; DIE_NODE(ps_atc1_usb_aon): power-controller@98 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x98 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2067,7 +2067,7 @@ }; DIE_NODE(ps_atc2_usb_aon): power-controller@a0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xa0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2076,7 +2076,7 @@ }; DIE_NODE(ps_atc3_usb_aon): power-controller@a8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xa8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2085,7 +2085,7 @@ }; DIE_NODE(ps_mtp_fabric): power-controller@b0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xb0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2096,7 +2096,7 @@ }; DIE_NODE(ps_nub_sram): power-controller@b8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xb8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2105,7 +2105,7 @@ }; DIE_NODE(ps_debug_switch): power-controller@c0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xc0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2114,7 +2114,7 @@ }; DIE_NODE(ps_atc0_usb): power-controller@c8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xc8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2123,7 +2123,7 @@ }; DIE_NODE(ps_atc1_usb): power-controller@d0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xd0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2132,7 +2132,7 @@ }; DIE_NODE(ps_atc2_usb): power-controller@d8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xd8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2141,7 +2141,7 @@ }; DIE_NODE(ps_atc3_usb): power-controller@e0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xe0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2152,7 +2152,7 @@ #if 0 /* MTP stuff is self-managed */ DIE_NODE(ps_mtp_gpio): power-controller@e8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xe8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2162,7 +2162,7 @@ }; DIE_NODE(ps_mtp_base): power-controller@f0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xf0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2172,7 +2172,7 @@ }; DIE_NODE(ps_mtp_periph): power-controller@f8 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0xf8 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2182,7 +2182,7 @@ }; DIE_NODE(ps_mtp_spi0): power-controller@100 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x100 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2192,7 +2192,7 @@ }; DIE_NODE(ps_mtp_i2cm0): power-controller@108 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x108 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2202,7 +2202,7 @@ }; DIE_NODE(ps_mtp_uart0): power-controller@110 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x110 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2212,7 +2212,7 @@ }; DIE_NODE(ps_mtp_cpu): power-controller@118 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x118 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2222,7 +2222,7 @@ }; DIE_NODE(ps_mtp_scm_fabric): power-controller@120 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x120 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2232,7 +2232,7 @@ }; DIE_NODE(ps_mtp_sram): power-controller@128 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x128 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2242,7 +2242,7 @@ }; DIE_NODE(ps_mtp_dma): power-controller@130 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x130 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2255,7 +2255,7 @@ &DIE_NODE(pmgr_gfx) { DIE_NODE(ps_gpx): power-controller@0 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x0 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2265,7 +2265,7 @@ }; DIE_NODE(ps_afr): power-controller@100 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x100 4>; #power-domain-cells = <0>; #reset-cells = <0>; @@ -2275,7 +2275,7 @@ }; DIE_NODE(ps_gfx): power-controller@108 { - compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate"; + compatible = "apple,t6020-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x108 4>; #power-domain-cells = <0>; #reset-cells = <0>; From 0f7206ffbb3bb66690ff086104e8cf652952388b Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:50:30 +1100 Subject: [PATCH 14/79] arm64: dts: apple: t6022: Enable the ANE and die 0 SIO on J180 The die 0 neural engine of the M2 Ultra matches the M2 Pro and M2 Max one and the driver has T6022 match data, but only t6021.dtsi enabled it, so it stayed disabled on the Mac Studio and Mac Pro (M2 Ultra). Enable it with its mailbox and DARTs. The Mac Pro also drives its die 0 HDMI port with dpaudio1, whose DMA comes from the die 0 SIO. The loader sets up and enables SIO only for the "sio" and "sio1" aliases, and J180 only had "sio1" (die 1), so that audio interface could never get its channel. Alias the die 0 SIO as "sio". Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6022-j180d.dts | 6 ++++++ arch/arm64/boot/dts/apple/t6022.dtsi | 24 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6022-j180d.dts b/arch/arm64/boot/dts/apple/t6022-j180d.dts index 91677000cc120..bf0a526e912ba 100644 --- a/arch/arm64/boot/dts/apple/t6022-j180d.dts +++ b/arch/arm64/boot/dts/apple/t6022-j180d.dts @@ -33,6 +33,12 @@ ethernet1 = ðernet1; nvram = &nvram; serial0 = &serial0; + /* + * The loader sets up and enables each SIO it finds by alias. + * The die 0 HDMI port's audio (dpaudio1) is fed by the die 0 + * SIO; t6022-jxxxd.dtsi only aliases the die 1 one as sio1. + */ + sio = &sio; usb4-0-acio = &usb4_0_acio; usb4-0-nhi = &usb4_0_nhi; usb4-1-acio = &usb4_1_acio; diff --git a/arch/arm64/boot/dts/apple/t6022.dtsi b/arch/arm64/boot/dts/apple/t6022.dtsi index 4d0c94ce67d5b..95de0fb2c36c1 100644 --- a/arch/arm64/boot/dts/apple/t6022.dtsi +++ b/arch/arm64/boot/dts/apple/t6022.dtsi @@ -405,3 +405,27 @@ }; #include "hwmon-common.dtsi" + +/* + * The die 0 ANE matches the M2 Pro and M2 Max one and the driver carries + * T6022 data, so enable it with its mailbox and DARTs as t6021.dtsi does. + */ +&ane { + status = "okay"; +}; + +&ane_dart0 { + status = "okay"; +}; + +&ane_dart1 { + status = "okay"; +}; + +&ane_dart2 { + status = "okay"; +}; + +&ane_mbox { + status = "okay"; +}; From d937e5214307fa0146f7030a96370a648bf648fe Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 01:05:29 +1100 Subject: [PATCH 15/79] gpio: macsmc: add templated SMC output lines Some SMC-controlled enables are not plain gPxx GPIOs: they are written as a key with a per-line command template (a lowercase gp bank on T6040, pcIO lines on J700). Describe them with apple,output-templates and drive them through the same gpio_chip, reading back the SMC output latch where the key supports it. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/gpio/apple,smc-gpio.yaml | 12 +++ drivers/gpio/gpio-macsmc.c | 95 ++++++++++++++++++- 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml b/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml index b4063a9dd1248..b5159611f73c4 100644 --- a/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml @@ -23,6 +23,18 @@ properties: '#gpio-cells': const: 2 + apple,output-templates: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + maxItems: 128 + description: Pairs of GPIO number and native four-byte output template. + + apple,pcio-templates: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 3 + maxItems: 192 + description: Triples of GPIO number and native pcIO low/high word templates. + required: - compatible - gpio-controller diff --git a/drivers/gpio/gpio-macsmc.c b/drivers/gpio/gpio-macsmc.c index b9500afad3ce4..47feaa9e9d12a 100644 --- a/drivers/gpio/gpio-macsmc.c +++ b/drivers/gpio/gpio-macsmc.c @@ -106,6 +106,11 @@ struct macsmc_gpio { bool j700_pcio; DECLARE_BITMAP(j700_pcio_level, MAX_GPIO); + DECLARE_BITMAP(pcio_template_valid, MAX_GPIO); + u32 pcio_template_lo[MAX_GPIO]; + u32 pcio_template_hi[MAX_GPIO]; + DECLARE_BITMAP(output_template_valid, MAX_GPIO); + u32 output_template[MAX_GPIO]; bool j713; struct mutex j713_reg_on_lock; @@ -118,7 +123,14 @@ static bool macsmc_gpio_is_j700_pcio(struct macsmc_gpio *smcgp, { return smcgp->j700_pcio && (offset == MACSMC_J700_AFE_RESET_GPIO || - offset == MACSMC_J700_RADIO_REG_ON_GPIO); + offset == MACSMC_J700_RADIO_REG_ON_GPIO || + test_bit(offset, smcgp->pcio_template_valid)); +} + +static bool macsmc_gpio_has_output_template(struct macsmc_gpio *smcgp, + unsigned int offset) +{ + return test_bit(offset, smcgp->output_template_valid); } static bool macsmc_gpio_is_j713_reg_on(struct macsmc_gpio *smcgp, @@ -199,7 +211,8 @@ static int macsmc_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) int ret; if (macsmc_gpio_is_j700_pcio(smcgp, offset) || - macsmc_gpio_is_j713_reg_on(smcgp, offset)) + macsmc_gpio_is_j713_reg_on(smcgp, offset) || + macsmc_gpio_has_output_template(smcgp, offset)) return GPIO_LINE_DIRECTION_OUT; /* First try reading the explicit pin mode register */ @@ -230,6 +243,15 @@ static int macsmc_gpio_get(struct gpio_chip *gc, unsigned int offset) return ret; } + /* Query the SMC output latch; CMD_OUTPUT does not change the line. */ + if (macsmc_gpio_has_output_template(smcgp, offset)) { + ret = apple_smc_rw_u32(smcgp->smc, key, CMD_OUTPUT, &val); + if (ret < 0) + return ret; + + return !!val; + } + /* pcIO cannot be read back; report the last level written. */ if (macsmc_gpio_is_j700_pcio(smcgp, offset)) return test_bit(offset, smcgp->j700_pcio_level); @@ -271,6 +293,17 @@ static int macsmc_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) return ret; } + if (macsmc_gpio_has_output_template(smcgp, offset)) { + ret = apple_smc_write_u32(smcgp->smc, key, + smcgp->output_template[offset] | + !!value); + if (ret < 0) + dev_err_ratelimited(smcgp->dev, + "templated GPIO %u set to %u failed: %d\n", + offset, !!value, ret); + return ret; + } + if (macsmc_gpio_is_j700_pcio(smcgp, offset)) { u32 lo, hi; u64 payload; @@ -278,6 +311,9 @@ static int macsmc_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) if (offset == MACSMC_J700_RADIO_REG_ON_GPIO) { lo = MACSMC_J700_RADIO_REG_ON_LO; hi = MACSMC_J700_RADIO_REG_ON_HI; + } else if (test_bit(offset, smcgp->pcio_template_valid)) { + lo = smcgp->pcio_template_lo[offset]; + hi = smcgp->pcio_template_hi[offset]; } else { lo = MACSMC_J700_AFE_RESET_LO; hi = MACSMC_J700_AFE_RESET_HI; @@ -317,7 +353,10 @@ static int macsmc_gpio_init_valid_mask(struct gpio_chip *gc, if (smcgp->j700_pcio) { set_bit(MACSMC_J700_AFE_RESET_GPIO, valid_mask); set_bit(MACSMC_J700_RADIO_REG_ON_GPIO, valid_mask); + bitmap_or(valid_mask, valid_mask, smcgp->pcio_template_valid, + ngpios); } + bitmap_or(valid_mask, valid_mask, smcgp->output_template_valid, ngpios); for (i = 0; i < count; i++) { int ret, gpio_nr; @@ -346,6 +385,54 @@ struct macsmc_gpio_of_match_data { smc_key base_key; }; +static int macsmc_gpio_parse_templates(struct macsmc_gpio *smcgp) +{ + struct device *dev = smcgp->dev; + u32 *values; + int count, i, ret; + + count = device_property_count_u32(dev, "apple,output-templates"); + if (count > 0) { + if (count % 2) + return -EINVAL; + values = devm_kcalloc(dev, count, sizeof(*values), GFP_KERNEL); + if (!values) + return -ENOMEM; + ret = device_property_read_u32_array(dev, "apple,output-templates", + values, count); + if (ret) + return ret; + for (i = 0; i < count; i += 2) { + if (values[i] >= MAX_GPIO) + return -EINVAL; + smcgp->output_template[values[i]] = values[i + 1]; + set_bit(values[i], smcgp->output_template_valid); + } + } + + count = device_property_count_u32(dev, "apple,pcio-templates"); + if (count > 0) { + if (count % 3) + return -EINVAL; + values = devm_kcalloc(dev, count, sizeof(*values), GFP_KERNEL); + if (!values) + return -ENOMEM; + ret = device_property_read_u32_array(dev, "apple,pcio-templates", + values, count); + if (ret) + return ret; + for (i = 0; i < count; i += 3) { + if (values[i] >= MAX_GPIO) + return -EINVAL; + smcgp->pcio_template_lo[values[i]] = values[i + 1]; + smcgp->pcio_template_hi[values[i]] = values[i + 2]; + set_bit(values[i], smcgp->pcio_template_valid); + } + } + + return 0; +} + static int macsmc_gpio_probe(struct platform_device *pdev) { struct macsmc_gpio *smcgp; @@ -365,6 +452,10 @@ static int macsmc_gpio_probe(struct platform_device *pdev) device_is_compatible(&pdev->dev, "apple,smc-gpio"); smcgp->j713 = of_machine_is_compatible("apple,j713"); mutex_init(&smcgp->j713_reg_on_lock); + ret = macsmc_gpio_parse_templates(smcgp); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "invalid GPIO command templates\n"); smcgp->first_index = macsmc_gpio_find_first_gpio_index(smcgp); if (smcgp->first_index < 0) From 8fb736f0cc95726921205ba446532674f6caf9d1 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 01:05:29 +1100 Subject: [PATCH 16/79] nfc: add Apple Stockholm NCI controller over SPMI The NFC controller with embedded secure element on Apple silicon Macs sits on its own SPMI bus and carries NCI packets through a non-incrementing data register. Add a transport that powers it through its VEN line, checks the follower identity with side-effect-free register reads, registers it with the NCI core and parks VEN low whenever the device is closed, which is the controller's lowest power state. The NCI core reads the controller identity on first open. No secure element commands are implemented. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/net/nfc/apple,stockholm.yaml | 70 +++ drivers/nfc/Kconfig | 10 + drivers/nfc/Makefile | 1 + drivers/nfc/apple-stockholm.c | 452 ++++++++++++++++++ 4 files changed, 533 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml create mode 100644 drivers/nfc/apple-stockholm.c diff --git a/Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml b/Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml new file mode 100644 index 0000000000000..e3fb998b80486 --- /dev/null +++ b/Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/nfc/apple,stockholm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple Stockholm NFC controller over SPMI + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Stockholm is an NCI NFC controller and embedded Secure Element connected as + an SPMI follower. NCI frames are transferred through a non-incrementing FIFO + register. A separate enable GPIO controls the deepest power state. + +properties: + compatible: + const: apple,stockholm-nci + + reg: + maxItems: 1 + + interrupts: + minItems: 3 + maxItems: 3 + + interrupt-names: + items: + - const: host-wake + - const: data-ready + - const: error + + enable-gpios: + maxItems: 1 + description: VEN, the controller's enable line; low is its deepest power state. + + apple,transport-crc16: + type: boolean + description: NCI frames carry the standard big-endian CRC-CCITT trailer. + +required: + - compatible + - reg + - interrupts + - interrupt-names + - enable-gpios + +additionalProperties: false + +examples: + - | + #include + #include + #include + + spmi { + #address-cells = <2>; + #size-cells = <0>; + + nfc@9 { + compatible = "apple,stockholm-nci"; + reg = <9 SPMI_USID>; + interrupts = <229 IRQ_TYPE_EDGE_RISING>, + <230 IRQ_TYPE_EDGE_RISING>, + <227 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "host-wake", "data-ready", "error"; + enable-gpios = <&smc_gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index 288c6f1c69792..ec8d9f6e74419 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig @@ -60,6 +60,16 @@ config NFC_VIRTUAL_NCI If unsure, say N. +config NFC_APPLE_STOCKHOLM + tristate "Apple Stockholm NFC controller over SPMI" + depends on NFC_NCI && SPMI && GPIOLIB + select CRC_CCITT + help + This enables the NCI transport used by Apple Stockholm NFC and + embedded Secure Element controllers connected over SPMI. + + Say M here to compile this driver as a module named apple-stockholm. + source "drivers/nfc/fdp/Kconfig" source "drivers/nfc/pn544/Kconfig" source "drivers/nfc/pn533/Kconfig" diff --git a/drivers/nfc/Makefile b/drivers/nfc/Makefile index 7b1bfde1d971a..dafe12aae6922 100644 --- a/drivers/nfc/Makefile +++ b/drivers/nfc/Makefile @@ -18,3 +18,4 @@ obj-$(CONFIG_NFC_NXP_NCI) += nxp-nci/ obj-$(CONFIG_NFC_S3FWRN5) += s3fwrn5/ obj-$(CONFIG_NFC_ST95HF) += st95hf/ obj-$(CONFIG_NFC_VIRTUAL_NCI) += virtual_ncidev.o +obj-$(CONFIG_NFC_APPLE_STOCKHOLM) += apple-stockholm.o diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c new file mode 100644 index 0000000000000..0bcd811167d8a --- /dev/null +++ b/drivers/nfc/apple-stockholm.c @@ -0,0 +1,452 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Apple Stockholm NFC controller transport over SPMI + * + * Copyright The Asahi Linux Contributors + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define STOCKHOLM_NFC_PROTOCOLS (NFC_PROTO_JEWEL_MASK | \ + NFC_PROTO_MIFARE_MASK | \ + NFC_PROTO_FELICA_MASK | \ + NFC_PROTO_ISO14443_MASK | \ + NFC_PROTO_ISO14443_B_MASK | \ + NFC_PROTO_ISO15693_MASK | \ + NFC_PROTO_NFC_DEP_MASK) + +/* Transport parameters of one controller model. */ +struct stockholm_model { + u16 data_reg; /* non-incrementing NCI FIFO */ + u16 id_reg; /* follower ID, side-effect-free read */ + u16 irq_reg; /* follower IRQ offset, side-effect-free read */ + u16 standby_reg; /* follower virtual command register */ + u8 irq_offset; + u8 standby_on; + u8 standby_off; + u32 startup_delay_us; +}; + +static const struct stockholm_model stockholm_model96 = { + .data_reg = 0x1000, + .id_reg = 0x100, + .irq_reg = 0x105, + .standby_reg = 0x0, + .irq_offset = 0xa0, + .standby_on = 0x15, + .standby_off = 0x14, + .startup_delay_us = 10000, +}; + +struct stockholm { + struct spmi_device *sdev; + struct nci_dev *ndev; + struct gpio_desc *enable_gpio; + struct mutex io_lock; + u16 data_reg; + u16 standby_reg; + u8 standby_on; + u8 standby_off; + u32 startup_delay_us; + int data_irq; + int wake_irq; + int error_irq; + bool crc16; + bool powered; +}; + +static int stockholm_fifo_read(struct stockholm *st, u8 *buf, size_t len) +{ + size_t chunk; + int ret; + + while (len) { + chunk = min_t(size_t, len, 8); + ret = spmi_ext_register_readl(st->sdev, st->data_reg, buf, chunk); + if (ret) + return ret; + buf += chunk; + len -= chunk; + } + + return 0; +} + +static int stockholm_fifo_write(struct stockholm *st, const u8 *buf, size_t len) +{ + size_t chunk; + int ret; + + while (len) { + chunk = min_t(size_t, len, 8); + ret = spmi_ext_register_writel(st->sdev, st->data_reg, buf, chunk); + if (ret) + return ret; + buf += chunk; + len -= chunk; + } + + return 0; +} + +static int stockholm_set_standby(struct stockholm *st, bool standby) +{ + u8 value = standby ? st->standby_on : st->standby_off; + + return spmi_ext_register_writel(st->sdev, st->standby_reg, &value, 1); +} + +static int stockholm_set_power(struct stockholm *st, bool on) +{ + int ret; + + if (st->powered == on) + return 0; + + ret = gpiod_direction_output(st->enable_gpio, on); + if (ret) + return ret; + + st->powered = on; + if (on) { + usleep_range(st->startup_delay_us, + st->startup_delay_us + max_t(u32, 100, st->startup_delay_us / 10)); + ret = stockholm_set_standby(st, false); + if (ret) + dev_dbg(&st->sdev->dev, "standby exit failed: %d\n", ret); + } + + return 0; +} + +static int stockholm_nci_open(struct nci_dev *ndev) +{ + struct stockholm *st = nci_get_drvdata(ndev); + int ret; + + mutex_lock(&st->io_lock); + ret = stockholm_set_power(st, true); + if (!ret) + enable_irq(st->data_irq); + mutex_unlock(&st->io_lock); + + return ret; +} + +static int stockholm_nci_close(struct nci_dev *ndev) +{ + struct stockholm *st = nci_get_drvdata(ndev); + int ret; + + disable_irq(st->data_irq); + mutex_lock(&st->io_lock); + ret = stockholm_set_standby(st, false); + if (ret) + dev_dbg(&st->sdev->dev, "standby disable failed: %d\n", ret); + ret = stockholm_set_power(st, false); + mutex_unlock(&st->io_lock); + + return ret; +} + +static int stockholm_nci_send(struct nci_dev *ndev, struct sk_buff *skb) +{ + struct stockholm *st = nci_get_drvdata(ndev); + u8 *frame = skb->data; + size_t len = skb->len; + u16 crc; + int ret; + + if (!st->powered) { + kfree_skb(skb); + return -EHOSTDOWN; + } + + if (st->crc16) { + frame = kmalloc(len + sizeof(crc), GFP_KERNEL); + if (!frame) { + kfree_skb(skb); + return -ENOMEM; + } + memcpy(frame, skb->data, len); + crc = crc_ccitt(0xffff, frame, len); + put_unaligned_be16(crc, frame + len); + len += sizeof(crc); + } + + mutex_lock(&st->io_lock); + ret = stockholm_fifo_write(st, frame, len); + mutex_unlock(&st->io_lock); + + if (st->crc16) + kfree(frame); + if (ret) + kfree_skb(skb); + else + consume_skb(skb); + + return ret; +} + +static int stockholm_nci_post_setup(struct nci_dev *ndev) +{ + struct stockholm *st = nci_get_drvdata(ndev); + + dev_info(&st->sdev->dev, + "NCI %u.%u, manufacturer %#02x, firmware identity %#08x\n", + ndev->nci_ver >> 4, ndev->nci_ver & 0xf, + ndev->manufact_id, ndev->manufact_specific_info); + + return 0; +} + +static const struct nci_ops stockholm_nci_ops = { + .open = stockholm_nci_open, + .close = stockholm_nci_close, + .send = stockholm_nci_send, + .post_setup = stockholm_nci_post_setup, +}; + +static irqreturn_t stockholm_data_irq_thread(int irq, void *data) +{ + struct stockholm *st = data; + struct nci_ctrl_hdr hdr; + struct sk_buff *skb = NULL; + size_t nci_len, wire_len; + u16 expected, received; + int ret; + + mutex_lock(&st->io_lock); + ret = stockholm_fifo_read(st, (u8 *)&hdr, sizeof(hdr)); + if (ret) + goto out_unlock; + + nci_len = sizeof(hdr) + hdr.plen; + wire_len = nci_len + (st->crc16 ? sizeof(received) : 0); + skb = alloc_skb(wire_len, GFP_KERNEL); + if (!skb) { + ret = -ENOMEM; + goto out_unlock; + } + + skb_put_data(skb, &hdr, sizeof(hdr)); + ret = stockholm_fifo_read(st, skb_put(skb, wire_len - sizeof(hdr)), + wire_len - sizeof(hdr)); + mutex_unlock(&st->io_lock); + if (ret) + goto out_free; + + if (st->crc16) { + received = get_unaligned_be16(skb->data + nci_len); + expected = crc_ccitt(0xffff, skb->data, nci_len); + if (received != expected) { + dev_err_ratelimited(&st->sdev->dev, + "NCI transport CRC mismatch\n"); + goto out_free; + } + skb_trim(skb, nci_len); + } + + nci_recv_frame(st->ndev, skb); + return IRQ_HANDLED; + +out_unlock: + mutex_unlock(&st->io_lock); +out_free: + if (!ret) + ret = -EBADMSG; + if (ret) + dev_err_ratelimited(&st->sdev->dev, "NCI receive failed: %d\n", ret); + if (skb) + kfree_skb(skb); + return IRQ_HANDLED; +} + +static irqreturn_t stockholm_wake_irq_thread(int irq, void *data) +{ + struct stockholm *st = data; + + pm_wakeup_event(&st->sdev->dev, 0); + return IRQ_HANDLED; +} + +static irqreturn_t stockholm_error_irq_thread(int irq, void *data) +{ + struct stockholm *st = data; + + dev_err_ratelimited(&st->sdev->dev, "SPMI transport error interrupt\n"); + return IRQ_HANDLED; +} + +static int stockholm_read_config(struct stockholm *st, + const struct stockholm_model *model) +{ + struct device *dev = &st->sdev->dev; + u8 value; + int ret; + + ret = spmi_ext_register_readl(st->sdev, model->id_reg, &value, 1); + if (ret) + return dev_err_probe(dev, ret, "failed to read follower ID\n"); + if (value != st->sdev->usid) + return dev_err_probe(dev, -ENODEV, + "unexpected follower ID %#02x\n", value); + + ret = spmi_ext_register_readl(st->sdev, model->irq_reg, &value, 1); + if (ret) + return dev_err_probe(dev, ret, "failed to read IRQ offset\n"); + if (value != model->irq_offset) + return dev_err_probe(dev, -ENODEV, + "unexpected IRQ offset %#02x\n", value); + + return 0; +} + +static int stockholm_probe(struct spmi_device *sdev) +{ + struct device *dev = &sdev->dev; + const struct stockholm_model *model; + struct stockholm *st; + int ven, ret; + + st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL); + if (!st) + return -ENOMEM; + + st->sdev = sdev; + mutex_init(&st->io_lock); + spmi_device_set_drvdata(sdev, st); + + model = device_get_match_data(dev); + if (!model) + return -ENODEV; + st->data_reg = model->data_reg; + st->standby_reg = model->standby_reg; + st->standby_on = model->standby_on; + st->standby_off = model->standby_off; + st->startup_delay_us = model->startup_delay_us; + st->crc16 = device_property_read_bool(dev, "apple,transport-crc16"); + + st->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_ASIS); + if (IS_ERR(st->enable_gpio)) + return dev_err_probe(dev, PTR_ERR(st->enable_gpio), + "failed to get VEN GPIO\n"); + ven = gpiod_get_value_cansleep(st->enable_gpio); + dev_dbg(dev, "VEN at probe: %d\n", ven); + + ret = stockholm_set_power(st, true); + if (ret) + return dev_err_probe(dev, ret, "failed to enable controller\n"); + + ret = stockholm_read_config(st, model); + if (ret) + goto err_poweroff; + + st->ndev = nci_allocate_device(&stockholm_nci_ops, + STOCKHOLM_NFC_PROTOCOLS, 0, 0); + if (!st->ndev) { + ret = -ENOMEM; + goto err_poweroff; + } + nci_set_parent_dev(st->ndev, dev); + nci_set_drvdata(st->ndev, st); + + st->data_irq = fwnode_irq_get_byname(dev_fwnode(dev), "data-ready"); + if (st->data_irq < 0) { + ret = st->data_irq; + goto err_free_nci; + } + ret = devm_request_threaded_irq(dev, st->data_irq, NULL, + stockholm_data_irq_thread, IRQF_ONESHOT, + dev_name(dev), st); + if (ret) + goto err_free_nci; + disable_irq(st->data_irq); + + st->wake_irq = fwnode_irq_get_byname(dev_fwnode(dev), "host-wake"); + if (st->wake_irq >= 0) { + ret = devm_request_threaded_irq(dev, st->wake_irq, NULL, + stockholm_wake_irq_thread, + IRQF_ONESHOT, dev_name(dev), st); + if (ret) + goto err_free_nci; + device_init_wakeup(dev, true); + } + + st->error_irq = fwnode_irq_get_byname(dev_fwnode(dev), "error"); + if (st->error_irq >= 0) { + ret = devm_request_threaded_irq(dev, st->error_irq, NULL, + stockholm_error_irq_thread, + IRQF_ONESHOT, dev_name(dev), st); + if (ret) + goto err_free_nci; + } + + ret = nci_register_device(st->ndev); + if (ret) + goto err_free_nci; + + ret = stockholm_set_standby(st, false); + if (ret) + dev_dbg(dev, "initial standby disable failed: %d\n", ret); + ret = stockholm_set_power(st, false); + if (ret) + dev_warn(dev, "failed to park VEN low: %d\n", ret); + else + dev_info(dev, "registered NCI device and parked VEN low\n"); + + return 0; + +err_free_nci: + nci_free_device(st->ndev); +err_poweroff: + stockholm_set_power(st, false); + return ret; +} + +static void stockholm_remove(struct spmi_device *sdev) +{ + struct stockholm *st = spmi_device_get_drvdata(sdev); + + nci_unregister_device(st->ndev); + nci_free_device(st->ndev); + stockholm_set_power(st, false); +} + +static void stockholm_shutdown(struct spmi_device *sdev) +{ + struct stockholm *st = spmi_device_get_drvdata(sdev); + + stockholm_set_power(st, false); +} + +static const struct of_device_id stockholm_of_match[] = { + { .compatible = "apple,stockholm-nci", .data = &stockholm_model96 }, + {} +}; +MODULE_DEVICE_TABLE(of, stockholm_of_match); + +static struct spmi_driver stockholm_driver = { + .probe = stockholm_probe, + .remove = stockholm_remove, + .shutdown = stockholm_shutdown, + .driver = { + .name = "apple-stockholm", + .of_match_table = stockholm_of_match, + }, +}; +module_spmi_driver(stockholm_driver); + +MODULE_AUTHOR("Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>"); +MODULE_DESCRIPTION("Apple Stockholm NFC controller over SPMI"); +MODULE_LICENSE("GPL"); From c81aac918300cb4ffa4c6da06c801bd323fe0f63 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 01:05:30 +1100 Subject: [PATCH 17/79] arm64: dts: apple: describe the AOP SPMI bus and Stockholm on J616s and J700 aop-spmi0 is driven by the application processor (there is no AOP ownership handoff), so give it its interrupt controller and parent interrupt, add the T8140 node, and describe the Stockholm NFC/SE controller at SID 9 with its VEN line on the J616s and J700. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6040-j616s.dts | 24 +++++++++++++++++++++++ arch/arm64/boot/dts/apple/t604x.dtsi | 5 ++++- arch/arm64/boot/dts/apple/t8140-j700.dts | 19 ++++++++++++++++++ arch/arm64/boot/dts/apple/t8140.dtsi | 13 ++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 276f7347b12a2..5a25e63052c83 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -26,6 +26,30 @@ brcm,board-type = "apple,hostomel"; }; +&smc { + smc_gpio_low_stockholm: gpio-low { + compatible = "apple,smc-low-gpio"; + gpio-controller; + #gpio-cells = <2>; + apple,output-templates = <0xe 0x00800000>; + }; +}; + +&aop_spmi0 { + status = "okay"; + + stockholm: nfc@9 { + compatible = "apple,stockholm-nci"; + reg = <9 SPMI_USID>; + interrupt-parent = <&aop_spmi0>; + interrupts = <229 IRQ_TYPE_EDGE_RISING>, + <230 IRQ_TYPE_EDGE_RISING>, + <227 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "host-wake", "data-ready", "error"; + enable-gpios = <&smc_gpio_low_stockholm 0xe GPIO_ACTIVE_HIGH>; + }; +}; + &panel { compatible = "apple,panel-j616", "apple,panel-mini-led", "apple,panel"; width-mm = <345>; diff --git a/arch/arm64/boot/dts/apple/t604x.dtsi b/arch/arm64/boot/dts/apple/t604x.dtsi index 178f1b061283e..bd087b234f20c 100644 --- a/arch/arm64/boot/dts/apple/t604x.dtsi +++ b/arch/arm64/boot/dts/apple/t604x.dtsi @@ -2241,7 +2241,10 @@ reg = <0x5 0x10914000 0x0 0x100>; #address-cells = <2>; #size-cells = <0>; - /* Shared with AOP firmware; no AP bus ownership handoff yet. */ + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = ; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/apple/t8140-j700.dts b/arch/arm64/boot/dts/apple/t8140-j700.dts index d1cee1f89ff0b..40cba05dd1116 100644 --- a/arch/arm64/boot/dts/apple/t8140-j700.dts +++ b/arch/arm64/boot/dts/apple/t8140-j700.dts @@ -660,6 +660,25 @@ status = "okay"; }; +&smc_gpio { + apple,pcio-templates = <10 0x800000 0xa0000>; +}; + +&aop_spmi0 { + status = "okay"; + + stockholm: nfc@9 { + compatible = "apple,stockholm-nci"; + reg = <9 SPMI_USID>; + interrupt-parent = <&aop_spmi0>; + interrupts = <229 IRQ_TYPE_EDGE_RISING>, + <230 IRQ_TYPE_EDGE_RISING>, + <227 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "host-wake", "data-ready", "error"; + enable-gpios = <&smc_gpio 10 GPIO_ACTIVE_HIGH>; + }; +}; + &smc_hwmon { apple,thermal-pressure-key = "mTPL"; diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index 21f5759613177..8199030e4386b 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -905,6 +905,19 @@ status = "disabled"; }; + aop_spmi0: spmi@100914000 { + compatible = "apple,t8140-spmi", "apple,t8103-spmi"; + reg = <0x1 0x00914000 0x0 0x100>; + #address-cells = <2>; + #size-cells = <0>; + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_aop_spmi0>; + status = "disabled"; + }; + smc: smc@30c600000 { compatible = "apple,t8140-smc", "apple,t8103-smc"; reg = <0x3 0x0c600000 0x0 0x4000>, From c7558a6ce40df2782ee4e4e293c62fe0a408aaa1 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:19:24 +1100 Subject: [PATCH 18/79] nfc: apple-stockholm: correct the model 96 receive transport Use the separate receive FIFO, drain its two-byte wire footer, and report the native diagnostic status registers on a transport error. Drop the unsupported CRC-CCITT transform. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/nfc/apple-stockholm.c | 116 +++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index 0bcd811167d8a..b675e76e485a2 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -5,15 +5,14 @@ * Copyright The Asahi Linux Contributors */ -#include #include #include #include #include +#include #include #include #include -#include #include @@ -25,24 +24,30 @@ NFC_PROTO_ISO15693_MASK | \ NFC_PROTO_NFC_DEP_MASK) +#define STOCKHOLM_ERROR_STATUS0_REG 0x4 +#define STOCKHOLM_ERROR_STATUS1_REG 0x7 +#define STOCKHOLM_ERROR_STATUS2_REG 0x8 + /* Transport parameters of one controller model. */ struct stockholm_model { - u16 data_reg; /* non-incrementing NCI FIFO */ + u16 tx_reg; /* non-incrementing NCI transmit FIFO */ + u16 rx_reg; /* non-incrementing NCI receive FIFO */ u16 id_reg; /* follower ID, side-effect-free read */ u16 irq_reg; /* follower IRQ offset, side-effect-free read */ u16 standby_reg; /* follower virtual command register */ - u8 irq_offset; + u8 rx_trailer_len; /* bytes drained after the NCI packet */ u8 standby_on; u8 standby_off; u32 startup_delay_us; }; static const struct stockholm_model stockholm_model96 = { - .data_reg = 0x1000, + .tx_reg = 0x1000, + .rx_reg = 0x80, .id_reg = 0x100, .irq_reg = 0x105, .standby_reg = 0x0, - .irq_offset = 0xa0, + .rx_trailer_len = 2, .standby_on = 0x15, .standby_off = 0x14, .startup_delay_us = 10000, @@ -53,15 +58,16 @@ struct stockholm { struct nci_dev *ndev; struct gpio_desc *enable_gpio; struct mutex io_lock; - u16 data_reg; + u16 tx_reg; + u16 rx_reg; u16 standby_reg; + u8 rx_trailer_len; u8 standby_on; u8 standby_off; u32 startup_delay_us; int data_irq; int wake_irq; int error_irq; - bool crc16; bool powered; }; @@ -72,7 +78,7 @@ static int stockholm_fifo_read(struct stockholm *st, u8 *buf, size_t len) while (len) { chunk = min_t(size_t, len, 8); - ret = spmi_ext_register_readl(st->sdev, st->data_reg, buf, chunk); + ret = spmi_ext_register_readl(st->sdev, st->rx_reg, buf, chunk); if (ret) return ret; buf += chunk; @@ -89,7 +95,7 @@ static int stockholm_fifo_write(struct stockholm *st, const u8 *buf, size_t len) while (len) { chunk = min_t(size_t, len, 8); - ret = spmi_ext_register_writel(st->sdev, st->data_reg, buf, chunk); + ret = spmi_ext_register_writel(st->sdev, st->tx_reg, buf, chunk); if (ret) return ret; buf += chunk; @@ -162,9 +168,6 @@ static int stockholm_nci_close(struct nci_dev *ndev) static int stockholm_nci_send(struct nci_dev *ndev, struct sk_buff *skb) { struct stockholm *st = nci_get_drvdata(ndev); - u8 *frame = skb->data; - size_t len = skb->len; - u16 crc; int ret; if (!st->powered) { @@ -172,24 +175,10 @@ static int stockholm_nci_send(struct nci_dev *ndev, struct sk_buff *skb) return -EHOSTDOWN; } - if (st->crc16) { - frame = kmalloc(len + sizeof(crc), GFP_KERNEL); - if (!frame) { - kfree_skb(skb); - return -ENOMEM; - } - memcpy(frame, skb->data, len); - crc = crc_ccitt(0xffff, frame, len); - put_unaligned_be16(crc, frame + len); - len += sizeof(crc); - } - mutex_lock(&st->io_lock); - ret = stockholm_fifo_write(st, frame, len); + ret = stockholm_fifo_write(st, skb->data, skb->len); mutex_unlock(&st->io_lock); - if (st->crc16) - kfree(frame); if (ret) kfree_skb(skb); else @@ -222,8 +211,8 @@ static irqreturn_t stockholm_data_irq_thread(int irq, void *data) struct stockholm *st = data; struct nci_ctrl_hdr hdr; struct sk_buff *skb = NULL; - size_t nci_len, wire_len; - u16 expected, received; + u8 trailer[2]; + size_t nci_len; int ret; mutex_lock(&st->io_lock); @@ -232,31 +221,21 @@ static irqreturn_t stockholm_data_irq_thread(int irq, void *data) goto out_unlock; nci_len = sizeof(hdr) + hdr.plen; - wire_len = nci_len + (st->crc16 ? sizeof(received) : 0); - skb = alloc_skb(wire_len, GFP_KERNEL); + skb = alloc_skb(nci_len, GFP_KERNEL); if (!skb) { ret = -ENOMEM; goto out_unlock; } skb_put_data(skb, &hdr, sizeof(hdr)); - ret = stockholm_fifo_read(st, skb_put(skb, wire_len - sizeof(hdr)), - wire_len - sizeof(hdr)); + ret = stockholm_fifo_read(st, skb_put(skb, hdr.plen), hdr.plen); + /* The two model-96 trailer bytes are not part of the NCI packet. */ + if (!ret && st->rx_trailer_len) + ret = stockholm_fifo_read(st, trailer, st->rx_trailer_len); mutex_unlock(&st->io_lock); if (ret) goto out_free; - if (st->crc16) { - received = get_unaligned_be16(skb->data + nci_len); - expected = crc_ccitt(0xffff, skb->data, nci_len); - if (received != expected) { - dev_err_ratelimited(&st->sdev->dev, - "NCI transport CRC mismatch\n"); - goto out_free; - } - skb_trim(skb, nci_len); - } - nci_recv_frame(st->ndev, skb); return IRQ_HANDLED; @@ -283,8 +262,30 @@ static irqreturn_t stockholm_wake_irq_thread(int irq, void *data) static irqreturn_t stockholm_error_irq_thread(int irq, void *data) { struct stockholm *st = data; + u8 status[3]; + int ret; + + mutex_lock(&st->io_lock); + ret = spmi_ext_register_readl(st->sdev, STOCKHOLM_ERROR_STATUS0_REG, + &status[0], 1); + if (!ret) + ret = spmi_ext_register_readl(st->sdev, + STOCKHOLM_ERROR_STATUS1_REG, + &status[1], 1); + if (!ret) + ret = spmi_ext_register_readl(st->sdev, + STOCKHOLM_ERROR_STATUS2_REG, + &status[2], 1); + mutex_unlock(&st->io_lock); - dev_err_ratelimited(&st->sdev->dev, "SPMI transport error interrupt\n"); + if (ret) + dev_err_ratelimited(&st->sdev->dev, + "SPMI transport error; status read failed: %d\n", + ret); + else + dev_err_ratelimited(&st->sdev->dev, + "SPMI transport error: status %#02x/%#02x/%#02x\n", + status[0], status[1], status[2]); return IRQ_HANDLED; } @@ -292,20 +293,33 @@ static int stockholm_read_config(struct stockholm *st, const struct stockholm_model *model) { struct device *dev = &st->sdev->dev; + u32 expected; u8 value; int ret; + ret = device_property_read_u32(dev, "apple,follower-id", &expected); + if (ret) + return dev_err_probe(dev, ret, "missing expected follower ID\n"); + if (expected > U8_MAX) + return dev_err_probe(dev, -EINVAL, "invalid expected follower ID\n"); + ret = spmi_ext_register_readl(st->sdev, model->id_reg, &value, 1); if (ret) return dev_err_probe(dev, ret, "failed to read follower ID\n"); - if (value != st->sdev->usid) + if (value != expected) return dev_err_probe(dev, -ENODEV, "unexpected follower ID %#02x\n", value); + ret = device_property_read_u32(dev, "apple,irq-offset", &expected); + if (ret) + return dev_err_probe(dev, ret, "missing expected IRQ offset\n"); + if (expected > U8_MAX) + return dev_err_probe(dev, -EINVAL, "invalid expected IRQ offset\n"); + ret = spmi_ext_register_readl(st->sdev, model->irq_reg, &value, 1); if (ret) return dev_err_probe(dev, ret, "failed to read IRQ offset\n"); - if (value != model->irq_offset) + if (value != expected) return dev_err_probe(dev, -ENODEV, "unexpected IRQ offset %#02x\n", value); @@ -330,13 +344,13 @@ static int stockholm_probe(struct spmi_device *sdev) model = device_get_match_data(dev); if (!model) return -ENODEV; - st->data_reg = model->data_reg; + st->tx_reg = model->tx_reg; + st->rx_reg = model->rx_reg; st->standby_reg = model->standby_reg; + st->rx_trailer_len = model->rx_trailer_len; st->standby_on = model->standby_on; st->standby_off = model->standby_off; st->startup_delay_us = model->startup_delay_us; - st->crc16 = device_property_read_bool(dev, "apple,transport-crc16"); - st->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_ASIS); if (IS_ERR(st->enable_gpio)) return dev_err_probe(dev, PTR_ERR(st->enable_gpio), From 2d25d2aa21c36ccb16fac50e55867432beea2094 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:20:01 +1100 Subject: [PATCH 19/79] nfc: apple-stockholm: drop the unused CRC dependency The corrected wire transport drains its opaque footer without applying a CRC transform, so CRC_CCITT is no longer needed. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/nfc/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index ec8d9f6e74419..b87ab0027c848 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig @@ -63,7 +63,6 @@ config NFC_VIRTUAL_NCI config NFC_APPLE_STOCKHOLM tristate "Apple Stockholm NFC controller over SPMI" depends on NFC_NCI && SPMI && GPIOLIB - select CRC_CCITT help This enables the NCI transport used by Apple Stockholm NFC and embedded Secure Element controllers connected over SPMI. From 2925b4ee7de954c4b9e3908bc4ce7b5bdcc626d3 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:36:17 +1100 Subject: [PATCH 20/79] nfc: apple-stockholm: check the model 96 identity registers The follower identity register of a model 96 controller reads 0x19 and its IRQ-offset register reads the base of the follower's interrupt block, 0xe0; neither is the SPMI address. Check them against the model data instead of the follower's SID. Seen on the J616s with the controller powered. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/nfc/apple-stockholm.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index b675e76e485a2..0087568292dee 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,8 @@ struct stockholm_model { u16 irq_reg; /* follower IRQ offset, side-effect-free read */ u16 standby_reg; /* follower virtual command register */ u8 rx_trailer_len; /* bytes drained after the NCI packet */ + u8 follower_id; /* expected value of id_reg */ + u8 irq_offset; /* expected base of the follower's IRQ block */ u8 standby_on; u8 standby_off; u32 startup_delay_us; @@ -48,6 +49,8 @@ static const struct stockholm_model stockholm_model96 = { .irq_reg = 0x105, .standby_reg = 0x0, .rx_trailer_len = 2, + .follower_id = 0x19, + .irq_offset = 0xe0, .standby_on = 0x15, .standby_off = 0x14, .startup_delay_us = 10000, @@ -293,33 +296,20 @@ static int stockholm_read_config(struct stockholm *st, const struct stockholm_model *model) { struct device *dev = &st->sdev->dev; - u32 expected; u8 value; int ret; - ret = device_property_read_u32(dev, "apple,follower-id", &expected); - if (ret) - return dev_err_probe(dev, ret, "missing expected follower ID\n"); - if (expected > U8_MAX) - return dev_err_probe(dev, -EINVAL, "invalid expected follower ID\n"); - ret = spmi_ext_register_readl(st->sdev, model->id_reg, &value, 1); if (ret) return dev_err_probe(dev, ret, "failed to read follower ID\n"); - if (value != expected) + if (value != model->follower_id) return dev_err_probe(dev, -ENODEV, "unexpected follower ID %#02x\n", value); - ret = device_property_read_u32(dev, "apple,irq-offset", &expected); - if (ret) - return dev_err_probe(dev, ret, "missing expected IRQ offset\n"); - if (expected > U8_MAX) - return dev_err_probe(dev, -EINVAL, "invalid expected IRQ offset\n"); - ret = spmi_ext_register_readl(st->sdev, model->irq_reg, &value, 1); if (ret) return dev_err_probe(dev, ret, "failed to read IRQ offset\n"); - if (value != expected) + if (value != model->irq_offset) return dev_err_probe(dev, -ENODEV, "unexpected IRQ offset %#02x\n", value); From 31de54b1839eaa98fffdff6e549bc969bf822207 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:54:00 +1100 Subject: [PATCH 21/79] nfc: apple-stockholm: model 96 receive frames carry no trailer On the J616s a model 96 controller delivers each NCI packet as header and payload only. Reading two more bytes runs into the next packet or past the end of the FIFO, fails the SPMI frame parity check and raises the transport error interrupt. Drain nothing after the payload. Tested on J616s (trial device tree, fleet17 base): CORE_RESET and CORE_INIT complete, the NCI core reports NCI 1.0 and the controller identity, no parity or transport errors, VEN parked low on close. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/nfc/apple-stockholm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index 0087568292dee..6aa4802df38d1 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -48,7 +48,7 @@ static const struct stockholm_model stockholm_model96 = { .id_reg = 0x100, .irq_reg = 0x105, .standby_reg = 0x0, - .rx_trailer_len = 2, + .rx_trailer_len = 0, .follower_id = 0x19, .irq_offset = 0xe0, .standby_on = 0x15, From 88aa1e296179703a060b925f2dab2c55696a4592 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:32 -0500 Subject: [PATCH 22/79] dt-bindings: arm: apple: Call the J713 and J715 M4 MacBook Airs The J713 and J715 entries sit under the M4 platforms but their comments name the M3. Name the M4. Signed-off-by: Diljit Singh --- Documentation/devicetree/bindings/arm/apple.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml index f0061e05acbef..19972afe6eb3d 100644 --- a/Documentation/devicetree/bindings/arm/apple.yaml +++ b/Documentation/devicetree/bindings/arm/apple.yaml @@ -357,8 +357,8 @@ properties: - apple,j604 # MacBook Pro (14-inch, M4, 2024) - apple,j623 # iMac (24-inch, 2x USB-C, M4, 2024) - apple,j624 # iMac (24-inch, 4x USB-C, M4, 2024) - - apple,j713 # MacBook Air (13-inch, M3, 2025) - - apple,j715 # MacBook Air (15-inch, M3, 2025) + - apple,j713 # MacBook Air (13-inch, M4, 2025) + - apple,j715 # MacBook Air (15-inch, M4, 2025) - apple,j773g # Mac mini (M4, 2024) - const: apple,t8132 - const: apple,arm-platform From 1374afba07c9712d008f458c387c7774d04715ab Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:32 -0500 Subject: [PATCH 23/79] dt-bindings: sound: apple,macaudio: Add the J715 The J715 (MacBook Air 15-inch, M4) has a speaker card and a headphone jack card of its own, like the J713. Signed-off-by: Diljit Singh --- Documentation/devicetree/bindings/sound/apple,macaudio.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml index 78cd6910dfba8..0c6ba6d3b6222 100644 --- a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml @@ -40,6 +40,8 @@ properties: - apple,j700-macaudio - apple,j713-macaudio - apple,j713-macaudio-jack + - apple,j715-macaudio + - apple,j715-macaudio-jack - const: apple,macaudio - description: Machines that share the speaker and jack layout of an earlier From da1ed9fdd83a04a2f7d6c8a894a5373a0e73bfbe Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:32 -0500 Subject: [PATCH 24/79] soc: apple: Cover the J715 wherever the J713 is matched The J715 (MacBook Air 15-inch, M4) is the J713 board with a larger panel and six speaker amps. Its ADT matches the J713's in the PMGR device and power-state tables, the DARTs and their streams, the PMP, MTP, SEP and Mesa wiring, so the same boot loader handoff applies. Add apple_t8132_air() for the two boards, and use it where the T8132 support only qualifies the J713: the PMP display and GPU vote bridge, the PMP telemetry, the dcpext route gate, the MTP RTKit preservation, the legacy-loader platform handoff and its KUnit test, and the SEP Touch ID profile. Signed-off-by: Diljit Singh --- drivers/soc/apple/display-gate.c | 9 +++++---- drivers/soc/apple/pmp-telemetry.c | 4 ++-- drivers/soc/apple/profile.rs | 12 +++++++----- drivers/soc/apple/rtkit-helper.c | 6 +++--- drivers/soc/apple/t8132-platform-handoff.c | 7 ++++--- drivers/soc/apple/t8132-platform-test.c | 5 +++-- include/linux/soc/apple/pmp-display.h | 6 +++--- include/linux/soc/apple/t8132.h | 20 ++++++++++++++++++++ 8 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 include/linux/soc/apple/t8132.h diff --git a/drivers/soc/apple/display-gate.c b/drivers/soc/apple/display-gate.c index 81f0c022ed947..94828093b3154 100644 --- a/drivers/soc/apple/display-gate.c +++ b/drivers/soc/apple/display-gate.c @@ -107,6 +107,7 @@ #include #include #include +#include #include #include #include @@ -3068,9 +3069,9 @@ static void __init gate_t6041_max_run(void) } /* - * J713: the dcpext Type-C routes are disabled in the device tree, as on - * J613, because a USB-C port controller waits for the mode switch of every - * available route. Enable them only for a dcpext the boot loader handed + * J713 and J715: the dcpext Type-C routes are disabled in the device tree, + * as on J613, because a USB-C port controller waits for the mode switch of + * every available route. Enable them only for a dcpext the boot loader handed * over (apple,t8132-dcpext-firmware-ready = 1). A handed-over dcpext that is * not adopted then disables them again, see dcp_platform_probe_t8132_ext(). * Only the device tree changes here; no register is touched. @@ -3114,7 +3115,7 @@ static int __init apple_display_gate(void) { int i; - if (of_machine_is_compatible("apple,j713")) { + if (apple_t8132_air()) { gate_j713_dcpext_routes(); return 0; } diff --git a/drivers/soc/apple/pmp-telemetry.c b/drivers/soc/apple/pmp-telemetry.c index fb9c1605e874d..4ef51355328fe 100644 --- a/drivers/soc/apple/pmp-telemetry.c +++ b/drivers/soc/apple/pmp-telemetry.c @@ -15,11 +15,11 @@ #include #include #include +#include bool apple_pmp_telemetry_retained_board(void) { - return of_machine_is_compatible("apple,j713") && - of_machine_is_compatible("apple,t8132"); + return apple_t8132_air() && of_machine_is_compatible("apple,t8132"); } static LIST_HEAD(apple_pmp_telemetry_list); diff --git a/drivers/soc/apple/profile.rs b/drivers/soc/apple/profile.rs index b7a7a40b328d6..a662fa9289fdf 100644 --- a/drivers/soc/apple/profile.rs +++ b/drivers/soc/apple/profile.rs @@ -468,9 +468,9 @@ pub(crate) const T6041: PlatformProfile = PlatformProfile { /// calibration is an FSC2 image. So it takes J700's SPI mode 2 and nonce /// session; its device tree names its signed root key. J713 on OS firmware /// 26.6.2 provisions its keybag, enrols, matches and restores the enrolment -/// after a reboot. +/// after a reboot. The J715 ADT describes the same sensor, wiring and SEP. pub(crate) const T8132: PlatformProfile = PlatformProfile { - name: "T8132/J713", + name: "T8132/J713/J715", sensor: SensorProfile { controller_base: 0x3_ad10_8000, mode: SpiMode::Mode2, @@ -663,8 +663,8 @@ fn select( if has(b"apple,t6041") && has(b"apple,j616c") { return Ok(&T6041); } - // Only J713: the other T8132 Macs are unread. - if has(b"apple,t8132") && has(b"apple,j713") { + // Only the M4 MacBook Airs: the other T8132 Macs are unread. + if has(b"apple,t8132") && (has(b"apple,j713") || has(b"apple,j715")) { return Ok(&T8132); } Err(ENODEV) @@ -731,8 +731,10 @@ mod tests { } #[test] - fn t8132_selection_is_limited_to_j713() { + fn t8132_selection_is_limited_to_the_m4_airs() { assert_eq!(picked(&[b"apple,j713", b"apple,t8132"]), Some(T8132.name)); + assert_eq!(picked(&[b"apple,j715", b"apple,t8132"]), Some(T8132.name)); + assert_eq!(picked(&[b"apple,j604", b"apple,t8132"]), None); assert_eq!(picked(&[b"apple,t8132"]), None); assert_eq!(picked(&[b"apple,j613", b"apple,t8132"]), None); assert_eq!(picked(&[b"apple,j713", b"apple,t8122"]), None); diff --git a/drivers/soc/apple/rtkit-helper.c b/drivers/soc/apple/rtkit-helper.c index cbb4be1ebfbaf..2442635f7500d 100644 --- a/drivers/soc/apple/rtkit-helper.c +++ b/drivers/soc/apple/rtkit-helper.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -275,15 +276,14 @@ static int apple_rtkit_helper_probe(struct platform_device *pdev) count = apple_rtkit_helper_inherit_buffers(helper, buffers); if (count < 0) return dev_err_probe(dev, count, "Invalid inherited RTKit buffers\n"); - if ((of_machine_is_compatible("apple,j713") && + if ((apple_t8132_air() && of_device_is_compatible(dev->of_node, "apple,t8132-mtp")) || (of_machine_is_compatible("apple,j614s") && of_device_is_compatible(dev->of_node, "apple,t6041-mtp"))) helper->preserved = true; } - if (!live && of_machine_is_compatible("apple,j713") && - of_machine_is_compatible("apple,t8132")) { + if (!live && apple_t8132_air() && of_machine_is_compatible("apple,t8132")) { struct property *prop; u32 inherited; int len; diff --git a/drivers/soc/apple/t8132-platform-handoff.c b/drivers/soc/apple/t8132-platform-handoff.c index 302c41d4964a1..35140c5404506 100644 --- a/drivers/soc/apple/t8132-platform-handoff.c +++ b/drivers/soc/apple/t8132-platform-handoff.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT -/* Supply missing platform descriptions for the original J713 loader ABI. +/* Supply missing platform descriptions for the original J713 loader ABI, + * which the J715 shares. * Keep the shared m1n1 payload usable by the stable kernel. Hardware control * remains in the ordinary MCC, PMC and CLPC drivers, with one DTS data source. * J713 PMGR ownership/status also comes from its board DTS, before any domain @@ -9,6 +10,7 @@ #include #include #include +#include #include extern const u8 __dtb_t8132_platform_data_begin[]; @@ -215,8 +217,7 @@ static int __init t8132_platform_handoff(void) unsigned int added = 0, changed = 0; int root, node, ret; - if (!of_machine_is_compatible("apple,j713") || - !of_machine_is_compatible("apple,t8132")) + if (!apple_t8132_air() || !of_machine_is_compatible("apple,t8132")) return 0; if (fdt_check_header(data)) return -EINVAL; diff --git a/drivers/soc/apple/t8132-platform-test.c b/drivers/soc/apple/t8132-platform-test.c index a5cdf1e467f39..cea42199a28c0 100644 --- a/drivers/soc/apple/t8132-platform-test.c +++ b/drivers/soc/apple/t8132-platform-test.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT #include #include +#include static void t8132_test_legacy_descriptions(struct kunit *test) { @@ -14,8 +15,8 @@ static void t8132_test_legacy_descriptions(struct kunit *test) u32 reg[8], agent; const char *status; - if (!of_machine_is_compatible("apple,j713")) { - kunit_skip(test, "requires the J713 legacy-loader fixture"); + if (!apple_t8132_air()) { + kunit_skip(test, "requires the J713/J715 legacy-loader fixture"); return; } mcc = of_find_compatible_node(NULL, NULL, "apple,t8132-mcc"); diff --git a/include/linux/soc/apple/pmp-display.h b/include/linux/soc/apple/pmp-display.h index f919a4c362d6c..350a3c5f4e1c7 100644 --- a/include/linux/soc/apple/pmp-display.h +++ b/include/linux/soc/apple/pmp-display.h @@ -3,13 +3,13 @@ #define _LINUX_SOC_APPLE_PMP_DISPLAY_H #include +#include #include -/* The retained M4 bridge and raw thermal records are qualified for J713. */ +/* The retained M4 bridge and raw thermal records: J713, and the J715 too. */ static inline bool apple_pmp_j713_board(void) { - return of_machine_is_compatible("apple,j713") && - of_machine_is_compatible("apple,t8132"); + return apple_t8132_air() && of_machine_is_compatible("apple,t8132"); } struct device; diff --git a/include/linux/soc/apple/t8132.h b/include/linux/soc/apple/t8132.h new file mode 100644 index 0000000000000..bd383c51b13d7 --- /dev/null +++ b/include/linux/soc/apple/t8132.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ +#ifndef _LINUX_SOC_APPLE_T8132_H +#define _LINUX_SOC_APPLE_T8132_H + +#include +#include + +/* + * The M4 MacBook Airs, J713 (13-inch) and J715 (15-inch): one board design + * and boot loader handoff. Their ADTs differ in the panel, the speakers, the + * radio's firmware island and per-machine trims, all of which their device + * trees describe. + */ +static inline bool apple_t8132_air(void) +{ + return of_machine_is_compatible("apple,j713") || + of_machine_is_compatible("apple,j715"); +} + +#endif From 2b4b35c8fa52909b7d853e77e69c375d74714689 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:33 -0500 Subject: [PATCH 25/79] pmdomain: apple: Cover the J715 like the J713 The J715 shares the J713's loader handoff and PMGR tables. Require the board's power-domain policy and use the T8132 PMP report path on it too. Signed-off-by: Diljit Singh --- drivers/pmdomain/apple/pmgr-pwrstate.c | 13 +++++++------ drivers/pmdomain/apple/pmp-report.c | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/pmdomain/apple/pmgr-pwrstate.c b/drivers/pmdomain/apple/pmgr-pwrstate.c index 59ebf701f8db0..2367cc8c339d6 100644 --- a/drivers/pmdomain/apple/pmgr-pwrstate.c +++ b/drivers/pmdomain/apple/pmgr-pwrstate.c @@ -20,6 +20,7 @@ #include #include #include +#include #define APPLE_PMGR_RESET BIT(31) #define APPLE_PMGR_AUTO_ENABLE BIT(28) @@ -531,13 +532,13 @@ static int apple_pmgr_ps_probe(struct platform_device *pdev) t8132 = of_device_is_compatible(node, "apple,t8132-pmgr-pwrstate"); /* - * The original J713 loader tree exposes domains Linux cannot access. - * The early compatibility adapter supplies the board's explicit status - * and ownership before population; fail closed if it was not enabled. - * Other T8132 boards keep their own domain descriptions and behaviour. + * The original J713 loader tree, which the J715 shares, exposes domains + * Linux cannot access. The early compatibility adapter supplies the + * board's explicit status and ownership before population; fail closed + * if it was not enabled. Other T8132 boards keep their own domain + * descriptions and behaviour. */ - if (t8132 && of_machine_is_compatible("apple,j713") && - !of_property_present(node, "status")) + if (t8132 && apple_t8132_air() && !of_property_present(node, "status")) return dev_err_probe(dev, -ENODEV, "missing J713 power-domain policy\n"); tvm = of_parse_phandle(node, "power-domains", 0); diff --git a/drivers/pmdomain/apple/pmp-report.c b/drivers/pmdomain/apple/pmp-report.c index 2429a5637c2a9..d3b5350fc50e1 100644 --- a/drivers/pmdomain/apple/pmp-report.c +++ b/drivers/pmdomain/apple/pmp-report.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -486,7 +487,7 @@ int apple_pmp_report_wait_supplier_ready(struct device *supplier, unsigned int t struct platform_device *pdev; struct apple_pmp_report *rep; u64 status; - bool t8132 = of_machine_is_compatible("apple,j713") && + bool t8132 = apple_t8132_air() && of_device_is_compatible(supplier->of_node, "apple,t8132-pmp-v2"); int ret; From 3e7fcb23167adf93710ac2fa2c809621753c1d2a Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:33 -0500 Subject: [PATCH 26/79] iommu/apple-dart: Cover the J715 like the J713 The J715's display, external display, radio and MTP DARTs are the J713's: the same addresses and streams, and the same live state at boot. Give them the J713 handling, and accept the J715 target-type in the retained display handoff's ADT check. Signed-off-by: Diljit Singh --- drivers/iommu/apple-dart-dcp-format.h | 4 +++- drivers/iommu/apple-dart.c | 22 +++++++++---------- .../apple-dcp/m4-dart-boot-contract-test.py | 6 +++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/apple-dart-dcp-format.h b/drivers/iommu/apple-dart-dcp-format.h index 124f20977afd7..b47db0f65e29b 100644 --- a/drivers/iommu/apple-dart-dcp-format.h +++ b/drivers/iommu/apple-dart-dcp-format.h @@ -157,7 +157,9 @@ static inline int dcp_adt_value(struct dcp_adt_tables *out, if (kind == 1 && !strcmp(name, "target-type")) { bit = 1; - if (length != 5 || memcmp(value, "J713", 5)) + /* The M4 Airs share the retained display handoff. */ + if (length != 5 || + (memcmp(value, "J713", 5) && memcmp(value, "J715", 5))) return -ENODEV; } else if (kind == 3 && !strcmp(name, "compatible")) { bit = 2; diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 1234b4a771e7a..2d332ea3abff9 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -3493,7 +3494,7 @@ static int apple_dart_def_domain_type(struct device *dev) */ if (cfg->stream_maps[0].dart->tunneled) return IOMMU_DOMAIN_DMA; - if (dev_is_pci(dev) && of_machine_is_compatible("apple,j713") && + if (dev_is_pci(dev) && apple_t8132_air() && cfg->supports_bypass && !cfg->locked) return IOMMU_DOMAIN_IDENTITY; if (!cfg->supports_bypass) @@ -4111,24 +4112,24 @@ static int apple_dart_probe(struct platform_device *pdev) bool j713_display, j713_dcpext, j713_dispext, j713_radio; /* - * The J713 internal display DARTs are live: DCP firmware (SID23) and - * the scanout/PIODMA frontend (SID0/SID16) keep using them. Leave both - * untouched until userspace, with its watchdog armed, opts in. + * The J713/J715 internal display DARTs are live: DCP firmware (SID23) + * and the scanout/PIODMA frontend (SID0/SID16) keep using them. Leave + * both untouched until userspace, with its watchdog armed, opts in. */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - j713_display = res && !tunneled && of_machine_is_compatible("apple,j713") && + j713_display = res && !tunneled && apple_t8132_air() && of_device_is_compatible(dev->of_node, "apple,t8132-dart") && (res->start == 0x30a300000ULL || res->start == 0x30a340000ULL); /* The external DCP firmware DARTs (SID23) of dcpext0 and dcpext1. */ - j713_dcpext = res && !tunneled && of_machine_is_compatible("apple,j713") && + j713_dcpext = res && !tunneled && apple_t8132_air() && of_device_is_compatible(dev->of_node, "apple,t8132-dart") && (res->start == 0x286340000ULL || res->start == 0x48a340000ULL); /* The external display DARTs (SID0/SID16) of dispext0 and dispext1. */ - j713_dispext = res && !tunneled && of_machine_is_compatible("apple,j713") && + j713_dispext = res && !tunneled && apple_t8132_air() && of_device_is_compatible(dev->of_node, "apple,t8132-dart") && (res->start == 0x286300000ULL || res->start == 0x48a300000ULL); - /* The J713 radio DART's fault interrupt is not described by its loader. */ - j713_radio = res && !tunneled && of_machine_is_compatible("apple,j713") && + /* The radio DART's fault interrupt is not described by the loader. */ + j713_radio = res && !tunneled && apple_t8132_air() && of_machine_is_compatible("apple,t8132") && of_device_is_compatible(dev->of_node, "apple,t8132-dart") && res->start == 0x490000000ULL; @@ -4531,8 +4532,7 @@ static int apple_dart_probe(struct platform_device *pdev) of_node_put(iommu); of_node_put(mtp); } - if (of_machine_is_compatible("apple,j713") && - of_machine_is_compatible("apple,t8132") && + if (apple_t8132_air() && of_machine_is_compatible("apple,t8132") && res->start == 0x394800000ULL && dart->hw->type == DART_T8110 && !dart->locked && !tunneled && dart->supports_bypass && apple_dart_streams_bypassed(dart)) { diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/m4-dart-boot-contract-test.py b/tools/testing/selftests/drivers/gpu/apple-dcp/m4-dart-boot-contract-test.py index 0366c9102d31b..79ba745f03e04 100755 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/m4-dart-boot-contract-test.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/m4-dart-boot-contract-test.py @@ -20,6 +20,9 @@ args = parser.parse_args() DTB, ROOT = args.dtb, args.kernel_root.resolve() source = (ROOT / 'drivers/iommu/apple-dart.c').read_text() +t8132 = (ROOT / 'include/linux/soc/apple/t8132.h').read_text() +air = t8132[t8132.index('static inline bool apple_t8132_air('):] +air = air[:air.index('\n}\n') + 3] def property(node, name, kind='s'): @@ -77,8 +80,10 @@ def address(node): static unsigned int checks; static bool of_machine_is_compatible(const char *s) { if (!strcmp(s,"apple,j713")) return board; + if (!strcmp(s,"apple,j715")) return false; assert(!strcmp(s,"apple,t8132")); return soc; } +AIR_HELPER static bool of_device_is_compatible(const struct device_node *n,const char *s) { for(unsigned int i=0;icount;i++) if(!strcmp(n->compatible[i],s))return true; return false; @@ -127,6 +132,7 @@ def address(node): } ''' for name, value in { + 'AIR_HELPER': air, 'RADIO_EXPRESSION': radio, 'MTP_EXPRESSION': mtp, 'IRQ_EXPRESSION': irq, 'IRQ_EXPECTED': '(display||radio)' if 'preserve_display' in irq else 'radio', 'RADIO_COMPAT': radio_compat, 'MTP_COMPAT': mtp_compat, From 770d3d62ff07133d6ac235a9bfd99953521761e8 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:33 -0500 Subject: [PATCH 27/79] PCI: apple: Accept the J715's managed radio streams The J715 ADT maps the radio to DART streams 1 and 2 as on the J713, so accept its apple,managed-sids. Signed-off-by: Diljit Singh --- drivers/pci/controller/pcie-apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index 01e0813480566..8de8cc90524e9 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -3120,7 +3121,7 @@ static int apple_pcie_probe(struct platform_device *pdev) int count = of_property_count_u32_elems(dev->of_node, "apple,managed-sids"); if (!of_device_is_compatible(dev->of_node, "apple,t8132-pcie") || - !of_machine_is_compatible("apple,j713") || count <= 0 || count > 15) + !apple_t8132_air() || count <= 0 || count > 15) return -EINVAL; ret = of_property_read_u32_array(dev->of_node, "apple,managed-sids", ids, count); if (!ret && (count != 2 || ids[0] != 1 || ids[1] != 2)) From 378be650e72e783b60f7c8ef82f339b895a7504e Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:34 -0500 Subject: [PATCH 28/79] gpio: macsmc: Drive the J715 radio reg_on like the J713's The J715 ADT's /amfm/function-reg_on is the J713's pKW4("gP13", 0x00800000). Use the same write-only handling for it, and cover the J715 in the host test. Signed-off-by: Diljit Singh --- drivers/gpio/gpio-macsmc.c | 11 +++++----- .../selftests/drivers/apple/macsmc-j713.py | 20 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-macsmc.c b/drivers/gpio/gpio-macsmc.c index b9500afad3ce4..c16d7a737a6af 100644 --- a/drivers/gpio/gpio-macsmc.c +++ b/drivers/gpio/gpio-macsmc.c @@ -15,6 +15,7 @@ #include #include #include +#include #define MAX_GPIO 64 @@ -35,10 +36,10 @@ #define MACSMC_J700_RADIO_REG_ON_HI 0x80000 /* - * J713 /amfm/function-reg_on is pKW4("gP13", 0x00800000). The firmware - * function preserves the template's upper 16 bits and inserts the level - * into its low 16 bits. This does not establish generic CMD_OUTPUT semantics, - * a pin-mode command, or a readback operation for this line. + * On the J713 and J715, /amfm/function-reg_on is pKW4("gP13", 0x00800000). + * The firmware function preserves the template's upper 16 bits and inserts + * the level into its low 16 bits. This does not establish generic CMD_OUTPUT + * semantics, a pin-mode command, or a readback operation for this line. */ #define MACSMC_J713_RADIO_REG_ON_GPIO 0x13 #define MACSMC_J713_RADIO_REG_ON_TEMPLATE 0x00800000 @@ -363,7 +364,7 @@ static int macsmc_gpio_probe(struct platform_device *pdev) smcgp->base_key = data ? data->base_key : _SMC_KEY("gP\0\0"); smcgp->j700_pcio = of_machine_is_compatible("apple,j700") && device_is_compatible(&pdev->dev, "apple,smc-gpio"); - smcgp->j713 = of_machine_is_compatible("apple,j713"); + smcgp->j713 = apple_t8132_air(); mutex_init(&smcgp->j713_reg_on_lock); smcgp->first_index = macsmc_gpio_find_first_gpio_index(smcgp); diff --git a/tools/testing/selftests/drivers/apple/macsmc-j713.py b/tools/testing/selftests/drivers/apple/macsmc-j713.py index d4398800492a8..cc3402376f157 100755 --- a/tools/testing/selftests/drivers/apple/macsmc-j713.py +++ b/tools/testing/selftests/drivers/apple/macsmc-j713.py @@ -24,6 +24,7 @@ def main(): root = Path(__file__).resolve().parents[5] source = (root / "drivers/gpio/gpio-macsmc.c").read_text() header = (root / "include/linux/mfd/macsmc.h").read_text() + t8132 = (root / "include/linux/soc/apple/t8132.h").read_text() defines = "\n".join(re.findall( r"^#define (?:MAX_GPIO|MACSMC_\w+|CMD_\w+|MODE_\w+)\b[^\n]*", source, re.M)) key_defines = "\n".join(re.findall(r"^#define (?:_SMC_KEY\(s\)|SMC_KEY\(s\))[^\n]*", header, re.M)) @@ -97,18 +98,23 @@ def main(): # Compile the actual probe assignments, so the test also checks board selection. assignments = re.search(r"\tsmcgp->j713 = [^;]+;\n\tmutex_init\([^;]+;", source).group() parts += [r''' -static bool board_j713; +static const char *const boards[] = { NULL, "apple,j713", "apple,j715" }; +static unsigned int board; static bool of_machine_is_compatible(const char *name) -{ assert(!strcmp(name, "apple,j713")); return board_j713; } +{ + assert(!strcmp(name, "apple,j713") || !strcmp(name, "apple,j715")); + return board && !strcmp(name, boards[board]); +} +''', block(t8132, "static inline bool apple_t8132_air("), r''' static void profile_init(struct macsmc_gpio *smcgp) { ''', assignments, r''' } -static void reset(struct macsmc_gpio *g, bool j713, smc_key base) +static void reset(struct macsmc_gpio *g, unsigned int which, smc_key base) { memset(g, 0, sizeof(*g)); g->gc.data = g; g->base_key = base; - board_j713 = j713; profile_init(g); + board = which; profile_init(g); active = g; expect_native = false; write_result = rw_result = 0; writes32 = writes64 = rw_count = 0; } @@ -147,11 +153,11 @@ def main(): CHECK(!g.j713_reg_on_lock.held && rw_count == 0 && writes64 == 0); /* Every other board/namespace/line retains the generic GPIO operations. */ - for (unsigned int board = 0; board < 2; board++) + for (unsigned int b = 0; b < 3; b++) for (unsigned int lower = 0; lower < 2; lower++) for (unsigned int line = 0; line < MAX_GPIO; line++) { - reset(&g, board, lower ? _SMC_KEY("gp\0\0") : _SMC_KEY("gP\0\0")); - bool native = board && !lower && line == 0x13; + reset(&g, b, lower ? _SMC_KEY("gp\0\0") : _SMC_KEY("gP\0\0")); + bool native = b && !lower && line == 0x13; CHECK(macsmc_gpio_is_j713_reg_on(&g, line) == native); if (native) continue; CHECK(macsmc_gpio_get_direction(&g.gc, line) == GPIO_LINE_DIRECTION_OUT); From c931c8f8d5a806d364561a76171c62e8616e2ded Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:34 -0500 Subject: [PATCH 29/79] usb: dwc3: apple: Cover the J715 like the J713 The J715's USB-C ports are the J713's, so start them in host mode before the core is initialised as on the J713. Signed-off-by: Diljit Singh --- drivers/usb/dwc3/dwc3-apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-apple.c b/drivers/usb/dwc3/dwc3-apple.c index 349faf22f5225..4652697b2f4d0 100644 --- a/drivers/usb/dwc3/dwc3-apple.c +++ b/drivers/usb/dwc3/dwc3-apple.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -326,7 +327,7 @@ static void dwc3_apple_set_ptrcap(struct dwc3_apple *appledwc, u32 mode) static bool dwc3_apple_host_before_core_init(struct dwc3_apple *appledwc, enum dwc3_apple_state state) { - return state == DWC3_APPLE_HOST && of_machine_is_compatible("apple,j713") && + return state == DWC3_APPLE_HOST && apple_t8132_air() && of_device_is_compatible(appledwc->dev->of_node, "apple,t8132-dwc3"); } From 70099aff17eb119749cfd6efea55c5a539bd07dd Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:35 -0500 Subject: [PATCH 30/79] thermal: apple-pmp: Cover the J715 The J715 is fanless like the J713 and reports the same PMP sensors. Apply the J713 policy to it; its larger chassis only adds margin. Signed-off-by: Diljit Singh --- drivers/thermal/apple-pmp-thermal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/apple-pmp-thermal.c b/drivers/thermal/apple-pmp-thermal.c index 203ea9f5608bd..41ca922045ae2 100644 --- a/drivers/thermal/apple-pmp-thermal.c +++ b/drivers/thermal/apple-pmp-thermal.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -739,8 +740,8 @@ static int apple_pmp_thermal_probe(struct platform_device *pdev) { const struct apple_pmp_sensor_data *sensors = dev_get_platdata(&pdev->dev); - /* Only this board's sensor topology and operating policy are qualified. */ - if (!of_machine_is_compatible("apple,j713")) + /* Only the M4 Airs' sensor topology and operating policy are qualified. */ + if (!apple_t8132_air()) return -ENODEV; if (!sensors || !sensors->read || !sensors->dev) return -EINVAL; From 9ea623412ac265fe97af5486b762127a103e8f78 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:35 -0500 Subject: [PATCH 31/79] spi: apple-qspi: Add the J715 NVRAM The J715 ADT has the J713's anvram partition, 0x700000 and 1 MiB, on the same controller. Its NOR part is taken to be the J713's W25Q64; a different part fails the JEDEC check and stays read-only. Signed-off-by: Diljit Singh --- drivers/spi/spi-apple-qspi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-apple-qspi.c b/drivers/spi/spi-apple-qspi.c index 11fb1d5553105..e51cb94f12979 100644 --- a/drivers/spi/spi-apple-qspi.c +++ b/drivers/spi/spi-apple-qspi.c @@ -124,6 +124,9 @@ static const struct apple_qspi_board apple_qspi_boards[] = { 0x700000, 0x100000, APPLE_QSPI_JEDEC_W25Q64, 0 }, { "apple,t8132-qspi", "apple,j713", 0x3ad118000ULL, 0x700000, 0x100000, APPLE_QSPI_JEDEC_W25Q64, 0 }, + /* The J715 ADT has the J713's nvram; its NOR part is assumed the same. */ + { "apple,t8132-qspi", "apple,j715", 0x3ad118000ULL, + 0x700000, 0x100000, APPLE_QSPI_JEDEC_W25Q64, 0 }, /* Macronix is the ID macOS reports; a J616s also reads W25Q64 on the bus. */ { "apple,t6041-qspi", "apple,j616s", 0x429118000ULL, 0x700000, 0x100000, APPLE_QSPI_JEDEC_MX_2B27, 0, From b09b461b1f5a2166582fb418e4911079d6146bc2 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:35 -0500 Subject: [PATCH 32/79] drm/apple: m4: Add a J715 panel profile The M4 backend had one static profile, the J713's, with the panel's timing hard-coded in the timing parser. Move the timing into the profile and select the profile by machine when the DCP probes. The J715 runs the same DCP firmware ABI on a 2880x1864 panel. Its panel timing is in neither the ADT nor any capture yet, so its profile has no timing and the internal DCP refuses to probe before it sends anything: the boot framebuffer stays. The external DCPs and the T8132 external outputs cover the J715 as they do the J713. Signed-off-by: Diljit Singh --- drivers/gpu/drm/apple/dcp-m4-profile.h | 41 +++++++++++++++++-- drivers/gpu/drm/apple/dcp-m4-timing.h | 24 +++++++---- drivers/gpu/drm/apple/iomfb_m4.c | 19 ++++++++- drivers/gpu/drm/apple/t8132_ext_drm.c | 3 +- .../selftests/drivers/gpu/apple-dcp/m4.py | 3 +- 5 files changed, 74 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/apple/dcp-m4-profile.h b/drivers/gpu/drm/apple/dcp-m4-profile.h index 4cbed603d3166..8703744e1c484 100644 --- a/drivers/gpu/drm/apple/dcp-m4-profile.h +++ b/drivers/gpu/drm/apple/dcp-m4-profile.h @@ -7,6 +7,7 @@ /* Firmware 26.6.2 internal-panel ABI, qualified for the T8132/J713 handoff. */ struct dcp_m4_profile { const char *name; + const char *machine; /* machine compatible */ u32 panel_width, panel_height; u32 boot_stride; /* D101: inherited framebuffer stride */ u32 swap_size; /* A407 input */ @@ -22,10 +23,22 @@ struct dcp_m4_profile { u16 open_method; /* first client open */ u32 brightness_max, brightness_default; u32 width_mm, height_mm; + /* + * The qualified preferred timing, horizontal then vertical: Active, + * Total, FrontPorch, SyncWidth, BackPorch, PreciseSyncRate, + * SyncPolarity, PixelRepetition. NULL: none, so the panel is not + * adopted. + */ + const u32 (*timing)[8]; +}; + +static const u32 dcp_m4_timing_j713[2][8] = { + { 2560, 2640, 8, 32, 40, 6877358, 1, 0 }, + { 1664, 1749, 33, 8, 44, 3932166, 1, 0 }, }; static const struct dcp_m4_profile dcp_m4_profile_j713 = { - .name = "J713", + .name = "J713", .machine = "apple,j713", .panel_width = 2560, .panel_height = 1664, .boot_stride = 10240, .swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38, .swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e, @@ -34,9 +47,31 @@ static const struct dcp_m4_profile dcp_m4_profile_j713 = { .done_method = 590, .done_size = 0x730, .open_method = 457, .brightness_max = 500, .brightness_default = 120, .width_mm = 0, .height_mm = 0, + .timing = dcp_m4_timing_j713, +}; + +/* + * The J715: the same firmware ABI with a 2880x1864 panel. Its timing is + * not in the ADT and has not been read from a J715 DCP yet. + */ +static const struct dcp_m4_profile dcp_m4_profile_j715 = { + .name = "J715", .machine = "apple,j715", + .panel_width = 2880, .panel_height = 1864, .boot_stride = 11520, + .swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38, + .swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e, + .swap_intent = 0x17c, + .disabled_color = 0xff000000, + .done_method = 590, .done_size = 0x730, .open_method = 457, + .brightness_max = 500, .brightness_default = 120, + .width_mm = 0, .height_mm = 0, +}; + +static const struct dcp_m4_profile *const dcp_m4_profiles[] = { + &dcp_m4_profile_j713, + &dcp_m4_profile_j715, }; -/* This generation backend admits one qualified internal-panel ABI. */ -static const struct dcp_m4_profile *const dcp_m4_pf = &dcp_m4_profile_j713; +/* The machine's profile, set before the first DCP session starts. */ +extern const struct dcp_m4_profile *dcp_m4_pf; #endif diff --git a/drivers/gpu/drm/apple/dcp-m4-timing.h b/drivers/gpu/drm/apple/dcp-m4-timing.h index e85908b659a77..b8eabc880c7be 100644 --- a/drivers/gpu/drm/apple/dcp-m4-timing.h +++ b/drivers/gpu/drm/apple/dcp-m4-timing.h @@ -12,7 +12,7 @@ #define DCP_M4_TIMING_TOKENS 2048 -/* The first qualified J713 physical mode, not a generic panel-mode fallback. */ +/* The profile's qualified physical mode, not a generic panel-mode fallback. */ struct dcp_m4_timing { u32 id, color_id; u32 hdisplay, hsync_start, hsync_end, htotal; @@ -148,12 +148,11 @@ static inline int dcp_m4_timing_axis(const struct dcp_m4_timing_parser *p, "Active", "Total", "FrontPorch", "SyncWidth", "BackPorch", "PreciseSyncRate", "SyncPolarity", "PixelRepetition", }; - static const u32 values[2][8] = { - { 2560, 2640, 8, 32, 40, 6877358, 1, 0 }, - { 1664, 1749, 33, 8, 44, 3932166, 1, 0 }, - }; + const u32 (*values)[8] = dcp_m4_pf->timing; int axis = dcp_m4_timing_field(p, mode, name, 1); + if (!values) + return -ENODEV; if (axis < 0) return axis; for (unsigned int i = 0; i < 8; i++) @@ -171,7 +170,10 @@ static inline int dcp_m4_parse_timing(const void *data, size_t size, struct dcp_ }; static const u32 color_values[] = { 1, 8, 0, 0, 0, 16, 0 }; int ret = -EINVAL, colors, color; + const u32 *h, *v; + if (!dcp_m4_pf->timing) + return -ENODEV; if (!data || !out || size < 4 || size > (1U << 20) || get_unaligned_le32(data) != 0xd3) return -EINVAL; p = kzalloc(sizeof(*p), GFP_KERNEL); @@ -207,12 +209,16 @@ static inline int dcp_m4_parse_timing(const void *data, size_t size, struct dcp_ for (unsigned int i = 0; i < 7; i++) if (!dcp_m4_timing_equals(p, color, color_fields[i], 4, color_values[i])) goto done; + h = dcp_m4_pf->timing[0]; + v = dcp_m4_pf->timing[1]; *out = (struct dcp_m4_timing) { .id = 2, .color_id = 1, - .hdisplay = 2560, .hsync_start = 2568, .hsync_end = 2600, .htotal = 2640, - .vdisplay = 1664, .vsync_start = 1697, .vsync_end = 1705, .vtotal = 1749, - .clock_khz = ((2640ULL * 1749 * 3932166 >> 16) + 500) / 1000, - .refresh_16_16 = 3932166, + .hdisplay = h[0], .hsync_start = h[0] + h[2], + .hsync_end = h[0] + h[2] + h[3], .htotal = h[1], + .vdisplay = v[0], .vsync_start = v[0] + v[2], + .vsync_end = v[0] + v[2] + v[3], .vtotal = v[1], + .clock_khz = (((u64)h[1] * v[1] * v[5] >> 16) + 500) / 1000, + .refresh_16_16 = v[5], }; ret = 0; done: diff --git a/drivers/gpu/drm/apple/iomfb_m4.c b/drivers/gpu/drm/apple/iomfb_m4.c index 3e639595accda..2ffde863b8fac 100644 --- a/drivers/gpu/drm/apple/iomfb_m4.c +++ b/drivers/gpu/drm/apple/iomfb_m4.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT /* - * Apple DCP firmware 26.6.2 (T8132/J713). + * Apple DCP firmware 26.6.2 (T8132/J713, J715). * * The appledrm component and KMS paths own this controller. This backend owns * only its generation-specific EP37 RPC ABI and retained firmware session. @@ -56,6 +56,16 @@ #include "parser.h" #include "t8132_ext_drm.h" +const struct dcp_m4_profile *dcp_m4_pf = &dcp_m4_profile_j713; + +static const struct dcp_m4_profile *dcp_m4_machine_profile(void) +{ + for (unsigned int i = 0; i < ARRAY_SIZE(dcp_m4_profiles); i++) + if (of_machine_is_compatible(dcp_m4_profiles[i]->machine)) + return dcp_m4_profiles[i]; + return NULL; +} + static unsigned int idle_cache_ms = 1000; static int idle_cache_ms_set(const char *val, const struct kernel_param *kp) @@ -2528,6 +2538,7 @@ int iomfb_m4_init(struct apple_dcp *owner) struct device *dev = owner->dev; struct iomfb_m4 *dcp; struct resource *res; + const struct dcp_m4_profile *pf = dcp_m4_machine_profile(); const char *uuid; u32 ready = 0; int ret; @@ -2538,13 +2549,17 @@ int iomfb_m4_init(struct apple_dcp *owner) (of_property_read_u32(dev->of_node, "apple,t8132-dcpext-firmware-ready", &ready) || ready != 1)) return dev_err_probe(dev, -ENODEV, "external DCP not handed over\n"); - if (!of_machine_is_compatible("apple,j713") || + if (!pf || (!external && !of_device_is_compatible(dev->of_node, "apple,t8132-dcp")) || !iomfb_m4_firmware_property(dev->of_node, "apple,firmware-version") || !iomfb_m4_firmware_property(dev->of_node, "apple,firmware-compat") || of_property_read_string(dev->of_node, "apple,firmware-uuid", &uuid) || strcmp(uuid, "81BAF476-679D-3CC0-8C6A-E6B6FA659D5E")) return dev_err_probe(dev, -ENODEV, "unqualified firmware 26.6.2 handoff\n"); + /* Refuse before any message, so the boot framebuffer stays. */ + if (!external && !pf->timing) + return dev_err_probe(dev, -ENODEV, "no qualified %s panel timing\n", pf->name); + dcp_m4_pf = pf; ret = dcp_m4_dart_check(dev); if (ret) return dev_err_probe(dev, ret, "inherited SID23 domain not qualified\n"); diff --git a/drivers/gpu/drm/apple/t8132_ext_drm.c b/drivers/gpu/drm/apple/t8132_ext_drm.c index f6cc2f7767190..ad0f23955e1b6 100644 --- a/drivers/gpu/drm/apple/t8132_ext_drm.c +++ b/drivers/gpu/drm/apple/t8132_ext_drm.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1089,7 +1090,7 @@ int t8132_ext_drm_init(struct drm_device *drm) bool mine, reg; int ret = 0; - if (!of_machine_is_compatible("apple,j713")) + if (!apple_t8132_air()) return 0; /* Sleep handling for the outputs of one DRM device only. */ mutex_lock(&t8132_ext_reg_lock); diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/m4.py b/tools/testing/selftests/drivers/gpu/apple-dcp/m4.py index 7fc32185e318d..79f4c23ebc677 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/m4.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/m4.py @@ -58,7 +58,8 @@ def header_body(source): def production(root): - return PREFIX + ''.join(header_body((root / APPLE / p).read_text()) for p in HEADERS) + return (PREFIX + ''.join(header_body((root / APPLE / p).read_text()) for p in HEADERS) + + 'const struct dcp_m4_profile *dcp_m4_pf = &dcp_m4_profile_j713;\n') def request_golden(root, output): From fe6585237fab3eb55f5ce33129906cd34eadc99e Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:36:36 -0500 Subject: [PATCH 33/79] ASoC: apple: macaudio: Add the J715 The J715 runs the J713's AOP speaker stream with all six playback and twelve sense slots in use: two woofers and a tweeter per side, six SN012776 amps. Add its speaker variant with the J713's safe level and no tweeter high-pass grant, and its jack card as on the J713. Signed-off-by: Diljit Singh --- sound/soc/apple/macaudio-amp-level-test.h | 2 +- sound/soc/apple/macaudio.c | 24 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/sound/soc/apple/macaudio-amp-level-test.h b/sound/soc/apple/macaudio-amp-level-test.h index 54f091838085b..bf062d733d648 100644 --- a/sound/soc/apple/macaudio-amp-level-test.h +++ b/sound/soc/apple/macaudio-amp-level-test.h @@ -57,7 +57,7 @@ static void macaudio_level_no_table(struct kunit *test) &macaudio_j180_cfg, &macaudio_j314_cfg, &macaudio_j316_cfg, &macaudio_j37x_j47x_cfg, &macaudio_j413_cfg, &macaudio_j415_cfg, &macaudio_j493_cfg, &macaudio_j614_cfg, &macaudio_j616_cfg, - &macaudio_j713_cfg, + &macaudio_j713_cfg, &macaudio_j715_cfg, }; unsigned int i; diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c index 5bcdbe96edfe2..ec06ae8223538 100644 --- a/sound/soc/apple/macaudio.c +++ b/sound/soc/apple/macaudio.c @@ -2921,6 +2921,27 @@ struct macaudio_platform_cfg macaudio_j713_cfg = { .speaker_fe_channels = 6, }; +/* + * J715 (T8132, MacBook Air 15" M4): the same stream with six SN012776 amps, + * two woofers and a tweeter per side, on all six playback and twelve sense + * slots. The speakers stay at their safe level as on the J713. + */ +struct macaudio_platform_cfg macaudio_j715_cfg = { + .enable_speakers = true, + .amp = AMP_SN012776, + .speakers = SPKR_2W1T, + .stereo = true, + .safe_vol = -20, + .fe_dai_names = { "j616-pcm-0", "j616-pcm-1", "j616-pcm-2" }, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBC_CFC | + SND_SOC_DAIFMT_GATED | SND_SOC_DAIFMT_NB_IF, + .secondary_bclk_ratio = 250, + .fe_cpu_is_platform = true, + /* No headphone codec on this card: the jack is a card of its own. */ + .route_only_fes = BIT(0), + .speaker_fe_channels = 6, +}; + /* * The J614s and J616s headphone jack, a card of its own: a CS42L84 on the * AOP's "jack" back-end, which the firmware runs on MCA cluster 2 as a 64-SCLK @@ -3011,6 +3032,9 @@ static const struct of_device_id macaudio_snd_device_id[] = { { .compatible = "apple,j713-macaudio", .data = &macaudio_j713_cfg }, /* The J713 jack runs on the AOP like the J616s one. */ { .compatible = "apple,j713-macaudio-jack", .data = &macaudio_j616_jack_cfg }, + /* j715 - sn012776 15 2x 2W+1T (AOP-fed, one serializer) */ + { .compatible = "apple,j715-macaudio", .data = &macaudio_j715_cfg }, + { .compatible = "apple,j715-macaudio-jack", .data = &macaudio_j616_jack_cfg }, /* Fallback, jack only */ { .compatible = "apple,macaudio"}, { } From 9bd274e0fea055a17f356ce47d9b8780c3546b9a Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:37:34 -0500 Subject: [PATCH 34/79] arm64: dts: apple: t8132: Share the J713 board body Move everything but the panel, the speakers and the per-machine firmware names out of the J713 tree into t8132-j713-j715.dtsi, so the J715 can share it. The J713 dtb is unchanged byte for byte. Signed-off-by: Diljit Singh --- .../arm64/boot/dts/apple/t8132-j713-j715.dtsi | 652 ++++++++++++++++++ arch/arm64/boot/dts/apple/t8132-j713.dts | 631 +---------------- 2 files changed, 656 insertions(+), 627 deletions(-) create mode 100644 arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi diff --git a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi new file mode 100644 index 0000000000000..f510a2be2ead4 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi @@ -0,0 +1,652 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple MacBook Air (13-inch and 15-inch, M4, 2025) + * + * The parts the J713 and J715 share. Their ADTs differ in the panel, the + * speakers, the radio's firmware island and the ATC PHY trims; the J715 + * overrides the last two, and each board adds its own panel, speakers and + * firmware names. + * + * Copyright The Asahi Linux Contributors + */ + +#include "t8132-j713-pmgr.dtsi" +#include +#include +#include +#include + +/ { + aliases { + sep = &sep; + ans = &nvme; + ans-mbox = &ans_mbox; + atcphy0 = &atcphy0; + atcphy1 = &atcphy1; + bluetooth0 = &bluetooth0; + keyboard = &keyboard; + nvram = &nvram; + pmu-primary = &pmic1; + pmp = &pmp; + sart-ans = &sart; + spmi-primary = &nub_spmi; + wifi0 = &wifi0; + }; + + chosen { + linux-enablement-mac,disk-boot; + linux-enablement-mac,dapf-handoff = "/arm-io/aop", "/arm-io/mtp", + "/arm-io/pmp"; + linux-enablement-mac,dapf-power-on-handoff = "/arm-io/pmp"; + }; + + led-controller { + compatible = "pwm-leds"; + led-0 { + pwms = <&fpwm1 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; + + reserved-memory { + /* + * iBoot loads the ISP firmware outside the kernel's memory, at + * addresses that move with the boot firmware. The boot loader + * fills these placeholders from the ADT's isp segment-ranges: reg, + * and iommu-addresses where the firmware runs them, from + * 0x100_0000_0000 on. The driver checks that the coprocessor's + * reset vector is this text before it starts the firmware. + */ + isp_fw_text: isp-firmware-text { }; + + isp_fw_data: isp-firmware-data { }; + + /* the firmware's 20 MiB main memory, the driver allocates above it */ + isp_heap: isp-heap { + iommu-addresses = <&isp 0x100 0x0 0x0 0x1400000>; + }; + }; + + /* + * The boot NOR runs from a PMU rail that is on whenever the SoC is + * and that no OS switches. The ADT gives the flash no supply. + */ + nor_flash_vcc: regulator-nor-flash-vcc { + compatible = "regulator-fixed"; + regulator-name = "nor-flash-vcc"; + regulator-always-on; + }; +}; + +/* + * The boot loader enables the ISP and its DARTs once it has filled the + * firmware placeholders and set apple,platform-id, the ADT isp node's + * sensor-type (neither ADT has a cam-connections-scheme). + */ +&isp { + memory-region = <&isp_fw_text>, <&isp_fw_data>, <&isp_heap>; + memory-region-names = "text", "data", "heap"; + + /* The front camera, an IMX958: configuration 5, as on the J616s. */ + sensor-presets { + /* 1920x1080 */ + preset0 { + apple,config-index = <5>; + apple,input-size = <1920 2160>; + apple,output-size = <1920 1080>; + apple,crop = <0 0 1920 1080>; + }; + /* 1280x720 */ + preset1 { + apple,config-index = <5>; + apple,input-size = <1920 2160>; + apple,output-size = <1280 720>; + apple,crop = <0 0 1280 720>; + }; + }; +}; + +/* + * m1n1 programs the AOP DART's DAPF and reserves the firmware segments and + * the DAPF windows in memory-region when /chosen asks for the AOP's handoff, + * or disables the AOP. + */ +&aop { + status = "okay"; +}; + +&aop_audio { + /* + * The microphones on LEAP; the speakers and their sense on base-ns TX0 + * and RX0 (the J616s stream: six playback and twelve sense slots; the + * J713's four amps take the first four and eight, the J715's six all + * of them), the jack on TX2 and RX2. + */ + dmas = <&admac0 1>, <&admac1 0>, <&admac1 1>, <&admac1 4>, <&admac1 5>; + dma-names = "dma", "spkr", "sense", "cout", "cin"; +}; + +/* + * The CS42L84 headphone codec (ADT /arm-io/i2c1/audio-codec-output at 0x4b). + * Its reset line is nub GPIO 17, driven high to run the codec; its interrupt + * is AP GPIO 98, level low. The AOP firmware runs the jack's stream. + */ +&i2c1 { + status = "okay"; + + jack_codec: codec@4b { + compatible = "cirrus,cs42l84"; + reg = <0x4b>; + reset-gpios = <&pinctrl_nub 17 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <0>; + interrupts-extended = <&pinctrl_ap 98 IRQ_TYPE_LEVEL_LOW>; + sound-name-prefix = "Jack"; + }; +}; + +&aop_dart { + status = "okay"; +}; + +&aop_mbox { + status = "okay"; + /* A periodic report need not wake the system. */ + apple,hold-rx-in-sleep; +}; + +&admac0 { + status = "okay"; +}; + +&admac1 { + status = "okay"; +}; + +/* Enable DVFS only with the board thermal owner. */ +&cpufreq_e { + status = "okay"; +}; + +&cpufreq_p { + status = "okay"; +}; + +&cpuidle { + status = "okay"; +}; + +&qspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + vcc-supply = <&nor_flash_vcc>; + spi-rx-bus-width = <1>; + spi-tx-bus-width = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nvram: partition@700000 { + label = "nvram"; + /* ADT /arm-io/qspi/spinor/anvram, flash-relative. */ + reg = <0x700000 0x100000>; + }; + }; + }; +}; + +/* + * m1n1 performs the T8132 controller and PHY initialization. Linux adopts + * the trained link and owns DART stream 16, RID-to-SID routing and MSI. + * + * The DART fault interrupt is taken from the ADT, independently of + * the PCIe port and MSI interrupts. + */ +&nub_spmi_a0 { + status = "okay"; + hpm1: usb-pd@a { + compatible = "apple,t8132-sn201202x", "apple,sn201202x"; + reg = <0xa SPMI_USID>; + interrupts = <37 IRQ_TYPE_EDGE_RISING>, + <43 IRQ_TYPE_EDGE_RISING>, + <45 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "irq", "sleep", "wake"; + wakeup-source; + + typec1: connector { + compatible = "usb-c-connector"; + label = "USB-C MagSafe-adjacent"; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + typec1_connector_hs: endpoint { + remote-endpoint = <&dwc3_1_hs>; + }; + }; + + port@1 { + reg = <1>; + typec1_connector_ss: endpoint { + remote-endpoint = <&atcphy1_typec_lanes>; + }; + }; + }; + }; + }; + hpm0: usb-pd@c { + compatible = "apple,t8132-sn201202x", "apple,sn201202x"; + reg = <0xc SPMI_USID>; + interrupts = <11 IRQ_TYPE_EDGE_RISING>, + <17 IRQ_TYPE_EDGE_RISING>, + <19 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "irq", "sleep", "wake"; + wakeup-source; + + typec0: connector { + compatible = "usb-c-connector"; + label = "USB-C native client"; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + typec0_connector_hs: endpoint { + remote-endpoint = <&dwc3_0_hs>; + }; + }; + + port@1 { + reg = <1>; + typec0_connector_ss: endpoint { + remote-endpoint = <&atcphy0_typec_lanes>; + }; + }; + }; + }; + }; +}; + +&pmp_dart { + status = "okay"; +}; + +&pmp_report { + status = "okay"; +}; + +&pmp_mbox { + status = "okay"; +}; + +&atcphy0 { + status = "okay"; + /* Leave the display crossbar at core + 0x4c000 to its own driver. */ + reg = <0x4 0x02a90000 0x0 0x4000>, + <0x4 0x02a84000 0x0 0x4000>, + <0x4 0x03000000 0x0 0x24000>, + <0x4 0x00000000 0x0 0x8000>, + <0x4 0x00020000 0x0 0x4000>, + <0x4 0x03044000 0x0 0x4000>, + <0x4 0x03050000 0x0 0x4000>; + reg-names = "usb2phy", "pipehandler", "core", "axi2af", "lioa", + "fabric", "common-config"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + atcphy0_typec_lanes: endpoint { + remote-endpoint = <&typec0_connector_ss>; + }; + }; + }; +}; + +&dwc3_0_dart_0 { + status = "okay"; +}; + +&dwc3_0_dart_1 { + status = "okay"; +}; + +&dwc3_0 { + status = "okay"; + dr_mode = "host"; + maximum-speed = "super-speed"; + phys = <&atcphy0 PHY_TYPE_USB2>, <&atcphy0 PHY_TYPE_USB3>; + phy-names = "usb2-phy", "usb3-phy"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dwc3_0_hs: endpoint { + remote-endpoint = <&typec0_connector_hs>; + }; + }; + }; +}; + +&atcphy1 { + status = "okay"; + /* Leave the display crossbar at core + 0x4c000 to its own driver. */ + reg = <0x4 0x0aa90000 0x0 0x4000>, + <0x4 0x0aa84000 0x0 0x4000>, + <0x4 0x0b000000 0x0 0x24000>, + <0x4 0x08000000 0x0 0x8000>, + <0x4 0x08020000 0x0 0x4000>, + <0x4 0x0b044000 0x0 0x4000>, + <0x4 0x0b050000 0x0 0x4000>; + reg-names = "usb2phy", "pipehandler", "core", "axi2af", "lioa", + "fabric", "common-config"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + atcphy1_typec_lanes: endpoint { + remote-endpoint = <&typec1_connector_ss>; + }; + }; + }; +}; + +&dwc3_1_dart_0 { + status = "okay"; +}; + +&dwc3_1_dart_1 { + status = "okay"; +}; + +&dwc3_1 { + status = "okay"; + dr_mode = "host"; + maximum-speed = "super-speed"; + phys = <&atcphy1 PHY_TYPE_USB2>, <&atcphy1 PHY_TYPE_USB3>; + phy-names = "usb2-phy", "usb3-phy"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dwc3_1_hs: endpoint { + remote-endpoint = <&typec1_connector_hs>; + }; + }; + }; +}; + +&dart_apcie0 { + status = "okay"; + apple,managed-sids = <1 2>; + apple,dma-range = <0x100 0x00100000 0x0 0x3fe00000>; +}; + +/* The radio's board-type is its firmware island: the J713's here. */ +&pcie0 { + status = "okay"; + apple,managed-sids = <1 2>; + iommu-map = <0x100 &dart_apcie0 1 2>; + iommu-map-mask = <0xffff>; + pci@0,0 { + pwren-gpios = <&smc_gpio 0x13 GPIO_ACTIVE_HIGH>; + reset-gpios = <&pinctrl_ap 163 GPIO_ACTIVE_LOW>; + bluetooth0: bluetooth@0,1 { + compatible = "pci14e4,5f72"; + reg = <0x10100 0x0 0x0 0x0 0x0>; + brcm,board-type = "apple,garden"; + /* Per-machine address and calibration supplied by m1n1. */ + local-bd-address = [00 00 00 00 00 00]; + }; + wifi0: wifi@0,0 { + compatible = "pci14e4,4434"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + brcm,board-type = "apple,garden"; + local-mac-address = [00 00 00 00 00 00]; + apple,antenna-sku = "XX"; + }; + }; +}; + +&fpwm1 { + status = "okay"; +}; + +&mcc { + status = "okay"; + apple,boot-dma-devices = <&pmp>; +}; + +&pmc { + status = "okay"; + apple,static-voters = <3>; +}; + +/* + * The PMC enables of an external pipe are set once the pipe's SYS state is + * on, and before its FE state powers on. + */ +&ps_dispext0_fe { + power-domains = <&ps_dispext0_sys>, <&pmc_dispext0>; +}; + +&ps_dispext1_fe { + power-domains = <&ps_dispext1_sys>, <&pmc_dispext1>; +}; + +&smc { + status = "okay"; + + hwmon { + compatible = "apple,smc-hwmon"; + + current-ID0R { + apple,key-id = "ID0R"; + label = "AC Input Current"; + }; + + /* Panel and backlight supply; tracks brightness, idles when blanked. */ + current-Ib8f { + apple,key-id = "Ib8f"; + label = "Display Supply Current"; + }; + + power-PDTR { + apple,key-id = "PDTR"; + label = "AC Input Power"; + }; + + power-PMVC { + apple,key-id = "PMVC"; + label = "3.8 V Rail Power"; + }; + + power-PSTR { + apple,key-id = "PSTR"; + label = "Total System Power"; + }; + + temperature-TB0T { + apple,key-id = "TB0T"; + label = "Battery Hotspot"; + }; + + temperature-TCHP { + apple,key-id = "TCHP"; + label = "Charge Regulator Temp"; + }; + + temperature-TH0x { + apple,key-id = "TH0x"; + label = "NAND Flash Temperature"; + }; + + temperature-TW0P { + apple,key-id = "TW0P"; + label = "WiFi/BT Module Temp"; + }; + + voltage-SBAV { + apple,key-id = "SBAV"; + label = "Battery Voltage"; + }; + + voltage-VD0R { + apple,key-id = "VD0R"; + label = "Charger Input Voltage"; + }; + }; + + rtc { + compatible = "apple,smc-rtc"; + nvmem-cells = <&rtc_offset>; + nvmem-cell-names = "rtc_offset"; + }; + + reboot { + compatible = "apple,t8132-smc-reboot", "apple,smc-reboot"; + nvmem-cells = <&shutdown_flag>, <&boot_stage>, + <&boot_error_count>, <&panic_count>; + nvmem-cell-names = "shutdown_flag", "boot_stage", + "boot_error_count", "panic_count"; + }; +}; + +&smc_mbox { + status = "okay"; +}; + +&nub_spmi { + status = "okay"; + + pmic1: pmic@0 { + compatible = "apple,abbey-pmic", "apple,spmi-nvmem"; + reg = <0x0 SPMI_USID>; /* To be filled by loader */ + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + rtc_offset: rtc-offset@2100 { + reg = <0x2100 0x6>; + }; + + boot_stage: boot-stage@f801 { + reg = <0xf801 0x1>; + }; + + boot_error_count: boot-error-count@f802,0 { + reg = <0xf802 0x1>; + bits = <0 4>; + }; + + panic_count: panic-count@f802,4 { + reg = <0xf802 0x1>; + bits = <4 4>; + }; + + shutdown_flag: shutdown-flag@f80f,3 { + reg = <0xf80f 0x1>; + bits = <3 1>; + }; + }; + }; +}; + +&mtp { + status = "okay"; +}; + +&mtp_mbox { + status = "okay"; +}; + +&mtp_dart { + status = "okay"; +}; + +&mtp_dockchannel { + status = "okay"; +}; + +&mtp_hid { + apple,afe-reset-gpios = <&smc_gpio 28 GPIO_ACTIVE_LOW>; + apple,stm-reset-gpios = <&smc_gpio 29 GPIO_ACTIVE_LOW>; + + multi-touch { + apple,power-method = <2>; + }; + + keyboard: keyboard { + hid-country-code = <0>; + apple,keyboard-layout-id = <0>; + }; + + stm { + }; +}; + +/* + * These blocks are initialized and retained by iBoot/DCP. Linux does not yet + * own the T8132 display power sequence, and the GPIO block must remain live + * for inherited firmware and input state. + */ +/* + * Mesa fingerprint sensor on spi2 (ADT /arm-io/spi2/mesa): power on + * NUB GPIO 28, active high; data-ready on AP GPIO 199. Native chip select only. + */ +&sep_mbox { + status = "okay"; +}; + +&spi2 { + status = "okay"; +}; + +&mesa { + status = "okay"; + enable-gpios = <&pinctrl_nub 28 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&pinctrl_ap>; + interrupts = <199 IRQ_TYPE_EDGE_RISING>; + spi-cs-setup-delay-ns = <20>; + spi-cs-hold-delay-ns = <20>; +}; + +&framebuffer0 { + /delete-property/ power-domains; + panel = <&fb_panel>; +}; + +#include "t8132-j713-gpu.dtsi" +#include "t8132-j713-display.dtsi" +#include "t8132-j713-dcpext.dtsi" +#include "t8132-j713-atcphy-tunables.dtsi" +#include "t8132-j713-usb4.dtsi" +#include "t8132-j713-usb4-tunables.dtsi" +#include "t8132-j713-pciec-tunables.dtsi" diff --git a/arch/arm64/boot/dts/apple/t8132-j713.dts b/arch/arm64/boot/dts/apple/t8132-j713.dts index eda4f52c23f93..eaa579f9efd1e 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713.dts +++ b/arch/arm64/boot/dts/apple/t8132-j713.dts @@ -11,33 +11,13 @@ #include "t8132.dtsi" #include "t8132-jxxx.dtsi" -#include "t8132-j713-pmgr.dtsi" #include -#include -#include -#include / { compatible = "apple,j713", "apple,t8132", "apple,arm-platform"; model = "Apple MacBook Air (13-inch, M4, 2025)"; chassis-type = "laptop"; - aliases { - sep = &sep; - ans = &nvme; - ans-mbox = &ans_mbox; - atcphy0 = &atcphy0; - atcphy1 = &atcphy1; - bluetooth0 = &bluetooth0; - keyboard = &keyboard; - nvram = &nvram; - pmu-primary = &pmic1; - pmp = &pmp; - sart-ans = &sart; - spmi-primary = &nub_spmi; - wifi0 = &wifi0; - }; - /* * The speaker amps' shared shutdown line (SDZ, AP GPIO 15, the ADT * function-reset; low = shutdown). One fixed regulator, the SDZ supply @@ -107,102 +87,17 @@ }; }; }; - - chosen { - linux-enablement-mac,disk-boot; - linux-enablement-mac,dapf-handoff = "/arm-io/aop", "/arm-io/mtp", - "/arm-io/pmp"; - linux-enablement-mac,dapf-power-on-handoff = "/arm-io/pmp"; - }; - - led-controller { - compatible = "pwm-leds"; - led-0 { - pwms = <&fpwm1 0 40000>; - label = "kbd_backlight"; - function = LED_FUNCTION_KBD_BACKLIGHT; - color = ; - max-brightness = <255>; - default-state = "keep"; - }; - }; - - reserved-memory { - /* - * iBoot loads the ISP firmware outside the kernel's memory, at - * addresses that move with the boot firmware. The boot loader - * fills these placeholders from the ADT's isp segment-ranges: reg, - * and iommu-addresses where the firmware runs them, from - * 0x100_0000_0000 on. The driver checks that the coprocessor's - * reset vector is this text before it starts the firmware. - */ - isp_fw_text: isp-firmware-text { }; - - isp_fw_data: isp-firmware-data { }; - - /* the firmware's 20 MiB main memory, the driver allocates above it */ - isp_heap: isp-heap { - iommu-addresses = <&isp 0x100 0x0 0x0 0x1400000>; - }; - }; - - /* - * The boot NOR runs from a PMU rail that is on whenever the SoC is - * and that no OS switches. The ADT gives the flash no supply. - */ - nor_flash_vcc: regulator-nor-flash-vcc { - compatible = "regulator-fixed"; - regulator-name = "nor-flash-vcc"; - regulator-always-on; - }; }; -/* - * The boot loader enables the ISP and its DARTs once it has filled the - * firmware placeholders and set apple,platform-id, the ADT isp node's - * sensor-type (the J713 ADT has no cam-connections-scheme). - */ -&isp { - memory-region = <&isp_fw_text>, <&isp_fw_data>, <&isp_heap>; - memory-region-names = "text", "data", "heap"; - - /* The front camera, an IMX958: configuration 5, as on the J616s. */ - sensor-presets { - /* 1920x1080 */ - preset0 { - apple,config-index = <5>; - apple,input-size = <1920 2160>; - apple,output-size = <1920 1080>; - apple,crop = <0 0 1920 1080>; - }; - /* 1280x720 */ - preset1 { - apple,config-index = <5>; - apple,input-size = <1920 2160>; - apple,output-size = <1280 720>; - apple,crop = <0 0 1280 720>; - }; +&mtp_hid { + multi-touch { + firmware-name = "apple/tpmtfw-j713.bin"; }; }; -/* - * m1n1 programs the AOP DART's DAPF and reserves the firmware segments and - * the DAPF windows in memory-region when /chosen asks for the AOP's handoff, - * or disables the AOP. - */ -&aop { - status = "okay"; -}; +#include "t8132-j713-j715.dtsi" &aop_audio { - /* - * The microphones on LEAP; the speakers and their sense on base-ns TX0 - * and RX0 (the J616s stream: six playback and twelve sense slots, of - * which the four amps take the first four and eight), the jack on TX2 - * and RX2. - */ - dmas = <&admac0 1>, <&admac1 0>, <&admac1 1>, <&admac1 4>, <&admac1 5>; - dma-names = "dma", "spkr", "sense", "cout", "cin"; apple,chassis-name = "J713"; apple,machine-kind = "MacBook Air"; }; @@ -271,513 +166,7 @@ }; }; -/* - * The CS42L84 headphone codec (ADT /arm-io/i2c1/audio-codec-output at 0x4b). - * Its reset line is nub GPIO 17, driven high to run the codec; its interrupt - * is AP GPIO 98, level low. The AOP firmware runs the jack's stream. - */ -&i2c1 { - status = "okay"; - - jack_codec: codec@4b { - compatible = "cirrus,cs42l84"; - reg = <0x4b>; - reset-gpios = <&pinctrl_nub 17 GPIO_ACTIVE_HIGH>; - #sound-dai-cells = <0>; - interrupts-extended = <&pinctrl_ap 98 IRQ_TYPE_LEVEL_LOW>; - sound-name-prefix = "Jack"; - }; -}; - -&aop_dart { - status = "okay"; -}; - -&aop_mbox { - status = "okay"; - /* A periodic report need not wake the system. */ - apple,hold-rx-in-sleep; -}; - -&admac0 { - status = "okay"; -}; - -&admac1 { - status = "okay"; -}; - -/* Enable DVFS only with the J713 board thermal owner. */ -&cpufreq_e { - status = "okay"; -}; - -&cpufreq_p { - status = "okay"; -}; - -&cpuidle { - status = "okay"; -}; - -&qspi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - vcc-supply = <&nor_flash_vcc>; - spi-rx-bus-width = <1>; - spi-tx-bus-width = <1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - nvram: partition@700000 { - label = "nvram"; - /* J713 ADT /arm-io/qspi/spinor/anvram, flash-relative. */ - reg = <0x700000 0x100000>; - }; - }; - }; -}; - -/* - * m1n1 performs the T8132 controller and PHY initialization. Linux adopts - * the trained link and owns DART stream 16, RID-to-SID routing and MSI. - * - * The DART fault interrupt is taken from the J713 ADT, independently of - * the PCIe port and MSI interrupts. - */ -&nub_spmi_a0 { - status = "okay"; - hpm1: usb-pd@a { - compatible = "apple,t8132-sn201202x", "apple,sn201202x"; - reg = <0xa SPMI_USID>; - interrupts = <37 IRQ_TYPE_EDGE_RISING>, - <43 IRQ_TYPE_EDGE_RISING>, - <45 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "irq", "sleep", "wake"; - wakeup-source; - - typec1: connector { - compatible = "usb-c-connector"; - label = "USB-C MagSafe-adjacent"; - power-role = "dual"; - data-role = "dual"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - typec1_connector_hs: endpoint { - remote-endpoint = <&dwc3_1_hs>; - }; - }; - - port@1 { - reg = <1>; - typec1_connector_ss: endpoint { - remote-endpoint = <&atcphy1_typec_lanes>; - }; - }; - }; - }; - }; - hpm0: usb-pd@c { - compatible = "apple,t8132-sn201202x", "apple,sn201202x"; - reg = <0xc SPMI_USID>; - interrupts = <11 IRQ_TYPE_EDGE_RISING>, - <17 IRQ_TYPE_EDGE_RISING>, - <19 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "irq", "sleep", "wake"; - wakeup-source; - - typec0: connector { - compatible = "usb-c-connector"; - label = "USB-C native client"; - power-role = "dual"; - data-role = "dual"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - typec0_connector_hs: endpoint { - remote-endpoint = <&dwc3_0_hs>; - }; - }; - - port@1 { - reg = <1>; - typec0_connector_ss: endpoint { - remote-endpoint = <&atcphy0_typec_lanes>; - }; - }; - }; - }; - }; -}; - -&pmp_dart { - status = "okay"; -}; - -&pmp_report { - status = "okay"; -}; - -&pmp_mbox { - status = "okay"; -}; - -&atcphy0 { - status = "okay"; - /* Leave the display crossbar at core + 0x4c000 to its own driver. */ - reg = <0x4 0x02a90000 0x0 0x4000>, - <0x4 0x02a84000 0x0 0x4000>, - <0x4 0x03000000 0x0 0x24000>, - <0x4 0x00000000 0x0 0x8000>, - <0x4 0x00020000 0x0 0x4000>, - <0x4 0x03044000 0x0 0x4000>, - <0x4 0x03050000 0x0 0x4000>; - reg-names = "usb2phy", "pipehandler", "core", "axi2af", "lioa", - "fabric", "common-config"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - atcphy0_typec_lanes: endpoint { - remote-endpoint = <&typec0_connector_ss>; - }; - }; - }; -}; - -&dwc3_0_dart_0 { - status = "okay"; -}; - -&dwc3_0_dart_1 { - status = "okay"; -}; - -&dwc3_0 { - status = "okay"; - dr_mode = "host"; - maximum-speed = "super-speed"; - phys = <&atcphy0 PHY_TYPE_USB2>, <&atcphy0 PHY_TYPE_USB3>; - phy-names = "usb2-phy", "usb3-phy"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - dwc3_0_hs: endpoint { - remote-endpoint = <&typec0_connector_hs>; - }; - }; - }; -}; - -&atcphy1 { - status = "okay"; - /* Leave the display crossbar at core + 0x4c000 to its own driver. */ - reg = <0x4 0x0aa90000 0x0 0x4000>, - <0x4 0x0aa84000 0x0 0x4000>, - <0x4 0x0b000000 0x0 0x24000>, - <0x4 0x08000000 0x0 0x8000>, - <0x4 0x08020000 0x0 0x4000>, - <0x4 0x0b044000 0x0 0x4000>, - <0x4 0x0b050000 0x0 0x4000>; - reg-names = "usb2phy", "pipehandler", "core", "axi2af", "lioa", - "fabric", "common-config"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - atcphy1_typec_lanes: endpoint { - remote-endpoint = <&typec1_connector_ss>; - }; - }; - }; -}; - -&dwc3_1_dart_0 { - status = "okay"; -}; - -&dwc3_1_dart_1 { - status = "okay"; -}; - -&dwc3_1 { - status = "okay"; - dr_mode = "host"; - maximum-speed = "super-speed"; - phys = <&atcphy1 PHY_TYPE_USB2>, <&atcphy1 PHY_TYPE_USB3>; - phy-names = "usb2-phy", "usb3-phy"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - dwc3_1_hs: endpoint { - remote-endpoint = <&typec1_connector_hs>; - }; - }; - }; -}; - -&dart_apcie0 { - status = "okay"; - apple,managed-sids = <1 2>; - apple,dma-range = <0x100 0x00100000 0x0 0x3fe00000>; -}; - -&pcie0 { - status = "okay"; - apple,managed-sids = <1 2>; - iommu-map = <0x100 &dart_apcie0 1 2>; - iommu-map-mask = <0xffff>; - pci@0,0 { - pwren-gpios = <&smc_gpio 0x13 GPIO_ACTIVE_HIGH>; - reset-gpios = <&pinctrl_ap 163 GPIO_ACTIVE_LOW>; - bluetooth0: bluetooth@0,1 { - compatible = "pci14e4,5f72"; - reg = <0x10100 0x0 0x0 0x0 0x0>; - brcm,board-type = "apple,garden"; - /* Per-machine address and calibration supplied by m1n1. */ - local-bd-address = [00 00 00 00 00 00]; - }; - wifi0: wifi@0,0 { - compatible = "pci14e4,4434"; - reg = <0x10000 0x0 0x0 0x0 0x0>; - brcm,board-type = "apple,garden"; - local-mac-address = [00 00 00 00 00 00]; - apple,antenna-sku = "XX"; - }; - }; -}; - - -&fpwm1 { - status = "okay"; -}; - -&mcc { - status = "okay"; - apple,boot-dma-devices = <&pmp>; -}; - -&pmc { - status = "okay"; - apple,static-voters = <3>; -}; - -/* - * The PMC enables of an external pipe are set once the pipe's SYS state is - * on, and before its FE state powers on. - */ -&ps_dispext0_fe { - power-domains = <&ps_dispext0_sys>, <&pmc_dispext0>; -}; - -&ps_dispext1_fe { - power-domains = <&ps_dispext1_sys>, <&pmc_dispext1>; -}; - -&smc { - status = "okay"; - - hwmon { - compatible = "apple,smc-hwmon"; - - current-ID0R { - apple,key-id = "ID0R"; - label = "AC Input Current"; - }; - - /* Panel and backlight supply; tracks brightness, idles when blanked. */ - current-Ib8f { - apple,key-id = "Ib8f"; - label = "Display Supply Current"; - }; - - power-PDTR { - apple,key-id = "PDTR"; - label = "AC Input Power"; - }; - - power-PMVC { - apple,key-id = "PMVC"; - label = "3.8 V Rail Power"; - }; - - power-PSTR { - apple,key-id = "PSTR"; - label = "Total System Power"; - }; - - temperature-TB0T { - apple,key-id = "TB0T"; - label = "Battery Hotspot"; - }; - - temperature-TCHP { - apple,key-id = "TCHP"; - label = "Charge Regulator Temp"; - }; - - temperature-TH0x { - apple,key-id = "TH0x"; - label = "NAND Flash Temperature"; - }; - - temperature-TW0P { - apple,key-id = "TW0P"; - label = "WiFi/BT Module Temp"; - }; - - voltage-SBAV { - apple,key-id = "SBAV"; - label = "Battery Voltage"; - }; - - voltage-VD0R { - apple,key-id = "VD0R"; - label = "Charger Input Voltage"; - }; - }; - - rtc { - compatible = "apple,smc-rtc"; - nvmem-cells = <&rtc_offset>; - nvmem-cell-names = "rtc_offset"; - }; - - reboot { - compatible = "apple,t8132-smc-reboot", "apple,smc-reboot"; - nvmem-cells = <&shutdown_flag>, <&boot_stage>, - <&boot_error_count>, <&panic_count>; - nvmem-cell-names = "shutdown_flag", "boot_stage", - "boot_error_count", "panic_count"; - }; -}; - -&smc_mbox { - status = "okay"; -}; - -&nub_spmi { - status = "okay"; - - pmic1: pmic@0 { - compatible = "apple,abbey-pmic", "apple,spmi-nvmem"; - reg = <0x0 SPMI_USID>; /* To be filled by loader */ - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - rtc_offset: rtc-offset@2100 { - reg = <0x2100 0x6>; - }; - - boot_stage: boot-stage@f801 { - reg = <0xf801 0x1>; - }; - - boot_error_count: boot-error-count@f802,0 { - reg = <0xf802 0x1>; - bits = <0 4>; - }; - - panic_count: panic-count@f802,4 { - reg = <0xf802 0x1>; - bits = <4 4>; - }; - - shutdown_flag: shutdown-flag@f80f,3 { - reg = <0xf80f 0x1>; - bits = <3 1>; - }; - }; - }; -}; - -&mtp { - status = "okay"; -}; - -&mtp_mbox { - status = "okay"; -}; - -&mtp_dart { - status = "okay"; -}; - -&mtp_dockchannel { - status = "okay"; -}; - -&mtp_hid { - apple,afe-reset-gpios = <&smc_gpio 28 GPIO_ACTIVE_LOW>; - apple,stm-reset-gpios = <&smc_gpio 29 GPIO_ACTIVE_LOW>; - - multi-touch { - firmware-name = "apple/tpmtfw-j713.bin"; - apple,power-method = <2>; - }; - - keyboard: keyboard { - hid-country-code = <0>; - apple,keyboard-layout-id = <0>; - }; - - stm { - }; -}; - -/* - * These blocks are initialized and retained by iBoot/DCP. Linux does not yet - * own the T8132 display power sequence, and the GPIO block must remain live - * for inherited firmware and input state. - */ -/* - * Mesa fingerprint sensor on spi2 (J713 ADT /arm-io/spi2/mesa): power on - * NUB GPIO 28, active high; data-ready on AP GPIO 199. Native chip select only. - */ -&sep_mbox { - status = "okay"; -}; - -&spi2 { - status = "okay"; -}; - &mesa { - status = "okay"; - enable-gpios = <&pinctrl_nub 28 GPIO_ACTIVE_HIGH>; - interrupt-parent = <&pinctrl_ap>; - interrupts = <199 IRQ_TYPE_EDGE_RISING>; - spi-cs-setup-delay-ns = <20>; - spi-cs-hold-delay-ns = <20>; /* * Per-device factory data from this Mac's own iBoot system container: * the calibration, and the signed root key the nonce session loads. @@ -785,11 +174,6 @@ firmware-name = "apple/mesacal-j713.bin", "apple/msrk-j713.bin"; }; -&framebuffer0 { - /delete-property/ power-domains; - panel = <&fb_panel>; -}; - / { /* * Physical size of the firmware framebuffer's 2560x1600 area below the @@ -801,10 +185,3 @@ status = "disabled"; }; }; -#include "t8132-j713-gpu.dtsi" -#include "t8132-j713-display.dtsi" -#include "t8132-j713-dcpext.dtsi" -#include "t8132-j713-atcphy-tunables.dtsi" -#include "t8132-j713-usb4.dtsi" -#include "t8132-j713-usb4-tunables.dtsi" -#include "t8132-j713-pciec-tunables.dtsi" From 23a628607573b5a14b209cba4eabba5ac517bbb6 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 05:37:34 -0500 Subject: [PATCH 35/79] arm64: dts: apple: t8132: Add the J715 board Describe the MacBook Air (15-inch, M4, 2025) on the shared J713 body, with the values its ADT gives where they differ from the J713's: - the Wi-Fi and Bluetooth firmware island, kos; - six SN012776 amps on i2c3: the J713's four plus a second woofer per side at 0x3a and 0x3d, listed in the ADT provider order (LW1 RW1 LT RT LW2 RW2) with the ADT amp-tx-zd-config idle masks over 24 sense slots, and the J715 macaudio cards; - three ATC PHY trims: atcphy0 AUSPLL_CORE and atcphy1 CIO3PLL_CORE and AUSCMN_SHM; - its MTP and Mesa firmware names and chassis name; - the 2880x1864 panel at 224 ppi: 327x211 mm, 327x204 mm below the notch. The rest of the J715 ADT matches the J713's: GPIOs, I2C, the NVRAM partition, PMGR, DARTs, the USB4 and PCIe-C tunables and the DROM. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j715.dts | 276 ++++++++++++++++++++++- 1 file changed, 265 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j715.dts b/arch/arm64/boot/dts/apple/t8132-j715.dts index 1a387d273e8ff..6662e95eebf95 100644 --- a/arch/arm64/boot/dts/apple/t8132-j715.dts +++ b/arch/arm64/boot/dts/apple/t8132-j715.dts @@ -4,6 +4,9 @@ * * target-type: J715 * + * The J713 board with a 15.3" panel and six speaker amps. Its ADT matches + * the J713's elsewhere, apart from the radio island and the ATC PHY trims. + * * Copyright The Asahi Linux Contributors */ @@ -11,26 +14,277 @@ #include "t8132.dtsi" #include "t8132-jxxx.dtsi" -#include +#include / { compatible = "apple,j715", "apple,t8132", "apple,arm-platform"; model = "Apple MacBook Air (15-inch, M4, 2025)"; chassis-type = "laptop"; - led-controller { - compatible = "pwm-leds"; - led-0 { - pwms = <&fpwm1 0 40000>; - label = "kbd_backlight"; - function = LED_FUNCTION_KBD_BACKLIGHT; - color = ; - max-brightness = <255>; - default-state = "keep"; + /* + * The speaker amps' shared shutdown line (SDZ, AP GPIO 15, the ADT + * function-reset; low = shutdown). One fixed regulator, the SDZ supply + * of all six, so one amp's fault takes the whole group down. + */ + speaker_sdz: regulator-sn012776-sdz { + compatible = "regulator-fixed"; + regulator-name = "sn012776-sdz"; + gpios = <&pinctrl_ap 15 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + /* + * The AOP firmware runs the stream (MCA cluster 0, one serializer for + * the six amps); macaudio's J715 variant links the AOP audio + * component's speaker back-end (DAI 3) to them. The codecs are listed in + * the ADT provider order, so each gets its native playback slot (LW1 0, + * RW1 1, LT 2, RT 3, LW2 4, RW2 5). The idle masks are the ADT + * amp-tx-zd-config rows 0 and 1 over the 24 sense byte slots: the left + * woofer drives zeros in the right amps' sense slots, the right woofer + * in the left amps'. + */ + sound: sound { + compatible = "apple,j715-macaudio", "apple,macaudio"; + model = "MacBook Air J715"; + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + reg = <0>; + link-name = "Speakers"; + dai-tdm-idle-mode-0 = "zero"; + dai-tdm-idle-mode-1 = "zero"; + dai-tdm-slot-tx-idle-mask-0 = <0xf0f0f0>; + dai-tdm-slot-tx-idle-mask-1 = <0x0f0f0f>; + + cpu { + sound-dai = <&aop_audio 3>; + }; + + codec { + sound-dai = <&speaker_left_woof1>, <&speaker_right_woof1>, + <&speaker_left_tweet>, <&speaker_right_tweet>, + <&speaker_left_woof2>, <&speaker_right_woof2>; + }; + }; + }; + + /* + * The headphone jack: the AOP audio component's jack back-end (DAI 4) + * to the CS42L84, as a card of its own. + */ + sound_jack: sound-jack { + compatible = "apple,j715-macaudio-jack", "apple,macaudio"; + model = "MacBook Air J715 Jack"; + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + reg = <0>; + link-name = "Headphone Jack"; + + cpu { + sound-dai = <&aop_audio 4>; + }; + + codec { + sound-dai = <&jack_codec>; + }; }; }; }; -&fpwm1 { +&mtp_hid { + multi-touch { + firmware-name = "apple/tpmtfw-j715.bin"; + }; +}; + +#include "t8132-j713-j715.dtsi" + +/* The radio module's firmware island, from the ADT's module-instance. */ +&wifi0 { + brcm,board-type = "apple,kos"; +}; + +&bluetooth0 { + brcm,board-type = "apple,kos"; +}; + +&aop_audio { + apple,chassis-name = "J715"; + apple,machine-kind = "MacBook Air"; +}; + +/* + * The six SN012776 speaker amps, held in hardware shutdown until the sound + * card enables them (ADT /arm-io/i2c3/audio-speaker at 0x38 and its + * speaker1..5): one interrupt line on AP GPIO 14, level low; sense slots + * from speaker-config (amp i at RX bytes 4i and 4i + 2, order LW1 RW1 LT RT + * LW2 RW2). Every amp joins the SDZ fail-closed group. + */ +&i2c3 { status = "okay"; + + speaker_left_woof1: codec@38 { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x38>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Left Woofer 1"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <0>; + ti,vmon-slot-no = <2>; + }; + + speaker_left_tweet: codec@39 { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x39>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Left Tweeter"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <8>; + ti,vmon-slot-no = <10>; + }; + + speaker_left_woof2: codec@3a { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3a>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Left Woofer 2"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <16>; + ti,vmon-slot-no = <18>; + }; + + speaker_right_woof1: codec@3b { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3b>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Right Woofer 1"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <4>; + ti,vmon-slot-no = <6>; + }; + + speaker_right_tweet: codec@3c { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3c>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Right Tweeter"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <12>; + ti,vmon-slot-no = <14>; + }; + + speaker_right_woof2: codec@3d { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3d>; + SDZ-supply = <&speaker_sdz>; + apple,sdz-group-fail-closed; + apple,deferred-shutdown; + #sound-dai-cells = <0>; + sound-name-prefix = "Right Woofer 2"; + interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; + ti,imon-slot-no = <20>; + ti,vmon-slot-no = <22>; + }; +}; + +&mesa { + /* + * Per-device factory data from this Mac's own iBoot system container: + * the calibration, and the signed root key the nonce session loads. + */ + firmware-name = "apple/mesacal-j715.bin", "apple/msrk-j715.bin"; +}; + +/* + * The ATC PHY calibration where the J715 ADT differs from the J713 tree: + * PLL and common-block trims, which also differ between machines and + * between the two PHYs. + */ +&atcphy0 { + apple,tunable-cio-common = + <0x800 0x3f0000 0x230000>, + <0x2224 0xc00 0x800>, + <0x2230 0x1f 0xf>, + <0x2240 0x18007f 0x39>, + <0x22b0 0x8700000 0x300000>, + <0x22e8 0x60001 0x40001>, + <0x2338 0xf800000 0x7800000>, + <0x2a00 0x888 0x888>, + <0x2a08 0x1f0000 0x30000>, + <0x2a24 0xc00 0x800>, + <0x2a28 0xf00 0xb00>, + <0x2a30 0x1f 0xf>, + <0x2a4c 0x7ffe00 0x63ba00>, + <0x2ab0 0x700000 0x300000>, + <0x2ae8 0x60000 0x20000>, + <0x2b00 0xfff 0xd8>, + <0x2894 0x100 0x100>, + <0x28a0 0x1ff 0x114>, + <0x1030 0x8000 0x8000>, + <0x4000 0xf00700 0xb00000>, + <0x10c 0x40000 0x0>; +}; + +&atcphy1 { + apple,tunable-cio-common = + <0x800 0x3f0000 0x230000>, + <0x2224 0xc00 0x800>, + <0x2230 0x1f 0xf>, + <0x2240 0x18007f 0x39>, + <0x22b0 0x8700000 0x300000>, + <0x22e8 0x60001 0x40001>, + <0x2338 0xf800000 0x7800000>, + <0x2a00 0x888 0x888>, + <0x2a08 0x1f0000 0x30000>, + <0x2a24 0xc00 0x800>, + <0x2a28 0xf00 0xb00>, + <0x2a30 0x1f 0xf>, + <0x2a4c 0x7ffe00 0x22ba00>, + <0x2ab0 0x700000 0x300000>, + <0x2ae8 0x60000 0x20000>, + <0x2b00 0xfff 0xd8>, + <0x2894 0x100 0x100>, + <0x28a0 0x1ff 0x114>, + <0x1030 0x8000 0x8000>, + <0x4000 0xf00700 0xb00000>, + <0x10c 0x40000 0x0>; + apple,tunable-cio-post = + <0xa04 0x7c 0x50>, + <0x260c 0x3ff 0x200>; +}; + +/* The full 2880x1864 panel including the notch rows, 224 ppi. */ +&dcp { + apple,panel-width-mm = <327>; + apple,panel-height-mm = <211>; +}; + +/ { + /* + * Physical size of the firmware framebuffer's 2880x1800 area below the + * notch (15.3" panel, 224 ppi), so simpledrm reports the real DPI. + */ + fb_panel: panel { + width-mm = <327>; + height-mm = <204>; + status = "disabled"; + }; }; From a208f1168266b039d484370f407807f3f4d26852 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:10:19 +1100 Subject: [PATCH 36/79] nfc: apple-stockholm: read the identity once and keep the controller off On the J616s the model 96 controller answers CORE_RESET (NCI 1.0) and CORE_INIT, but CORE_INIT reports no RF interfaces, a zero-size listen mode routing table and no discovery features. The NCI core then sends RF_DISCOVER_MAP with no mappings, which the controller rejects with a syntax error, so nfc0 can never be brought up. There is no NFC antenna on these Macs either: the controller only fronts the embedded Secure Element. Registering an NFC device that can never be powered would only confuse neard and other NFC users. Drop the NCI core registration and make the driver what the hardware supports: check the follower ID and IRQ base, do one CORE_RESET/CORE_INIT exchange to log the NCI version, manufacturer, firmware identity and RF interface count, then disable standby and drive VEN low. The controller stays in that deepest state for the life of the system, so suspend, resume and runtime PM need no callbacks; a failed identity read still parks it. Also drop the unused CRC property from the binding, rename the binding after its compatible, use the Aurora copyright line and add the files to the Apple MAINTAINERS entry. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- ...tockholm.yaml => apple,stockholm-nci.yaml} | 23 +- MAINTAINERS | 2 + drivers/nfc/Kconfig | 12 +- drivers/nfc/apple-stockholm.c | 486 ++++++++---------- 4 files changed, 249 insertions(+), 274 deletions(-) rename Documentation/devicetree/bindings/net/nfc/{apple,stockholm.yaml => apple,stockholm-nci.yaml} (64%) diff --git a/Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml b/Documentation/devicetree/bindings/net/nfc/apple,stockholm-nci.yaml similarity index 64% rename from Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml rename to Documentation/devicetree/bindings/net/nfc/apple,stockholm-nci.yaml index e3fb998b80486..316c7b99e59e4 100644 --- a/Documentation/devicetree/bindings/net/nfc/apple,stockholm.yaml +++ b/Documentation/devicetree/bindings/net/nfc/apple,stockholm-nci.yaml @@ -1,18 +1,21 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- -$id: http://devicetree.org/schemas/net/nfc/apple,stockholm.yaml# +$id: http://devicetree.org/schemas/net/nfc/apple,stockholm-nci.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Apple Stockholm NFC controller over SPMI +title: Apple Stockholm NFC controller and Secure Element over SPMI maintainers: - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> description: | - Stockholm is an NCI NFC controller and embedded Secure Element connected as - an SPMI follower. NCI frames are transferred through a non-incrementing FIFO - register. A separate enable GPIO controls the deepest power state. + Stockholm is an NCI NFC controller with an embedded Secure Element, + connected to the SoC as a follower on a dedicated SPMI bus. NCI packets + are written to and read from non-incrementing FIFO registers of the + follower. The follower raises host-wake, data-ready and error interrupts + through the SPMI controller, and an enable line (VEN) selects between + operation and the controller's deepest power state. properties: compatible: @@ -22,8 +25,10 @@ properties: maxItems: 1 interrupts: - minItems: 3 - maxItems: 3 + items: + - description: host wake request from the controller + - description: NCI packet ready in the receive FIFO + - description: transport error interrupt-names: items: @@ -35,10 +40,6 @@ properties: maxItems: 1 description: VEN, the controller's enable line; low is its deepest power state. - apple,transport-crc16: - type: boolean - description: NCI frames carry the standard big-endian CRC-CCITT trailer. - required: - compatible - reg diff --git a/MAINTAINERS b/MAINTAINERS index 94db75cad4059..433fde7181d4d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2734,6 +2734,7 @@ F: Documentation/devicetree/bindings/leds/backlight/apple,dwi-bl.yaml F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml F: Documentation/devicetree/bindings/mfd/apple,smc.yaml F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml +F: Documentation/devicetree/bindings/net/nfc/apple,stockholm-nci.yaml F: Documentation/devicetree/bindings/npu/apple,ane.yaml F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml @@ -2777,6 +2778,7 @@ F: drivers/iommu/apple-dart.c F: drivers/iommu/io-pgtable-dart.c F: drivers/irqchip/irq-apple-aic.c F: drivers/mfd/macsmc*.c +F: drivers/nfc/apple-stockholm.c F: drivers/nvme/host/apple.c F: drivers/nvmem/apple-efuses.c F: drivers/nvmem/apple-spmi-nvmem.c diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index b87ab0027c848..7ec08ca367152 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig @@ -61,11 +61,15 @@ config NFC_VIRTUAL_NCI If unsure, say N. config NFC_APPLE_STOCKHOLM - tristate "Apple Stockholm NFC controller over SPMI" - depends on NFC_NCI && SPMI && GPIOLIB + tristate "Apple Stockholm NFC controller and Secure Element" + depends on SPMI && GPIOLIB && OF + depends on ARCH_APPLE || COMPILE_TEST help - This enables the NCI transport used by Apple Stockholm NFC and - embedded Secure Element controllers connected over SPMI. + This enables the driver for the Apple Stockholm NFC controller with + embedded Secure Element found on Apple silicon Macs, connected over + SPMI. The Mac parts have no NFC radio interfaces, so no NFC device + is registered: the driver reads the controller identity once and + keeps the controller powered off. Say M here to compile this driver as a module named apple-stockholm. diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index 6aa4802df38d1..b6defed23b770 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -1,43 +1,53 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Apple Stockholm NFC controller transport over SPMI + * Apple Stockholm NFC controller and embedded Secure Element over SPMI * - * Copyright The Asahi Linux Contributors + * Stockholm is an NCI controller with an embedded Secure Element. On the + * Macs it sits on its own SPMI bus and is enabled through an SMC GPIO (VEN). + * The Mac parts report no RF interfaces and no listen-mode routing in + * CORE_INIT, so there is no NFC reader to offer the NFC core: the controller + * only fronts the Secure Element. This driver checks that the follower is + * present, reads the controller identity once and then holds the controller + * in its deepest power state (VEN low) for the life of the system. + * + * Copyright The Aurora Silicon Contributors */ +#include #include #include #include #include #include +#include #include #include +#include -#include +#include -#define STOCKHOLM_NFC_PROTOCOLS (NFC_PROTO_JEWEL_MASK | \ - NFC_PROTO_MIFARE_MASK | \ - NFC_PROTO_FELICA_MASK | \ - NFC_PROTO_ISO14443_MASK | \ - NFC_PROTO_ISO14443_B_MASK | \ - NFC_PROTO_ISO15693_MASK | \ - NFC_PROTO_NFC_DEP_MASK) +#define STOCKHOLM_FIFO_CHUNK 8 +#define STOCKHOLM_NCI_TIMEOUT_MS 500 #define STOCKHOLM_ERROR_STATUS0_REG 0x4 #define STOCKHOLM_ERROR_STATUS1_REG 0x7 #define STOCKHOLM_ERROR_STATUS2_REG 0x8 +/* NCI 1.x CORE_INIT_RSP: status, 4 feature bytes, RF interface count. */ +#define STOCKHOLM_INIT_RSP_RF_COUNT 5 +/* After the RF list: connections, routing (2), control size, large (2). */ +#define STOCKHOLM_INIT_RSP_TAIL 6 +#define STOCKHOLM_INIT_RSP_MANUF_LEN 5 + /* Transport parameters of one controller model. */ struct stockholm_model { u16 tx_reg; /* non-incrementing NCI transmit FIFO */ u16 rx_reg; /* non-incrementing NCI receive FIFO */ u16 id_reg; /* follower ID, side-effect-free read */ - u16 irq_reg; /* follower IRQ offset, side-effect-free read */ + u16 irq_reg; /* follower IRQ base, side-effect-free read */ u16 standby_reg; /* follower virtual command register */ - u8 rx_trailer_len; /* bytes drained after the NCI packet */ u8 follower_id; /* expected value of id_reg */ - u8 irq_offset; /* expected base of the follower's IRQ block */ - u8 standby_on; + u8 irq_base; /* expected value of irq_reg */ u8 standby_off; u32 startup_delay_us; }; @@ -48,30 +58,27 @@ static const struct stockholm_model stockholm_model96 = { .id_reg = 0x100, .irq_reg = 0x105, .standby_reg = 0x0, - .rx_trailer_len = 0, .follower_id = 0x19, - .irq_offset = 0xe0, - .standby_on = 0x15, + .irq_base = 0xe0, .standby_off = 0x14, .startup_delay_us = 10000, }; struct stockholm { struct spmi_device *sdev; - struct nci_dev *ndev; + const struct stockholm_model *model; struct gpio_desc *enable_gpio; - struct mutex io_lock; - u16 tx_reg; - u16 rx_reg; - u16 standby_reg; - u8 rx_trailer_len; - u8 standby_on; - u8 standby_off; - u32 startup_delay_us; int data_irq; - int wake_irq; int error_irq; - bool powered; + + /* Serialises FIFO access and the awaited-response state below. */ + struct mutex io_lock; + struct completion rx_done; + bool rx_waiting; + u8 rx_hdr[2]; /* awaited packet: MT/GID and OID bytes */ + u8 rx_len; + u8 rx_payload[NCI_MAX_PAYLOAD_SIZE]; + u8 pkt[NCI_CTRL_HDR_SIZE + NCI_MAX_PAYLOAD_SIZE]; }; static int stockholm_fifo_read(struct stockholm *st, u8 *buf, size_t len) @@ -80,8 +87,9 @@ static int stockholm_fifo_read(struct stockholm *st, u8 *buf, size_t len) int ret; while (len) { - chunk = min_t(size_t, len, 8); - ret = spmi_ext_register_readl(st->sdev, st->rx_reg, buf, chunk); + chunk = min_t(size_t, len, STOCKHOLM_FIFO_CHUNK); + ret = spmi_ext_register_readl(st->sdev, st->model->rx_reg, buf, + chunk); if (ret) return ret; buf += chunk; @@ -97,8 +105,9 @@ static int stockholm_fifo_write(struct stockholm *st, const u8 *buf, size_t len) int ret; while (len) { - chunk = min_t(size_t, len, 8); - ret = spmi_ext_register_writel(st->sdev, st->tx_reg, buf, chunk); + chunk = min_t(size_t, len, STOCKHOLM_FIFO_CHUNK); + ret = spmi_ext_register_writel(st->sdev, st->model->tx_reg, + buf, chunk); if (ret) return ret; buf += chunk; @@ -108,161 +117,79 @@ static int stockholm_fifo_write(struct stockholm *st, const u8 *buf, size_t len) return 0; } -static int stockholm_set_standby(struct stockholm *st, bool standby) +static int stockholm_standby_off(struct stockholm *st) { - u8 value = standby ? st->standby_on : st->standby_off; + u8 value = st->model->standby_off; - return spmi_ext_register_writel(st->sdev, st->standby_reg, &value, 1); + return spmi_ext_register_writel(st->sdev, st->model->standby_reg, + &value, 1); } -static int stockholm_set_power(struct stockholm *st, bool on) +static int stockholm_power_on(struct stockholm *st) { + u32 delay = st->model->startup_delay_us; int ret; - if (st->powered == on) - return 0; - - ret = gpiod_direction_output(st->enable_gpio, on); + ret = gpiod_direction_output(st->enable_gpio, 1); if (ret) return ret; - st->powered = on; - if (on) { - usleep_range(st->startup_delay_us, - st->startup_delay_us + max_t(u32, 100, st->startup_delay_us / 10)); - ret = stockholm_set_standby(st, false); - if (ret) - dev_dbg(&st->sdev->dev, "standby exit failed: %d\n", ret); - } + usleep_range(delay, delay + delay / 10); + ret = stockholm_standby_off(st); + if (ret) + dev_dbg(&st->sdev->dev, "standby exit failed: %d\n", ret); return 0; } -static int stockholm_nci_open(struct nci_dev *ndev) +static int stockholm_park(struct stockholm *st) { - struct stockholm *st = nci_get_drvdata(ndev); int ret; - mutex_lock(&st->io_lock); - ret = stockholm_set_power(st, true); - if (!ret) - enable_irq(st->data_irq); - mutex_unlock(&st->io_lock); - - return ret; -} - -static int stockholm_nci_close(struct nci_dev *ndev) -{ - struct stockholm *st = nci_get_drvdata(ndev); - int ret; - - disable_irq(st->data_irq); - mutex_lock(&st->io_lock); - ret = stockholm_set_standby(st, false); + ret = stockholm_standby_off(st); if (ret) dev_dbg(&st->sdev->dev, "standby disable failed: %d\n", ret); - ret = stockholm_set_power(st, false); - mutex_unlock(&st->io_lock); - - return ret; -} - -static int stockholm_nci_send(struct nci_dev *ndev, struct sk_buff *skb) -{ - struct stockholm *st = nci_get_drvdata(ndev); - int ret; - - if (!st->powered) { - kfree_skb(skb); - return -EHOSTDOWN; - } - mutex_lock(&st->io_lock); - ret = stockholm_fifo_write(st, skb->data, skb->len); - mutex_unlock(&st->io_lock); - - if (ret) - kfree_skb(skb); - else - consume_skb(skb); - - return ret; + return gpiod_direction_output(st->enable_gpio, 0); } -static int stockholm_nci_post_setup(struct nci_dev *ndev) -{ - struct stockholm *st = nci_get_drvdata(ndev); - - dev_info(&st->sdev->dev, - "NCI %u.%u, manufacturer %#02x, firmware identity %#08x\n", - ndev->nci_ver >> 4, ndev->nci_ver & 0xf, - ndev->manufact_id, ndev->manufact_specific_info); - - return 0; -} - -static const struct nci_ops stockholm_nci_ops = { - .open = stockholm_nci_open, - .close = stockholm_nci_close, - .send = stockholm_nci_send, - .post_setup = stockholm_nci_post_setup, -}; - -static irqreturn_t stockholm_data_irq_thread(int irq, void *data) +static irqreturn_t stockholm_data_irq(int irq, void *data) { struct stockholm *st = data; - struct nci_ctrl_hdr hdr; - struct sk_buff *skb = NULL; - u8 trailer[2]; - size_t nci_len; + u8 *hdr = st->pkt; + u8 plen = 0; int ret; mutex_lock(&st->io_lock); - ret = stockholm_fifo_read(st, (u8 *)&hdr, sizeof(hdr)); - if (ret) - goto out_unlock; - - nci_len = sizeof(hdr) + hdr.plen; - skb = alloc_skb(nci_len, GFP_KERNEL); - if (!skb) { - ret = -ENOMEM; - goto out_unlock; + ret = stockholm_fifo_read(st, hdr, NCI_CTRL_HDR_SIZE); + if (!ret) { + plen = nci_plen(hdr); + ret = stockholm_fifo_read(st, hdr + NCI_CTRL_HDR_SIZE, plen); + } + if (ret) { + mutex_unlock(&st->io_lock); + dev_err_ratelimited(&st->sdev->dev, "NCI receive failed: %d\n", + ret); + return IRQ_HANDLED; } - skb_put_data(skb, &hdr, sizeof(hdr)); - ret = stockholm_fifo_read(st, skb_put(skb, hdr.plen), hdr.plen); - /* The two model-96 trailer bytes are not part of the NCI packet. */ - if (!ret && st->rx_trailer_len) - ret = stockholm_fifo_read(st, trailer, st->rx_trailer_len); - mutex_unlock(&st->io_lock); - if (ret) - goto out_free; - - nci_recv_frame(st->ndev, skb); - return IRQ_HANDLED; - -out_unlock: + /* Ignore the packet boundary flag; match MT, GID and OID. */ + if (st->rx_waiting && (hdr[0] & 0xef) == st->rx_hdr[0] && + (hdr[1] & 0x3f) == st->rx_hdr[1]) { + memcpy(st->rx_payload, hdr + NCI_CTRL_HDR_SIZE, plen); + st->rx_len = plen; + st->rx_waiting = false; + complete(&st->rx_done); + } else { + dev_dbg(&st->sdev->dev, "dropped NCI packet %02x %02x len %u\n", + hdr[0], hdr[1], plen); + } mutex_unlock(&st->io_lock); -out_free: - if (!ret) - ret = -EBADMSG; - if (ret) - dev_err_ratelimited(&st->sdev->dev, "NCI receive failed: %d\n", ret); - if (skb) - kfree_skb(skb); - return IRQ_HANDLED; -} -static irqreturn_t stockholm_wake_irq_thread(int irq, void *data) -{ - struct stockholm *st = data; - - pm_wakeup_event(&st->sdev->dev, 0); return IRQ_HANDLED; } -static irqreturn_t stockholm_error_irq_thread(int irq, void *data) +static irqreturn_t stockholm_error_irq(int irq, void *data) { struct stockholm *st = data; u8 status[3]; @@ -283,157 +210,200 @@ static irqreturn_t stockholm_error_irq_thread(int irq, void *data) if (ret) dev_err_ratelimited(&st->sdev->dev, - "SPMI transport error; status read failed: %d\n", + "transport error, status read failed: %d\n", ret); else dev_err_ratelimited(&st->sdev->dev, - "SPMI transport error: status %#02x/%#02x/%#02x\n", + "transport error, status %02x/%02x/%02x\n", status[0], status[1], status[2]); + return IRQ_HANDLED; } -static int stockholm_read_config(struct stockholm *st, - const struct stockholm_model *model) +/* + * Send one NCI control command and wait for its response. Returns the + * response payload length; the payload is left in st->rx_payload. + */ +static int stockholm_nci_cmd(struct stockholm *st, u16 opcode, + const u8 *payload, u8 plen) +{ + u8 cmd[NCI_CTRL_HDR_SIZE + 2] = {}; + unsigned long left; + int ret; + + if (plen > sizeof(cmd) - NCI_CTRL_HDR_SIZE) + return -EINVAL; + + cmd[0] = nci_opcode_gid(opcode); + nci_mt_set(cmd, NCI_MT_CMD_PKT); + cmd[1] = nci_opcode_oid(opcode); + cmd[2] = plen; + if (plen) + memcpy(cmd + NCI_CTRL_HDR_SIZE, payload, plen); + + mutex_lock(&st->io_lock); + reinit_completion(&st->rx_done); + st->rx_hdr[0] = (NCI_MT_RSP_PKT << 5) | nci_opcode_gid(opcode); + st->rx_hdr[1] = nci_opcode_oid(opcode); + st->rx_waiting = true; + ret = stockholm_fifo_write(st, cmd, NCI_CTRL_HDR_SIZE + plen); + if (ret) + st->rx_waiting = false; + mutex_unlock(&st->io_lock); + if (ret) + return ret; + + left = wait_for_completion_timeout(&st->rx_done, + msecs_to_jiffies(STOCKHOLM_NCI_TIMEOUT_MS)); + + mutex_lock(&st->io_lock); + if (!left && st->rx_waiting) { + st->rx_waiting = false; + ret = -ETIMEDOUT; + } else { + ret = st->rx_len; + } + mutex_unlock(&st->io_lock); + + return ret; +} + +/* CORE_RESET and CORE_INIT, then log what the controller reports. */ +static int stockholm_identify(struct stockholm *st) +{ + struct device *dev = &st->sdev->dev; + u8 reset_type = NCI_RESET_TYPE_RESET_CONFIG; + const u8 *rsp = st->rx_payload; + unsigned int n_rf, tail; + u8 version; + int len; + + len = stockholm_nci_cmd(st, NCI_OP_CORE_RESET_CMD, &reset_type, 1); + if (len < 0) + return len; + if (len < 1 || rsp[0] != NCI_STATUS_OK) + return -EIO; + /* Only the NCI 1.x reset response carries the version (3 bytes). */ + if (len != 3) + return -EOPNOTSUPP; + version = rsp[1]; + + len = stockholm_nci_cmd(st, NCI_OP_CORE_INIT_CMD, NULL, 0); + if (len < 0) + return len; + if (len <= STOCKHOLM_INIT_RSP_RF_COUNT || rsp[0] != NCI_STATUS_OK) + return -EIO; + + n_rf = rsp[STOCKHOLM_INIT_RSP_RF_COUNT]; + tail = STOCKHOLM_INIT_RSP_RF_COUNT + 1 + n_rf + STOCKHOLM_INIT_RSP_TAIL; + if (len < tail + STOCKHOLM_INIT_RSP_MANUF_LEN) + return -EIO; + + dev_info(dev, + "NCI %u.%u controller, manufacturer %#04x, firmware %08x, %u RF interfaces; parked off\n", + version >> 4, version & 0xf, rsp[tail], + get_unaligned_le32(&rsp[tail + 1]), n_rf); + + return 0; +} + +static int stockholm_check_follower(struct stockholm *st) { struct device *dev = &st->sdev->dev; u8 value; int ret; - ret = spmi_ext_register_readl(st->sdev, model->id_reg, &value, 1); + ret = spmi_ext_register_readl(st->sdev, st->model->id_reg, &value, 1); if (ret) return dev_err_probe(dev, ret, "failed to read follower ID\n"); - if (value != model->follower_id) + if (value != st->model->follower_id) return dev_err_probe(dev, -ENODEV, - "unexpected follower ID %#02x\n", value); + "unexpected follower ID %#04x\n", value); - ret = spmi_ext_register_readl(st->sdev, model->irq_reg, &value, 1); + ret = spmi_ext_register_readl(st->sdev, st->model->irq_reg, &value, 1); if (ret) - return dev_err_probe(dev, ret, "failed to read IRQ offset\n"); - if (value != model->irq_offset) + return dev_err_probe(dev, ret, "failed to read IRQ base\n"); + if (value != st->model->irq_base) return dev_err_probe(dev, -ENODEV, - "unexpected IRQ offset %#02x\n", value); + "unexpected IRQ base %#04x\n", value); return 0; } +static int stockholm_request_irq(struct stockholm *st, const char *name, + irq_handler_t thread_fn) +{ + struct device *dev = &st->sdev->dev; + int irq, ret; + + irq = fwnode_irq_get_byname(dev_fwnode(dev), name); + if (irq < 0) + return dev_err_probe(dev, irq, "no %s interrupt\n", name); + + ret = devm_request_threaded_irq(dev, irq, NULL, thread_fn, + IRQF_ONESHOT | IRQF_NO_AUTOEN, + dev_name(dev), st); + if (ret) + return dev_err_probe(dev, ret, "failed to request %s IRQ\n", + name); + + return irq; +} + static int stockholm_probe(struct spmi_device *sdev) { struct device *dev = &sdev->dev; - const struct stockholm_model *model; struct stockholm *st; - int ven, ret; + int ret, err; st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL); if (!st) return -ENOMEM; st->sdev = sdev; + st->model = device_get_match_data(dev); + if (!st->model) + return -ENODEV; mutex_init(&st->io_lock); - spmi_device_set_drvdata(sdev, st); + init_completion(&st->rx_done); - model = device_get_match_data(dev); - if (!model) - return -ENODEV; - st->tx_reg = model->tx_reg; - st->rx_reg = model->rx_reg; - st->standby_reg = model->standby_reg; - st->rx_trailer_len = model->rx_trailer_len; - st->standby_on = model->standby_on; - st->standby_off = model->standby_off; - st->startup_delay_us = model->startup_delay_us; st->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_ASIS); if (IS_ERR(st->enable_gpio)) return dev_err_probe(dev, PTR_ERR(st->enable_gpio), "failed to get VEN GPIO\n"); - ven = gpiod_get_value_cansleep(st->enable_gpio); - dev_dbg(dev, "VEN at probe: %d\n", ven); - - ret = stockholm_set_power(st, true); - if (ret) - return dev_err_probe(dev, ret, "failed to enable controller\n"); - ret = stockholm_read_config(st, model); - if (ret) - goto err_poweroff; - - st->ndev = nci_allocate_device(&stockholm_nci_ops, - STOCKHOLM_NFC_PROTOCOLS, 0, 0); - if (!st->ndev) { - ret = -ENOMEM; - goto err_poweroff; - } - nci_set_parent_dev(st->ndev, dev); - nci_set_drvdata(st->ndev, st); + st->data_irq = stockholm_request_irq(st, "data-ready", + stockholm_data_irq); + if (st->data_irq < 0) + return st->data_irq; + st->error_irq = stockholm_request_irq(st, "error", + stockholm_error_irq); + if (st->error_irq < 0) + return st->error_irq; - st->data_irq = fwnode_irq_get_byname(dev_fwnode(dev), "data-ready"); - if (st->data_irq < 0) { - ret = st->data_irq; - goto err_free_nci; - } - ret = devm_request_threaded_irq(dev, st->data_irq, NULL, - stockholm_data_irq_thread, IRQF_ONESHOT, - dev_name(dev), st); + ret = stockholm_power_on(st); if (ret) - goto err_free_nci; - disable_irq(st->data_irq); - - st->wake_irq = fwnode_irq_get_byname(dev_fwnode(dev), "host-wake"); - if (st->wake_irq >= 0) { - ret = devm_request_threaded_irq(dev, st->wake_irq, NULL, - stockholm_wake_irq_thread, - IRQF_ONESHOT, dev_name(dev), st); - if (ret) - goto err_free_nci; - device_init_wakeup(dev, true); - } + return dev_err_probe(dev, ret, "failed to raise VEN\n"); - st->error_irq = fwnode_irq_get_byname(dev_fwnode(dev), "error"); - if (st->error_irq >= 0) { - ret = devm_request_threaded_irq(dev, st->error_irq, NULL, - stockholm_error_irq_thread, - IRQF_ONESHOT, dev_name(dev), st); - if (ret) - goto err_free_nci; + ret = stockholm_check_follower(st); + if (!ret) { + enable_irq(st->error_irq); + enable_irq(st->data_irq); + err = stockholm_identify(st); + disable_irq(st->data_irq); + disable_irq(st->error_irq); + if (err) + dev_warn(dev, "identity read failed (%d); parked off\n", + err); } - ret = nci_register_device(st->ndev); - if (ret) - goto err_free_nci; - - ret = stockholm_set_standby(st, false); - if (ret) - dev_dbg(dev, "initial standby disable failed: %d\n", ret); - ret = stockholm_set_power(st, false); - if (ret) - dev_warn(dev, "failed to park VEN low: %d\n", ret); - else - dev_info(dev, "registered NCI device and parked VEN low\n"); - - return 0; + err = stockholm_park(st); + if (err) + return dev_err_probe(dev, err, "failed to park VEN low\n"); -err_free_nci: - nci_free_device(st->ndev); -err_poweroff: - stockholm_set_power(st, false); return ret; } -static void stockholm_remove(struct spmi_device *sdev) -{ - struct stockholm *st = spmi_device_get_drvdata(sdev); - - nci_unregister_device(st->ndev); - nci_free_device(st->ndev); - stockholm_set_power(st, false); -} - -static void stockholm_shutdown(struct spmi_device *sdev) -{ - struct stockholm *st = spmi_device_get_drvdata(sdev); - - stockholm_set_power(st, false); -} - static const struct of_device_id stockholm_of_match[] = { { .compatible = "apple,stockholm-nci", .data = &stockholm_model96 }, {} @@ -442,8 +412,6 @@ MODULE_DEVICE_TABLE(of, stockholm_of_match); static struct spmi_driver stockholm_driver = { .probe = stockholm_probe, - .remove = stockholm_remove, - .shutdown = stockholm_shutdown, .driver = { .name = "apple-stockholm", .of_match_table = stockholm_of_match, @@ -452,5 +420,5 @@ static struct spmi_driver stockholm_driver = { module_spmi_driver(stockholm_driver); MODULE_AUTHOR("Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>"); -MODULE_DESCRIPTION("Apple Stockholm NFC controller over SPMI"); +MODULE_DESCRIPTION("Apple Stockholm NFC controller and Secure Element (power and identity)"); MODULE_LICENSE("GPL"); From 6bd3e75fe436d1e5f049003487f5d314950d3693 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:12:41 +1100 Subject: [PATCH 37/79] Bluetooth: btcentauri: Kick the poll work on system_percpu_wq The send path re-arms the poll work with mod_delayed_work(system_wq), while every other caller uses schedule_delayed_work(), which already queues on system_percpu_wq. system_wq is deprecated and logs a warning the first time an item is queued on it. Use system_percpu_wq so the work always runs on the queue the rest of the driver uses, and the kernel log stays clean. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> --- drivers/bluetooth/btcentauri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/btcentauri.c b/drivers/bluetooth/btcentauri.c index 5830c8b2285e4..5e229464bf047 100644 --- a/drivers/bluetooth/btcentauri.c +++ b/drivers/bluetooth/btcentauri.c @@ -786,7 +786,7 @@ static int cen_hci_send(struct hci_dev *hdev, struct sk_buff *skb) ret = -ENOBUFS; else { skb_queue_tail(queue, skb); - mod_delayed_work(system_wq, &bt->poll, 0); + mod_delayed_work(system_percpu_wq, &bt->poll, 0); } mutex_unlock(&bt->lock); if (!ret) From ddd0bbecdffc528a544152ded255b961fd93745a Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:12:42 +1100 Subject: [PATCH 38/79] drm/apple: t8132_ext: Queue the flip work on system_percpu_wq system_wq is deprecated, and the first item queued on it logs "enqueued on deprecated workqueue" at warning level. Queue the delayed flip event on system_percpu_wq, the per-CPU queue that replaces it; the behaviour is unchanged. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> --- drivers/gpu/drm/apple/t8132_ext_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/apple/t8132_ext_drm.c b/drivers/gpu/drm/apple/t8132_ext_drm.c index f6cc2f7767190..a30003908346e 100644 --- a/drivers/gpu/drm/apple/t8132_ext_drm.c +++ b/drivers/gpu/drm/apple/t8132_ext_drm.c @@ -527,7 +527,7 @@ static void t8132_ext_crtc_flush(struct drm_crtc *crtc, struct drm_atomic_commit if (READ_ONCE(out->dying)) t8132_ext_send_event(out); else - mod_delayed_work(system_wq, &out->flip_work, + mod_delayed_work(system_percpu_wq, &out->flip_work, ret >= 0 ? 0 : msecs_to_jiffies(16)); } } From edad0f2715338de2a17963b4983df8fa2e7043af Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:13:08 +1100 Subject: [PATCH 39/79] arm64: asahi.config: build the Apple Stockholm driver The driver holds the Stockholm NFC controller and Secure Element in its deepest power state on the J616s and the J700 once their device trees describe it. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/configs/asahi.config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/configs/asahi.config b/arch/arm64/configs/asahi.config index 2689839863cf7..d95c2bda2773c 100644 --- a/arch/arm64/configs/asahi.config +++ b/arch/arm64/configs/asahi.config @@ -41,6 +41,8 @@ CONFIG_SPI_APPLE_QSPI=m CONFIG_SPMI_APPLE=y CONFIG_PINCTRL_APPLE_GPIO=m CONFIG_GPIO_MACSMC=m +CONFIG_NFC=m +CONFIG_NFC_APPLE_STOCKHOLM=m CONFIG_POWER_RESET_MACSMC=m CONFIG_MACSMC_POWER=m CONFIG_SENSORS_MACSMC_HWMON=m From 5f072cbf953720e456fdc35e6b9ed84585677b59 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:13:21 +1100 Subject: [PATCH 40/79] arm64: dts: apple: t6040-j616s: name the SMC low GPIO bank like the J616c Use the smc_gpio_low label the J616c already uses for the same bank. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6040-j616s.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 325055cbce747..2dcc62fb617c0 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -27,7 +27,7 @@ }; &smc { - smc_gpio_low_stockholm: gpio-low { + smc_gpio_low: gpio-low { compatible = "apple,smc-low-gpio"; gpio-controller; #gpio-cells = <2>; @@ -46,7 +46,7 @@ <230 IRQ_TYPE_EDGE_RISING>, <227 IRQ_TYPE_EDGE_RISING>; interrupt-names = "host-wake", "data-ready", "error"; - enable-gpios = <&smc_gpio_low_stockholm 0xe GPIO_ACTIVE_HIGH>; + enable-gpios = <&smc_gpio_low 0xe GPIO_ACTIVE_HIGH>; }; }; From 08c42b895b4925b9dd3d86fe7952f0310e1d4c9a Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:17:10 +1100 Subject: [PATCH 41/79] arm64: dts: apple: t8140: put the AOP SPMI bus at its real address The ADT places aop-spmi0 at 0x100914000 in the arm-io space, which is 0x310914000 in the SoC address map like every other t8140 arm-io node (nub-spmi0 0xf8714000 -> 0x308714000, smc 0xfc600000 -> 0x30c600000). The node used the arm-io offset as an absolute address. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8140.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index f13609fa3ba9b..76ebb748c8b73 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -954,9 +954,9 @@ status = "disabled"; }; - aop_spmi0: spmi@100914000 { + aop_spmi0: spmi@310914000 { compatible = "apple,t8140-spmi", "apple,t8103-spmi"; - reg = <0x1 0x00914000 0x0 0x100>; + reg = <0x3 0x10914000 0x0 0x100>; #address-cells = <2>; #size-cells = <0>; #interrupt-cells = <2>; From 5e92a16b6bc8dcc7687ba08cf34067f09c1d8298 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:17:12 +1100 Subject: [PATCH 42/79] dt-bindings: apple: describe unqualified T6041 and T8140 hardware resources Describe the structural register, interrupt, power-domain, clock-selector and DART interfaces of currently unqualified blocks. These bindings do not establish firmware ownership or enable a device. Keep T6041 APR distinct from the driven T8140 engine. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/clock/apple,pmgr-clocks.yaml | 40 +++++++++++++ .../devicetree/bindings/crypto/apple,aes.yaml | 50 +++++++++++++++++ .../bindings/display/apple,dcp-expert.yaml | 41 ++++++++++++++ .../display/apple,display-secure-proxy.yaml | 32 +++++++++++ .../bindings/display/apple,dpin.yaml | 36 ++++++++++++ .../bindings/dma/apple,pcie-piodma.yaml | 42 ++++++++++++++ .../bindings/dma/apple,pciec-piodma.yaml | 42 ++++++++++++++ .../devicetree/bindings/dma/apple,sio.yaml | 23 +++++++- .../mailbox/apple,secure-mailbox.yaml | 42 ++++++++++++++ .../media/apple,isp-secure-proxy.yaml | 32 +++++++++++ .../bindings/media/apple,scaler.yaml | 56 +++++++++++++++++++ .../bindings/media/apple,t6041-prores.yaml | 48 ++++++++++++++++ .../bindings/serial/samsung_uart.yaml | 3 + .../bindings/soc/apple/apple,aon-ptd.yaml | 40 +++++++++++++ .../bindings/soc/apple/apple,aop2.yaml | 47 ++++++++++++++++ .../bindings/soc/apple/apple,cpu-debug.yaml | 37 ++++++++++++ .../bindings/soc/apple/apple,dwi.yaml | 45 +++++++++++++++ .../bindings/soc/apple/apple,esm.yaml | 42 ++++++++++++++ .../bindings/soc/apple/apple,rsm.yaml | 41 ++++++++++++++ .../bindings/timer/apple,aic-timebase.yaml | 31 ++++++++++ .../bindings/timer/apple,secure-timebase.yaml | 31 ++++++++++ .../watchdog/apple,secure-watchdog.yaml | 31 ++++++++++ 22 files changed, 831 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml create mode 100644 Documentation/devicetree/bindings/crypto/apple,aes.yaml create mode 100644 Documentation/devicetree/bindings/display/apple,dcp-expert.yaml create mode 100644 Documentation/devicetree/bindings/display/apple,display-secure-proxy.yaml create mode 100644 Documentation/devicetree/bindings/display/apple,dpin.yaml create mode 100644 Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml create mode 100644 Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml create mode 100644 Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml create mode 100644 Documentation/devicetree/bindings/media/apple,isp-secure-proxy.yaml create mode 100644 Documentation/devicetree/bindings/media/apple,scaler.yaml create mode 100644 Documentation/devicetree/bindings/media/apple,t6041-prores.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,esm.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml create mode 100644 Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml create mode 100644 Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml create mode 100644 Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml diff --git a/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml b/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml new file mode 100644 index 0000000000000..84e7e54dc662b --- /dev/null +++ b/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/apple,pmgr-clocks.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple PMGR peripheral clock selectors + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Peripheral input clocks managed by the SoC power manager. The clock + specifier is the SoC clock selector from the hardware description. It is + separate from a PMGR device/power-gate ID. Rates may change with performance + state and must not be represented as fixed clocks sampled at one boot. + The provider remains disabled until a generation-specific clock driver + can resolve selectors and coordinate ownership with firmware. + +properties: + compatible: + items: + - enum: + - apple,t6041-pmgr-clocks + - apple,t8140-pmgr-clocks + - const: apple,pmgr-clocks + + '#clock-cells': + const: 1 + + apple,pmgr: + $ref: /schemas/types.yaml#/definitions/phandle + description: Power manager providing the clock control registers. + +required: + - compatible + - '#clock-cells' + - apple,pmgr + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/crypto/apple,aes.yaml b/Documentation/devicetree/bindings/crypto/apple,aes.yaml new file mode 100644 index 0000000000000..516a7ae14036f --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/apple,aes.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/crypto/apple,aes.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple AES engine + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + AES hardware attached to the SIO DART. The register banks are the + engine, shared control and auxiliary control windows, in that order. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-aes + - const: apple,aes + - items: + - const: apple,t8140-aes + - const: apple,aes + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + power-domains: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml b/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml new file mode 100644 index 0000000000000..a0b34e37f6d1f --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,dcp-expert.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple display expert control registers + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Display control and timing register apertures associated with a display + coprocessor. These registers can be shared with firmware-owned display + blocks and must not be accessed without an ownership handoff. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-dcp-expert + - const: apple,dcp-expert + - items: + - const: apple,t8140-dcp-expert + - const: apple,dcp-expert + + reg: + minItems: 3 + maxItems: 17 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,display-secure-proxy.yaml b/Documentation/devicetree/bindings/display/apple,display-secure-proxy.yaml new file mode 100644 index 0000000000000..417d16344e07b --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,display-secure-proxy.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,display-secure-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure display proxy apertures + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure display proxy register apertures. They are distinct from the + non-secure display engine and remain owned by firmware. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-display-secure-proxy + - const: apple,display-secure-proxy + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,dpin.yaml b/Documentation/devicetree/bindings/display/apple,dpin.yaml new file mode 100644 index 0000000000000..a58aef9bb9c3c --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,dpin.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,dpin.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple DisplayPort tunnel ingress + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + DisplayPort ingress registers and interrupt for a USB4 display tunnel. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-dpin + - const: apple,dpin + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml b/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml new file mode 100644 index 0000000000000..157a640a5ea32 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/apple,pcie-piodma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple PCIe PIODMA engine + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + PCIe auxiliary DMA register banks and completion interrupt. The stream + is distinct from the PCIe endpoint streams in the same DART. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-pcie-piodma + - const: apple,pcie-piodma + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml b/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml new file mode 100644 index 0000000000000..18313d789cd7b --- /dev/null +++ b/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/apple,pciec-piodma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple PCIe tunnel PIODMA engine + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + PCIe tunnel auxiliary DMA register banks and completion interrupt. Its + stream is distinct from the tunnel endpoint streams in the same DART. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-pciec-piodma + - const: apple,pciec-piodma + + reg: + minItems: 4 + maxItems: 4 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/dma/apple,sio.yaml b/Documentation/devicetree/bindings/dma/apple,sio.yaml index 2498a7adaf410..7e0171d53eb1e 100644 --- a/Documentation/devicetree/bindings/dma/apple,sio.yaml +++ b/Documentation/devicetree/bindings/dma/apple,sio.yaml @@ -18,6 +18,20 @@ maintainers: allOf: - $ref: dma-controller.yaml# + - if: + properties: + compatible: + contains: + const: apple,t8140-sio + then: + properties: + reg: + minItems: 2 + maxItems: 2 + else: + properties: + reg: + maxItems: 1 properties: compatible: @@ -29,12 +43,19 @@ properties: - apple,t6030-sio - apple,t8103-sio - apple,t8112-sio + - apple,t8140-sio - const: apple,sio - description: T6041 firmware requires a generation-specific backend. const: apple,t6041-sio reg: - maxItems: 1 + minItems: 1 + maxItems: 2 + description: Coprocessor registers, followed on T8140 by the ASC auxiliary window. + + clocks: + minItems: 1 + maxItems: 3 '#dma-cells': const: 1 diff --git a/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml new file mode 100644 index 0000000000000..0bdb3a73cadc5 --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mailbox/apple,secure-mailbox.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure coprocessor mailbox aperture + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure coprocessor proxy mailbox aperture and its transport interrupts. + This description does not authorize access to secure-world registers. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-secure-mailbox + - const: apple,secure-mailbox + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 2 + maxItems: 2 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/media/apple,isp-secure-proxy.yaml b/Documentation/devicetree/bindings/media/apple,isp-secure-proxy.yaml new file mode 100644 index 0000000000000..cb90bbe4b4251 --- /dev/null +++ b/Documentation/devicetree/bindings/media/apple,isp-secure-proxy.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/apple,isp-secure-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure image processor proxy apertures + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure image processor proxy register apertures. They are distinct from + the non-secure image processor and remain owned by firmware. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-isp-secure-proxy + - const: apple,isp-secure-proxy + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/media/apple,scaler.yaml b/Documentation/devicetree/bindings/media/apple,scaler.yaml new file mode 100644 index 0000000000000..7f97ff9a6199d --- /dev/null +++ b/Documentation/devicetree/bindings/media/apple,scaler.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/apple,scaler.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple image scaler + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + The image scaler and its companion DMA registers. The two DART streams + carry image data and PIODMA transfers. Firmware performance votes are + not fixed clock rates and are not encoded as clock-frequency values. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-scaler + - const: apple,scaler + - items: + - const: apple,t8140-scaler + - const: apple,scaler + + reg: + minItems: 4 + maxItems: 4 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 2 + maxItems: 2 + + power-domains: + minItems: 2 + maxItems: 2 + + iommus: + minItems: 2 + maxItems: 2 + + clocks: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - iommus + - clocks + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml new file mode 100644 index 0000000000000..1a35ae29920ef --- /dev/null +++ b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/apple,t6041-prores.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple T6041 ProRes engine + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + T6041 APR engine, wrapper and auxiliary register banks. This resource + layout is distinct from the T8140 APR binding and must not select that + generation's driver. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-prores + - const: apple,prores + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + power-domains: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.yaml b/Documentation/devicetree/bindings/serial/samsung_uart.yaml index 75ac2a08f2576..e1a606f86bce1 100644 --- a/Documentation/devicetree/bindings/serial/samsung_uart.yaml +++ b/Documentation/devicetree/bindings/serial/samsung_uart.yaml @@ -28,6 +28,9 @@ properties: - samsung,exynos5433-uart - samsung,exynos850-uart - samsung,exynos8895-uart + - items: + - const: apple,t8140-uart + - const: apple,s5l-uart - items: - enum: - samsung,exynos2200-uart diff --git a/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml b/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml new file mode 100644 index 0000000000000..2a3dc9f5856d4 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,aon-ptd.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple always-on power telemetry interrupt router + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Always-on power telemetry register banks and upstream interrupts. The + firmware owns the telemetry data and interrupt routing at boot. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-aon-ptd + - const: apple,aon-ptd + - items: + - const: apple,t8140-aon-ptd + - const: apple,aon-ptd + + reg: + minItems: 4 + maxItems: 4 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 32 + maxItems: 32 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml b/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml new file mode 100644 index 0000000000000..3bb8d1a5ff384 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,aop2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secondary always-on processor + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secondary always-on processor register banks and transport interrupts. + The processor uses a distinct stream in the primary AOP DART. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-aop2 + - const: apple,aop2 + + reg: + minItems: 3 + maxItems: 3 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 4 + maxItems: 4 + + power-domains: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml b/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml new file mode 100644 index 0000000000000..1770af2c28fc1 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,cpu-debug.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple processor debug interface + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Processor debug register apertures. Access ownership must be established + before a debugger accesses this block. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-cpu-debug + - const: apple,cpu-debug + + reg: + minItems: 2 + maxItems: 2 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml b/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml new file mode 100644 index 0000000000000..f6d84bf0f371c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,dwi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple DWI controller + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + DWI hardware register window and interrupt. Register programming and + firmware ownership must be qualified before enabling the controller. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-dwi + - const: apple,dwi + - items: + - const: apple,t8140-dwi + - const: apple,dwi + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + power-domains: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml b/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml new file mode 100644 index 0000000000000..f9f73a9215b99 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,esm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure SEP manager transport + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure SEP manager transport register aperture and interrupts. This is + separate from the ordinary SEP mailbox and has no qualified AP client. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-esm + - const: apple,esm + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 2 + maxItems: 2 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml b/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml new file mode 100644 index 0000000000000..24e8e20f688a5 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,rsm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple remote service manager + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Remote service manager register banks, interrupt and DART stream. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-rsm + - const: apple,rsm + + reg: + minItems: 2 + maxItems: 2 + description: Register apertures in hardware-description order. + + interrupts: + minItems: 1 + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml b/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml new file mode 100644 index 0000000000000..8e31d99e85792 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/apple,aic-timebase.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple AIC timebase + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + The timebase register aperture associated with the interrupt controller. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-aic-timebase + - const: apple,aic-timebase + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml b/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml new file mode 100644 index 0000000000000..527cf5841a6e1 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/apple,secure-timebase.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure audio timebase aperture + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure audio timebase register aperture, owned by firmware at boot. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-secure-timebase + - const: apple,secure-timebase + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml b/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml new file mode 100644 index 0000000000000..83e6ebc7e17ff --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/apple,secure-watchdog.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure hibernation watchdog aperture + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure hibernation watchdog register aperture, owned by firmware at boot. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-secure-watchdog + - const: apple,secure-watchdog + + reg: + minItems: 1 + maxItems: 1 + description: Register apertures in hardware-description order. + +required: + - compatible + - reg + +additionalProperties: false From 5ef0d687e44cfea3ad15d9b35a698eb5ab95ef7f Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:18:20 +1100 Subject: [PATCH 43/79] arm64: dts: apple: describe unqualified J616s and J700 peripheral resources Translate the saved live ADTs into disabled hardware descriptions, including scaler, AES, APR, telemetry, display experts, PCIe DMA and DisplayPort ingress; describe the secondary and secure coprocessor resources on T8140. Keep the new blocks disabled so firmware-owned apertures and power gates are not touched. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../boot/dts/apple/t6040-peripherals.dtsi | 282 ++++++++++++ arch/arm64/boot/dts/apple/t6040.dtsi | 1 + .../boot/dts/apple/t8140-peripherals.dtsi | 414 ++++++++++++++++++ arch/arm64/boot/dts/apple/t8140.dtsi | 1 + 4 files changed, 698 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/t6040-peripherals.dtsi create mode 100644 arch/arm64/boot/dts/apple/t8140-peripherals.dtsi diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi new file mode 100644 index 0000000000000..c65b68a15bfca --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -0,0 +1,282 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + * Structural hardware resources from the board's saved Apple Device Tree. + * Keep unqualified blocks disabled: describing them does not transfer + * ownership from firmware or make their registers safe to access. + */ + +/ { + + /* ADT /arm-io/dwi. */ + dwi: dwi@5029b0000 { + compatible = "apple,t6041-dwi", "apple,dwi"; + reg = <0x5 0x029b0000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dwi>; + status = "disabled"; + }; + + /* ADT /arm-io/aes. */ + aes: crypto@42900c000 { + compatible = "apple,t6041-aes", "apple,aes"; + reg = <0x4 0x2900c000 0x0 0x4000>, + <0x5 0x08340000 0x0 0x8000>, + <0x5 0x08090000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_aes>; + iommus = <&sio_dart 1>; + status = "disabled"; + }; + + /* ADT /arm-io/aon-ptd. */ + aon_ptd: aon-ptd@50cdc0000 { + compatible = "apple,t6041-aon-ptd", "apple,aon-ptd"; + reg = <0x5 0x0cdc0000 0x0 0x4000>, + <0x5 0x0cdd0000 0x0 0x4000>, + <0x5 0x0cdd8000 0x0 0x4000>, + <0x5 0x0cde0000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + status = "disabled"; + }; + + /* ADT /arm-io/scaler0. */ + scaler0: scaler@521000000 { + compatible = "apple,t6041-scaler", "apple,scaler"; + reg = <0x5 0x21000000 0x0 0x38000>, + <0x5 0x21210000 0x0 0x4000>, + <0x5 0x21204000 0x0 0x4000>, + <0x5 0x20000000 0x0 0x8000>; + interrupt-parent = <&aic>; + interrupts = , + ; + power-domains = <&ps_msr0>, + <&ps_msr0_ase_core>; + iommus = <&scaler0_dart 0>, + <&scaler0_dart 1>; + clocks = <&peripheral_clocks 417>; + status = "disabled"; + }; + + /* ADT /arm-io/aic-timebase. */ + aic_timebase: aic-timebase@502580000 { + compatible = "apple,t6041-aic-timebase", "apple,aic-timebase"; + reg = <0x5 0x02580000 0x0 0x1000>; + status = "disabled"; + }; + + /* ADT /arm-io/dbgCPU. */ + cpu_debug: cpu-debug@508700000 { + compatible = "apple,t6041-cpu-debug", "apple,cpu-debug"; + reg = <0x5 0x08700000 0x0 0x28000>, + <0x5 0x085c0000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/apcie0-piodma. */ + apcie0_piodma: dma@410030000 { + compatible = "apple,t6041-pcie-piodma", "apple,pcie-piodma"; + reg = <0x4 0x10030000 0x0 0x4000>, + <0x4 0x10034000 0x0 0x4000>, + <0x4 0x10038000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&pcie_dart 17>; + status = "disabled"; + }; + + /* ADT /arm-io/apcie1-piodma. */ + apcie1_piodma: dma@411030000 { + compatible = "apple,t6041-pcie-piodma", "apple,pcie-piodma"; + reg = <0x4 0x11030000 0x0 0x4000>, + <0x4 0x11034000 0x0 0x4000>, + <0x4 0x11038000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&apcie1_dart 17>; + status = "disabled"; + }; + + /* ADT /arm-io/apciec0-piodma. */ + apciec0_piodma: dma@384068000 { + compatible = "apple,t6041-pciec-piodma", "apple,pciec-piodma"; + reg = <0x3 0x84068000 0x0 0x4000>, + <0x3 0x8406c000 0x0 0x4000>, + <0x3 0x84070000 0x0 0x4000>, + <0x3 0x8403c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&apciec0_dart 254>; + status = "disabled"; + }; + + /* ADT /arm-io/apciec1-piodma. */ + apciec1_piodma: dma@38c068000 { + compatible = "apple,t6041-pciec-piodma", "apple,pciec-piodma"; + reg = <0x3 0x8c068000 0x0 0x4000>, + <0x3 0x8c06c000 0x0 0x4000>, + <0x3 0x8c070000 0x0 0x4000>, + <0x3 0x8c03c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&apciec1_dart 254>; + status = "disabled"; + }; + + /* ADT /arm-io/apciec2-piodma. */ + apciec2_piodma: dma@394068000 { + compatible = "apple,t6041-pciec-piodma", "apple,pciec-piodma"; + reg = <0x3 0x94068000 0x0 0x4000>, + <0x3 0x9406c000 0x0 0x4000>, + <0x3 0x94070000 0x0 0x4000>, + <0x3 0x9403c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&apciec2_dart 254>; + status = "disabled"; + }; + + /* ADT /arm-io/apr0. */ + apr0: video-codec@301000000 { + compatible = "apple,t6041-prores", "apple,prores"; + reg = <0x3 0x01000000 0x0 0x4000>, + <0x3 0x00000000 0x0 0x1000000>, + <0x3 0x010c0000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_scodec>; + iommus = <&apr0_dart 1>; + status = "disabled"; + }; + + /* ADT /arm-io/atc0-dpin0. */ + atc0_dpin0: dpin@381e50000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x81e50000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/atc0-dpin1. */ + atc0_dpin1: dpin@381e58000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x81e58000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/atc1-dpin0. */ + atc1_dpin0: dpin@389e50000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x89e50000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/atc1-dpin1. */ + atc1_dpin1: dpin@389e58000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x89e58000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/atc2-dpin0. */ + atc2_dpin0: dpin@391e50000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x91e50000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/atc2-dpin1. */ + atc2_dpin1: dpin@391e58000 { + compatible = "apple,t6041-dpin", "apple,dpin"; + reg = <0x3 0x91e58000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/dcpext0-expert. */ + dcp_expert: display-expert@4023a8050 { + compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; + reg = <0x4 0x023a8050 0x0 0x4>, + <0x4 0x02374000 0x0 0x40>, + <0x4 0x02370000 0x0 0x40>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/dcpext0-expert. */ + dcpext0_expert: display-expert@3a23a8050 { + compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; + reg = <0x3 0xa23a8050 0x0 0x4>, + <0x3 0xa2374000 0x0 0x40>, + <0x3 0xa2370000 0x0 0x40>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/dcpext1-expert. */ + dcpext1_expert: display-expert@6023a8050 { + compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; + reg = <0x6 0x023a8050 0x0 0x4>, + <0x6 0x02374000 0x0 0x40>, + <0x6 0x02370000 0x0 0x40>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* Clock IDs are SoC hardware selectors, not ADT phandles. */ + peripheral_clocks: clock-controller { + compatible = "apple,t6041-pmgr-clocks", "apple,pmgr-clocks"; + #clock-cells = <1>; + apple,pmgr = <&pmgr>; + status = "disabled"; + }; +}; + diff --git a/arch/arm64/boot/dts/apple/t6040.dtsi b/arch/arm64/boot/dts/apple/t6040.dtsi index 38dc7888509fd..c901f331bc03e 100644 --- a/arch/arm64/boot/dts/apple/t6040.dtsi +++ b/arch/arm64/boot/dts/apple/t6040.dtsi @@ -6,6 +6,7 @@ */ #include "t604x.dtsi" +#include "t6040-peripherals.dtsi" /* The M4 Pro has five cores in each P cluster. */ /delete-node/ &cpu_p05; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi new file mode 100644 index 0000000000000..4c3ef3ea1a551 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -0,0 +1,414 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + * Structural hardware resources from the board's saved Apple Device Tree. + * Keep unqualified blocks disabled: describing them does not transfer + * ownership from firmware or make their registers safe to access. + */ + +/ { + + /* ADT /arm-io/dwi. */ + dwi: dwi@300200000 { + compatible = "apple,t8140-dwi", "apple,dwi"; + reg = <0x3 0x00200000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dwi>; + status = "disabled"; + }; + + /* ADT /arm-io/aes. */ + aes: crypto@38500c000 { + compatible = "apple,t8140-aes", "apple,aes"; + reg = <0x3 0x8500c000 0x0 0x4000>, + <0x3 0x082dc000 0x0 0x8000>, + <0x3 0x08078000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_aes>; + iommus = <&sio_dart 1>; + status = "disabled"; + }; + + /* ADT /arm-io/aon-ptd. */ + aon_ptd: aon-ptd@30c840000 { + compatible = "apple,t8140-aon-ptd", "apple,aon-ptd"; + reg = <0x3 0x0c840000 0x0 0x4000>, + <0x3 0x0c850000 0x0 0x4000>, + <0x3 0x0c858000 0x0 0x4000>, + <0x3 0x0c860000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + status = "disabled"; + }; + + /* ADT /arm-io/scaler0. */ + scaler0: scaler@291000000 { + compatible = "apple,t8140-scaler", "apple,scaler"; + reg = <0x2 0x91000000 0x0 0x38000>, + <0x2 0x91210000 0x0 0x4000>, + <0x2 0x91204000 0x0 0x4000>, + <0x2 0x90000000 0x0 0x8000>; + interrupt-parent = <&aic>; + interrupts = , + ; + power-domains = <&ps_msr>, + <&ps_msr_ase_core>; + iommus = <&scaler0_dart 0>, + <&scaler0_dart 1>; + clocks = <&peripheral_clocks 374>; + status = "disabled"; + }; + + /* ADT /arm-io/aop2. */ + aop2: coprocessor@311600000 { + compatible = "apple,t8140-aop2", "apple,aop2"; + reg = <0x3 0x11600000 0x0 0x88000>, + <0x3 0x11050000 0x0 0x4000>, + <0x3 0x1162c000 0x0 0x3c008>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + power-domains = <&ps_aop2_cpu>; + iommus = <&aop_dart 16>; + status = "disabled"; + }; + + /* ADT /arm-io/aop2-exclave-mailbox. */ + aop2_secure_mbox: mailbox@35167c000 { + compatible = "apple,t8140-secure-mailbox", "apple,secure-mailbox"; + reg = <0x3 0x5167c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + ; + iommus = <&aop_dart 17>; + status = "disabled"; + }; + + /* ADT /arm-io/esm. */ + esm: coprocessor@4d267c000 { + compatible = "apple,t8140-esm", "apple,esm"; + reg = <0x4 0xd267c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + ; + iommus = <&sep_dart 2>; + status = "disabled"; + }; + + /* ADT /arm-io/rsm. */ + rsm: rsm@309825000 { + compatible = "apple,t8140-rsm", "apple,rsm"; + reg = <0x3 0x09825000 0x0 0x4000>, + <0x3 0x098c0000 0x0 0x4>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&rsm_dart 0>; + status = "disabled"; + }; + + /* ADT /arm-io/dcp0-expert. */ + dcp_expert: display-expert@3082b8044 { + compatible = "apple,t8140-dcp-expert", "apple,dcp-expert"; + reg = <0x3 0x082b8044 0x0 0xc>, + <0x3 0x08008000 0x0 0x4>, + <0x4 0x123ac050 0x0 0x4>, + <0x4 0x12370000 0x0 0x40>, + <0x4 0x12384000 0x0 0x40>, + <0x4 0x12378000 0x0 0x40>, + <0x4 0x1237c000 0x0 0x40>, + <0x4 0x12380000 0x0 0x40>, + <0x4 0x12374000 0x0 0x40>, + <0x4 0x123b8000 0x0 0x40>, + <0x4 0x1239c000 0x0 0x40>, + <0x4 0x123a0000 0x0 0x40>, + <0x4 0x12388000 0x0 0x40>, + <0x4 0x1238c000 0x0 0x40>, + <0x4 0x12394000 0x0 0x40>, + <0x4 0x12398000 0x0 0x40>, + <0x4 0x12390000 0x0 0x40>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/dcpext-expert. */ + dcpext_expert: display-expert@4163ac050 { + compatible = "apple,t8140-dcp-expert", "apple,dcp-expert"; + reg = <0x4 0x163ac050 0x0 0x4>, + <0x4 0x16370000 0x0 0x40>, + <0x4 0x16374000 0x0 0x40>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + /* ADT /arm-io/dcp-exclave-mailbox. */ + dcp_secure_mbox: mailbox@452e7c000 { + compatible = "apple,t8140-secure-mailbox", "apple,secure-mailbox"; + reg = <0x4 0x52e7c000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + ; + iommus = <&dcp_dart 24>; + status = "disabled"; + }; + + /* ADT /arm-io/exdisplaypipe-s-proxy. */ + display_secure_proxy: display-secure-proxy@450000000 { + compatible = "apple,t8140-display-secure-proxy", "apple,display-secure-proxy"; + reg = <0x4 0x50000000 0x0 0xafc000>, + <0x4 0x51000000 0x0 0xafc000>, + <0x4 0x523b0000 0x0 0x8000>; + status = "disabled"; + }; + + /* ADT /arm-io/isp-exclave-s-proxy. */ + isp_secure_proxy: isp-secure-proxy@361800000 { + compatible = "apple,t8140-isp-secure-proxy", "apple,isp-secure-proxy"; + reg = <0x3 0x61800000 0x0 0x480000>, + <0x3 0x628ac000 0x0 0x4000>, + <0x3 0x62780000 0x0 0x10000>; + status = "disabled"; + }; + + /* ADT /arm-io/siri-exclave-timebase. */ + siri_timebase: secure-timebase@3482a8000 { + compatible = "apple,t8140-secure-timebase", "apple,secure-timebase"; + reg = <0x3 0x482a8000 0x0 0x4000>; + status = "disabled"; + }; + + /* ADT /arm-io/hib-exclave-watchdog. */ + hib_watchdog: secure-watchdog@3482b0000 { + compatible = "apple,t8140-secure-watchdog", "apple,secure-watchdog"; + reg = <0x3 0x482b0000 0x0 0x4000>; + status = "disabled"; + }; + + /* Clock IDs are SoC hardware selectors, not ADT phandles. */ + peripheral_clocks: clock-controller { + compatible = "apple,t8140-pmgr-clocks", "apple,pmgr-clocks"; + #clock-cells = <1>; + apple,pmgr = <&pmgr>; + status = "disabled"; + }; +}; + +/ { + + /* ADT /arm-io/aop-gpio; coprocessor/firmware ownership unqualified. */ + pinctrl_aop: pinctrl@310824000 { + compatible = "apple,t8140-pinctrl", "apple,t8103-pinctrl"; + reg = <0x3 0x10824000 0x0 0x4000>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_aop 0 0 57>; + apple,npins = <57>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + power-domains = <&ps_aop_gpio>; + status = "disabled"; + }; + + /* ADT /arm-io/nub-gpio; coprocessor/firmware ownership unqualified. */ + pinctrl_nub: pinctrl@3081f0000 { + compatible = "apple,t8140-pinctrl", "apple,t8103-pinctrl"; + reg = <0x3 0x081f0000 0x0 0x4000>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_nub 0 0 30>; + apple,npins = <30>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + power-domains = <&ps_nub_gpio>; + status = "disabled"; + }; + + /* ADT /arm-io/smc-gpio; coprocessor/firmware ownership unqualified. */ + pinctrl_smc: pinctrl@30c820000 { + compatible = "apple,t8140-pinctrl", "apple,t8103-pinctrl"; + reg = <0x3 0x0c820000 0x0 0x4000>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_smc 0 0 6>; + apple,npins = <6>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + status = "disabled"; + }; + + /* ADT /arm-io/mtp-gpio; coprocessor/firmware ownership unqualified. */ + pinctrl_mtp: pinctrl@314838000 { + compatible = "apple,t8140-pinctrl", "apple,t8103-pinctrl"; + reg = <0x3 0x14838000 0x0 0x4000>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_mtp 0 0 10>; + apple,npins = <10>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + status = "disabled"; + }; + + /* ADT /arm-io/dart-sio. */ + sio_dart: iommu@385060000 { + compatible = "apple,t8140-dart", "apple,t8110-dart"; + reg = <0x3 0x85060000 0x0 0x20000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_sio_cpu>; + status = "disabled"; + }; + + /* ADT /arm-io/dart-scaler. */ + scaler0_dart: iommu@291260000 { + compatible = "apple,t8140-dart", "apple,t8110-dart"; + reg = <0x2 0x91260000 0x0 0x20000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_msr>; + status = "disabled"; + }; + + /* ADT /arm-io/dart-rsm. */ + rsm_dart: iommu@3099a0000 { + compatible = "apple,t8140-dart", "apple,t8110-dart"; + reg = <0x3 0x099a0000 0x0 0xc000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + status = "disabled"; + }; + + uart0: serial@385200000 { + compatible = "apple,t8140-uart", "apple,s5l-uart"; + reg = <0x3 0x85200000 0x0 0x4000>; + reg-io-width = <4>; + interrupt-parent = <&aic>; + interrupts = ; + clocks = <&peripheral_clocks 401>, <&peripheral_clocks 4>; + clock-names = "uart", "clk_uart_baud0"; + power-domains = <&ps_uart0>; + status = "disabled"; + }; + + uart4: serial@385210000 { + compatible = "apple,t8140-uart", "apple,s5l-uart"; + reg = <0x3 0x85210000 0x0 0x4000>; + reg-io-width = <4>; + interrupt-parent = <&aic>; + interrupts = ; + clocks = <&peripheral_clocks 401>, <&peripheral_clocks 4>; + clock-names = "uart", "clk_uart_baud0"; + power-domains = <&ps_uart4>; + status = "disabled"; + }; + + uart5: serial@385214000 { + compatible = "apple,t8140-uart", "apple,s5l-uart"; + reg = <0x3 0x85214000 0x0 0x4000>; + reg-io-width = <4>; + interrupt-parent = <&aic>; + interrupts = ; + clocks = <&peripheral_clocks 401>, <&peripheral_clocks 4>; + clock-names = "uart", "clk_uart_baud0"; + power-domains = <&ps_uart5>; + status = "disabled"; + }; + + sio: dma-controller@385e00000 { + compatible = "apple,t8140-sio", "apple,sio"; + reg = <0x3 0x85e00000 0x0 0x88000>, + <0x3 0x85850000 0x0 0x4000>; + #dma-cells = <1>; + dma-channels = <128>; + mboxes = <&sio_mbox>; + iommus = <&sio_dart 0>; + power-domains = <&ps_sio_cpu>; + clocks = <&peripheral_clocks 393>, <&peripheral_clocks 391>, <&peripheral_clocks 392>; + status = "disabled"; + }; + + sio_mbox: mailbox@385e08000 { + compatible = "apple,t8140-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x85e08000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_sio_cpu>; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index b27ca1ee8b05c..2b210d8ce99f5 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -1999,6 +1999,7 @@ }; #include "t8140-pmgr.dtsi" +#include "t8140-peripherals.dtsi" /* * DRAM interface class: width and maximum rate are inferred from topology From 00a90e1bc382ba695a2575cbae0cad012a5631ac Mon Sep 17 00:00:00 2001 From: AxxzyWasTaken Date: Sat, 7 Nov 2026 11:19:07 +0000 Subject: [PATCH 44/79] media: apple: avd: check the AV1 tile entries before using them The tile group control is user data. A request with fewer entries than the frame has tiles made avd-av1 read past the array, and an entry past the coded data sent the engine to wild addresses: DART faults, a frame timeout, then recovery. Chromium's VA path hit this with 8 tiles and 1 entry on an M4 Max. Refuse such a request. Signed-off-by: AxxzyWasTaken --- drivers/media/platform/apple/avd/avd-av1.c | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/apple/avd/avd-av1.c b/drivers/media/platform/apple/avd/avd-av1.c index d5d3207deaa0b..67dca20402b54 100644 --- a/drivers/media/platform/apple/avd/avd-av1.c +++ b/drivers/media/platform/apple/avd/avd-av1.c @@ -1396,10 +1396,36 @@ static void update_dec_buf_info(struct avd_decoded_buffer *buf, buf->av1.ref_frame_idx[i] = frame->ref_frame_idx[i]; } +/* The engine fetches each tile from these: bad values make it read wild addresses. */ +static int avd_av1_check_tiles(struct avd_ctx *ctx, struct avd_av1_run *run, + unsigned int entries) +{ + size_t payload = vb2_get_plane_payload(&run->base.bufs.src->vb2_buf, 0); + unsigned int tiles = run->frame->tile_info.tile_cols * + run->frame->tile_info.tile_rows; + unsigned int t; + + if (entries < tiles) { + dev_err_ratelimited(ctx->dev->dev, "AV1: %u tiles but %u tile entries\n", + tiles, entries); + return -EINVAL; + } + for (t = 0; t < tiles; t++) { + const struct v4l2_ctrl_av1_tile_group_entry *e = &run->tile_group[t]; + + if ((u64)e->tile_offset + e->tile_size > payload) { + dev_err_ratelimited(ctx->dev->dev, "AV1: tile %u at %u+%u past %zu bytes\n", + t, e->tile_offset, e->tile_size, payload); + return -EINVAL; + } + } + return 0; +} + static int avd_av1_run_preamble(struct avd_ctx *ctx, struct avd_av1_run *run) { struct v4l2_ctrl *ctrl; - int dst_len, tlb_len; + int dst_len, ret, tlb_len; avd_run_preamble(ctx, &run->base); @@ -1436,6 +1462,9 @@ static int avd_av1_run_preamble(struct avd_ctx *ctx, struct avd_av1_run *run) if (WARN_ON(!ctrl)) return -EINVAL; run->tile_group = ctrl->p_cur.p; + ret = avd_av1_check_tiles(ctx, run, ctrl->elems); + if (ret) + return ret; ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, V4L2_CID_STATELESS_AV1_FILM_GRAIN); From 0c94baf620c7ab85ba2fd251fd985eebda143bba Mon Sep 17 00:00:00 2001 From: AxxzyWasTaken Date: Sat, 7 Nov 2026 11:19:07 +0000 Subject: [PATCH 45/79] media: apple: avd: don't reset the T6041 decoder in recovery On the J616C the machine hangs right after the recovery reset, while the decoder's DART domain is restored, so one decoder timeout takes the whole Mac down. Until the cause is known, stay parked on T6041: the decoder retires and players fall back to software. Other SoCs recover fine and keep the reset. Signed-off-by: AxxzyWasTaken --- drivers/media/platform/apple/avd/avd-drv.c | 2 +- drivers/media/platform/apple/avd/avd-pm.c | 9 +++++++++ drivers/media/platform/apple/avd/avd.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/apple/avd/avd-drv.c b/drivers/media/platform/apple/avd/avd-drv.c index 2cba04cd6f443..b6e071493a9ae 100644 --- a/drivers/media/platform/apple/avd/avd-drv.c +++ b/drivers/media/platform/apple/avd/avd-drv.c @@ -548,7 +548,7 @@ static const struct avd_variant avd_t6041_variant = { .submit_offset = 0x40, .submit_queue_max_offset = 0x44, .submit_queue_status_offset = 0x7c, - .quirks = AVD_QUIRK_HEVC_V5_HEADER, + .quirks = AVD_QUIRK_HEVC_V5_HEADER | AVD_QUIRK_NO_RECOVERY_RESET, }; /* diff --git a/drivers/media/platform/apple/avd/avd-pm.c b/drivers/media/platform/apple/avd/avd-pm.c index 01b9069e113ab..d6b45ba78e844 100644 --- a/drivers/media/platform/apple/avd/avd-pm.c +++ b/drivers/media/platform/apple/avd/avd-pm.c @@ -336,6 +336,15 @@ int avd_pm_recover(struct avd_dev *avd) ret = avd_pm_park(avd); if (ret) return ret; + /* + * On the J616C the machine hangs right after this reset, while the + * decoder's DART domain is restored. The cause is not known yet, so + * stay parked: players fall back to software. + */ + if (avd->variant && avd->variant->quirks & AVD_QUIRK_NO_RECOVERY_RESET) { + dev_err(avd->dev, "recover: staying parked, no reset on this SoC\n"); + return -EIO; + } dev_warn(avd->dev, "recover: reset\n"); ret = reset_control_reset(avd->rstc); if (ret) { diff --git a/drivers/media/platform/apple/avd/avd.h b/drivers/media/platform/apple/avd/avd.h index 1313a07e00389..d187639ddedf3 100644 --- a/drivers/media/platform/apple/avd/avd.h +++ b/drivers/media/platform/apple/avd/avd.h @@ -43,6 +43,8 @@ #define AVD_QUIRK_V5_QUEUE_PACING BIT(3) /* H.264 co-located motion vectors take 128 bytes per macroblock, not 64. */ #define AVD_QUIRK_H264_MV_128 BIT(4) +/* A reset after a timeout hangs the machine: stay parked and retire the decoder */ +#define AVD_QUIRK_NO_RECOVERY_RESET BIT(5) #define VP_SLOT_NONE 255 #define INST_FIFO_SLOT_NONE 255 From e680a9917e9df64f051e1a2ff5480ae4545b0352 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:21:27 +1100 Subject: [PATCH 46/79] dt-bindings: apple: describe firmware endpoints and board control devices Document firmware-only endpoints separately from directly programmed hardware, and describe the panel and card-reader sideband control interfaces. Keep hardware description independent of driver availability. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/clock/apple,nco-service.yaml | 32 ++++++++++++++ .../display/apple,sac-controller.yaml | 33 +++++++++++++++ .../display/apple,secure-display-pipe.yaml | 36 ++++++++++++++++ .../bindings/display/bridge/parade,dp855.yaml | 32 ++++++++++++++ .../media/apple,isp-service-proxy.yaml | 26 ++++++++++++ .../bindings/misc/apple,display-pcon.yaml | 29 +++++++++++++ .../bindings/misc/apple,sd-card-control.yaml | 29 +++++++++++++ .../bindings/soc/apple/apple,debug-dock.yaml | 35 ++++++++++++++++ .../bindings/soc/apple/apple,debug-port.yaml | 38 +++++++++++++++++ .../bindings/soc/apple/apple,eic.yaml | 42 +++++++++++++++++++ .../soc/apple/apple,hid-transport-mux.yaml | 29 +++++++++++++ .../soc/apple/apple,processor-trace.yaml | 29 +++++++++++++ .../bindings/soc/apple/apple,sac-manager.yaml | 29 +++++++++++++ .../soc/apple/apple,wireless-debug-dock.yaml | 26 ++++++++++++ .../sound/apple,audio-dart-proxy.yaml | 31 ++++++++++++++ .../bindings/sound/apple,audio-mic-proxy.yaml | 26 ++++++++++++ 16 files changed, 502 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/apple,nco-service.yaml create mode 100644 Documentation/devicetree/bindings/display/apple,sac-controller.yaml create mode 100644 Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml create mode 100644 Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml create mode 100644 Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml create mode 100644 Documentation/devicetree/bindings/misc/apple,display-pcon.yaml create mode 100644 Documentation/devicetree/bindings/misc/apple,sd-card-control.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,eic.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml diff --git a/Documentation/devicetree/bindings/clock/apple,nco-service.yaml b/Documentation/devicetree/bindings/clock/apple,nco-service.yaml new file mode 100644 index 0000000000000..567efa089d067 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/apple,nco-service.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/apple,nco-service.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple firmware NCO clock service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware-managed numerically controlled oscillator service. Unlike the + directly programmed NCO binding, no AP register window is published. + The input selectors identify clocks in the PMGR clock namespace. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-nco-service + - const: apple,nco-service + + clocks: + minItems: 4 + maxItems: 4 + +required: + - compatible + - clocks + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,sac-controller.yaml b/Documentation/devicetree/bindings/display/apple,sac-controller.yaml new file mode 100644 index 0000000000000..b2c2770fb5f2f --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,sac-controller.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,sac-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple display SAC controller + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Display SAC firmware controller associated with the SAC manager. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-sac-controller + - const: apple,sac-controller + - items: + - const: apple,t8140-sac-controller + - const: apple,sac-controller + + apple,manager: + $ref: /schemas/types.yaml#/definitions/phandle + description: Firmware SAC manager. + +required: + - compatible + - apple,manager + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml b/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml new file mode 100644 index 0000000000000..8ec1c0ef71480 --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,secure-display-pipe.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure display pipeline + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure display pipeline firmware endpoint, its interrupts and DART + streams. Firmware retains control of the display registers. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-secure-display-pipe + - const: apple,secure-display-pipe + + interrupts: + minItems: 4 + maxItems: 4 + + iommus: + minItems: 2 + maxItems: 2 + +required: + - compatible + - interrupts + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml b/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml new file mode 100644 index 0000000000000..9517baae77ce8 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/parade,dp855.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Parade DP855 panel timing controller + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Panel timing controller controlled through SPI. The controller also + mediates access to panel management devices. Its downstream address + transport must be established before exposing those clients on a host + bus; the SPI chip select is not their downstream device address. + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + const: parade,dp855 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml b/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml new file mode 100644 index 0000000000000..217e3933f6868 --- /dev/null +++ b/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/apple,isp-service-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple image processor firmware service proxy + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Image processor secure firmware service endpoint. This is separate + from the AP image processor and has no AP register window. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-isp-service-proxy + - const: apple,isp-service-proxy + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/misc/apple,display-pcon.yaml b/Documentation/devicetree/bindings/misc/apple,display-pcon.yaml new file mode 100644 index 0000000000000..095b4bfd67ee8 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/apple,display-pcon.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/apple,display-pcon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple display protocol converter control + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Display protocol converter control endpoint on the panel control bus. + Firmware retains control of the display path at boot. + +properties: + compatible: + items: + - const: apple,t6041-display-pcon + - const: apple,display-pcon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/misc/apple,sd-card-control.yaml b/Documentation/devicetree/bindings/misc/apple,sd-card-control.yaml new file mode 100644 index 0000000000000..7671d72d9b306 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/apple,sd-card-control.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/apple,sd-card-control.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SD card sideband control + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Sideband control device on the SD reader control bus. The PCIe card + reader is a separate device; this endpoint does not replace it. + +properties: + compatible: + items: + - const: apple,t6041-sd-card-control + - const: apple,sd-card-control + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml b/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml new file mode 100644 index 0000000000000..836fa12906e65 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,debug-dock.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple debug dock connection detector + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Debug dock connection detector register and interrupt resources. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-debug-dock + - const: apple,debug-dock + + reg: + minItems: 1 + maxItems: 1 + + interrupts: + minItems: 2 + maxItems: 2 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml b/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml new file mode 100644 index 0000000000000..549ad92ccaf14 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,debug-port.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple auxiliary on-chip debug port + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Auxiliary on-chip debug port. Firmware describes the port separately + from the processor debug MMIO apertures. Pin ownership and the debug + transport must be established before this endpoint is used. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-debug-port + - const: apple,debug-port + - items: + - const: apple,t8140-debug-port + - const: apple,debug-port + + swclk-gpios: + maxItems: 1 + description: Serial wire clock pin. + + swdio-gpios: + maxItems: 1 + description: Bidirectional serial wire data pin. + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,eic.yaml b/Documentation/devicetree/bindings/soc/apple/apple,eic.yaml new file mode 100644 index 0000000000000..4d916ffa1d51c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,eic.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,eic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure peripheral controller + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure peripheral controller register apertures. These are absolute + secure-side aliases published separately from the ordinary AP devices. + The firmware retains ownership; an AP driver must establish an access + contract before touching these resources. + +properties: + compatible: + items: + - const: apple,t8140-eic + - const: apple,eic + + reg: + minItems: 6 + maxItems: 6 + + reg-names: + items: + - const: ps + - const: wd-isp + - const: gpio + - const: fpwm + - const: gltb + - const: wd-e + +required: + - compatible + - reg + - reg-names + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml b/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml new file mode 100644 index 0000000000000..ae444f86cd0c0 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,hid-transport-mux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple HID transport multiplexer + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware HID transport multiplexer between the MTP and AOP services. + The hardware description provides no independent register aperture. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-hid-transport-mux + - const: apple,hid-transport-mux + - items: + - const: apple,t8140-hid-transport-mux + - const: apple,hid-transport-mux + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml b/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml new file mode 100644 index 0000000000000..6207bfbe14d0b --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,processor-trace.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple processor trace service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Processor trace service. The hardware description provides no AP MMIO + register aperture; a driver must establish its firmware transport. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-processor-trace + - const: apple,processor-trace + - items: + - const: apple,t8140-processor-trace + - const: apple,processor-trace + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml b/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml new file mode 100644 index 0000000000000..3e6a309f0a694 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,sac-manager.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple display SAC manager + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware display SAC manager. It has no independent register aperture + in the hardware description. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-sac-manager + - const: apple,sac-manager + - items: + - const: apple,t8140-sac-manager + - const: apple,sac-manager + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml b/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml new file mode 100644 index 0000000000000..beee156b0b223 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,wireless-debug-dock.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple wireless debug dock endpoint + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Wireless debug dock firmware endpoint. It does not describe a second + wireless radio or transfer ownership of the existing radio. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-wireless-debug-dock + - const: apple,wireless-debug-dock + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml b/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml new file mode 100644 index 0000000000000..96a0e4a2892fc --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-dart-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple isolated audio DART service proxy + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Isolated audio firmware endpoint and its DART streams. The firmware + retains ownership of the stream mappings at boot. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-audio-dart-proxy + - const: apple,audio-dart-proxy + + iommus: + minItems: 2 + maxItems: 2 + +required: + - compatible + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml new file mode 100644 index 0000000000000..6bc04371a4420 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-mic-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple isolated microphone service proxy + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Isolated microphone firmware endpoint. Buffer geometry and calibration + are runtime data and are not static hardware resources. + +properties: + compatible: + oneOf: + - items: + - const: apple,t8140-audio-mic-proxy + - const: apple,audio-mic-proxy + +required: + - compatible + +additionalProperties: false From aae7eb1c2ca563731c2204287e61acb0b5cad836 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:21:28 +1100 Subject: [PATCH 47/79] arm64: dts: apple: describe remaining debug and firmware service endpoints Describe the live ADT firmware endpoints without inventing register windows for services that publish none. Add the secure peripheral aliases and keep board GPIO and control-bus wiring in the board descriptions. All additions remain disabled. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6040-j616s.dts | 29 +++++ .../boot/dts/apple/t6040-peripherals.dtsi | 35 ++++++ arch/arm64/boot/dts/apple/t8140-j700.dts | 6 + .../boot/dts/apple/t8140-peripherals.dtsi | 115 ++++++++++++++++++ 4 files changed, 185 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 087a1e96316e8..0d25857c3a5e5 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -80,3 +80,32 @@ &jpeg1 { status = "okay"; }; + +&debug_port2 { + swclk-gpios = <&pinctrl_ap 42 GPIO_ACTIVE_HIGH>; + swdio-gpios = <&pinctrl_ap 43 GPIO_ACTIVE_HIGH>; +}; + +&i2c4 { + sd_card_control: card-control@20 { + compatible = "apple,t6041-sd-card-control", "apple,sd-card-control"; + reg = <0x20>; + status = "disabled"; + }; +}; + +&i2c8 { + display_pcon: display-converter@8 { + compatible = "apple,t6041-display-pcon", "apple,display-pcon"; + reg = <0x8>; + status = "disabled"; + }; +}; + +&spi4 { + tcon: panel-controller@0 { + compatible = "parade,dp855"; + reg = <0>; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index c65b68a15bfca..5bbb542140323 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -280,3 +280,38 @@ }; }; + +/ { + + /* ADT /arm-io/mtp-aop-mux; no qualified host transport/ownership contract. */ + hid_mux: hid-transport-mux { + compatible = "apple,t6041-hid-transport-mux", "apple,hid-transport-mux"; + status = "disabled"; + }; + + /* ADT /arm-io/apple-processor-trace; no qualified host transport/ownership contract. */ + processor_trace: processor-trace { + compatible = "apple,t6041-processor-trace", "apple,processor-trace"; + status = "disabled"; + }; + + /* ADT /arm-io/aod2; no qualified host transport/ownership contract. */ + debug_port2: debug-port-2 { + compatible = "apple,t6041-debug-port", "apple,debug-port"; + status = "disabled"; + }; + + /* ADT /sacm; no qualified host transport/ownership contract. */ + sac_manager: sac-manager { + compatible = "apple,t6041-sac-manager", "apple,sac-manager"; + status = "disabled"; + }; + + /* ADT /arm-io/dcp0-sac-controller; no qualified host transport/ownership contract. */ + sac_controller: sac-controller { + compatible = "apple,t6041-sac-controller", "apple,sac-controller"; + apple,manager = <&sac_manager>; + status = "disabled"; + }; +}; + diff --git a/arch/arm64/boot/dts/apple/t8140-j700.dts b/arch/arm64/boot/dts/apple/t8140-j700.dts index 80dbb11d873ec..2a73f2b65d3a5 100644 --- a/arch/arm64/boot/dts/apple/t8140-j700.dts +++ b/arch/arm64/boot/dts/apple/t8140-j700.dts @@ -2005,3 +2005,9 @@ &ane_dart2 { status = "okay"; }; + +&debug_port4 { + swclk-gpios = <&pinctrl_ap 86 GPIO_ACTIVE_HIGH>; + swdio-gpios = <&pinctrl_ap 85 GPIO_ACTIVE_HIGH>; +}; + diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index 4c3ef3ea1a551..6183366b0581f 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -412,3 +412,118 @@ status = "disabled"; }; }; + +/ { + + /* ADT /arm-io/mtp-aop-mux; no qualified host transport/ownership contract. */ + hid_mux: hid-transport-mux { + compatible = "apple,t8140-hid-transport-mux", "apple,hid-transport-mux"; + status = "disabled"; + }; + + /* ADT /arm-io/apple-processor-trace; no qualified host transport/ownership contract. */ + processor_trace: processor-trace { + compatible = "apple,t8140-processor-trace", "apple,processor-trace"; + status = "disabled"; + }; + + /* ADT /arm-io/aod2; no qualified host transport/ownership contract. */ + debug_port2: debug-port-2 { + compatible = "apple,t8140-debug-port", "apple,debug-port"; + status = "disabled"; + }; + + /* ADT /arm-io/aod3; no qualified host transport/ownership contract. */ + debug_port3: debug-port-3 { + compatible = "apple,t8140-debug-port", "apple,debug-port"; + status = "disabled"; + }; + + /* ADT /arm-io/aod4; no qualified host transport/ownership contract. */ + debug_port4: debug-port-4 { + compatible = "apple,t8140-debug-port", "apple,debug-port"; + status = "disabled"; + }; + + /* ADT /sacm; no qualified host transport/ownership contract. */ + sac_manager: sac-manager { + compatible = "apple,t8140-sac-manager", "apple,sac-manager"; + status = "disabled"; + }; + + /* ADT /arm-io/dcp-sac-controller; no qualified host transport/ownership contract. */ + sac_controller: sac-controller { + compatible = "apple,t8140-sac-controller", "apple,sac-controller"; + apple,manager = <&sac_manager>; + status = "disabled"; + }; + + /* ADT /arm-io/nco; no qualified host transport/ownership contract. */ + nco_service: nco-service { + compatible = "apple,t8140-nco-service", "apple,nco-service"; + clocks = <&peripheral_clocks 377>, <&peripheral_clocks 378>, <&peripheral_clocks 375>, <&peripheral_clocks 376>; + status = "disabled"; + }; + + /* ADT /arm-io/exdisplaypipe; no qualified host transport/ownership contract. */ + secure_display_pipe: secure-display-pipe { + compatible = "apple,t8140-secure-display-pipe", "apple,secure-display-pipe"; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + iommus = <&disp0_dart 3>, <&disp0_dart 4>; + status = "disabled"; + }; + + /* ADT /arm-io/isp-exclave-proxy; no qualified host transport/ownership contract. */ + isp_service_proxy: isp-service-proxy { + compatible = "apple,t8140-isp-service-proxy", "apple,isp-service-proxy"; + status = "disabled"; + }; + + /* ADT /arm-io/audio-hp-mic-proxy; no qualified host transport/ownership contract. */ + audio_mic_proxy: audio-mic-proxy { + compatible = "apple,t8140-audio-mic-proxy", "apple,audio-mic-proxy"; + status = "disabled"; + }; + + /* ADT /arm-io/audio-shared-dart-proxy; no qualified host transport/ownership contract. */ + audio_dart_proxy: audio-dart-proxy { + compatible = "apple,t8140-audio-dart-proxy", "apple,audio-dart-proxy"; + iommus = <&aop_dart 9>, <&aop_dart 11>; + status = "disabled"; + }; + + /* ADT /dock-debug-wireless; no qualified host transport/ownership contract. */ + wireless_debug_dock: wireless-debug-dock { + compatible = "apple,t8140-wireless-debug-dock", "apple,wireless-debug-dock"; + status = "disabled"; + }; + + /* ADT /dock-connect; no qualified host transport/ownership contract. */ + debug_dock: debug-dock@3082d8008 { + compatible = "apple,t8140-debug-dock", "apple,debug-dock"; + reg = <0x3 0x082d8008 0x0 0x4>; + interrupt-parent = <&aic>; + interrupts = , + ; + status = "disabled"; + }; +}; + +/ { + /* ADT /arm-io/eic named MMIO apertures are absolute addresses. */ + eic: secure-controller@340700000 { + compatible = "apple,t8140-eic", "apple,eic"; + reg = <0x3 0x40700000 0x0 0x18000>, + <0x3 0x63b50000 0x0 0x8000>, + <0x3 0x5a000000 0x0 0x4000>, + <0x3 0xc5040000 0x0 0xc000>, + <0x3 0x482a8000 0x0 0x4000>, + <0x3 0x482b0000 0x0 0x4000>; + reg-names = "ps", "wd-isp", "gpio", "fpwm", "gltb", "wd-e"; + status = "disabled"; + }; +}; From 0fee4d201b9c1885d25a2080cd18ae850a76ef82 Mon Sep 17 00:00:00 2001 From: AxxzyWasTaken Date: Wed, 4 Nov 2026 19:22:20 +0000 Subject: [PATCH 48/79] accel/ane: admit the J616C 26.6.2 preload The H16 preload on a J616C with 26.6.2 (25G83) has the same patchbay cells, zeroed region and build as the 25G83 profile, but a different digest, so the driver refuses the engine on this Mac. Add the digest as its own profile. Signed-off-by: AxxzyWasTaken --- drivers/accel/ane/ane_h16_boot_data.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/accel/ane/ane_h16_boot_data.h b/drivers/accel/ane/ane_h16_boot_data.h index 0dd4b1ea91b82..e11a02c6a417d 100644 --- a/drivers/accel/ane/ane_h16_boot_data.h +++ b/drivers/accel/ane/ane_h16_boot_data.h @@ -329,6 +329,20 @@ static const struct ane_h16_preload_rule ane_h16_preload_25f84 = { }, }; +/* The 25G83 layout as iBoot leaves it on a J616C with 32 GPU cores. */ +static const struct ane_h16_preload_rule ane_h16_preload_25g83_j616c = { + .cells = ane_h16_patchbay_25g83, + .cell_count = ARRAY_SIZE(ane_h16_patchbay_25g83), + .zero_start = 0x1bc00, + .zero_end = 0x1c2a0, + .digest = { + 0xf6, 0xee, 0x81, 0x1d, 0x12, 0x55, 0xba, 0x09, + 0x99, 0x4e, 0x0f, 0xb4, 0x14, 0x66, 0x82, 0xe4, + 0xc7, 0xd5, 0x55, 0xe6, 0xca, 0x4c, 0xe5, 0x04, + 0x16, 0x6b, 0x39, 0xaf, 0x51, 0xa7, 0xc4, 0xcf, + }, +}; + /* Every supported H16 firmware build, matched against the live preload. */ static const struct ane_h16_profile ane_h16_profiles[] __maybe_unused = { { @@ -341,6 +355,11 @@ static const struct ane_h16_profile ane_h16_profiles[] __maybe_unused = { .preload = &ane_h16_preload_25g83, .build = &ane_h16_build_26a428, }, + { + .identity = "H16 26.6.2 25G83 J616C", + .preload = &ane_h16_preload_25g83_j616c, + .build = &ane_h16_build_26a428, + }, { .identity = "H16 26.5.2 25F84", .preload = &ane_h16_preload_25f84, From 097e0ff9c48ff523887588791a1c08f5af5459ab Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:24:21 +1100 Subject: [PATCH 49/79] arm64: dts: apple: use the T6041 AP GPIO label for the debug port Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6040-j616s.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 0d25857c3a5e5..20b096996f303 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -82,8 +82,8 @@ }; &debug_port2 { - swclk-gpios = <&pinctrl_ap 42 GPIO_ACTIVE_HIGH>; - swdio-gpios = <&pinctrl_ap 43 GPIO_ACTIVE_HIGH>; + swclk-gpios = <&pinctrl 42 GPIO_ACTIVE_HIGH>; + swdio-gpios = <&pinctrl 43 GPIO_ACTIVE_HIGH>; }; &i2c4 { From 7b69f979ee957892f2344445fde0507e5c91e23e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:29:30 +1100 Subject: [PATCH 50/79] dt-bindings: apple: cover panel sensors, PMU functions and loader placeholders Describe telemetry interrupt sources and the remaining SPMI control endpoints. Permit disabled coprocessor memory placeholders to carry a size until the loader assigns their physical reg, and document the existing Type-C PHY port graph. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/display/bridge/parade,dp855.yaml | 12 ++++++ .../devicetree/bindings/dma/apple,sio.yaml | 11 ++++-- .../bindings/misc/apple,radio-pmu.yaml | 30 +++++++++++++++ .../bindings/misc/apple,spmi-all-ace.yaml | 30 +++++++++++++++ .../bindings/misc/apple,xspmi-proxy.yaml | 30 +++++++++++++++ .../bindings/nvmem/apple,spmi-nvmem.yaml | 3 ++ .../bindings/phy/apple,t6040-atcphy.yaml | 4 ++ .../power/supply/apple,battery-monitor.yaml | 37 +++++++++++++++++++ .../reserved-memory/apple,asc-mem.yaml | 16 +++++++- .../bindings/soc/apple/apple,aon-ptd.yaml | 11 ++++++ .../soc/apple/apple,xspmi-controller.yaml | 31 ++++++++++++++++ .../bindings/sound/apple,smc-mogul.yaml | 37 +++++++++++++++++++ 12 files changed, 247 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/misc/apple,radio-pmu.yaml create mode 100644 Documentation/devicetree/bindings/misc/apple,spmi-all-ace.yaml create mode 100644 Documentation/devicetree/bindings/misc/apple,xspmi-proxy.yaml create mode 100644 Documentation/devicetree/bindings/power/supply/apple,battery-monitor.yaml create mode 100644 Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml b/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml index 9517baae77ce8..846fcecfb86d3 100644 --- a/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml +++ b/Documentation/devicetree/bindings/display/bridge/parade,dp855.yaml @@ -25,6 +25,18 @@ properties: reg: maxItems: 1 + i2c: + type: object + $ref: /schemas/i2c/i2c-controller.yaml# + description: Downstream panel management bus mediated by the timing controller. + + patternProperties: + '^temperature-sensor@7[0-2]$': + type: object + $ref: /schemas/trivial-devices.yaml# + + unevaluatedProperties: false + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/dma/apple,sio.yaml b/Documentation/devicetree/bindings/dma/apple,sio.yaml index 7e0171d53eb1e..5a6e7e84cd469 100644 --- a/Documentation/devicetree/bindings/dma/apple,sio.yaml +++ b/Documentation/devicetree/bindings/dma/apple,sio.yaml @@ -26,8 +26,8 @@ allOf: then: properties: reg: - minItems: 2 - maxItems: 2 + minItems: 3 + maxItems: 3 else: properties: reg: @@ -50,8 +50,11 @@ properties: reg: minItems: 1 - maxItems: 2 - description: Coprocessor registers, followed on T8140 by the ASC auxiliary window. + maxItems: 3 + description: | + Coprocessor control registers. T8140 also publishes an auxiliary ASC + window and the remaining ASC registers after the mailbox window. + The mailbox registers are described by the mailbox provider. clocks: minItems: 1 diff --git a/Documentation/devicetree/bindings/misc/apple,radio-pmu.yaml b/Documentation/devicetree/bindings/misc/apple,radio-pmu.yaml new file mode 100644 index 0000000000000..934fd143ec834 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/apple,radio-pmu.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/apple,radio-pmu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple radio power management follower + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + SPMI radio power-management follower. The firmware controls its power + policy; this node only describes its address on the SPMI bus. + +properties: + compatible: + items: + - enum: + - apple,t6041-radio-pmu + - const: apple,radio-pmu + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/misc/apple,spmi-all-ace.yaml b/Documentation/devicetree/bindings/misc/apple,spmi-all-ace.yaml new file mode 100644 index 0000000000000..00b7caba3bfff --- /dev/null +++ b/Documentation/devicetree/bindings/misc/apple,spmi-all-ace.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/apple,spmi-all-ace.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SPMI Type-C control companion + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + SPMI companion endpoint alongside the Type-C port controllers. It + remains firmware-owned and is distinct from the per-port HPM followers. + +properties: + compatible: + items: + - enum: + - apple,t8140-spmi-all-ace + - const: apple,spmi-all-ace + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/misc/apple,xspmi-proxy.yaml b/Documentation/devicetree/bindings/misc/apple,xspmi-proxy.yaml new file mode 100644 index 0000000000000..d6ec66464ea3d --- /dev/null +++ b/Documentation/devicetree/bindings/misc/apple,xspmi-proxy.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/apple,xspmi-proxy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple external SPMI proxy follower + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + External SPMI proxy endpoint on the NUB SPMI bus. Firmware owns the + proxy transport until a host driver establishes an access contract. + +properties: + compatible: + items: + - enum: + - apple,t8140-xspmi-proxy + - const: apple,xspmi-proxy + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml b/Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml index 1a1051584e8fa..bd28dc14068e1 100644 --- a/Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml @@ -29,6 +29,9 @@ properties: reg: maxItems: 1 + battery-monitor: + $ref: /schemas/power/supply/apple,battery-monitor.yaml# + rtc: $ref: /schemas/rtc/apple,j700-pmu-rtc.yaml# diff --git a/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml b/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml index 04c8907584946..f62c71901541f 100644 --- a/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml +++ b/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml @@ -109,6 +109,10 @@ properties: Link to the SuperSpeed lanes of the Type-C connector. Absent on a fixed DisplayPort PHY. + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: USB and DisplayPort lane connections to the Type-C connector. + apple,tunable-axi2af: $ref: "#/$defs/apple,tunable" description: Tunables applied to the axi2af region. diff --git a/Documentation/devicetree/bindings/power/supply/apple,battery-monitor.yaml b/Documentation/devicetree/bindings/power/supply/apple,battery-monitor.yaml new file mode 100644 index 0000000000000..32385b877710b --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/apple,battery-monitor.yaml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/apple,battery-monitor.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple PMU battery monitor + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Battery-monitor function. T6041 uses a separate SPMI follower and + telemetry-router source identifiers; T8140 is a function of the primary + PMIC and signals through the SPMI interrupt controller. The monitor does + not transfer ownership of PMIC control or battery policy to the host. + +properties: + compatible: + items: + - enum: + - apple,t6041-battery-monitor + - apple,t8140-battery-monitor + - const: apple,battery-monitor + + reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + +required: + - compatible + - interrupts + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml index fb306d541ca44..2a6cc96799c9f 100644 --- a/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml +++ b/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml @@ -19,6 +19,19 @@ description: allOf: - $ref: reserved-memory.yaml# + - if: + properties: + status: + const: disabled + required: + - status + then: + anyOf: + - required: [reg] + - required: [size] + else: + required: + - reg properties: compatible: @@ -27,6 +40,8 @@ properties: reg: maxItems: 1 + size: true + no-map: true iommu-addresses: true @@ -37,6 +52,5 @@ properties: required: - compatible - - reg unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml b/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml index 2a3dc9f5856d4..13dec59b733fc 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,aon-ptd.yaml @@ -32,9 +32,20 @@ properties: minItems: 32 maxItems: 32 + interrupt-controller: true + + '#interrupt-cells': + description: Firmware telemetry source identifier, plus flags on T8140. + enum: [1, 2] + + '#address-cells': + const: 0 + required: - compatible - reg - interrupts + - interrupt-controller + - '#interrupt-cells' additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml new file mode 100644 index 0000000000000..2c0f48c8ebc52 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/apple/apple,xspmi-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple external SPMI controller endpoint + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + External SPMI controller firmware endpoint. Its bus access is mediated + by a proxy follower; it has no independently published AP MMIO aperture. + +properties: + compatible: + items: + - enum: + - apple,t8140-xspmi-controller + - const: apple,xspmi-controller + + apple,proxy: + $ref: /schemas/types.yaml#/definitions/phandle + description: SPMI follower implementing the firmware proxy transport. + +required: + - compatible + - apple,proxy + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml b/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml new file mode 100644 index 0000000000000..1e628186118ac --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,smc-mogul.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SMC Mogul control endpoint + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Mogul control endpoint published below the SMC firmware node. Its + control address belongs to the SMC-mediated peripheral namespace and + must not be interpreted as an AP physical address. + +properties: + compatible: + items: + - enum: + - apple,t8140-smc-mogul + - const: apple,smc-mogul + + apple,smc: + $ref: /schemas/types.yaml#/definitions/phandle + description: SMC firmware transport provider. + + apple,control-address: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Peripheral address in the SMC-mediated control namespace. + +required: + - compatible + - apple,smc + - apple,control-address + +additionalProperties: false From 5890ebc1609de5b2e31eef9d461ec9fb06cedd8e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:29:31 +1100 Subject: [PATCH 51/79] arm64: dts: apple: complete control endpoints and correct static resource descriptions Describe panel temperature clients, PMU monitor/proxy functions and their structural links. Use disabled size placeholders for memory that the loader fills with reg. Put the named SGX resource first on T8140 to avoid the GPU/mailbox unit-address collision; consumers resolve resources by name. Remove unused static child-bus cells from the internal DCP. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../apple/t6040-j616s-extdisp-mem-loader.dtsi | 12 ++--- arch/arm64/boot/dts/apple/t6040-j616s.dts | 24 +++++++++ .../boot/dts/apple/t6040-peripherals.dtsi | 26 +++++++++- .../arm64/boot/dts/apple/t604x-j614-j616.dtsi | 12 ++--- arch/arm64/boot/dts/apple/t604x.dtsi | 3 -- .../boot/dts/apple/t8140-peripherals.dtsi | 52 ++++++++++++++++++- arch/arm64/boot/dts/apple/t8140.dtsi | 20 ++++--- 7 files changed, 123 insertions(+), 26 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi index 08d4768494634..542a2d9f22dfa 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi @@ -19,42 +19,42 @@ reserved-memory { dcpext0_text: dcpext0-text { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; dcpext0_data: dcpext0-data { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; dcpext0_heap: dcpext0-heap { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; dcpext1_text: dcpext1-text { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; dcpext1_data: dcpext1-data { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; dcpext1_heap: dcpext1-heap { compatible = "apple,asc-mem"; - reg = <0x0 0x0 0x0 0x4000>; + size = <0x0 0x4000>; /* The loader supplies reg. */ no-map; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index 20b096996f303..09c22cc658d81 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -107,5 +107,29 @@ compatible = "parade,dp855"; reg = <0>; status = "disabled"; + + /* ADT display-temp-sens1..3 are downstream of the TCON. */ + i2c { + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor@70 { + compatible = "ti,tmp103"; + reg = <0x70>; + status = "disabled"; + }; + + temperature-sensor@71 { + compatible = "ti,tmp103"; + reg = <0x71>; + status = "disabled"; + }; + + temperature-sensor@72 { + compatible = "ti,tmp103"; + reg = <0x72>; + status = "disabled"; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index 5bbb542140323..5743d9032f5f4 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -238,7 +238,7 @@ status = "disabled"; }; - /* ADT /arm-io/dcpext0-expert. */ + /* ADT /arm-io/dcp0-expert. */ dcp_expert: display-expert@4023a8050 { compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; reg = <0x4 0x023a8050 0x0 0x4>, @@ -315,3 +315,27 @@ }; }; + +&aon_ptd { + interrupt-controller; + #interrupt-cells = <1>; + #address-cells = <0>; +}; + +&nub_spmi0 { + battery_monitor: battery-monitor@b { + compatible = "apple,t6041-battery-monitor", "apple,battery-monitor"; + reg = <0xb SPMI_USID>; + interrupt-parent = <&aon_ptd>; + interrupts = <0x62746d30>, <0x62746d31>; + status = "disabled"; + }; +}; + +&aop_spmi0 { + radio_pmu: pmic@e { + compatible = "apple,t6041-radio-pmu", "apple,radio-pmu"; + reg = <0xe SPMI_USID>; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 2c4e9d8cec2bc..7e8f9950c4afb 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi @@ -108,7 +108,7 @@ * segment-ranges[0]); the driver identifies the build from it. */ gpu_fw_text: gpu-fw-text { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; @@ -118,7 +118,7 @@ * places its crash log here. */ gpu_fw_data: gpu-fw-data { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; @@ -129,25 +129,25 @@ * the boot loader adds them to /memory. */ uat_ttbs: uat-ttbs { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; uat_pagetables: uat-pagetables { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; uat_l2_pagetables: uat-l2-pagetables { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; uat_handoff: uat-handoff { - reg = <0 0 0 0>; + size = <0 0>; /* The loader adds reg before enabling this region. */ status = "disabled"; no-map; }; diff --git a/arch/arm64/boot/dts/apple/t604x.dtsi b/arch/arm64/boot/dts/apple/t604x.dtsi index 93a595a057f24..1b289ab28059f 100644 --- a/arch/arm64/boot/dts/apple/t604x.dtsi +++ b/arch/arm64/boot/dts/apple/t604x.dtsi @@ -915,9 +915,6 @@ iommus = <&dcp_dart 23>; apple,bw-scratch = <&pmgr_dcp 0 4 0x20000>; apple,iomfb-surfaces = <1 1 0 0>; - /* the boot loader describes the piodma's regions with 2+2 cells */ - #address-cells = <2>; - #size-cells = <2>; /* enabled once the boot loader has handed the display over */ status = "disabled"; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index 6183366b0581f..8714ef1e60642 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -386,8 +386,10 @@ sio: dma-controller@385e00000 { compatible = "apple,t8140-sio", "apple,sio"; - reg = <0x3 0x85e00000 0x0 0x88000>, - <0x3 0x85850000 0x0 0x4000>; + /* Split the ASC bank around the separately owned mailbox window. */ + reg = <0x3 0x85e00000 0x0 0x8000>, + <0x3 0x85850000 0x0 0x4000>, + <0x3 0x85e0c000 0x0 0x7c000>; #dma-cells = <1>; dma-channels = <128>; mboxes = <&sio_mbox>; @@ -527,3 +529,49 @@ status = "disabled"; }; }; + +&aon_ptd { + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <0>; +}; + +&{/soc/spmi@308714000/pmic@e} { + battery_monitor: battery-monitor { + compatible = "apple,t8140-battery-monitor", "apple,battery-monitor"; + interrupt-parent = <&nub_spmi0>; + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; +}; + +&nub_spmi1 { + xspmi_proxy: proxy@d { + compatible = "apple,t8140-xspmi-proxy", "apple,xspmi-proxy"; + reg = <0xd SPMI_USID>; + status = "disabled"; + }; +}; + +&nub_spmi_a0 { + spmi_all_ace: controller@e { + compatible = "apple,t8140-spmi-all-ace", "apple,spmi-all-ace"; + reg = <0xe SPMI_USID>; + status = "disabled"; + }; +}; + +/ { + xspmi_controller: spmi-proxy-controller { + compatible = "apple,t8140-xspmi-controller", "apple,xspmi-controller"; + apple,proxy = <&xspmi_proxy>; + status = "disabled"; + }; + + smc_mogul: smc-mogul { + compatible = "apple,t8140-smc-mogul", "apple,smc-mogul"; + apple,smc = <&smc>; + apple,control-address = <0x10>; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index 338272182371d..2e1109aaa451c 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -430,7 +430,8 @@ ranges; uat_handoff: uat-handoff { - reg = <0 0 0 0>; + size = <0 0>; /* The loader supplies reg and enables the region. */ + status = "disabled"; }; /* @@ -458,15 +459,18 @@ /* Only reserved: the GPU node does not reference it */ uat_l2_pagetables: uat-l2-pagetables { - reg = <0 0 0 0>; + size = <0 0>; /* The loader supplies reg and enables the region. */ + status = "disabled"; }; uat_pagetables: uat-pagetables { - reg = <0 0 0 0>; + size = <0 0>; /* The loader supplies reg and enables the region. */ + status = "disabled"; }; uat_ttbs: uat-ttbs { - reg = <0 0 0 0>; + size = <0 0>; /* The loader supplies reg and enables the region. */ + status = "disabled"; }; }; @@ -1344,11 +1348,11 @@ status = "disabled"; }; - gpu: gpu@482600000 { + gpu: gpu@480000000 { compatible = "apple,agx-t8140"; - reg = <0x4 0x82600000 0x0 0x88000>, - <0x4 0x80000000 0x0 0x4000000>; - reg-names = "asc", "sgx"; + reg = <0x4 0x80000000 0x0 0x4000000>, + <0x4 0x82600000 0x0 0x88000>; + reg-names = "sgx", "asc"; mboxes = <&gfx_mbox>, <&gfx1_mbox>; power-domains = <&ps_gfx>; memory-region = <&uat_ttbs>, <&uat_pagetables>, From ce8a6412530aead3c8cbae06e27c97b198c0d2db Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:30:35 +1100 Subject: [PATCH 52/79] nfc: apple-stockholm: keep the response wait within the line limit No functional change. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/nfc/apple-stockholm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index b6defed23b770..cbf8ba841bb96 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -253,8 +253,8 @@ static int stockholm_nci_cmd(struct stockholm *st, u16 opcode, if (ret) return ret; - left = wait_for_completion_timeout(&st->rx_done, - msecs_to_jiffies(STOCKHOLM_NCI_TIMEOUT_MS)); + left = msecs_to_jiffies(STOCKHOLM_NCI_TIMEOUT_MS); + left = wait_for_completion_timeout(&st->rx_done, left); mutex_lock(&st->io_lock); if (!left && st->rx_waiting) { From 40019000bb46705d3ed77e30dce4721601134903 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:36:16 +1100 Subject: [PATCH 53/79] accel/ane: h17: keep dynamic power gating off across back-to-back requests The H17 path still sends 0x002d 0 before and 0x002d 1 after every EXECUTE. On the Neo (T8140) that costs 68-78 us of each MobileNet request (gate open 43-52 us, gate close 20-26 us, debugfs means over 300-3400 requests on fleet22), out of 2.2 ms. The session hold that commit fedd276b6c10 ("accel/ane: h16: keep dynamic power gating off across back-to-back requests") added for H16 is generic: gating goes back on 2 ms after the last request ended, before TERMINATE and UNLOAD and before system sleep, and a firmware booted again from the preload starts with gating on. Set the same 2 ms hold for the H17 backend. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/accel/ane/ane_fw_cold.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/accel/ane/ane_fw_cold.c b/drivers/accel/ane/ane_fw_cold.c index acfc4cc5aac8c..2c6914047cddd 100644 --- a/drivers/accel/ane/ane_fw_cold.c +++ b/drivers/accel/ane/ane_fw_cold.c @@ -1577,6 +1577,13 @@ static void ane_fw_debugfs(struct ane_fw_backend *b) dput(root); } +/* + * How long dynamic power gating stays off after the last EXECUTE, as on + * H16: toggling it around every request costs the H17 engine about 70 us + * (gate open plus gate close) of each back-to-back EXECUTE. + */ +#define ANE_FW_GATE_HOLD_NS (2 * NSEC_PER_MSEC) + static int ane_fw_program_stage(struct ane_fw_backend *b) { int ret; @@ -1586,6 +1593,7 @@ static int ane_fw_program_stage(struct ane_fw_backend *b) ANE_FW_TIMEOUT_NS); if (ret) return ret; + b->session.gate_hold_ns = ANE_FW_GATE_HOLD_NS; ret = ane_h16_accel_register(&b->pdev->dev, &b->session); if (ret) return ret; From 9c4c280e26a46921052719ca3d01351aa1ec97c4 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:41:30 +1100 Subject: [PATCH 54/79] dt-bindings: apple: describe unqualified audio and reporting endpoints Permit unrouted DP audio interfaces to remain disabled and describe their T8140 variant. Document the remaining audio firmware endpoints, secure ADMAC and external SPMI queue resources without inventing firmware transport links. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../display/apple,dcp-ioreporting.yaml | 27 +++++++ .../bindings/dma/apple,admac-secure.yaml | 56 +++++++++++++ .../soc/apple/apple,xspmi-controller.yaml | 28 +++++-- .../sound/apple,audio-firmware-services.yaml | 79 +++++++++++++++++++ .../bindings/sound/apple,t6030-dpaudio.yaml | 22 +++++- 5 files changed, 203 insertions(+), 9 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml create mode 100644 Documentation/devicetree/bindings/dma/apple,admac-secure.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml diff --git a/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml b/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml new file mode 100644 index 0000000000000..009c1df8f082d --- /dev/null +++ b/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/apple,dcp-ioreporting.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure display reporting service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Secure display coprocessor reporting endpoint. It is a firmware service + without an independently published AP MMIO window or interrupt. A host + client must establish the reporting transport and its lifecycle before + using it; the service is not an additional display engine. + +properties: + compatible: + items: + - const: apple,t8140-dcp-ioreporting + - const: apple,dcp-ioreporting + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/dma/apple,admac-secure.yaml b/Documentation/devicetree/bindings/dma/apple,admac-secure.yaml new file mode 100644 index 0000000000000..bb8ee4570b6bd --- /dev/null +++ b/Documentation/devicetree/bindings/dma/apple,admac-secure.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/apple,admac-secure.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple secure audio DMA controller + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + The secure LEAP audio DMA controller's direct hardware aperture. It is + distinct from the AP-accessible channel proxy. Its register aperture is + not safe for the AP to access until firmware transfers ownership. The + node remains disabled and must not select the ordinary ADMAC driver. + Linux logical channel IDs alternate TX and RX; the ADT slot count is + per direction. + +allOf: + - $ref: dma-controller.yaml# + +properties: + compatible: + items: + - const: apple,t8140-admac-secure + - const: apple,admac-secure + + reg: + maxItems: 1 + + '#dma-cells': + const: 1 + + dma-channels: + const: 18 + + interrupts: + maxItems: 1 + + iommus: + maxItems: 1 + + power-domains: + maxItems: 1 + +required: + - compatible + - reg + - '#dma-cells' + - dma-channels + - interrupts + - iommus + - power-domains + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml index 2c0f48c8ebc52..93ca2a72cc436 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml @@ -10,8 +10,10 @@ maintainers: - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> description: | - External SPMI controller firmware endpoint. Its bus access is mediated - by a proxy follower; it has no independently published AP MMIO aperture. + External SPMI controller queue aperture, published separately from the + non-secure bus and its SPMI proxy follower. The queue aperture is owned + by secure firmware; the response vector is local to this transport and + is not an AIC interrupt number. properties: compatible: @@ -20,12 +22,26 @@ properties: - apple,t8140-xspmi-controller - const: apple,xspmi-controller - apple,proxy: - $ref: /schemas/types.yaml#/definitions/phandle - description: SPMI follower implementing the firmware proxy transport. + reg: + maxItems: 1 + + apple,read-queue-depth: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Number of entries in the read request queue. + + apple,write-queue-depth: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Number of entries in the write request queue. + + apple,response-vector: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Local response vector of the firmware transport. required: - compatible - - apple,proxy + - reg + - apple,read-queue-depth + - apple,write-queue-depth + - apple,response-vector additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml b/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml new file mode 100644 index 0000000000000..c205aa516a552 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-firmware-services.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple firmware audio service endpoints + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio services published separately from the active sound card. + These endpoints identify voice-trigger, loopback, low-power microphone, + shared microphone buffer and listening clients. A service has no AP MMIO + aperture. DMA references describe ADMAC channel ownership, not permission + to reset a firmware-owned audio fabric or start an audio stream. + These endpoints remain disabled until their host client and ownership + protocol have been qualified. No acoustic tuning or buffer contents are + static hardware properties. + +properties: + compatible: + oneOf: + - items: + - const: apple,t6041-audio-leap-loopback + - const: apple,audio-leap-loopback + - items: + - const: apple,t6041-audio-listening-client + - const: apple,audio-listening-client + - items: + - const: apple,t6041-audio-low-power-mic + - const: apple,audio-low-power-mic + - items: + - const: apple,t6041-audio-mca-loopback + - const: apple,audio-mca-loopback + - items: + - const: apple,t6041-audio-mic-buffer + - const: apple,audio-mic-buffer + - items: + - const: apple,t6041-audio-voice-trigger + - const: apple,audio-voice-trigger + - items: + - const: apple,t8140-audio-leap-loopback + - const: apple,audio-leap-loopback + - items: + - const: apple,t8140-audio-listening-client + - const: apple,audio-listening-client + - items: + - const: apple,t8140-audio-low-power-mic + - const: apple,audio-low-power-mic + - items: + - const: apple,t8140-audio-mca-loopback + - const: apple,audio-mca-loopback + - items: + - const: apple,t8140-audio-mic-buffer + - const: apple,audio-mic-buffer + - items: + - const: apple,t8140-audio-mic-injection + - const: apple,audio-mic-injection + - items: + - const: apple,t8140-audio-speaker-tap + - const: apple,audio-speaker-tap + - items: + - const: apple,t8140-audio-voice-trigger + - const: apple,audio-voice-trigger + + dmas: + minItems: 1 + maxItems: 2 + + iommus: + minItems: 1 + maxItems: 2 + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml b/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml index b511202f35c7e..1ae364f691740 100644 --- a/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/sound/apple,t6030-dpaudio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Apple T6030 and T6041 DisplayPort audio +title: Apple T6030, T6041 and T8140 DisplayPort audio maintainers: - Ryan Murray @@ -15,7 +15,10 @@ description: | Samples arrive through SIO, and the graph connects this interface to port 0 of the display processor that owns the audio service. - T6041 interfaces remain disabled until a generation-specific SIO firmware + Unrouted interfaces can be described disabled without inventing an audio + connection to a display processor. A route is required before enabling. + + T6041 and T8140 interfaces remain disabled until a generation-specific SIO firmware backend and loader handoff are available and display audio is qualified. select: @@ -25,6 +28,7 @@ select: enum: - apple,t6030-dpaudio - apple,t6041-dpaudio + - apple,t8140-dpaudio required: - compatible @@ -34,6 +38,7 @@ properties: - enum: - apple,t6030-dpaudio - apple,t6041-dpaudio + - apple,t8140-dpaudio - const: apple,dpaudio dmas: @@ -59,6 +64,17 @@ required: - dmas - dma-names - power-domains - - ports + +allOf: + - if: + not: + properties: + status: + const: disabled + required: + - status + then: + required: + - ports additionalProperties: false From 6a81702a42916e3dcf29c6e3cd615fe7a933b628 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:41:30 +1100 Subject: [PATCH 55/79] arm64: dts: apple: expose remaining audio endpoints and complete T8140 channel counts Describe the remaining DP/audio firmware endpoints and the CPU power-state descriptors without enabling them. Correct non-secure T8140 ADMAC counts: the live ADT counts TX/RX pairs, as the licensed m1n1 ADMAC helper also documents, while Linux logical IDs alternate directions. Describe the secure direct aperture separately from the existing proxy. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../boot/dts/apple/t6040-peripherals.dtsi | 75 +++++++++++++ .../boot/dts/apple/t8140-peripherals.dtsi | 106 +++++++++++++++++- arch/arm64/boot/dts/apple/t8140-pmgr.dtsi | 76 +++++++++++++ arch/arm64/boot/dts/apple/t8140.dtsi | 6 +- 4 files changed, 259 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index 5743d9032f5f4..a79fc041dec1c 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -339,3 +339,78 @@ status = "disabled"; }; }; + +/* Register-less DP audio interfaces: ADT DMA channels and PMGR gates. */ +/ { + + dpaudio0: audio-controller-0 { + compatible = "apple,t6041-dpaudio", "apple,dpaudio"; + dmas = <&sio 0x64>; + dma-names = "tx"; + power-domains = <&ps_dpa0>; + /* No qualified firmware audio route is assigned at boot. */ + status = "disabled"; + }; + + dpaudio3: audio-controller-3 { + compatible = "apple,t6041-dpaudio", "apple,dpaudio"; + dmas = <&sio 0x6a>; + dma-names = "tx"; + power-domains = <&ps_dpa3>; + /* No qualified firmware audio route is assigned at boot. */ + status = "disabled"; + }; + + dpaudio4: audio-controller-4 { + compatible = "apple,t6041-dpaudio", "apple,dpaudio"; + dmas = <&sio 0x6c>; + dma-names = "tx"; + power-domains = <&ps_dpa4>; + /* No qualified firmware audio route is assigned at boot. */ + status = "disabled"; + }; +}; + + +/* Firmware audio endpoints with no qualified independent host client. */ +/ { + + /* ADT /arm-io/iop-voicetrigger-controller/audio-vt-device. */ + audio_voice_trigger: audio-voice-trigger { + compatible = "apple,t6041-audio-voice-trigger", "apple,audio-voice-trigger"; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/audio-mca-loopback. */ + audio_mca_loopback: audio-mca-loopback { + compatible = "apple,t6041-audio-mca-loopback", "apple,audio-mca-loopback"; + dmas = <&admac1 6>, <&admac1 7>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/audio-leap-internal-loopback. */ + audio_leap_loopback: audio-leap-loopback { + compatible = "apple,t6041-audio-leap-loopback", "apple,audio-leap-loopback"; + dmas = <&admac0 8>, <&admac0 9>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/lp-mic-device. */ + audio_low_power_mic: audio-low-power-mic { + compatible = "apple,t6041-audio-low-power-mic", "apple,audio-low-power-mic"; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/lp-mic-io-buffer-device. */ + audio_mic_buffer: audio-mic-buffer { + compatible = "apple,t6041-audio-mic-buffer", "apple,audio-mic-buffer"; + iommus = <&aop_dart 8>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/siri-listening-device. */ + audio_listening_client: audio-listening-client { + compatible = "apple,t6041-audio-listening-client", "apple,audio-listening-client"; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index 8714ef1e60642..7a696b6f4addb 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -140,6 +140,26 @@ status = "disabled"; }; + /* ADT /arm-io/admac-leap-s; the existing AP proxy is separate. */ + admac_leap_secure: dma-controller@313200000 { + compatible = "apple,t8140-admac-secure", "apple,admac-secure"; + reg = <0x3 0x13200000 0x0 0x34000>; + #dma-cells = <1>; + dma-channels = <18>; + interrupt-parent = <&aic>; + interrupts = ; + iommus = <&aop_dart 11>; + power-domains = <&ps_audio_leap_s_a>; + status = "disabled"; + }; + + /* ADT /arm-io/dcp0-expert. */ + /* ADT /arm-io/dcp-exclave-ioreporting. */ + dcp_ioreporting: dcp-ioreporting { + compatible = "apple,t8140-dcp-ioreporting", "apple,dcp-ioreporting"; + status = "disabled"; + }; + /* ADT /arm-io/dcp0-expert. */ dcp_expert: display-expert@3082b8044 { compatible = "apple,t8140-dcp-expert", "apple,dcp-expert"; @@ -562,9 +582,12 @@ }; / { - xspmi_controller: spmi-proxy-controller { + xspmi_controller: spmi-proxy-controller@348614000 { compatible = "apple,t8140-xspmi-controller", "apple,xspmi-controller"; - apple,proxy = <&xspmi_proxy>; + reg = <0x3 0x48614000 0x0 0x4000>; + apple,read-queue-depth = <256>; + apple,write-queue-depth = <256>; + apple,response-vector = <256>; status = "disabled"; }; @@ -575,3 +598,82 @@ status = "disabled"; }; }; + +/* Register-less DP audio interfaces: ADT DMA channels and PMGR gates. */ +/ { + + dpaudio0: audio-controller-0 { + compatible = "apple,t8140-dpaudio", "apple,dpaudio"; + dmas = <&sio 0x64>; + dma-names = "tx"; + power-domains = <&ps_dpa0>; + /* No qualified firmware audio route is assigned at boot. */ + status = "disabled"; + }; + + dpaudio1: audio-controller-1 { + compatible = "apple,t8140-dpaudio", "apple,dpaudio"; + dmas = <&sio 0x66>; + dma-names = "tx"; + power-domains = <&ps_dpa1>; + /* No qualified firmware audio route is assigned at boot. */ + status = "disabled"; + }; +}; + +/* Firmware audio endpoints with no qualified independent host client. */ +/ { + + /* ADT /arm-io/iop-voicetrigger-controller/audio-vt-device. */ + audio_voice_trigger: audio-voice-trigger { + compatible = "apple,t8140-audio-voice-trigger", "apple,audio-voice-trigger"; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/audio-mca-loopback. */ + audio_mca_loopback: audio-mca-loopback { + compatible = "apple,t8140-audio-mca-loopback", "apple,audio-mca-loopback"; + dmas = <&admac_base_ns 6>, <&admac_base_ns 7>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/audio-leap-internal-loopback. */ + audio_leap_loopback: audio-leap-loopback { + compatible = "apple,t8140-audio-leap-loopback", "apple,audio-leap-loopback"; + dmas = <&admac_leap_ns 8>, <&admac_leap_ns 9>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/lp-mic-device. */ + audio_low_power_mic: audio-low-power-mic { + compatible = "apple,t8140-audio-low-power-mic", "apple,audio-low-power-mic"; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/lp-mic-io-buffer-device. */ + audio_mic_buffer: audio-mic-buffer { + compatible = "apple,t8140-audio-mic-buffer", "apple,audio-mic-buffer"; + iommus = <&aop_dart 9>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/siri-listening-device. */ + audio_listening_client: audio-listening-client { + compatible = "apple,t8140-audio-listening-client", "apple,audio-listening-client"; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/audio-speaker-tap. */ + audio_speaker_tap: audio-speaker-tap { + compatible = "apple,t8140-audio-speaker-tap", "apple,audio-speaker-tap"; + dmas = <&admac_base_ns 3>; + status = "disabled"; + }; + + /* ADT /arm-io/iop-audio-controller/lp-mic-injection-device. */ + audio_mic_injection: audio-mic-injection { + compatible = "apple,t8140-audio-mic-injection", "apple,audio-mic-injection"; + dmas = <&admac_base_ns 10>; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8140-pmgr.dtsi b/arch/arm64/boot/dts/apple/t8140-pmgr.dtsi index 0a479f7e8e8e5..a2be4fc980916 100644 --- a/arch/arm64/boot/dts/apple/t8140-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-pmgr.dtsi @@ -1498,3 +1498,79 @@ }; }; + +/* CPU power states are described but remain owned by CPU power management. */ +&pmgr { + + ps_ecpu_0: power-controller@0 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ecpu_0"; + status = "disabled"; + }; + + ps_ecpu_1: power-controller@8 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ecpu_1"; + status = "disabled"; + }; + + ps_ecpu_2: power-controller@10 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x10 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ecpu_2"; + status = "disabled"; + }; + + ps_ecpu_3: power-controller@18 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x18 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ecpu_3"; + status = "disabled"; + }; + + ps_pcpu_0: power-controller@30 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x30 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "pcpu_0"; + status = "disabled"; + }; + + ps_pcpu_1: power-controller@38 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x38 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "pcpu_1"; + status = "disabled"; + }; + + ps_ecpm: power-controller@50 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x50 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "ecpm"; + status = "disabled"; + }; + + ps_pcpm: power-controller@58 { + compatible = "apple,t8140-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x58 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "pcpm"; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index 2e1109aaa451c..fbe4314221cff 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -1820,7 +1820,8 @@ admac_base_ns: dma-controller@313800000 { compatible = "apple,t8140-admac"; reg = <0x3 0x13800000 0x0 0x34000>; - dma-channels = <13>; + /* ADT has 13 slots per direction; Linux IDs alternate TX/RX. */ + dma-channels = <26>; interrupts-extended = <&aic AIC_IRQ 449 IRQ_TYPE_LEVEL_HIGH>, <0>, <0>, <0>; #dma-cells = <1>; @@ -1840,7 +1841,8 @@ admac_leap_ns: dma-controller@313300000 { compatible = "apple,t8140-admac"; reg = <0x3 0x13300000 0x0 0x34000>; - dma-channels = <9>; + /* ADT has 9 slots per direction, including loopback RX4. */ + dma-channels = <18>; interrupts-extended = <&aic AIC_IRQ 452 IRQ_TYPE_LEVEL_HIGH>, <0>, <0>, <0>; #dma-cells = <1>; From 1a6cd0120199c9b0a9aa13d55f5a305c66f4f658 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:42:38 +1100 Subject: [PATCH 56/79] docs: add compiled DT DMA geometry audit Validate that every client DMA specifier, including disabled clients, fits its provider geometry. This catches a structurally valid DT whose channel count excludes a described endpoint. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- docs/dt-audit/check-dma.py | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 docs/dt-audit/check-dma.py diff --git a/docs/dt-audit/check-dma.py b/docs/dt-audit/check-dma.py new file mode 100644 index 0000000000000..7596d436ccc82 --- /dev/null +++ b/docs/dt-audit/check-dma.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-only OR MIT +"""Check DMA references against provider geometry in compiled board DTBs. + +Run on the buildbox after compiling the boards. dt-schema validates each +node's shape; this checks the cross-node channel bounds, including disabled +clients intended for later enablement. +""" + +import pathlib +import struct +import sys + + +def cells(value): + if len(value) % 4: + raise ValueError("property length is not a whole number of cells") + return struct.unpack(">" + "I" * (len(value) // 4), value) + + +def read_nodes(data): + header = struct.unpack_from(">10I", data) + if header[0] != 0xD00DFEED or header[1] > len(data): + raise ValueError("invalid flattened device tree") + offset = header[2] + strings = data[header[3]:header[3] + header[8]] + stack = [] + nodes = {} + while True: + token, = struct.unpack_from(">I", data, offset) + offset += 4 + if token == 1: + end = data.index(b"\0", offset) + stack.append(data[offset:end].decode("ascii")) + offset = (end + 4) & ~3 + nodes["/".join(stack) or "/"] = {} + elif token == 2: + stack.pop() + elif token == 3: + size, name_offset = struct.unpack_from(">II", data, offset) + offset += 8 + end = strings.index(b"\0", name_offset) + name = strings[name_offset:end].decode("ascii") + nodes["/".join(stack) or "/"][name] = data[offset:offset + size] + offset = (offset + size + 3) & ~3 + elif token == 4: + continue + elif token == 9: + return nodes + else: + raise ValueError(f"unexpected FDT token {token}") + + +def check(path): + nodes = read_nodes(path.read_bytes()) + providers = {} + for name, props in nodes.items(): + if "phandle" in props: + providers[cells(props["phandle"])[0]] = (name, props) + references = 0 + for name, props in nodes.items(): + specifiers = cells(props.get("dmas", b"")) + offset = 0 + while offset < len(specifiers): + phandle = specifiers[offset] + offset += 1 + if phandle not in providers: + raise ValueError(f"{name}: DMA provider {phandle} is absent") + provider_name, provider = providers[phandle] + count = cells(provider.get("#dma-cells", b"")) + if len(count) != 1 or offset + count[0] > len(specifiers): + raise ValueError(f"{name}: invalid DMA specifier for {provider_name}") + args = specifiers[offset:offset + count[0]] + offset += count[0] + capacity = cells(provider.get("dma-channels", b"")) + if count[0] == 1 and capacity and args[0] >= capacity[0]: + raise ValueError( + f"{name}: channel {args[0]} exceeds {provider_name}'s " + f"{capacity[0]} logical channels" + ) + references += 1 + print(f"{path.name}: {references} DMA references within provider geometry") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + raise SystemExit("usage: check-dma.py BOARD.dtb [BOARD.dtb ...]") + for argument in sys.argv[1:]: + check(pathlib.Path(argument)) From ef3f2c01210325d8078911ab8c850972b163dbcb Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:45:36 +1100 Subject: [PATCH 57/79] driver core: Name the missing supplier only when the link is broken device_links_missing_supplier() logged "devices misses supplier" with dev_err() for every supplier that was not bound when a consumer's probe did not complete, then warned only when the link was not SYNC_STATE_ONLY. A SYNC_STATE_ONLY link is a firmware-graph hint that does not order probing, so an unbound supplier is expected there: on the Neo (J700) the Type-C PHY defers once until the CD2E22 repeater module loads, and every boot logged four err-level lines although the PHY then bound and USB came up. Fold the message into the WARN() so the supplier is still named in the one case that is a real bug, and nothing is printed for the expected one. Fixes: f9a2a6279b86 ("driver-core: Add error message to device_links_missing_supplier WARN()") Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> --- drivers/base/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 967d9d32ee0ae..48e03974f41d6 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1082,8 +1082,9 @@ static void device_links_missing_supplier(struct device *dev) if (link->supplier->links.status == DL_DEV_DRIVER_BOUND) { WRITE_ONCE(link->status, DL_STATE_AVAILABLE); } else { - dev_err(dev, "devices misses supplier %s\n", dev_name(link->supplier)); - WARN_ON(!device_link_test(link, DL_FLAG_SYNC_STATE_ONLY)); + WARN(!device_link_test(link, DL_FLAG_SYNC_STATE_ONLY), + "%s: supplier %s missing\n", dev_name(dev), + dev_name(link->supplier)); WRITE_ONCE(link->status, DL_STATE_DORMANT); } } From 3bddb4bfbac5efd9b7a5df9c810294ac862c4c6b Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:46:45 +1100 Subject: [PATCH 58/79] arm64: dts: apple: preserve display loader placeholders and describe engine resets Keep external DCP placeholder reg values required by the loader and give the initially disabled regions matching unit addresses. The GPU reservations keep their path-based fill interface. Add the scaler and T6041 APR reset relationships from the ADT ARST functions. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/media/apple,scaler.yaml | 4 ++++ .../bindings/media/apple,t6041-prores.yaml | 4 ++++ .../reserved-memory/apple,asc-mem.yaml | 16 +------------ .../apple/t6040-j616s-extdisp-mem-loader.dtsi | 24 +++++++++---------- .../boot/dts/apple/t6040-peripherals.dtsi | 2 ++ .../boot/dts/apple/t8140-peripherals.dtsi | 1 + 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/Documentation/devicetree/bindings/media/apple,scaler.yaml b/Documentation/devicetree/bindings/media/apple,scaler.yaml index 7f97ff9a6199d..62ae10462d76b 100644 --- a/Documentation/devicetree/bindings/media/apple,scaler.yaml +++ b/Documentation/devicetree/bindings/media/apple,scaler.yaml @@ -45,11 +45,15 @@ properties: minItems: 1 maxItems: 1 + resets: + maxItems: 1 + required: - compatible - reg - interrupts - power-domains + - resets - iommus - clocks diff --git a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml index 1a35ae29920ef..3754bc5a901f0 100644 --- a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml +++ b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml @@ -38,11 +38,15 @@ properties: minItems: 1 maxItems: 1 + resets: + maxItems: 1 + required: - compatible - reg - interrupts - power-domains + - resets - iommus additionalProperties: false diff --git a/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml index 2a6cc96799c9f..fb306d541ca44 100644 --- a/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml +++ b/Documentation/devicetree/bindings/reserved-memory/apple,asc-mem.yaml @@ -19,19 +19,6 @@ description: allOf: - $ref: reserved-memory.yaml# - - if: - properties: - status: - const: disabled - required: - - status - then: - anyOf: - - required: [reg] - - required: [size] - else: - required: - - reg properties: compatible: @@ -40,8 +27,6 @@ properties: reg: maxItems: 1 - size: true - no-map: true iommu-addresses: true @@ -52,5 +37,6 @@ properties: required: - compatible + - reg unevaluatedProperties: false diff --git a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi index 542a2d9f22dfa..53f8e1fbc9482 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi @@ -17,44 +17,44 @@ / { reserved-memory { - dcpext0_text: dcpext0-text { + dcpext0_text: dcpext0-text@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext0_data: dcpext0-data { + dcpext0_data: dcpext0-data@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext0_heap: dcpext0-heap { + dcpext0_heap: dcpext0-heap@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_text: dcpext1-text { + dcpext1_text: dcpext1-text@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_data: dcpext1-data { + dcpext1_data: dcpext1-data@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_heap: dcpext1-heap { + dcpext1_heap: dcpext1-heap@0 { compatible = "apple,asc-mem"; - size = <0x0 0x4000>; /* The loader supplies reg. */ + reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index a79fc041dec1c..b9a365b7a9691 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -88,6 +88,7 @@ iommus = <&scaler0_dart 0>, <&scaler0_dart 1>; clocks = <&peripheral_clocks 417>; + resets = <&ps_msr0>; status = "disabled"; }; @@ -181,6 +182,7 @@ interrupts = ; power-domains = <&ps_scodec>; iommus = <&apr0_dart 1>; + resets = <&ps_scodec>; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index 7a696b6f4addb..cd63104dcff23 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -88,6 +88,7 @@ iommus = <&scaler0_dart 0>, <&scaler0_dart 1>; clocks = <&peripheral_clocks 374>; + resets = <&ps_msr>; status = "disabled"; }; From 1767abd8dfe14329f89c91ab3046ab13a829866a Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:48:01 +1100 Subject: [PATCH 59/79] dt-bindings: clock: apple: retain the complete PMGR clock resource banks Publish the saved ADT structural register banks alongside the clock selector namespace. A future clock backend must not be limited to the primary PMGR power-state syscon aperture. Keep both providers disabled and omit sampled rates and programming tables. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/clock/apple,pmgr-clocks.yaml | 30 ++++++++- .../boot/dts/apple/t6040-peripherals.dtsi | 66 ++++++++++++++++++- .../boot/dts/apple/t8140-peripherals.dtsi | 47 ++++++++++++- 3 files changed, 140 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml b/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml index 84e7e54dc662b..71e74f7d59a83 100644 --- a/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml +++ b/Documentation/devicetree/bindings/clock/apple,pmgr-clocks.yaml @@ -25,16 +25,44 @@ properties: - apple,t8140-pmgr-clocks - const: apple,pmgr-clocks + reg: + description: PMGR control apertures in hardware-description order. + minItems: 44 + maxItems: 63 + '#clock-cells': const: 1 apple,pmgr: $ref: /schemas/types.yaml#/definitions/phandle - description: Power manager providing the clock control registers. + description: Primary PMGR syscon. Additional control banks are described by reg. required: + - reg - compatible - '#clock-cells' - apple,pmgr +allOf: + - if: + properties: + compatible: + contains: + const: apple,t6041-pmgr-clocks + then: + properties: + reg: + minItems: 63 + maxItems: 63 + - if: + properties: + compatible: + contains: + const: apple,t8140-pmgr-clocks + then: + properties: + reg: + minItems: 44 + maxItems: 44 + additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index b9a365b7a9691..81685adca2cb9 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -274,8 +274,72 @@ }; /* Clock IDs are SoC hardware selectors, not ADT phandles. */ - peripheral_clocks: clock-controller { + peripheral_clocks: clock-controller@502800000 { compatible = "apple,t6041-pmgr-clocks", "apple,pmgr-clocks"; + /* ADT /arm-io/pmgr register banks, in hardware-description order. */ + reg = <0x5 0x02800000 0x0 0x1e0000>, + <0x5 0x08300000 0x0 0x80000>, + <0x5 0x02280000 0x0 0x100000>, + <0x5 0x00000000 0x0 0x80000>, + <0x5 0x08200000 0x0 0x80000>, + <0x5 0x08004000 0x0 0x1000>, + <0x2 0x10e20000 0x0 0x2000>, + <0x2 0x10050000 0x0 0xef1000>, + <0x2 0x10e40000 0x0 0x9000>, + <0x2 0x10e50000 0x0 0xe81000>, + <0x2 0x10e70000 0x0 0x1000>, + <0x2 0x10050000 0x0 0x10000>, + <0x2 0x10150000 0x0 0x10000>, + <0x2 0x10250000 0x0 0x10000>, + <0x2 0x10350000 0x0 0x10000>, + <0x2 0x11e20000 0x0 0x2000>, + <0x2 0x11050000 0x0 0xef1000>, + <0x2 0x11e40000 0x0 0xb000>, + <0x2 0x11e50000 0x0 0xe81000>, + <0x2 0x11e70000 0x0 0x1000>, + <0x2 0x11050000 0x0 0x10000>, + <0x2 0x11150000 0x0 0x10000>, + <0x2 0x11250000 0x0 0x10000>, + <0x2 0x11350000 0x0 0x10000>, + <0x2 0x11450000 0x0 0x10000>, + <0x2 0x11550000 0x0 0x10000>, + <0x2 0x12e20000 0x0 0x2000>, + <0x2 0x12050000 0x0 0xef1000>, + <0x2 0x12e40000 0x0 0xb000>, + <0x2 0x12e50000 0x0 0xe81000>, + <0x2 0x12e70000 0x0 0x1000>, + <0x2 0x12050000 0x0 0x10000>, + <0x2 0x12150000 0x0 0x10000>, + <0x2 0x12250000 0x0 0x10000>, + <0x2 0x12350000 0x0 0x10000>, + <0x2 0x12450000 0x0 0x10000>, + <0x2 0x12550000 0x0 0x10000>, + <0x5 0x02800000 0x0 0x18000>, + <0x5 0x0282c000 0x0 0x4000>, + <0x5 0x02850000 0x0 0x4000>, + <0x5 0x02880000 0x0 0x1c000>, + <0x5 0x02900000 0x0 0x24000>, + <0x5 0x028f0000 0x0 0x4000>, + <0x5 0x028e0000 0x0 0x4000>, + <0x5 0x02820000 0x0 0x4000>, + <0x5 0x08330000 0x0 0x10000>, + <0x5 0x08374000 0x0 0x4000>, + <0x5 0x08360000 0x0 0x4000>, + <0x5 0x00200000 0x0 0x8000>, + <0x5 0x00400000 0x0 0x34000>, + <0x5 0x003c0000 0x0 0x30000>, + <0x5 0x08800000 0x0 0xa8000>, + <0x4 0x85878000 0x0 0x4000>, + <0x2 0x88eb0000 0x0 0x4000>, + <0x2 0x88e80000 0x0 0x30000>, + <0x5 0x08900000 0x0 0x18000>, + <0x5 0x00210000 0x0 0x8000>, + <0x5 0x0020c000 0x0 0x4000>, + <0x5 0x08004000 0x0 0x1000>, + <0x5 0x0007a000 0x0 0x4000>, + <0x5 0x04000000 0x0 0x1000000>, + <0x2 0x88e1c000 0x0 0x4000>, + <0x5 0x022a0000 0x0 0x4000>; #clock-cells = <1>; apple,pmgr = <&pmgr>; status = "disabled"; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index cd63104dcff23..a6a33c3223a66 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -241,8 +241,53 @@ }; /* Clock IDs are SoC hardware selectors, not ADT phandles. */ - peripheral_clocks: clock-controller { + peripheral_clocks: clock-controller@300700000 { compatible = "apple,t8140-pmgr-clocks", "apple,pmgr-clocks"; + /* ADT /arm-io/pmgr register banks, in hardware-description order. */ + reg = <0x3 0x00700000 0x0 0xcc000>, + <0x3 0x08280000 0x0 0x80000>, + <0x3 0x00000000 0x0 0x78000>, + <0x3 0x08200000 0x0 0x7c000>, + <0x3 0x08004000 0x0 0x1000>, + <0x2 0x10e20000 0x0 0x2000>, + <0x2 0x10050000 0x0 0xef1000>, + <0x2 0x10e40000 0x0 0x9000>, + <0x2 0x10e50000 0x0 0xe81000>, + <0x2 0x10e70000 0x0 0x1000>, + <0x2 0x10050000 0x0 0x10000>, + <0x2 0x10150000 0x0 0x10000>, + <0x2 0x10250000 0x0 0x10000>, + <0x2 0x10350000 0x0 0x10000>, + <0x2 0x11e20000 0x0 0x2000>, + <0x2 0x11050000 0x0 0xef1000>, + <0x2 0x11e40000 0x0 0xb000>, + <0x2 0x11e50000 0x0 0xe81000>, + <0x2 0x11e70000 0x0 0x1000>, + <0x2 0x11050000 0x0 0x10000>, + <0x2 0x11150000 0x0 0x10000>, + <0x3 0x00700000 0x0 0x18000>, + <0x3 0x00724000 0x0 0x4000>, + <0x3 0x00728000 0x0 0x4000>, + <0x3 0x00730000 0x0 0x14000>, + <0x3 0x00760000 0x0 0x4000>, + <0x3 0x00764000 0x0 0x4000>, + <0x3 0x00768000 0x0 0x4000>, + <0x3 0x00780000 0x0 0x4000>, + <0x3 0x082b8000 0x0 0x10000>, + <0x3 0x082c8000 0x0 0x4000>, + <0x3 0x082d0000 0x0 0x8000>, + <0x3 0x00208000 0x0 0x8000>, + <0x3 0x00280000 0x0 0x80000>, + <0x3 0x003c0000 0x0 0x30000>, + <0x3 0x08100000 0x0 0xa8000>, + <0x4 0x01878000 0x0 0x4000>, + <0x3 0x00780000 0x0 0x4000>, + <0x4 0x0195c000 0x0 0x4000>, + <0x4 0x01960000 0x0 0x4000>, + <0x4 0x01974000 0x0 0x4000>, + <0x2 0x11000000 0x0 0xff4000>, + <0x4 0x80e1c000 0x0 0x4000>, + <0x3 0x02000000 0x0 0x1000000>; #clock-cells = <1>; apple,pmgr = <&pmgr>; status = "disabled"; From 8777b6c7a5fa623e2252abb58b9fe6a4bf67df86 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:49:24 +1100 Subject: [PATCH 60/79] dt-bindings: clock: apple: keep firmware NCO selectors separate from input clocks Preserve the NCO service clock identifiers without asserting a direct AP input/output topology that the ADT does not publish. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/clock/apple,nco-service.yaml | 15 ++++++++++++--- arch/arm64/boot/dts/apple/t8140-peripherals.dtsi | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/apple,nco-service.yaml b/Documentation/devicetree/bindings/clock/apple,nco-service.yaml index 567efa089d067..78c553ce9b7bf 100644 --- a/Documentation/devicetree/bindings/clock/apple,nco-service.yaml +++ b/Documentation/devicetree/bindings/clock/apple,nco-service.yaml @@ -12,7 +12,9 @@ maintainers: description: | Firmware-managed numerically controlled oscillator service. Unlike the directly programmed NCO binding, no AP register window is published. - The input selectors identify clocks in the PMGR clock namespace. + The selectors identify clocks in the PMGR clock namespace. Their + firmware service association is preserved without assuming a direct + AP-programmable NCO input/output clock topology. properties: compatible: @@ -21,12 +23,19 @@ properties: - const: apple,t8140-nco-service - const: apple,nco-service - clocks: + apple,clock-controller: + $ref: /schemas/types.yaml#/definitions/phandle + description: Provider defining the SoC hardware clock selector namespace. + + apple,clock-selectors: + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 4 maxItems: 4 + description: Clock selectors published for this firmware NCO service. required: - compatible - - clocks + - apple,clock-controller + - apple,clock-selectors additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index a6a33c3223a66..a0a83dea2030a 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -529,7 +529,8 @@ /* ADT /arm-io/nco; no qualified host transport/ownership contract. */ nco_service: nco-service { compatible = "apple,t8140-nco-service", "apple,nco-service"; - clocks = <&peripheral_clocks 377>, <&peripheral_clocks 378>, <&peripheral_clocks 375>, <&peripheral_clocks 376>; + apple,clock-controller = <&peripheral_clocks>; + apple,clock-selectors = <377 378 375 376>; status = "disabled"; }; From 43f2e230f0816931c2a74022ee9ea6eecf0c25c6 Mon Sep 17 00:00:00 2001 From: Ryan <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:50:58 +1100 Subject: [PATCH 61/79] ci: check every Apple device tree against its bindings Run CHECK_DTBS on all Apple device trees at the base and the head of a change and fail when the head adds a schema warning, and run dt_binding_check on every binding the change adds or edits. Phandle values in the messages are masked so a renumbering is not reported as new. The existing warnings stay visible in the job artifact while they are burnt down; new device tree work cannot add to them. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .github/workflows/dt-checks.yml | 74 +++++++++++++++++++++++++++++++++ scripts/dtc/apple-dt-check.sh | 42 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 .github/workflows/dt-checks.yml create mode 100755 scripts/dtc/apple-dt-check.sh diff --git a/.github/workflows/dt-checks.yml b/.github/workflows/dt-checks.yml new file mode 100644 index 0000000000000..2cb9403641a34 --- /dev/null +++ b/.github/workflows/dt-checks.yml @@ -0,0 +1,74 @@ +name: Device tree checks + +# Every Apple device tree is validated against its dt-schema bindings (CHECK_DTBS) at the +# base and at the head of the change; a warning the base does not have fails the job, and +# every binding the change adds or edits must pass dt_binding_check. This keeps the +# "describe every device" work from regressing while the existing warnings are burnt down. + +on: + pull_request: + branches: [integration/aurora, aurora-wip] + paths: + - 'arch/arm64/boot/dts/apple/**' + - 'Documentation/devicetree/bindings/**' + - 'include/dt-bindings/**' + - 'scripts/dtc/**' + - '.github/workflows/dt-checks.yml' + push: + branches: [integration/aurora] + paths: + - 'arch/arm64/boot/dts/apple/**' + - 'Documentation/devicetree/bindings/**' + - 'include/dt-bindings/**' + - 'scripts/dtc/**' + - '.github/workflows/dt-checks.yml' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: dt-checks-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + CLANG_VERSION: '18' + +jobs: + dt-checks: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + filter: tree:0 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install the tools + run: | + sudo apt-get update -q + sudo apt-get install -y -q flex bison bc libyaml-dev clang-$CLANG_VERSION lld-$CLANG_VERSION llvm-$CLANG_VERSION + echo "/usr/lib/llvm-$CLANG_VERSION/bin" >> "$GITHUB_PATH" + pip install --quiet dtschema yamllint + + - name: CHECK_DTBS and dt_binding_check, base vs head + env: + BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + run: | + head=$(git rev-parse HEAD) + base=$BASE + if [ -z "$base" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then base=$(git rev-parse HEAD~1); fi + scripts/dtc/apple-dt-check.sh "$base" "$head" "$RUNNER_TEMP/dt" + + - name: Keep the warning lists + if: always() + uses: actions/upload-artifact@v4 + with: + name: dt-check-warnings + path: | + ${{ runner.temp }}/dt/*.warn + if-no-files-found: ignore diff --git a/scripts/dtc/apple-dt-check.sh b/scripts/dtc/apple-dt-check.sh new file mode 100755 index 0000000000000..57c2b1f110d7e --- /dev/null +++ b/scripts/dtc/apple-dt-check.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only +# apple-dt-check.sh BASE HEAD WORKDIR: run CHECK_DTBS on every Apple device tree at BASE and at HEAD +# and fail when HEAD has a warning BASE does not. Also runs dt_binding_check on every binding HEAD +# changes. Phandle values in the messages are masked, so renumbering is not a new warning. +# Needs dtschema (dt-validate), clang/lld (LLVM=1), flex, bison. Prints a summary. +set -u +BASE=$1 HEAD=$2 W=$3 +export ARCH=arm64 LLVM=1 +mkdir -p "$W" +warnings() { # rev tag + local t=$W/src-$2 o=$W/out-$2 + git worktree add -q --detach "$t" "$1" || return 1 + make -s -C "$t" O="$o" defconfig >/dev/null || return 1 + local dtbs; dtbs=$(cd "$t/arch/arm64/boot/dts" && ls apple/*.dts | sed 's/dts$/dtb/') + make -C "$t" O="$o" -j"$(nproc)" CHECK_DTBS=y $dtbs > "$W/$2.log" 2>&1 + local rc=$? + grep -E '\.dtb: |[Ww]arning|rror' "$W/$2.log" | grep -v '^ ' | + sed -E "s#$t/##g; s#$o/##g" | + perl -pe 's{(\[\[[^:]*?\]\])}{(my $x = $1) =~ s/\d+/N/g; $x}ge' | sort -u > "$W/$2.warn" + echo "$2: make rc=$rc, $(wc -l < "$W/$2.warn") warning lines, $(echo $dtbs | wc -w) DTBs" + return $rc +} +warnings "$BASE" base || echo "base build failed (its warnings still count)" +warnings "$HEAD" head; hrc=$? +comm -13 "$W/base.warn" "$W/head.warn" > "$W/new.warn" +comm -23 "$W/base.warn" "$W/head.warn" > "$W/gone.warn" +echo "new warnings: $(wc -l < "$W/new.warn"), removed: $(wc -l < "$W/gone.warn")" +fail=0 +[ $hrc = 0 ] || { echo "HEAD device trees do not build"; fail=1; } +if [ -s "$W/new.warn" ]; then echo "--- new CHECK_DTBS warnings"; cat "$W/new.warn"; fail=1; fi +b=$(git diff --name-only --diff-filter=AM "$BASE" "$HEAD" -- 'Documentation/devicetree/bindings/*.yaml') +for f in $b; do + if make -s -C "$W/src-head" O="$W/out-head" dt_binding_check DT_SCHEMA_FILES="${f#Documentation/devicetree/bindings/}" > "$W/binding.log" 2>&1 && + ! grep -qE 'warning|error' "$W/binding.log"; then + echo "binding ok: $f" + else + echo "--- binding check failed: $f"; cat "$W/binding.log"; fail=1 + fi +done +git worktree remove --force "$W/src-base" 2>/dev/null; true +exit $fail From d15dcdfa4ec88a1b133253a72d220ed4c8d24514 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:51:58 +1100 Subject: [PATCH 62/79] media: apple: avd: read the AV1 payload only for frames with tiles, fix the host fixtures Follow-up to "check the AV1 tile entries before using them": - Read the OUTPUT payload size only when the frame has tiles to check, so the check never looks at the source buffer for a frame without any. - The host tests extract the production preamble, which now calls avd_av1_check_tiles(), vb2_get_plane_payload() and reads v4l2_ctrl.elems. Extract the helper in avd-av1-tail-tests, and give both AV1 fixtures the payload accessor, the elems field (one entry for the single test tile) and a no-op ratelimited log. run-host-tests --only avd: 12/12 pass (CI failed avd-av1-tail-tests and avd-codec-tail-tests on the tile check alone). Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/media/platform/apple/avd/avd-av1.c | 5 ++++- drivers/media/platform/apple/avd/tests/av1-test.py | 6 ++++-- tools/asahi/avd-av1-tail-tests.py | 8 +++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/apple/avd/avd-av1.c b/drivers/media/platform/apple/avd/avd-av1.c index 67dca20402b54..8ea584fbcbe4c 100644 --- a/drivers/media/platform/apple/avd/avd-av1.c +++ b/drivers/media/platform/apple/avd/avd-av1.c @@ -1400,16 +1400,19 @@ static void update_dec_buf_info(struct avd_decoded_buffer *buf, static int avd_av1_check_tiles(struct avd_ctx *ctx, struct avd_av1_run *run, unsigned int entries) { - size_t payload = vb2_get_plane_payload(&run->base.bufs.src->vb2_buf, 0); unsigned int tiles = run->frame->tile_info.tile_cols * run->frame->tile_info.tile_rows; unsigned int t; + size_t payload; if (entries < tiles) { dev_err_ratelimited(ctx->dev->dev, "AV1: %u tiles but %u tile entries\n", tiles, entries); return -EINVAL; } + if (!tiles) + return 0; + payload = vb2_get_plane_payload(&run->base.bufs.src->vb2_buf, 0); for (t = 0; t < tiles; t++) { const struct v4l2_ctrl_av1_tile_group_entry *e = &run->tile_group[t]; diff --git a/drivers/media/platform/apple/avd/tests/av1-test.py b/drivers/media/platform/apple/avd/tests/av1-test.py index 661eb982f30a5..b073c8929fe69 100644 --- a/drivers/media/platform/apple/avd/tests/av1-test.py +++ b/drivers/media/platform/apple/avd/tests/av1-test.py @@ -73,9 +73,11 @@ static bool vp_feature=true; static bool avd_qfw_has_vp_done(const struct avd_dev *d){return d->queued&&vp_feature;} static void *vb2_plane_vaddr(struct vb2_buffer *b,int p){(void)p;return b->cpu;} +/* The tests' single tile entry lies inside the first MiB of the bitstream buffer. */ +static unsigned long vb2_get_plane_payload(struct vb2_buffer *b,unsigned int p){(void)b;(void)p;return 1UL<<20;} static struct vb2_v4l2_buffer *current_src,*current_dst; static struct vb2_v4l2_buffer *v4l2_m2m_next_src_buf(void *m){(void)m;return current_src;} -struct v4l2_ctrl {unsigned int id; union {void *p;} p_cur;}; +struct v4l2_ctrl {unsigned int id; unsigned int elems; union {void *p;} p_cur;}; struct v4l2_ctrl_ref {struct v4l2_ctrl_ref *next; struct v4l2_ctrl *ctrl; bool p_req_valid; union {void *p;} p_req;}; struct v4l2_ctrl_handler {struct v4l2_ctrl_ref *ctrl_refs;}; #define list_for_each_entry(ref,head,node) for((ref)=*(head);(ref);(ref)=(ref)->next) @@ -90,7 +92,7 @@ static struct v4l2_ctrl_handler *v4l2_ctrl_request_hdl_find(void *req,void *h){(void)h;assert(req==&request_hdl);request_gets++;return &request_hdl;} static void v4l2_ctrl_request_hdl_put(struct v4l2_ctrl_handler *h){assert(h==&request_hdl);request_puts++;} static struct v4l2_ctrl *v4l2_ctrl_find(void *h,u32 id){ - (void)h;controls[0].p_cur.p=&seq;controls[1].p_cur.p=¶ms;controls[2].p_cur.p=&tile;controls[3].p_cur.p=&grain; + (void)h;controls[0].p_cur.p=&seq;controls[1].p_cur.p=¶ms;controls[2].p_cur.p=&tile;controls[2].elems=1;controls[3].p_cur.p=&grain; if(id==V4L2_CID_STATELESS_AV1_SEQUENCE)return &controls[0]; if(id==V4L2_CID_STATELESS_AV1_FRAME)return &controls[1]; if(id==V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY)return &controls[2]; diff --git a/tools/asahi/avd-av1-tail-tests.py b/tools/asahi/avd-av1-tail-tests.py index d434ab3a0b8a2..633e3fdda337d 100644 --- a/tools/asahi/avd-av1-tail-tests.py +++ b/tools/asahi/avd-av1-tail-tests.py @@ -54,6 +54,7 @@ def structure(source, name): #define ALIGN_DOWN(x,a) ((x)&~((__typeof__(x))(a)-1)) #define WARN_ON(x) (x) #define DIV_ROUND_UP(n,d) (((n)+(d)-1)/(d)) +#define dev_err_ratelimited(...) ((void)0) @ALIGNMENT@ @CDF_HEADER@ @CDF_DEFAULTS@ @@ -64,10 +65,10 @@ def structure(source, name): struct {unsigned int color_size; unsigned short width,height; size_t seg_size;} av1; }; struct avd_buf {void *cpu; dma_addr_t addr;}; -struct avd_run {struct {struct vb2_v4l2_buffer *dst;} bufs; dma_addr_t y_out;}; +struct avd_run {struct {struct vb2_v4l2_buffer *src,*dst;} bufs; dma_addr_t y_out;}; @RUN_STRUCT@ @CTX_STRUCT@ -struct v4l2_ctrl {struct {void *p;} p_cur;}; +struct v4l2_ctrl {unsigned int elems; struct {void *p;} p_cur;}; struct v4l2_pix_format_mplane {unsigned int width,height; struct {unsigned int sizeimage;} plane_fmt[1];}; struct avd_ctx {void *priv; int ctrl_hdl; struct {struct {struct {unsigned int width,height;} pix_mp;} fmt;} decoded_fmt;}; static struct avd_decoded_buffer *reference; @@ -78,6 +79,7 @@ def structure(source, name): static struct v4l2_ctrl controls[4]; static unsigned int lookup_calls, preamble_calls; static void *vb2_plane_vaddr(struct vb2_buffer *b,unsigned int p){assert(p==0);return b->memory;} +static unsigned long vb2_get_plane_payload(struct vb2_buffer *b,unsigned int p){assert(p==0);return b->planes[0].length;} static dma_addr_t vb2_dma_contig_plane_dma_addr(struct vb2_buffer *b,unsigned int p){assert(p==0);return b->dma;} static struct avd_decoded_buffer *vb2_to_avd_decoded_buf(struct vb2_buffer *b){return (void *)b;} static struct avd_decoded_buffer *avd_get_ref_buf(struct avd_ctx *ctx,struct vb2_v4l2_buffer *dst,uint64_t timestamp){(void)ctx;(void)dst;assert(timestamp==1000);lookup_calls++;return reference;} @@ -213,7 +215,7 @@ def main(): text = {name: p.read_text() for name, p in paths.items()} src = text['avd-av1.c'] macros = src[src.index('#define AVD_CDFS_SIZE'):src.index('struct avd_av1_run {')] - functions = {n: function(src, n) for n in ['avd_av1_ref_ts', 'avd_av1_set_prob', 'avd_av1_set_seg', 'avd_av1_seg_size', 'avd_color_size', 'avd_av1_run_preamble', 'avd_av1_adjust_decoded_fmt']} + functions = {n: function(src, n) for n in ['avd_av1_ref_ts', 'avd_av1_set_prob', 'avd_av1_set_seg', 'avd_av1_seg_size', 'avd_color_size', 'avd_av1_check_tiles', 'avd_av1_run_preamble', 'avd_av1_adjust_decoded_fmt']} unaligned = ('\n#define UNALIGNED_CDFS_OFFSET(dst,cl) ((dst)-ALIGN(cl,AVD_ALIGN)-ALIGN(AVD_CDFS_SIZE,AVD_ALIGN))\n' '#define UNALIGNED_SEG_OFFSET(dst,cl,sl) (UNALIGNED_CDFS_OFFSET(dst,cl)-(sl))\n') # Each mutation names the extracted text it rewrites; a stale one is refused, never run as a no-op. From 00d827fde32806ddf1836c2f5a2386522c28e49c Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:53:14 +1100 Subject: [PATCH 63/79] dt-bindings: apple: preserve transport contracts in the completeness descriptions Use the SPMI controller supported rising-edge trigger for the PMU monitor, and check that contract across compiled interrupt references. Leave firmware queue-depth configuration out of static DTS. Select the T6041 APR resource layout only for its own primary compatible. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/media/apple,t6041-prores.yaml | 8 ++++++ .../soc/apple/apple,xspmi-controller.yaml | 10 ------- .../boot/dts/apple/t8140-peripherals.dtsi | 4 +-- docs/dt-audit/check-dma.py | 26 +++++++++++++++++-- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml index 3754bc5a901f0..96ffef4dbbca4 100644 --- a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml +++ b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml @@ -14,6 +14,14 @@ description: | layout is distinct from the T8140 APR binding and must not select that generation's driver. +select: + properties: + compatible: + contains: + const: apple,t6041-prores + required: + - compatible + properties: compatible: oneOf: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml index 93ca2a72cc436..23de22e476d5d 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,xspmi-controller.yaml @@ -25,14 +25,6 @@ properties: reg: maxItems: 1 - apple,read-queue-depth: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Number of entries in the read request queue. - - apple,write-queue-depth: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Number of entries in the write request queue. - apple,response-vector: $ref: /schemas/types.yaml#/definitions/uint32 description: Local response vector of the firmware transport. @@ -40,8 +32,6 @@ properties: required: - compatible - reg - - apple,read-queue-depth - - apple,write-queue-depth - apple,response-vector additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index a0a83dea2030a..6a00fc2f4ad69 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -607,7 +607,7 @@ battery_monitor: battery-monitor { compatible = "apple,t8140-battery-monitor", "apple,battery-monitor"; interrupt-parent = <&nub_spmi0>; - interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <12 IRQ_TYPE_EDGE_RISING>; status = "disabled"; }; }; @@ -632,8 +632,6 @@ xspmi_controller: spmi-proxy-controller@348614000 { compatible = "apple,t8140-xspmi-controller", "apple,xspmi-controller"; reg = <0x3 0x48614000 0x0 0x4000>; - apple,read-queue-depth = <256>; - apple,write-queue-depth = <256>; apple,response-vector = <256>; status = "disabled"; }; diff --git a/docs/dt-audit/check-dma.py b/docs/dt-audit/check-dma.py index 7596d436ccc82..938dcdad9c9cc 100644 --- a/docs/dt-audit/check-dma.py +++ b/docs/dt-audit/check-dma.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only OR MIT -"""Check DMA references against provider geometry in compiled board DTBs. +"""Check DMA geometry and SPMI interrupt references in compiled board DTBs. Run on the buildbox after compiling the boards. dt-schema validates each node's shape; this checks the cross-node channel bounds, including disabled @@ -58,6 +58,7 @@ def check(path): if "phandle" in props: providers[cells(props["phandle"])[0]] = (name, props) references = 0 + spmi_interrupts = 0 for name, props in nodes.items(): specifiers = cells(props.get("dmas", b"")) offset = 0 @@ -79,7 +80,28 @@ def check(path): f"{capacity[0]} logical channels" ) references += 1 - print(f"{path.name}: {references} DMA references within provider geometry") + interrupt_parent = props.get("interrupt-parent") + if interrupt_parent and "interrupts" in props: + phandle, = cells(interrupt_parent) + if phandle not in providers: + raise ValueError(f"{name}: interrupt provider {phandle} is absent") + provider_name, provider = providers[phandle] + compatible = provider.get("compatible", b"").split(b"\0") + if b"apple,t8103-spmi" in compatible: + specifiers = cells(props["interrupts"]) + if len(specifiers) % 2: + raise ValueError(f"{name}: malformed SPMI interrupt specifier") + for offset in range(0, len(specifiers), 2): + # spmi-apple-controller.c accepts IRQ_TYPE_EDGE_RISING only. + if specifiers[offset + 1] != 1: + raise ValueError( + f"{name}: {provider_name} supports rising-edge interrupts only" + ) + spmi_interrupts += 1 + print( + f"{path.name}: {references} DMA references within provider geometry; " + f"{spmi_interrupts} SPMI interrupt specifiers supported by the controller" + ) if __name__ == "__main__": From 043acbc7cecdd8ad1aac5d0d4dc37f79fdf5d1df Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:58:57 +1100 Subject: [PATCH 64/79] Remove audit tooling from the kernel tree per DT2 conventions Keep the audit reports and resource checker with the DT2 evidence and CI tooling outside the kernel repository. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- docs/dt-audit/check-dma.py | 111 ------------------------------------- 1 file changed, 111 deletions(-) delete mode 100644 docs/dt-audit/check-dma.py diff --git a/docs/dt-audit/check-dma.py b/docs/dt-audit/check-dma.py deleted file mode 100644 index 938dcdad9c9cc..0000000000000 --- a/docs/dt-audit/check-dma.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: GPL-2.0-only OR MIT -"""Check DMA geometry and SPMI interrupt references in compiled board DTBs. - -Run on the buildbox after compiling the boards. dt-schema validates each -node's shape; this checks the cross-node channel bounds, including disabled -clients intended for later enablement. -""" - -import pathlib -import struct -import sys - - -def cells(value): - if len(value) % 4: - raise ValueError("property length is not a whole number of cells") - return struct.unpack(">" + "I" * (len(value) // 4), value) - - -def read_nodes(data): - header = struct.unpack_from(">10I", data) - if header[0] != 0xD00DFEED or header[1] > len(data): - raise ValueError("invalid flattened device tree") - offset = header[2] - strings = data[header[3]:header[3] + header[8]] - stack = [] - nodes = {} - while True: - token, = struct.unpack_from(">I", data, offset) - offset += 4 - if token == 1: - end = data.index(b"\0", offset) - stack.append(data[offset:end].decode("ascii")) - offset = (end + 4) & ~3 - nodes["/".join(stack) or "/"] = {} - elif token == 2: - stack.pop() - elif token == 3: - size, name_offset = struct.unpack_from(">II", data, offset) - offset += 8 - end = strings.index(b"\0", name_offset) - name = strings[name_offset:end].decode("ascii") - nodes["/".join(stack) or "/"][name] = data[offset:offset + size] - offset = (offset + size + 3) & ~3 - elif token == 4: - continue - elif token == 9: - return nodes - else: - raise ValueError(f"unexpected FDT token {token}") - - -def check(path): - nodes = read_nodes(path.read_bytes()) - providers = {} - for name, props in nodes.items(): - if "phandle" in props: - providers[cells(props["phandle"])[0]] = (name, props) - references = 0 - spmi_interrupts = 0 - for name, props in nodes.items(): - specifiers = cells(props.get("dmas", b"")) - offset = 0 - while offset < len(specifiers): - phandle = specifiers[offset] - offset += 1 - if phandle not in providers: - raise ValueError(f"{name}: DMA provider {phandle} is absent") - provider_name, provider = providers[phandle] - count = cells(provider.get("#dma-cells", b"")) - if len(count) != 1 or offset + count[0] > len(specifiers): - raise ValueError(f"{name}: invalid DMA specifier for {provider_name}") - args = specifiers[offset:offset + count[0]] - offset += count[0] - capacity = cells(provider.get("dma-channels", b"")) - if count[0] == 1 and capacity and args[0] >= capacity[0]: - raise ValueError( - f"{name}: channel {args[0]} exceeds {provider_name}'s " - f"{capacity[0]} logical channels" - ) - references += 1 - interrupt_parent = props.get("interrupt-parent") - if interrupt_parent and "interrupts" in props: - phandle, = cells(interrupt_parent) - if phandle not in providers: - raise ValueError(f"{name}: interrupt provider {phandle} is absent") - provider_name, provider = providers[phandle] - compatible = provider.get("compatible", b"").split(b"\0") - if b"apple,t8103-spmi" in compatible: - specifiers = cells(props["interrupts"]) - if len(specifiers) % 2: - raise ValueError(f"{name}: malformed SPMI interrupt specifier") - for offset in range(0, len(specifiers), 2): - # spmi-apple-controller.c accepts IRQ_TYPE_EDGE_RISING only. - if specifiers[offset + 1] != 1: - raise ValueError( - f"{name}: {provider_name} supports rising-edge interrupts only" - ) - spmi_interrupts += 1 - print( - f"{path.name}: {references} DMA references within provider geometry; " - f"{spmi_interrupts} SPMI interrupt specifiers supported by the controller" - ) - - -if __name__ == "__main__": - if len(sys.argv) < 2: - raise SystemExit("usage: check-dma.py BOARD.dtb [BOARD.dtb ...]") - for argument in sys.argv[1:]: - check(pathlib.Path(argument)) From fcae20144e243ecdca6699dca9b0f213ee566ec8 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:02:04 +1100 Subject: [PATCH 65/79] dt-bindings: apple: reuse the APR binding and name audio bindings by generic compatible Extend the existing ProRes resource contract for the T6041 variant rather than carrying a separate SoC binding. Keep each firmware audio endpoint binding under its generic compatible name, following DT2 conventions. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/media/apple,prores.yaml | 39 ++++++++- .../bindings/media/apple,t6041-prores.yaml | 60 -------------- .../sound/apple,audio-firmware-services.yaml | 79 ------------------- .../sound/apple,audio-leap-loopback.yaml | 36 +++++++++ .../sound/apple,audio-listening-client.yaml | 31 ++++++++ .../sound/apple,audio-low-power-mic.yaml | 31 ++++++++ .../sound/apple,audio-mca-loopback.yaml | 36 +++++++++ .../sound/apple,audio-mic-buffer.yaml | 35 ++++++++ .../sound/apple,audio-mic-injection.yaml | 34 ++++++++ .../sound/apple,audio-speaker-tap.yaml | 34 ++++++++ .../sound/apple,audio-voice-trigger.yaml | 31 ++++++++ .../boot/dts/apple/t6040-peripherals.dtsi | 1 + 12 files changed, 304 insertions(+), 143 deletions(-) delete mode 100644 Documentation/devicetree/bindings/media/apple,t6041-prores.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml create mode 100644 Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml diff --git a/Documentation/devicetree/bindings/media/apple,prores.yaml b/Documentation/devicetree/bindings/media/apple,prores.yaml index 07afac17ef2ee..4124c331a9f8c 100644 --- a/Documentation/devicetree/bindings/media/apple,prores.yaml +++ b/Documentation/devicetree/bindings/media/apple,prores.yaml @@ -16,17 +16,23 @@ description: | properties: compatible: - const: apple,t8140-prores + oneOf: + - const: apple,t8140-prores + - items: + - const: apple,t6041-prores + - const: apple,prores reg: - items: - - description: Engine registers - - description: Wrapper registers + minItems: 2 + maxItems: 3 + description: Engine, wrapper and (on T6041) auxiliary register windows. reg-names: + minItems: 2 items: - const: core - const: wrapper + - const: aux interrupts: minItems: 1 @@ -58,6 +64,31 @@ required: - iommus - power-domains +allOf: + - if: + properties: + compatible: + contains: + const: apple,t6041-prores + then: + properties: + reg: + minItems: 3 + maxItems: 3 + reg-names: + minItems: 3 + maxItems: 3 + interrupts: + maxItems: 1 + required: + - resets + else: + properties: + reg: + maxItems: 2 + reg-names: + maxItems: 2 + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml b/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml deleted file mode 100644 index 96ffef4dbbca4..0000000000000 --- a/Documentation/devicetree/bindings/media/apple,t6041-prores.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/media/apple,t6041-prores.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple T6041 ProRes engine - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - T6041 APR engine, wrapper and auxiliary register banks. This resource - layout is distinct from the T8140 APR binding and must not select that - generation's driver. - -select: - properties: - compatible: - contains: - const: apple,t6041-prores - required: - - compatible - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-prores - - const: apple,prores - - reg: - minItems: 3 - maxItems: 3 - description: Register apertures in hardware-description order. - - interrupts: - minItems: 1 - maxItems: 1 - - power-domains: - minItems: 1 - maxItems: 1 - - iommus: - minItems: 1 - maxItems: 1 - - resets: - maxItems: 1 - -required: - - compatible - - reg - - interrupts - - power-domains - - resets - - iommus - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml b/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml deleted file mode 100644 index c205aa516a552..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-firmware-services.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-firmware-services.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple firmware audio service endpoints - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio services published separately from the active sound card. - These endpoints identify voice-trigger, loopback, low-power microphone, - shared microphone buffer and listening clients. A service has no AP MMIO - aperture. DMA references describe ADMAC channel ownership, not permission - to reset a firmware-owned audio fabric or start an audio stream. - These endpoints remain disabled until their host client and ownership - protocol have been qualified. No acoustic tuning or buffer contents are - static hardware properties. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-audio-leap-loopback - - const: apple,audio-leap-loopback - - items: - - const: apple,t6041-audio-listening-client - - const: apple,audio-listening-client - - items: - - const: apple,t6041-audio-low-power-mic - - const: apple,audio-low-power-mic - - items: - - const: apple,t6041-audio-mca-loopback - - const: apple,audio-mca-loopback - - items: - - const: apple,t6041-audio-mic-buffer - - const: apple,audio-mic-buffer - - items: - - const: apple,t6041-audio-voice-trigger - - const: apple,audio-voice-trigger - - items: - - const: apple,t8140-audio-leap-loopback - - const: apple,audio-leap-loopback - - items: - - const: apple,t8140-audio-listening-client - - const: apple,audio-listening-client - - items: - - const: apple,t8140-audio-low-power-mic - - const: apple,audio-low-power-mic - - items: - - const: apple,t8140-audio-mca-loopback - - const: apple,audio-mca-loopback - - items: - - const: apple,t8140-audio-mic-buffer - - const: apple,audio-mic-buffer - - items: - - const: apple,t8140-audio-mic-injection - - const: apple,audio-mic-injection - - items: - - const: apple,t8140-audio-speaker-tap - - const: apple,audio-speaker-tap - - items: - - const: apple,t8140-audio-voice-trigger - - const: apple,audio-voice-trigger - - dmas: - minItems: 1 - maxItems: 2 - - iommus: - minItems: 1 - maxItems: 2 - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml b/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml new file mode 100644 index 0000000000000..50dc5c5f685b2 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-leap-loopback.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple leap loopback firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-leap-loopback + - apple,t8140-audio-leap-loopback + - const: apple,audio-leap-loopback + + dmas: + minItems: 2 + maxItems: 2 + +required: + - compatible + - dmas + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml b/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml new file mode 100644 index 0000000000000..3558bb37de1e1 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-listening-client.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple listening client firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-listening-client + - apple,t8140-audio-listening-client + - const: apple,audio-listening-client + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml b/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml new file mode 100644 index 0000000000000..798fa55ff313a --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-low-power-mic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple low power mic firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-low-power-mic + - apple,t8140-audio-low-power-mic + - const: apple,audio-low-power-mic + +required: + - compatible + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml new file mode 100644 index 0000000000000..beed35f018c69 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-mca-loopback.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple mca loopback firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-mca-loopback + - apple,t8140-audio-mca-loopback + - const: apple,audio-mca-loopback + + dmas: + minItems: 2 + maxItems: 2 + +required: + - compatible + - dmas + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml new file mode 100644 index 0000000000000..85350cf05fd7e --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-mic-buffer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple mic buffer firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-mic-buffer + - apple,t8140-audio-mic-buffer + - const: apple,audio-mic-buffer + + iommus: + maxItems: 1 + +required: + - compatible + - iommus + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml new file mode 100644 index 0000000000000..d7c9713a9d241 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-mic-injection.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple mic injection firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t8140-audio-mic-injection + - const: apple,audio-mic-injection + + dmas: + maxItems: 1 + +required: + - compatible + - dmas + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml b/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml new file mode 100644 index 0000000000000..0f42cf7ae40a0 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-speaker-tap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple speaker tap firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t8140-audio-speaker-tap + - const: apple,audio-speaker-tap + + dmas: + maxItems: 1 + +required: + - compatible + - dmas + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml b/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml new file mode 100644 index 0000000000000..154839a2e053b --- /dev/null +++ b/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/apple,audio-voice-trigger.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple voice trigger firmware audio service + +maintainers: + - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> + +description: | + Firmware audio service endpoint, separate from the active sound card. + It has no independently published AP MMIO aperture. DMA and DART + references describe the service resources, without transferring audio + fabric ownership or authorizing a stream to start. The endpoint remains + disabled until its host client and ownership protocol are qualified. + Acoustic tuning and runtime buffer contents are not static properties. + +properties: + compatible: + items: + - enum: + - apple,t6041-audio-voice-trigger + - apple,t8140-audio-voice-trigger + - const: apple,audio-voice-trigger + +required: + - compatible + +additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index 81685adca2cb9..53e986ddbf96b 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -178,6 +178,7 @@ reg = <0x3 0x01000000 0x0 0x4000>, <0x3 0x00000000 0x0 0x1000000>, <0x3 0x010c0000 0x0 0x4000>; + reg-names = "core", "wrapper", "aux"; interrupt-parent = <&aic>; interrupts = ; power-domains = <&ps_scodec>; From e3ad94b3bf27714d00f80a403aa6fe8dd5b6a6e9 Mon Sep 17 00:00:00 2001 From: Ryan <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:09:34 +1100 Subject: [PATCH 66/79] ci: mask phandles inside byte-string schema messages too dt-schema prints some invalid phandle-array values as Python byte strings (b'\x00\x00\x01\x07'), so a renumbering showed up as new warnings (4 on the j375d dpaudio nodes for linux#1094). Mask those like the [[...]] cell lists. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- scripts/dtc/apple-dt-check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dtc/apple-dt-check.sh b/scripts/dtc/apple-dt-check.sh index 57c2b1f110d7e..04b634e886427 100755 --- a/scripts/dtc/apple-dt-check.sh +++ b/scripts/dtc/apple-dt-check.sh @@ -17,7 +17,8 @@ warnings() { # rev tag local rc=$? grep -E '\.dtb: |[Ww]arning|rror' "$W/$2.log" | grep -v '^ ' | sed -E "s#$t/##g; s#$o/##g" | - perl -pe 's{(\[\[[^:]*?\]\])}{(my $x = $1) =~ s/\d+/N/g; $x}ge' | sort -u > "$W/$2.warn" + perl -pe 's{(\[\[[^:]*?\]\])}{(my $x = $1) =~ s/\d+/N/g; $x}ge; s{b\x27(?:\\.|[^\x27])*\x27}{b\x27N\x27}g' | + sort -u > "$W/$2.warn" echo "$2: make rc=$rc, $(wc -l < "$W/$2.warn") warning lines, $(echo $dtbs | wc -w) DTBs" return $rc } From b00bf129df0c7eaa324729fe54dda0ee21978df9 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:17:39 +1100 Subject: [PATCH 67/79] dt-bindings: apple: use the single-entry cell-array schema form The schema checker requires only maxItems for unconstrained single-entry cell arrays. Remove redundant minItems declarations without changing their effective bounds. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- Documentation/devicetree/bindings/crypto/apple,aes.yaml | 3 --- .../devicetree/bindings/display/apple,dcp-expert.yaml | 1 - Documentation/devicetree/bindings/display/apple,dpin.yaml | 2 -- Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml | 2 -- Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml | 2 -- .../devicetree/bindings/mailbox/apple,secure-mailbox.yaml | 2 -- Documentation/devicetree/bindings/media/apple,scaler.yaml | 1 - Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml | 2 -- .../devicetree/bindings/soc/apple/apple,cpu-debug.yaml | 1 - .../devicetree/bindings/soc/apple/apple,debug-dock.yaml | 1 - Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml | 3 --- Documentation/devicetree/bindings/soc/apple/apple,esm.yaml | 2 -- Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml | 2 -- .../devicetree/bindings/timer/apple,aic-timebase.yaml | 1 - .../devicetree/bindings/timer/apple,secure-timebase.yaml | 1 - .../devicetree/bindings/watchdog/apple,secure-watchdog.yaml | 1 - arch/arm64/boot/dts/apple/t8140-j700.dts | 1 - 17 files changed, 28 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/apple,aes.yaml b/Documentation/devicetree/bindings/crypto/apple,aes.yaml index 516a7ae14036f..1b55625851940 100644 --- a/Documentation/devicetree/bindings/crypto/apple,aes.yaml +++ b/Documentation/devicetree/bindings/crypto/apple,aes.yaml @@ -29,15 +29,12 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 power-domains: - minItems: 1 maxItems: 1 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml b/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml index a0b34e37f6d1f..d8cb7328d7df0 100644 --- a/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml +++ b/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml @@ -30,7 +30,6 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/display/apple,dpin.yaml b/Documentation/devicetree/bindings/display/apple,dpin.yaml index a58aef9bb9c3c..340d078c054d1 100644 --- a/Documentation/devicetree/bindings/display/apple,dpin.yaml +++ b/Documentation/devicetree/bindings/display/apple,dpin.yaml @@ -20,12 +20,10 @@ properties: - const: apple,dpin reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml b/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml index 157a640a5ea32..530b4f7402804 100644 --- a/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml +++ b/Documentation/devicetree/bindings/dma/apple,pcie-piodma.yaml @@ -26,11 +26,9 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml b/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml index 18313d789cd7b..7381a24bba808 100644 --- a/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml +++ b/Documentation/devicetree/bindings/dma/apple,pciec-piodma.yaml @@ -26,11 +26,9 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml index 0bdb3a73cadc5..d9a92eefd1356 100644 --- a/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/apple,secure-mailbox.yaml @@ -21,7 +21,6 @@ properties: - const: apple,secure-mailbox reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. @@ -30,7 +29,6 @@ properties: maxItems: 2 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/media/apple,scaler.yaml b/Documentation/devicetree/bindings/media/apple,scaler.yaml index 62ae10462d76b..b5f2f5b0e50eb 100644 --- a/Documentation/devicetree/bindings/media/apple,scaler.yaml +++ b/Documentation/devicetree/bindings/media/apple,scaler.yaml @@ -42,7 +42,6 @@ properties: maxItems: 2 clocks: - minItems: 1 maxItems: 1 resets: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml b/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml index 3bb8d1a5ff384..54e5b2d87d875 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,aop2.yaml @@ -30,11 +30,9 @@ properties: maxItems: 4 power-domains: - minItems: 1 maxItems: 1 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml b/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml index 1770af2c28fc1..da180b772ad2d 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,cpu-debug.yaml @@ -26,7 +26,6 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml b/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml index 836fa12906e65..ec730e0b96211 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,debug-dock.yaml @@ -20,7 +20,6 @@ properties: - const: apple,debug-dock reg: - minItems: 1 maxItems: 1 interrupts: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml b/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml index f6d84bf0f371c..e067b3f3665b9 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,dwi.yaml @@ -24,16 +24,13 @@ properties: - const: apple,dwi reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 power-domains: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml b/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml index f9f73a9215b99..0565bb2dfdf95 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,esm.yaml @@ -21,7 +21,6 @@ properties: - const: apple,esm reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. @@ -30,7 +29,6 @@ properties: maxItems: 2 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml b/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml index 24e8e20f688a5..15e3e504b06ba 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,rsm.yaml @@ -25,11 +25,9 @@ properties: description: Register apertures in hardware-description order. interrupts: - minItems: 1 maxItems: 1 iommus: - minItems: 1 maxItems: 1 required: diff --git a/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml b/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml index 8e31d99e85792..19a606988c907 100644 --- a/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml +++ b/Documentation/devicetree/bindings/timer/apple,aic-timebase.yaml @@ -20,7 +20,6 @@ properties: - const: apple,aic-timebase reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. diff --git a/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml b/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml index 527cf5841a6e1..e2f3489775fbd 100644 --- a/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml +++ b/Documentation/devicetree/bindings/timer/apple,secure-timebase.yaml @@ -20,7 +20,6 @@ properties: - const: apple,secure-timebase reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. diff --git a/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml b/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml index 83e6ebc7e17ff..706d1ed52ef64 100644 --- a/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml +++ b/Documentation/devicetree/bindings/watchdog/apple,secure-watchdog.yaml @@ -20,7 +20,6 @@ properties: - const: apple,secure-watchdog reg: - minItems: 1 maxItems: 1 description: Register apertures in hardware-description order. diff --git a/arch/arm64/boot/dts/apple/t8140-j700.dts b/arch/arm64/boot/dts/apple/t8140-j700.dts index 60bf9b2c84541..030b98b270cda 100644 --- a/arch/arm64/boot/dts/apple/t8140-j700.dts +++ b/arch/arm64/boot/dts/apple/t8140-j700.dts @@ -2015,4 +2015,3 @@ swclk-gpios = <&pinctrl_ap 86 GPIO_ACTIVE_HIGH>; swdio-gpios = <&pinctrl_ap 85 GPIO_ACTIVE_HIGH>; }; - From 4d813137b70ea439cdaa33ceb3beb2e88f71c3ed Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:18:33 +1100 Subject: [PATCH 68/79] Revert "arm64: dts: apple: t8103: Enable SIO on every board" Keep SIO enabled only on the J274 for now. Nobody here has booted J293, J313, J456 or J457 with SIO on, and the node comment says the boot loader has to bring SIO up first. The enable moves to its own change that waits for a tester; this series stays description and bindings only. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8103-j274.dts | 6 ++++++ arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts index c6fd6580f56b7..2d491408f32cb 100644 --- a/arch/arm64/boot/dts/apple/t8103-j274.dts +++ b/arch/arm64/boot/dts/apple/t8103-j274.dts @@ -19,6 +19,7 @@ aliases { ethernet0 = ðernet0; + sio = &sio; }; }; @@ -26,6 +27,11 @@ apple,connector-type = "HDMI-A"; }; +/* remove once m1n1 enables sio nodes after setup */ +&sio { + status = "okay"; +}; + &dpaudio0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi index 40cf5bcfe4b13..77485eb85b0b3 100644 --- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi @@ -19,7 +19,6 @@ disp0-piodma = &disp0_piodma; serial0 = &serial0; serial2 = &serial2; - sio = &sio; wifi0 = &wifi0; atcphy0 = &atcphy0; atcphy1 = &atcphy1; @@ -222,11 +221,6 @@ }; }; -/* remove once m1n1 enables sio nodes after setup */ -&sio { - status = "okay"; -}; - &dpaudio1 { status = "okay"; }; From 59bb1a891c8eb50b84312f67313fff2f6b3a007c Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:18:34 +1100 Subject: [PATCH 69/79] Revert "arm64: dts: apple: t6022: Enable the ANE and die 0 SIO on J180" The die 0 ANE and the J180 die 0 SIO have not been booted on any T6022 Mac here. Move the enable to its own change that waits for a tester; this series stays description, bindings and the tested T600x fixes. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6022-j180d.dts | 6 ------ arch/arm64/boot/dts/apple/t6022.dtsi | 24 ----------------------- 2 files changed, 30 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6022-j180d.dts b/arch/arm64/boot/dts/apple/t6022-j180d.dts index bf0a526e912ba..91677000cc120 100644 --- a/arch/arm64/boot/dts/apple/t6022-j180d.dts +++ b/arch/arm64/boot/dts/apple/t6022-j180d.dts @@ -33,12 +33,6 @@ ethernet1 = ðernet1; nvram = &nvram; serial0 = &serial0; - /* - * The loader sets up and enables each SIO it finds by alias. - * The die 0 HDMI port's audio (dpaudio1) is fed by the die 0 - * SIO; t6022-jxxxd.dtsi only aliases the die 1 one as sio1. - */ - sio = &sio; usb4-0-acio = &usb4_0_acio; usb4-0-nhi = &usb4_0_nhi; usb4-1-acio = &usb4_1_acio; diff --git a/arch/arm64/boot/dts/apple/t6022.dtsi b/arch/arm64/boot/dts/apple/t6022.dtsi index 95de0fb2c36c1..4d0c94ce67d5b 100644 --- a/arch/arm64/boot/dts/apple/t6022.dtsi +++ b/arch/arm64/boot/dts/apple/t6022.dtsi @@ -405,27 +405,3 @@ }; #include "hwmon-common.dtsi" - -/* - * The die 0 ANE matches the M2 Pro and M2 Max one and the driver carries - * T6022 data, so enable it with its mailbox and DARTs as t6021.dtsi does. - */ -&ane { - status = "okay"; -}; - -&ane_dart0 { - status = "okay"; -}; - -&ane_dart1 { - status = "okay"; -}; - -&ane_dart2 { - status = "okay"; -}; - -&ane_mbox { - status = "okay"; -}; From d5be9a4117be81a37c685254c401552e88791c1f Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:18:35 +1100 Subject: [PATCH 70/79] Revert "arm64: dts: apple: t6002: Enable the ANE" The T6002 die 0 ANE has not been booted on any M1 Ultra here. Move the enable to its own change that waits for a tester. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- arch/arm64/boot/dts/apple/t6002.dtsi | 54 ---------------------------- 1 file changed, 54 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6002.dtsi b/arch/arm64/boot/dts/apple/t6002.dtsi index d5226019d484d..d34a03b374df5 100644 --- a/arch/arm64/boot/dts/apple/t6002.dtsi +++ b/arch/arm64/boot/dts/apple/t6002.dtsi @@ -380,57 +380,3 @@ }; #include "hwmon-common.dtsi" - -/* - * The die 0 ANE is the same block as on the M1 Pro and M1 Max, so enable it - * the way t6001.dtsi does: with its DARTs, the power states only it uses and - * the die 0 PMP report for its clock-level requests. - */ -&ane { - apple,performance-controller = <&pmp_report>; - power-domains = <&ps_ane_sys_cpu>, <&ps_ane_set1>, - <&ps_ane_set2>, <&ps_ane_set3>, <&ps_ane_set4>, <&ps_pms_sram>; - status = "okay"; -}; - -&ane_dart0 { - status = "okay"; -}; - -&ane_dart1 { - status = "okay"; -}; - -&ane_dart2 { - status = "okay"; -}; - -&ps_ane_base { - status = "okay"; -}; - -&ps_ane_set0 { - status = "okay"; -}; - -&ps_ane_set1 { - status = "okay"; -}; - -&ps_ane_set2 { - status = "okay"; -}; - -&ps_ane_set3 { - status = "okay"; -}; - -&ps_ane_set4 { - status = "okay"; -}; - -&pmp_report { - reg = <0x2 0x8e3c0000 0x0 0x20000>, - <0x2 0x85868000 0x0 0x4000>; - reg-names = "report", "ane-dvfs"; -}; From 35e0901e4881d8b932e1fa52ee2a6106b9a73d8b Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:19:52 +1100 Subject: [PATCH 71/79] dt-bindings: gpu: apple: allow named T8140 resources in either order T8140 resource consumers use reg-names. Accept the SGX-first order that gives the GPU its own unit address while preserving the existing ASC-first DTB interface. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../devicetree/bindings/gpu/apple,agx.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/gpu/apple,agx.yaml b/Documentation/devicetree/bindings/gpu/apple,agx.yaml index 882756aa0067d..87ecebae8d5c7 100644 --- a/Documentation/devicetree/bindings/gpu/apple,agx.yaml +++ b/Documentation/devicetree/bindings/gpu/apple,agx.yaml @@ -251,13 +251,17 @@ allOf: then: properties: reg: - items: - - description: GFX coprocessor control registers - - description: GPU block MMIO registers + minItems: 2 + maxItems: 2 + description: GPU and GFX coprocessor registers, ordered by reg-names. reg-names: - items: - - const: asc - - const: sgx + oneOf: + - items: + - const: asc + - const: sgx + - items: + - const: sgx + - const: asc mboxes: items: - description: GFX coprocessor mailbox From c711f5e3bf7b05488a28c1af580f8fd1035adfbd Mon Sep 17 00:00:00 2001 From: Ryan <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:45:52 +1100 Subject: [PATCH 72/79] ci: compare device trees against the current base branch tip pull_request.base.sha is the base tip recorded when the PR was opened, so a PR opened before newer integration merges was compared against an old tree and blamed for every warning those merges changed (97 'new' on #1030). Use the merge commit's first parent, which is the base tip the PR is actually merged into. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .github/workflows/dt-checks.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dt-checks.yml b/.github/workflows/dt-checks.yml index 2cb9403641a34..3b33a441be9d9 100644 --- a/.github/workflows/dt-checks.yml +++ b/.github/workflows/dt-checks.yml @@ -57,10 +57,13 @@ jobs: - name: CHECK_DTBS and dt_binding_check, base vs head env: - BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + EVENT: ${{ github.event_name }} + BEFORE: ${{ github.event.before }} run: | head=$(git rev-parse HEAD) - base=$BASE + # A pull request is checked out as its merge into the CURRENT base branch tip, which is + # HEAD^1 (pull_request.base.sha can be the stale tip from when the PR was opened). + if [ "$EVENT" = pull_request ]; then base=$(git rev-parse HEAD^1); else base=$BEFORE; fi if [ -z "$base" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then base=$(git rev-parse HEAD~1); fi scripts/dtc/apple-dt-check.sh "$base" "$head" "$RUNNER_TEMP/dt" From 36f3a97e1255b2f92964fbd28334161e687edbc3 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:51:54 +1100 Subject: [PATCH 73/79] arm64: dts: apple: describe disabled T8140 EDAC register banks Retain the native error and event bank resources for future qualified T8140 status decoding. Reuse the generic EDAC binding with SoC-specific resource counts. Both instances remain disabled; preserve the current qualified T6041 NI register contract. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../edac/apple,soc-error-handler.yaml | 16 +++++++-- arch/arm64/boot/dts/apple/t8140.dtsi | 33 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml b/Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml index 71053bd3841a5..157b0f836b1e3 100644 --- a/Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml +++ b/Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml @@ -35,10 +35,13 @@ properties: maxItems: 89 reg: - minItems: 25 + minItems: 10 maxItems: 25 description: | - T6041 per-source NI0 through NI6 status apertures, in interrupt order. + T6041 uses the qualified per-source NI status apertures in interrupt + order. T8140 publishes its native error/event register banks in + hardware-description order; their presence does not establish safe + AP access and the instances remain disabled until qualified. required: - compatible @@ -55,6 +58,9 @@ allOf: interrupts: minItems: 89 maxItems: 89 + reg: + minItems: 25 + maxItems: 25 required: - reg - if: @@ -67,6 +73,9 @@ allOf: interrupts: minItems: 26 maxItems: 26 + reg: + minItems: 17 + maxItems: 17 - if: properties: compatible: @@ -87,6 +96,9 @@ allOf: interrupts: minItems: 9 maxItems: 9 + reg: + minItems: 10 + maxItems: 10 additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index fbe4314221cff..b98c374805216 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -474,8 +474,26 @@ }; }; - error-handler { + error-handler@220000000 { compatible = "apple,t8140-error-handler", "apple,soc-error-handler"; + /* ADT /arm-io/error-handler banks; firmware/AP access is unqualified. */ + reg = <0x2 0x20000000 0x0 0x2f000000>, + <0x2 0x80d00000 0x0 0x40000>, + <0x2 0x80900000 0x0 0x8000>, + <0x3 0x00000000 0x0 0x70000>, + <0x3 0x00728000 0x0 0x4000>, + <0x3 0x082dc000 0x0 0x18000>, + <0x3 0x003d0000 0x0 0x4000>, + <0x3 0x00768000 0x0 0x4000>, + <0x3 0x02000000 0x0 0x1000000>, + <0x2 0x4f000000 0x0 0x4000>, + <0x2 0x50000000 0x0 0x4000>, + <0x2 0x51000000 0x0 0x4000>, + <0x2 0x52000000 0x0 0x4000>, + <0x2 0x5f000000 0x0 0x4000>, + <0x2 0x6f000000 0x0 0x4000>, + <0x2 0x5300a000 0x0 0x9a4>, + <0x2 0x54000000 0x0 0x20000>; interrupt-parent = <&aic>; interrupts = , , @@ -507,8 +525,19 @@ status = "disabled"; }; - event-log-handler { + event-log-handler@300700000 { compatible = "apple,t8140-event-log", "apple,soc-event-log"; + /* ADT /arm-io/event-log-handler banks; firmware/AP access is unqualified. */ + reg = <0x3 0x00700000 0x0 0xcc000>, + <0x3 0x08280000 0x0 0x80000>, + <0x3 0x00000000 0x0 0x70000>, + <0x3 0x08200000 0x0 0x7c000>, + <0x3 0x0028c000 0x0 0x4000>, + <0x3 0x00280000 0x0 0x8000>, + <0x4 0x01878000 0x0 0x4000>, + <0x4 0x01868000 0x0 0x8000>, + <0x3 0x02800000 0x0 0xbc000>, + <0x3 0x02900000 0x0 0x4000>; interrupt-parent = <&aic>; interrupts = , , From 7801f81ca057673162aefad164fea6fc8af2d512 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:22:25 +1100 Subject: [PATCH 74/79] soc: apple: clpc: raise DRAM and fabric floors for ANE work On the Neo (T8140) nothing raises the memory controller (DCS) or the SoC fabric while the Neural Engine runs: the CLPC only follows CPU and GPU load. A MobileNetV1 EXECUTE then takes 2.3-2.5 ms. With DCS 4 and fabric 3, the floor the GPU already gets for streaming work, it takes 1.25-1.31 ms; the engine time drops from 1.8-2.0 ms to about 1.0 ms. Add an ANE input next to the host GPU one. A driver gets a client with apple_clpc_ane_get() and reports work in flight with apple_clpc_ane_set_active(). The client has its own reference, so a late publication or put after the CLPC went away is harmless, and getting it never defers: without a bound CLPC the ANE runs without the floor. An idle-to-active edge samples at once, a request shorter than the sampling period is latched until the next sample, and the per-SoC ANE rail states then merge with the CPU and GPU demand under the usual hold. T8140 asks for DCS 4 and fabric 3. Other SoCs have no ANE input. A root-only debugfs file, ane_states, overrides the two states (clamped to each rail) for measurements, and the status file reports the ANE input and reason bit 32. KUnit covers demand and hold, short requests, provider removal, cold wake, a missing provider and the state overrides. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- MAINTAINERS | 1 + drivers/soc/apple/clpc.c | 352 ++++++++++++++++++++++++++++- drivers/soc/apple/clpc.kunitconfig | 11 + include/linux/soc/apple/clpc.h | 16 ++ 4 files changed, 376 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/apple/clpc.kunitconfig diff --git a/MAINTAINERS b/MAINTAINERS index 94db75cad4059..1723d610bd6a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2791,6 +2791,7 @@ F: tools/asahi/apple-pwm-pm-tests.py F: drivers/reset/reset-apple-cio.c F: drivers/rtc/rtc-macsmc.c F: drivers/soc/apple/* +F: drivers/soc/apple/clpc.kunitconfig F: tools/asahi/pmp-bootargs-tests.rs F: drivers/spi/spi-apple-test.c F: drivers/spi/spi-apple.c diff --git a/drivers/soc/apple/clpc.c b/drivers/soc/apple/clpc.c index c7b29f0e6a49b..fa94e1d522937 100644 --- a/drivers/soc/apple/clpc.c +++ b/drivers/soc/apple/clpc.c @@ -3,9 +3,9 @@ * Apple SoC host performance controller (CLPC) floors * * On macOS the CLPC raises the floor of the memory controller (DCS) and the - * SoC fabric while the CPU clusters or the GPU are busy, through its own + * SoC fabric while CPU clusters, the GPU or the ANE are busy, through its own * voter agent in the PMC. This driver keeps that agent's floor in step with - * Linux CPU load: + * Linux demand: * * - every sampling period, each cpufreq policy reports how busy its * busiest CPU was and how fast the policy runs relative to its maximum; @@ -38,6 +38,7 @@ #include #include #include +#include #include #define APPLE_CLPC_MAX_CLUSTERS 8 @@ -78,6 +79,7 @@ enum apple_clpc_rail { * @pmp_agent, limits the DCS, see apple_clpc_gpu_limited() * @gpu_dense: submissions per sampling period that make light GPU work * dense, see apple_clpc_gpu_dense(); 0 for none + * @ane: state of each rail while ANE work is in flight; all zero disables input * @gpu_input: the GPU driver reports its work in flight through * apple_clpc_gpu_get(); while there is some, both rails go to the top * of @map @@ -93,6 +95,7 @@ struct apple_clpc_hw { unsigned int pmp_agent; unsigned int gpu_dense; bool gpu_input; + u8 ane[APPLE_CLPC_RAILS]; }; struct apple_clpc_cluster { @@ -119,6 +122,18 @@ struct apple_clpc_gpu { struct delayed_work *wake; }; +/* One ANE publisher, with storage surviving provider removal. */ +struct apple_clpc_ane { + struct kref ref; + /* Protects activity, event metadata and wake across provider removal. */ + spinlock_t lock; + bool active; + bool pending; + u64 updated_ns; + u64 sequence; + struct delayed_work *wake; +}; + struct apple_clpc { struct device *dev; struct device *pmc; @@ -144,6 +159,8 @@ struct apple_clpc { struct dentry *debugfs; struct regmap *gpu_pmgr; struct apple_clpc_gpu *gpu; + struct apple_clpc_ane *ane; + unsigned int ane_states[APPLE_CLPC_RAILS]; u32 last_floor; u32 last_reason; u64 last_vote_ns; @@ -283,6 +300,118 @@ static void apple_clpc_gpu_owner_put(void *data) kref_put(&gpu->ref, apple_clpc_gpu_free); } +static void apple_clpc_ane_free(struct kref *ref) +{ + kfree(container_of(ref, struct apple_clpc_ane, ref)); +} + +void apple_clpc_ane_set_active(struct apple_clpc_ane *ane, bool active) +{ + unsigned long flags; + + if (!ane) + return; + spin_lock_irqsave(&ane->lock, flags); + if (active && !ane->active) { + /* Preserve even an EXECUTE shorter than the first queued sample. */ + ane->pending = true; + if (ane->wake) + mod_delayed_work(system_freezable_power_efficient_wq, ane->wake, 0); + } + ane->active = active; + ane->updated_ns = ktime_get_mono_fast_ns(); + ane->sequence++; + spin_unlock_irqrestore(&ane->lock, flags); +} +EXPORT_SYMBOL_GPL(apple_clpc_ane_set_active); + +void apple_clpc_ane_put(struct apple_clpc_ane *ane) +{ + if (ane) { + apple_clpc_ane_set_active(ane, false); + kref_put(&ane->ref, apple_clpc_ane_free); + } +} +EXPORT_SYMBOL_GPL(apple_clpc_ane_put); + +int apple_clpc_ane_get(struct device *dev, struct apple_clpc_ane **out) +{ + struct device_node *np; + struct platform_device *provider; + struct apple_clpc *clpc; + + *out = NULL; + if (!dev->of_node) + return 0; + np = of_parse_phandle(dev->of_node, "apple,clpc", 0); + if (!np && !of_find_property(dev->of_node, "apple,clpc", NULL)) + np = of_find_compatible_node(NULL, NULL, "apple,t8140-clpc"); + if (!np) + return 0; + if (!of_device_is_compatible(np, "apple,t8140-clpc")) { + of_node_put(np); + return 0; + } + provider = of_find_device_by_node(np); + of_node_put(np); + if (!provider) + return 0; + /* + * Optional input: never defer ANE startup for an absent CLPC driver. + * No device link is needed: the independent reference protects late + * publications and puts after the provider has withdrawn its work. + */ + mutex_lock(&apple_clpc_clients_lock); + clpc = dev_get_drvdata(&provider->dev); + if (device_is_bound(&provider->dev) && clpc && clpc->ane && + refcount_read(&clpc->ane->ref.refcount) == 1) { + kref_get(&clpc->ane->ref); + *out = clpc->ane; + } + mutex_unlock(&apple_clpc_clients_lock); + put_device(&provider->dev); + return 0; +} +EXPORT_SYMBOL_GPL(apple_clpc_ane_get); + +static void apple_clpc_ane_owner_put(void *data) +{ + struct apple_clpc_ane *ane = data; + + kref_put(&ane->ref, apple_clpc_ane_free); +} + +static void apple_clpc_ane_detach(struct apple_clpc_ane *ane) +{ + unsigned long flags; + + if (!ane) + return; + spin_lock_irqsave(&ane->lock, flags); + ane->wake = NULL; + spin_unlock_irqrestore(&ane->lock, flags); +} + +/* Called under sample_lock, like the CPU and GPU demand inputs. */ +static bool apple_clpc_ane_input_demand(struct apple_clpc *clpc, unsigned int *demand) +{ + struct apple_clpc_ane *ane = clpc->ane; + unsigned long flags; + unsigned int rail; + bool active; + + if (!ane) + return false; + spin_lock_irqsave(&ane->lock, flags); + active = ane->active || ane->pending; + ane->pending = false; + spin_unlock_irqrestore(&ane->lock, flags); + if (active) + for (rail = 0; rail < APPLE_CLPC_RAILS; rail++) + demand[rail] = max(demand[rail], clpc->ane_states[rail]); + return active; +} + /* cpufreq policies can appear after probe; pick up new ones as they do. */ static void apple_clpc_find_clusters(struct apple_clpc *clpc) { @@ -569,6 +698,8 @@ static void apple_clpc_sample(struct apple_clpc *clpc) reason |= 1; if (apple_clpc_gpu_input_demand(clpc->hw, clpc->gpu, demand)) reason |= 2; + if (apple_clpc_ane_input_demand(clpc, demand)) + reason |= 32; if (clpc->gpu_pmgr) { /* Both run every sample: each tracks state across samples. */ bool late = time_after(now, clpc->gpu_sampled + @@ -647,7 +778,7 @@ static int apple_clpc_status_show(struct seq_file *s, void *unused) clpc->hw->rail[rail]), clpc->hw->map[rail][0], clpc->hw->map[rail][1], clpc->hw->map[rail][2], clpc->hw->map[rail][3]); - seq_printf(s, "last_vote: %#x reason_bits %#x sampled_ns %llu (cpu=1 host_gpu=2 streaming_gpu=4 dense_gpu=8 hold=16)\n", + seq_printf(s, "last_vote: %#x reason_bits %#x sampled_ns %llu (cpu=1 host_gpu=2 streaming_gpu=4 dense_gpu=8 hold=16 ane=32)\n", READ_ONCE(clpc->last_floor), READ_ONCE(clpc->last_reason), READ_ONCE(clpc->last_vote_ns)); if (clpc->gpu) { @@ -657,6 +788,20 @@ static int apple_clpc_status_show(struct seq_file *s, void *unused) seq_printf(s, "host_gpu: active %u request_ns %llu sequence %llu\n", active, updated, sequence); } + if (clpc->ane) { + struct apple_clpc_ane *ane = clpc->ane; + unsigned long flags; + u64 updated, sequence; + bool active; + + spin_lock_irqsave(&ane->lock, flags); + active = ane->active; + updated = ane->updated_ns; + sequence = ane->sequence; + spin_unlock_irqrestore(&ane->lock, flags); + seq_printf(s, "ane: active %u request_ns %llu sequence %llu\n", + active, updated, sequence); + } seq_printf(s, "samples: %lu update errors: %lu\n", clpc->samples, clpc->update_errors); if (clpc->gpu_pmgr) { @@ -684,6 +829,63 @@ static int apple_clpc_status_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(apple_clpc_status); +static int apple_clpc_ane_states_show(struct seq_file *s, void *unused) +{ + struct apple_clpc *clpc = s->private; + + guard(mutex)(&clpc->sample_lock); + seq_printf(s, "%u %u\n", clpc->ane_states[APPLE_CLPC_DCS], + clpc->ane_states[APPLE_CLPC_SOC]); + return 0; +} + +static int apple_clpc_ane_states_open(struct inode *inode, struct file *file) +{ + return single_open(file, apple_clpc_ane_states_show, inode->i_private); +} + +/* The top measured CPU/GPU states bound the rail's supported range. */ +static void apple_clpc_ane_states_set(struct apple_clpc *clpc, const int *states) +{ + unsigned int rail, top; + + for (rail = 0; rail < APPLE_CLPC_RAILS; rail++) { + top = max(clpc->hw->map[rail][APPLE_CLPC_LEVELS - 1], clpc->hw->gpu[rail]); + clpc->ane_states[rail] = clamp(states[rail], 0, (int)top); + } +} + +static ssize_t apple_clpc_ane_states_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + struct apple_clpc *clpc = ((struct seq_file *)file->private_data)->private; + char text[48], extra; + int states[APPLE_CLPC_RAILS]; + + if (!count || count >= sizeof(text)) + return -EINVAL; + if (copy_from_user(text, buf, count)) + return -EFAULT; + text[count] = '\0'; + if (sscanf(text, "%d %d %c", &states[APPLE_CLPC_DCS], + &states[APPLE_CLPC_SOC], &extra) != 2) + return -EINVAL; + guard(mutex)(&clpc->sample_lock); + apple_clpc_ane_states_set(clpc, states); + if (!READ_ONCE(clpc->stopped)) + mod_delayed_work(system_freezable_power_efficient_wq, &clpc->work, 0); + return count; +} + +static const struct file_operations apple_clpc_ane_states_fops = { + .owner = THIS_MODULE, + .open = apple_clpc_ane_states_open, + .read = seq_read, + .write = apple_clpc_ane_states_write, + .llseek = seq_lseek, + .release = single_release, +}; + static void apple_clpc_free_clusters(struct apple_clpc *clpc) { unsigned int i; @@ -728,8 +930,9 @@ static void apple_clpc_stop(void *data) clpc->gpu->wake = NULL; spin_unlock_irqrestore(&clpc->gpu->lock, flags); } - apple_clpc_halt(clpc); + apple_clpc_ane_detach(clpc->ane); debugfs_remove_recursive(clpc->debugfs); + apple_clpc_halt(clpc); apple_clpc_free_clusters(clpc); } @@ -763,6 +966,18 @@ static int apple_clpc_probe(struct platform_device *pdev) if (ret) return ret; } + if (clpc->hw->ane[APPLE_CLPC_DCS] || clpc->hw->ane[APPLE_CLPC_SOC]) { + clpc->ane = kzalloc_obj(*clpc->ane); + if (!clpc->ane) + return -ENOMEM; + kref_init(&clpc->ane->ref); + spin_lock_init(&clpc->ane->lock); + ret = devm_add_action_or_reset(dev, apple_clpc_ane_owner_put, clpc->ane); + if (ret) + return ret; + for (rail = 0; rail < APPLE_CLPC_RAILS; rail++) + clpc->ane_states[rail] = clpc->hw->ane[rail]; + } /* The property is optional: without it, CPU demand alone sets the floors. */ if (clpc->hw->gpu_demand) gpu = of_parse_phandle(dev->of_node, "apple,gpu-power-state", 0); @@ -827,10 +1042,17 @@ static int apple_clpc_probe(struct platform_device *pdev) if (clpc->gpu && !clpc->hw->gpu_demand) clpc->gpu->wake = &clpc->work; + if (clpc->ane) + clpc->ane->wake = &clpc->work; + clpc->debugfs = debugfs_create_dir(dev_name(dev), NULL); debugfs_create_file("status", 0400, clpc->debugfs, clpc, &apple_clpc_status_fops); + if (clpc->ane) + debugfs_create_file("ane_states", 0600, clpc->debugfs, clpc, + &apple_clpc_ane_states_fops); + ret = devm_add_action_or_reset(dev, apple_clpc_stop, clpc); if (ret) return ret; @@ -926,6 +1148,12 @@ static const struct apple_clpc_hw apple_clpc_hw_t8140 = { .pmp_backoff = true, .pmp_agent = 0, .gpu_dense = 2, + /* + * Measured ANE demand (Neo, MobileNetV1): DCS 4 alone takes an + * EXECUTE from 2.3-2.5 to 1.8 ms, DCS 4 with fabric 3 (the GPU's + * streaming floor) to 1.25-1.31 ms. + */ + .ane = { [APPLE_CLPC_DCS] = 4, [APPLE_CLPC_SOC] = 3 }, }; /* @@ -1126,7 +1354,123 @@ static void apple_clpc_t8132_gpu_input_test(struct kunit *test) apple_clpc_gpu_put(gpu); } +static void apple_clpc_ane_demand_hold_test(struct kunit *test) +{ + struct apple_clpc_ane ane = {}; + struct apple_clpc_vote vote = {}; + struct apple_clpc *clpc = kunit_kzalloc(test, sizeof(*clpc), GFP_KERNEL); + unsigned int demand[APPLE_CLPC_RAILS] = {}; + unsigned long now = 100, hold = msecs_to_jiffies(APPLE_CLPC_HOLD_MS); + + KUNIT_ASSERT_NOT_NULL(test, clpc); + spin_lock_init(&ane.lock); + clpc->ane = &ane; + clpc->hw = &apple_clpc_hw_t8140; + clpc->ane_states[APPLE_CLPC_DCS] = clpc->hw->ane[APPLE_CLPC_DCS]; + clpc->ane_states[APPLE_CLPC_SOC] = clpc->hw->ane[APPLE_CLPC_SOC]; + KUNIT_EXPECT_FALSE(test, apple_clpc_ane_input_demand(clpc, demand)); + apple_clpc_ane_set_active(&ane, true); + KUNIT_EXPECT_TRUE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_DCS], 4u); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_SOC], 3u); + KUNIT_EXPECT_EQ(test, apple_clpc_vote(&vote, demand[APPLE_CLPC_DCS], now), 4u); + /* Demand continues across samples, without another publication. */ + now += hold; + KUNIT_EXPECT_TRUE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_EQ(test, apple_clpc_vote(&vote, demand[APPLE_CLPC_DCS], now), 4u); + apple_clpc_ane_set_active(&ane, false); + memset(demand, 0, sizeof(demand)); + KUNIT_EXPECT_FALSE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_EQ(test, apple_clpc_vote(&vote, demand[APPLE_CLPC_DCS], + now + hold - 1), 4u); + KUNIT_EXPECT_EQ(test, apple_clpc_vote(&vote, demand[APPLE_CLPC_DCS], + now + hold), 0u); + /* A request completing before the worker runs still earns the hold. */ + apple_clpc_ane_set_active(&ane, true); + apple_clpc_ane_set_active(&ane, false); + KUNIT_EXPECT_TRUE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_DCS], 4u); + KUNIT_EXPECT_FALSE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_GT(test, ane.updated_ns, 0ull); + KUNIT_EXPECT_EQ(test, ane.sequence, 4ull); +} + +static void apple_clpc_ane_states_test(struct kunit *test) +{ + struct apple_clpc *clpc = kunit_kzalloc(test, sizeof(*clpc), GFP_KERNEL); + struct apple_clpc_ane ane = {}; + unsigned int demand[APPLE_CLPC_RAILS] = { 5, 2 }; + int states[APPLE_CLPC_RAILS] = { 4, 3 }; + + KUNIT_ASSERT_NOT_NULL(test, clpc); + clpc->hw = &apple_clpc_hw_t8140; + clpc->ane = &ane; + spin_lock_init(&ane.lock); + apple_clpc_ane_states_set(clpc, states); + apple_clpc_ane_set_active(&ane, true); + KUNIT_EXPECT_TRUE(test, apple_clpc_ane_input_demand(clpc, demand)); + /* ANE cannot lower a concurrent CPU/GPU request. */ + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_DCS], 5u); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_SOC], 3u); + states[APPLE_CLPC_DCS] = -1; + states[APPLE_CLPC_SOC] = 100; + apple_clpc_ane_states_set(clpc, states); + KUNIT_EXPECT_EQ(test, clpc->ane_states[APPLE_CLPC_DCS], 0u); + KUNIT_EXPECT_EQ(test, clpc->ane_states[APPLE_CLPC_SOC], 3u); +} + +static void apple_clpc_ane_no_provider_test(struct kunit *test) +{ + struct apple_clpc *clpc = kunit_kzalloc(test, sizeof(*clpc), GFP_KERNEL); + struct apple_clpc_ane *ane = NULL; + unsigned int demand[APPLE_CLPC_RAILS] = {}; + struct device dev = {}; + + KUNIT_ASSERT_NOT_NULL(test, clpc); + KUNIT_EXPECT_EQ(test, apple_clpc_ane_get(&dev, &ane), 0); + KUNIT_EXPECT_PTR_EQ(test, ane, NULL); + apple_clpc_ane_set_active(ane, true); + apple_clpc_ane_set_active(ane, false); + apple_clpc_ane_put(ane); + KUNIT_EXPECT_FALSE(test, apple_clpc_ane_input_demand(clpc, demand)); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_DCS], 0u); + KUNIT_EXPECT_EQ(test, demand[APPLE_CLPC_SOC], 0u); + KUNIT_EXPECT_EQ(test, apple_clpc_hw_t6040.ane[APPLE_CLPC_DCS], 0); + KUNIT_EXPECT_EQ(test, apple_clpc_hw_t8132.ane[APPLE_CLPC_DCS], 0); + KUNIT_EXPECT_EQ(test, apple_clpc_hw_t8142.ane[APPLE_CLPC_DCS], 0); +} + +static void apple_clpc_ane_wake_removal_test(struct kunit *test) +{ + struct apple_clpc_ane *ane = kzalloc_obj(*ane); + struct apple_clpc_wake_test wake; + + KUNIT_ASSERT_NOT_NULL(test, ane); + kref_init(&ane->ref); + spin_lock_init(&ane->lock); + INIT_DELAYED_WORK(&wake.work, apple_clpc_wake_complete); + init_completion(&wake.done); + ane->wake = &wake.work; + kref_get(&ane->ref); + apple_clpc_ane_set_active(ane, true); + KUNIT_EXPECT_NE(test, wait_for_completion_timeout(&wake.done, HZ), 0ul); + /* Actual removal ordering: detach, drain, drop the provider reference. */ + apple_clpc_ane_detach(ane); + cancel_delayed_work_sync(&wake.work); + apple_clpc_ane_owner_put(ane); + reinit_completion(&wake.done); + apple_clpc_ane_set_active(ane, false); + apple_clpc_ane_set_active(ane, true); + KUNIT_EXPECT_FALSE(test, delayed_work_pending(&wake.work)); + KUNIT_EXPECT_FALSE(test, completion_done(&wake.done)); + apple_clpc_ane_put(ane); +} + static struct kunit_case apple_clpc_cases[] = { + KUNIT_CASE(apple_clpc_ane_demand_hold_test), + KUNIT_CASE(apple_clpc_ane_states_test), + KUNIT_CASE(apple_clpc_ane_no_provider_test), + KUNIT_CASE(apple_clpc_ane_wake_removal_test), KUNIT_CASE(apple_clpc_t8132_gpu_input_test), KUNIT_CASE(apple_clpc_gpu_dense_test), KUNIT_CASE(apple_clpc_gpu_cold_wake_test), diff --git a/drivers/soc/apple/clpc.kunitconfig b/drivers/soc/apple/clpc.kunitconfig new file mode 100644 index 0000000000000..b0e9a85d0905b --- /dev/null +++ b/drivers/soc/apple/clpc.kunitconfig @@ -0,0 +1,11 @@ +CONFIG_KUNIT=y +CONFIG_COMPILE_TEST=y +CONFIG_OF=y +CONFIG_PM=y +CONFIG_CPU_FREQ=y +CONFIG_APPLE_PMC=y +CONFIG_APPLE_CLPC=y +CONFIG_KASAN=y +CONFIG_KASAN_GENERIC=y +CONFIG_UBSAN=y +CONFIG_UBSAN_BOUNDS=y diff --git a/include/linux/soc/apple/clpc.h b/include/linux/soc/apple/clpc.h index 37b2cfce5594a..0a4c4f439ac56 100644 --- a/include/linux/soc/apple/clpc.h +++ b/include/linux/soc/apple/clpc.h @@ -7,11 +7,16 @@ #include struct apple_clpc_gpu; +struct apple_clpc_ane; #if IS_REACHABLE(CONFIG_APPLE_CLPC) int apple_clpc_gpu_get(struct device *dev, struct apple_clpc_gpu **out); void apple_clpc_gpu_set_active(struct apple_clpc_gpu *gpu, bool active); void apple_clpc_gpu_put(struct apple_clpc_gpu *gpu); +/* Optional, single-publisher input: success with NULL means no provider. */ +int apple_clpc_ane_get(struct device *dev, struct apple_clpc_ane **out); +void apple_clpc_ane_set_active(struct apple_clpc_ane *ane, bool active); +void apple_clpc_ane_put(struct apple_clpc_ane *ane); #else static inline int apple_clpc_gpu_get(struct device *dev, struct apple_clpc_gpu **out) { @@ -20,5 +25,16 @@ static inline int apple_clpc_gpu_get(struct device *dev, struct apple_clpc_gpu * } static inline void apple_clpc_gpu_set_active(struct apple_clpc_gpu *gpu, bool active) {} static inline void apple_clpc_gpu_put(struct apple_clpc_gpu *gpu) {} + +/* ANE remains usable when the optional floor provider is not reachable. */ +static inline int apple_clpc_ane_get(struct device *dev, struct apple_clpc_ane **out) +{ + *out = NULL; + return 0; +} + +static inline void apple_clpc_ane_set_active(struct apple_clpc_ane *ane, bool active) {} + +static inline void apple_clpc_ane_put(struct apple_clpc_ane *ane) {} #endif #endif From 171bd2c0e7db861a9dd516097c67932b96e99c5e Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:22:26 +1100 Subject: [PATCH 75/79] accel/ane: h17: hold the CLPC memory floor while an EXECUTE runs Get the CLPC ANE client at the program stage and report each EXECUTE through the session's busy hook, so the CLPC raises DRAM and the SoC fabric while the H17 engine works. Without a CLPC nothing changes. On the Neo this takes MobileNetV1 from 2.31-2.50 ms to 1.25-1.31 ms per EXECUTE (300 requests, three rounds, ane_states 0 0 against 4 3). Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- drivers/accel/ane/ane_fw_cold.c | 19 ++++++++++++++++++- drivers/accel/ane/ane_fw_cold_test.c | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/accel/ane/ane_fw_cold.c b/drivers/accel/ane/ane_fw_cold.c index 2c6914047cddd..5ea7e8fc865b8 100644 --- a/drivers/accel/ane/ane_fw_cold.c +++ b/drivers/accel/ane/ane_fw_cold.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "ane_fw_cold.h" @@ -62,6 +63,7 @@ struct ane_fw_backend { struct ane_fw_transport transport; /* Programs and their ABI 3 node, after the program stage. */ struct ane_h16_session session; + struct apple_clpc_ane *clpc; struct ane_fw_surface pool, ipc, heap; /* * For the cold boot after system sleep: the private TEXT/DATA copies, @@ -1519,10 +1521,18 @@ static void ane_fw_program_sync(void *ctx, const struct ane_fw_surface *s, bool dma_sync_single_for_cpu(b->memory, s->handle, s->size, DMA_BIDIRECTIONAL); } +static void ane_fw_program_busy(void *ctx, bool busy) +{ + struct ane_fw_backend *b = ctx; + + apple_clpc_ane_set_active(b->clpc, busy); +} + static const struct ane_h16_session_ops ane_fw_session_ops = { .map = ane_fw_program_map, .log = ane_fw_program_log, .sync = ane_fw_program_sync, + .busy = ane_fw_program_busy, }; /* @@ -1591,12 +1601,18 @@ static int ane_fw_program_stage(struct ane_fw_backend *b) b->transport.allow_free = true; ret = ane_h16_session_init(&b->session, &b->transport, &ane_fw_session_ops, b, ANE_FW_TIMEOUT_NS); + if (ret) + return ret; + ret = apple_clpc_ane_get(&b->pdev->dev, &b->clpc); if (ret) return ret; b->session.gate_hold_ns = ANE_FW_GATE_HOLD_NS; ret = ane_h16_accel_register(&b->pdev->dev, &b->session); - if (ret) + if (ret) { + apple_clpc_ane_put(b->clpc); + b->clpc = NULL; return ret; + } ane_fw_debugfs(b); dev_info(&b->pdev->dev, "ANE program: session and ABI 3 node ready\n"); return 0; @@ -1775,6 +1791,7 @@ static void ane_fw_observer_free(struct ane_fw_backend *b) iounmap(b->pmgr); if (b->gate) iounmap(b->gate); + apple_clpc_ane_put(b->clpc); put_device(&b->pdev->dev); kfree(b); } diff --git a/drivers/accel/ane/ane_fw_cold_test.c b/drivers/accel/ane/ane_fw_cold_test.c index 5b1f526299508..d05cb3569f3e2 100644 --- a/drivers/accel/ane/ane_fw_cold_test.c +++ b/drivers/accel/ane/ane_fw_cold_test.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT #include #include +#include #include "ane_fw_cold.h" #include "ane_fw_sleep.h" @@ -337,7 +338,25 @@ static void ane_cold_rvbar_test(struct kunit *test) KUNIT_EXPECT_EQ(test, ane_fw_rvbar_check(0x20000000001ULL, text), ANE_FW_RVBAR_FOREIGN); } +/* The boot/transport configs intentionally leave the floor driver disabled. */ +static void ane_cold_no_clpc_test(struct kunit *test) +{ +#if !IS_REACHABLE(CONFIG_APPLE_CLPC) + struct apple_clpc_ane *ane = NULL; + struct device dev = {}; + + KUNIT_EXPECT_EQ(test, apple_clpc_ane_get(&dev, &ane), 0); + KUNIT_EXPECT_PTR_EQ(test, ane, NULL); + apple_clpc_ane_set_active(ane, true); + apple_clpc_ane_set_active(ane, false); + apple_clpc_ane_put(ane); +#else + kunit_skip(test, "CLPC enabled; absence is covered by the CLPC suite"); +#endif +} + static struct kunit_case ane_cold_cases[] = { + KUNIT_CASE(ane_cold_no_clpc_test), KUNIT_CASE(ane_cold_restartable_test), KUNIT_CASE(ane_cold_rvbar_test), KUNIT_CASE(ane_cold_sleep_test), From c3927c878145967185cab992601453f901a140dc Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:27:42 +1100 Subject: [PATCH 76/79] arm64: dts: apple: place new MMIO devices on the SoC bus Preserve the established GPU path, named-resource order and loader reservation forms. Put new physical resource descriptors under /soc. Waive unqualified native firmware objects instead of representing them as root platform devices, and remove their unused bindings. Keep routed existing interfaces and the real ADMAC pair-count correction. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- .../bindings/clock/apple,nco-service.yaml | 41 --- .../bindings/display/apple,dcp-expert.yaml | 40 --- .../display/apple,dcp-ioreporting.yaml | 27 -- .../display/apple,sac-controller.yaml | 33 -- .../display/apple,secure-display-pipe.yaml | 36 -- .../devicetree/bindings/gpu/apple,agx.yaml | 16 +- .../media/apple,isp-service-proxy.yaml | 26 -- .../bindings/soc/apple/apple,debug-port.yaml | 38 --- .../soc/apple/apple,hid-transport-mux.yaml | 29 -- .../soc/apple/apple,processor-trace.yaml | 29 -- .../bindings/soc/apple/apple,sac-manager.yaml | 29 -- .../soc/apple/apple,wireless-debug-dock.yaml | 26 -- .../sound/apple,audio-dart-proxy.yaml | 31 -- .../sound/apple,audio-leap-loopback.yaml | 36 -- .../sound/apple,audio-listening-client.yaml | 31 -- .../sound/apple,audio-low-power-mic.yaml | 31 -- .../sound/apple,audio-mca-loopback.yaml | 36 -- .../sound/apple,audio-mic-buffer.yaml | 35 -- .../sound/apple,audio-mic-injection.yaml | 34 -- .../bindings/sound/apple,audio-mic-proxy.yaml | 26 -- .../sound/apple,audio-speaker-tap.yaml | 34 -- .../sound/apple,audio-voice-trigger.yaml | 31 -- .../bindings/sound/apple,smc-mogul.yaml | 37 -- .../bindings/sound/apple,t6030-dpaudio.yaml | 22 +- .../apple/t6040-j616s-extdisp-mem-loader.dtsi | 12 +- arch/arm64/boot/dts/apple/t6040-j616s.dts | 4 - .../boot/dts/apple/t6040-peripherals.dtsi | 150 +-------- .../arm64/boot/dts/apple/t604x-j614-j616.dtsi | 12 +- arch/arm64/boot/dts/apple/t604x.dtsi | 3 + arch/arm64/boot/dts/apple/t8140-j700.dts | 5 - .../boot/dts/apple/t8140-peripherals.dtsi | 318 +++++------------- arch/arm64/boot/dts/apple/t8140.dtsi | 97 +----- 32 files changed, 125 insertions(+), 1230 deletions(-) delete mode 100644 Documentation/devicetree/bindings/clock/apple,nco-service.yaml delete mode 100644 Documentation/devicetree/bindings/display/apple,dcp-expert.yaml delete mode 100644 Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml delete mode 100644 Documentation/devicetree/bindings/display/apple,sac-controller.yaml delete mode 100644 Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml delete mode 100644 Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml delete mode 100644 Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml delete mode 100644 Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml delete mode 100644 Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml delete mode 100644 Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml delete mode 100644 Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml delete mode 100644 Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml diff --git a/Documentation/devicetree/bindings/clock/apple,nco-service.yaml b/Documentation/devicetree/bindings/clock/apple,nco-service.yaml deleted file mode 100644 index 78c553ce9b7bf..0000000000000 --- a/Documentation/devicetree/bindings/clock/apple,nco-service.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/clock/apple,nco-service.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple firmware NCO clock service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware-managed numerically controlled oscillator service. Unlike the - directly programmed NCO binding, no AP register window is published. - The selectors identify clocks in the PMGR clock namespace. Their - firmware service association is preserved without assuming a direct - AP-programmable NCO input/output clock topology. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-nco-service - - const: apple,nco-service - - apple,clock-controller: - $ref: /schemas/types.yaml#/definitions/phandle - description: Provider defining the SoC hardware clock selector namespace. - - apple,clock-selectors: - $ref: /schemas/types.yaml#/definitions/uint32-array - minItems: 4 - maxItems: 4 - description: Clock selectors published for this firmware NCO service. - -required: - - compatible - - apple,clock-controller - - apple,clock-selectors - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml b/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml deleted file mode 100644 index d8cb7328d7df0..0000000000000 --- a/Documentation/devicetree/bindings/display/apple,dcp-expert.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/display/apple,dcp-expert.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple display expert control registers - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Display control and timing register apertures associated with a display - coprocessor. These registers can be shared with firmware-owned display - blocks and must not be accessed without an ownership handoff. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-dcp-expert - - const: apple,dcp-expert - - items: - - const: apple,t8140-dcp-expert - - const: apple,dcp-expert - - reg: - minItems: 3 - maxItems: 17 - description: Register apertures in hardware-description order. - - interrupts: - maxItems: 1 - -required: - - compatible - - reg - - interrupts - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml b/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml deleted file mode 100644 index 009c1df8f082d..0000000000000 --- a/Documentation/devicetree/bindings/display/apple,dcp-ioreporting.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/display/apple,dcp-ioreporting.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple secure display reporting service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Secure display coprocessor reporting endpoint. It is a firmware service - without an independently published AP MMIO window or interrupt. A host - client must establish the reporting transport and its lifecycle before - using it; the service is not an additional display engine. - -properties: - compatible: - items: - - const: apple,t8140-dcp-ioreporting - - const: apple,dcp-ioreporting - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,sac-controller.yaml b/Documentation/devicetree/bindings/display/apple,sac-controller.yaml deleted file mode 100644 index b2c2770fb5f2f..0000000000000 --- a/Documentation/devicetree/bindings/display/apple,sac-controller.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/display/apple,sac-controller.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple display SAC controller - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Display SAC firmware controller associated with the SAC manager. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-sac-controller - - const: apple,sac-controller - - items: - - const: apple,t8140-sac-controller - - const: apple,sac-controller - - apple,manager: - $ref: /schemas/types.yaml#/definitions/phandle - description: Firmware SAC manager. - -required: - - compatible - - apple,manager - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml b/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml deleted file mode 100644 index 8ec1c0ef71480..0000000000000 --- a/Documentation/devicetree/bindings/display/apple,secure-display-pipe.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/display/apple,secure-display-pipe.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple secure display pipeline - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Secure display pipeline firmware endpoint, its interrupts and DART - streams. Firmware retains control of the display registers. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-secure-display-pipe - - const: apple,secure-display-pipe - - interrupts: - minItems: 4 - maxItems: 4 - - iommus: - minItems: 2 - maxItems: 2 - -required: - - compatible - - interrupts - - iommus - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/gpu/apple,agx.yaml b/Documentation/devicetree/bindings/gpu/apple,agx.yaml index 87ecebae8d5c7..882756aa0067d 100644 --- a/Documentation/devicetree/bindings/gpu/apple,agx.yaml +++ b/Documentation/devicetree/bindings/gpu/apple,agx.yaml @@ -251,17 +251,13 @@ allOf: then: properties: reg: - minItems: 2 - maxItems: 2 - description: GPU and GFX coprocessor registers, ordered by reg-names. + items: + - description: GFX coprocessor control registers + - description: GPU block MMIO registers reg-names: - oneOf: - - items: - - const: asc - - const: sgx - - items: - - const: sgx - - const: asc + items: + - const: asc + - const: sgx mboxes: items: - description: GFX coprocessor mailbox diff --git a/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml b/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml deleted file mode 100644 index 217e3933f6868..0000000000000 --- a/Documentation/devicetree/bindings/media/apple,isp-service-proxy.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/media/apple,isp-service-proxy.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple image processor firmware service proxy - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Image processor secure firmware service endpoint. This is separate - from the AP image processor and has no AP register window. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-isp-service-proxy - - const: apple,isp-service-proxy - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml b/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml deleted file mode 100644 index 549ad92ccaf14..0000000000000 --- a/Documentation/devicetree/bindings/soc/apple/apple,debug-port.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/soc/apple/apple,debug-port.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple auxiliary on-chip debug port - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Auxiliary on-chip debug port. Firmware describes the port separately - from the processor debug MMIO apertures. Pin ownership and the debug - transport must be established before this endpoint is used. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-debug-port - - const: apple,debug-port - - items: - - const: apple,t8140-debug-port - - const: apple,debug-port - - swclk-gpios: - maxItems: 1 - description: Serial wire clock pin. - - swdio-gpios: - maxItems: 1 - description: Bidirectional serial wire data pin. - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml b/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml deleted file mode 100644 index ae444f86cd0c0..0000000000000 --- a/Documentation/devicetree/bindings/soc/apple/apple,hid-transport-mux.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/soc/apple/apple,hid-transport-mux.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple HID transport multiplexer - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware HID transport multiplexer between the MTP and AOP services. - The hardware description provides no independent register aperture. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-hid-transport-mux - - const: apple,hid-transport-mux - - items: - - const: apple,t8140-hid-transport-mux - - const: apple,hid-transport-mux - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml b/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml deleted file mode 100644 index 6207bfbe14d0b..0000000000000 --- a/Documentation/devicetree/bindings/soc/apple/apple,processor-trace.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/soc/apple/apple,processor-trace.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple processor trace service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Processor trace service. The hardware description provides no AP MMIO - register aperture; a driver must establish its firmware transport. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-processor-trace - - const: apple,processor-trace - - items: - - const: apple,t8140-processor-trace - - const: apple,processor-trace - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml b/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml deleted file mode 100644 index 3e6a309f0a694..0000000000000 --- a/Documentation/devicetree/bindings/soc/apple/apple,sac-manager.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/soc/apple/apple,sac-manager.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple display SAC manager - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware display SAC manager. It has no independent register aperture - in the hardware description. - -properties: - compatible: - oneOf: - - items: - - const: apple,t6041-sac-manager - - const: apple,sac-manager - - items: - - const: apple,t8140-sac-manager - - const: apple,sac-manager - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml b/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml deleted file mode 100644 index beee156b0b223..0000000000000 --- a/Documentation/devicetree/bindings/soc/apple/apple,wireless-debug-dock.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/soc/apple/apple,wireless-debug-dock.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple wireless debug dock endpoint - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Wireless debug dock firmware endpoint. It does not describe a second - wireless radio or transfer ownership of the existing radio. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-wireless-debug-dock - - const: apple,wireless-debug-dock - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml b/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml deleted file mode 100644 index 96a0e4a2892fc..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-dart-proxy.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-dart-proxy.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple isolated audio DART service proxy - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Isolated audio firmware endpoint and its DART streams. The firmware - retains ownership of the stream mappings at boot. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-audio-dart-proxy - - const: apple,audio-dart-proxy - - iommus: - minItems: 2 - maxItems: 2 - -required: - - compatible - - iommus - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml b/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml deleted file mode 100644 index 50dc5c5f685b2..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-leap-loopback.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-leap-loopback.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple leap loopback firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-leap-loopback - - apple,t8140-audio-leap-loopback - - const: apple,audio-leap-loopback - - dmas: - minItems: 2 - maxItems: 2 - -required: - - compatible - - dmas - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml b/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml deleted file mode 100644 index 3558bb37de1e1..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-listening-client.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-listening-client.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple listening client firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-listening-client - - apple,t8140-audio-listening-client - - const: apple,audio-listening-client - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml b/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml deleted file mode 100644 index 798fa55ff313a..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-low-power-mic.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-low-power-mic.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple low power mic firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-low-power-mic - - apple,t8140-audio-low-power-mic - - const: apple,audio-low-power-mic - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml deleted file mode 100644 index beed35f018c69..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-mca-loopback.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-mca-loopback.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple mca loopback firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-mca-loopback - - apple,t8140-audio-mca-loopback - - const: apple,audio-mca-loopback - - dmas: - minItems: 2 - maxItems: 2 - -required: - - compatible - - dmas - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml deleted file mode 100644 index 85350cf05fd7e..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-mic-buffer.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-mic-buffer.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple mic buffer firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-mic-buffer - - apple,t8140-audio-mic-buffer - - const: apple,audio-mic-buffer - - iommus: - maxItems: 1 - -required: - - compatible - - iommus - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml deleted file mode 100644 index d7c9713a9d241..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-mic-injection.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-mic-injection.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple mic injection firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t8140-audio-mic-injection - - const: apple,audio-mic-injection - - dmas: - maxItems: 1 - -required: - - compatible - - dmas - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml b/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml deleted file mode 100644 index 6bc04371a4420..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-mic-proxy.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-mic-proxy.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple isolated microphone service proxy - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Isolated microphone firmware endpoint. Buffer geometry and calibration - are runtime data and are not static hardware resources. - -properties: - compatible: - oneOf: - - items: - - const: apple,t8140-audio-mic-proxy - - const: apple,audio-mic-proxy - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml b/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml deleted file mode 100644 index 0f42cf7ae40a0..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-speaker-tap.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-speaker-tap.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple speaker tap firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t8140-audio-speaker-tap - - const: apple,audio-speaker-tap - - dmas: - maxItems: 1 - -required: - - compatible - - dmas - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml b/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml deleted file mode 100644 index 154839a2e053b..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,audio-voice-trigger.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,audio-voice-trigger.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple voice trigger firmware audio service - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Firmware audio service endpoint, separate from the active sound card. - It has no independently published AP MMIO aperture. DMA and DART - references describe the service resources, without transferring audio - fabric ownership or authorizing a stream to start. The endpoint remains - disabled until its host client and ownership protocol are qualified. - Acoustic tuning and runtime buffer contents are not static properties. - -properties: - compatible: - items: - - enum: - - apple,t6041-audio-voice-trigger - - apple,t8140-audio-voice-trigger - - const: apple,audio-voice-trigger - -required: - - compatible - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml b/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml deleted file mode 100644 index 1e628186118ac..0000000000000 --- a/Documentation/devicetree/bindings/sound/apple,smc-mogul.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -%YAML 1.2 ---- -$id: http://devicetree.org/schemas/sound/apple,smc-mogul.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# - -title: Apple SMC Mogul control endpoint - -maintainers: - - Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> - -description: | - Mogul control endpoint published below the SMC firmware node. Its - control address belongs to the SMC-mediated peripheral namespace and - must not be interpreted as an AP physical address. - -properties: - compatible: - items: - - enum: - - apple,t8140-smc-mogul - - const: apple,smc-mogul - - apple,smc: - $ref: /schemas/types.yaml#/definitions/phandle - description: SMC firmware transport provider. - - apple,control-address: - $ref: /schemas/types.yaml#/definitions/uint32 - description: Peripheral address in the SMC-mediated control namespace. - -required: - - compatible - - apple,smc - - apple,control-address - -additionalProperties: false diff --git a/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml b/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml index 1ae364f691740..b511202f35c7e 100644 --- a/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,t6030-dpaudio.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/sound/apple,t6030-dpaudio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Apple T6030, T6041 and T8140 DisplayPort audio +title: Apple T6030 and T6041 DisplayPort audio maintainers: - Ryan Murray @@ -15,10 +15,7 @@ description: | Samples arrive through SIO, and the graph connects this interface to port 0 of the display processor that owns the audio service. - Unrouted interfaces can be described disabled without inventing an audio - connection to a display processor. A route is required before enabling. - - T6041 and T8140 interfaces remain disabled until a generation-specific SIO firmware + T6041 interfaces remain disabled until a generation-specific SIO firmware backend and loader handoff are available and display audio is qualified. select: @@ -28,7 +25,6 @@ select: enum: - apple,t6030-dpaudio - apple,t6041-dpaudio - - apple,t8140-dpaudio required: - compatible @@ -38,7 +34,6 @@ properties: - enum: - apple,t6030-dpaudio - apple,t6041-dpaudio - - apple,t8140-dpaudio - const: apple,dpaudio dmas: @@ -64,17 +59,6 @@ required: - dmas - dma-names - power-domains - -allOf: - - if: - not: - properties: - status: - const: disabled - required: - - status - then: - required: - - ports + - ports additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi index 53f8e1fbc9482..08d4768494634 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-j616s-extdisp-mem-loader.dtsi @@ -17,42 +17,42 @@ / { reserved-memory { - dcpext0_text: dcpext0-text@0 { + dcpext0_text: dcpext0-text { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext0_data: dcpext0-data@0 { + dcpext0_data: dcpext0-data { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext0_heap: dcpext0-heap@0 { + dcpext0_heap: dcpext0-heap { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_text: dcpext1-text@0 { + dcpext1_text: dcpext1-text { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_data: dcpext1-data@0 { + dcpext1_data: dcpext1-data { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; status = "disabled"; }; - dcpext1_heap: dcpext1-heap@0 { + dcpext1_heap: dcpext1-heap { compatible = "apple,asc-mem"; reg = <0x0 0x0 0x0 0x4000>; no-map; diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index c362061e506df..32f589aa2971f 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -105,10 +105,6 @@ status = "okay"; }; -&debug_port2 { - swclk-gpios = <&pinctrl 42 GPIO_ACTIVE_HIGH>; - swdio-gpios = <&pinctrl 43 GPIO_ACTIVE_HIGH>; -}; &i2c4 { sd_card_control: card-control@20 { diff --git a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi index 53e986ddbf96b..3cddc40aac79a 100644 --- a/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6040-peripherals.dtsi @@ -6,7 +6,16 @@ */ / { + soc: soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + nonposted-mmio; + }; +}; +&soc { /* ADT /arm-io/dwi. */ dwi: dwi@5029b0000 { compatible = "apple,t6041-dwi", "apple,dwi"; @@ -241,38 +250,8 @@ status = "disabled"; }; - /* ADT /arm-io/dcp0-expert. */ - dcp_expert: display-expert@4023a8050 { - compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; - reg = <0x4 0x023a8050 0x0 0x4>, - <0x4 0x02374000 0x0 0x40>, - <0x4 0x02370000 0x0 0x40>; - interrupt-parent = <&aic>; - interrupts = ; - status = "disabled"; - }; - /* ADT /arm-io/dcpext0-expert. */ - dcpext0_expert: display-expert@3a23a8050 { - compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; - reg = <0x3 0xa23a8050 0x0 0x4>, - <0x3 0xa2374000 0x0 0x40>, - <0x3 0xa2370000 0x0 0x40>; - interrupt-parent = <&aic>; - interrupts = ; - status = "disabled"; - }; - /* ADT /arm-io/dcpext1-expert. */ - dcpext1_expert: display-expert@6023a8050 { - compatible = "apple,t6041-dcp-expert", "apple,dcp-expert"; - reg = <0x6 0x023a8050 0x0 0x4>, - <0x6 0x02374000 0x0 0x40>, - <0x6 0x02370000 0x0 0x40>; - interrupt-parent = <&aic>; - interrupts = ; - status = "disabled"; - }; /* Clock IDs are SoC hardware selectors, not ADT phandles. */ peripheral_clocks: clock-controller@502800000 { @@ -347,42 +326,6 @@ }; }; - -/ { - - /* ADT /arm-io/mtp-aop-mux; no qualified host transport/ownership contract. */ - hid_mux: hid-transport-mux { - compatible = "apple,t6041-hid-transport-mux", "apple,hid-transport-mux"; - status = "disabled"; - }; - - /* ADT /arm-io/apple-processor-trace; no qualified host transport/ownership contract. */ - processor_trace: processor-trace { - compatible = "apple,t6041-processor-trace", "apple,processor-trace"; - status = "disabled"; - }; - - /* ADT /arm-io/aod2; no qualified host transport/ownership contract. */ - debug_port2: debug-port-2 { - compatible = "apple,t6041-debug-port", "apple,debug-port"; - status = "disabled"; - }; - - /* ADT /sacm; no qualified host transport/ownership contract. */ - sac_manager: sac-manager { - compatible = "apple,t6041-sac-manager", "apple,sac-manager"; - status = "disabled"; - }; - - /* ADT /arm-io/dcp0-sac-controller; no qualified host transport/ownership contract. */ - sac_controller: sac-controller { - compatible = "apple,t6041-sac-controller", "apple,sac-controller"; - apple,manager = <&sac_manager>; - status = "disabled"; - }; -}; - - &aon_ptd { interrupt-controller; #interrupt-cells = <1>; @@ -406,78 +349,3 @@ status = "disabled"; }; }; - -/* Register-less DP audio interfaces: ADT DMA channels and PMGR gates. */ -/ { - - dpaudio0: audio-controller-0 { - compatible = "apple,t6041-dpaudio", "apple,dpaudio"; - dmas = <&sio 0x64>; - dma-names = "tx"; - power-domains = <&ps_dpa0>; - /* No qualified firmware audio route is assigned at boot. */ - status = "disabled"; - }; - - dpaudio3: audio-controller-3 { - compatible = "apple,t6041-dpaudio", "apple,dpaudio"; - dmas = <&sio 0x6a>; - dma-names = "tx"; - power-domains = <&ps_dpa3>; - /* No qualified firmware audio route is assigned at boot. */ - status = "disabled"; - }; - - dpaudio4: audio-controller-4 { - compatible = "apple,t6041-dpaudio", "apple,dpaudio"; - dmas = <&sio 0x6c>; - dma-names = "tx"; - power-domains = <&ps_dpa4>; - /* No qualified firmware audio route is assigned at boot. */ - status = "disabled"; - }; -}; - - -/* Firmware audio endpoints with no qualified independent host client. */ -/ { - - /* ADT /arm-io/iop-voicetrigger-controller/audio-vt-device. */ - audio_voice_trigger: audio-voice-trigger { - compatible = "apple,t6041-audio-voice-trigger", "apple,audio-voice-trigger"; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/audio-mca-loopback. */ - audio_mca_loopback: audio-mca-loopback { - compatible = "apple,t6041-audio-mca-loopback", "apple,audio-mca-loopback"; - dmas = <&admac1 6>, <&admac1 7>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/audio-leap-internal-loopback. */ - audio_leap_loopback: audio-leap-loopback { - compatible = "apple,t6041-audio-leap-loopback", "apple,audio-leap-loopback"; - dmas = <&admac0 8>, <&admac0 9>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/lp-mic-device. */ - audio_low_power_mic: audio-low-power-mic { - compatible = "apple,t6041-audio-low-power-mic", "apple,audio-low-power-mic"; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/lp-mic-io-buffer-device. */ - audio_mic_buffer: audio-mic-buffer { - compatible = "apple,t6041-audio-mic-buffer", "apple,audio-mic-buffer"; - iommus = <&aop_dart 8>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/siri-listening-device. */ - audio_listening_client: audio-listening-client { - compatible = "apple,t6041-audio-listening-client", "apple,audio-listening-client"; - status = "disabled"; - }; -}; diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 7e8f9950c4afb..2c4e9d8cec2bc 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi @@ -108,7 +108,7 @@ * segment-ranges[0]); the driver identifies the build from it. */ gpu_fw_text: gpu-fw-text { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; @@ -118,7 +118,7 @@ * places its crash log here. */ gpu_fw_data: gpu-fw-data { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; @@ -129,25 +129,25 @@ * the boot loader adds them to /memory. */ uat_ttbs: uat-ttbs { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; uat_pagetables: uat-pagetables { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; uat_l2_pagetables: uat-l2-pagetables { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; uat_handoff: uat-handoff { - size = <0 0>; /* The loader adds reg before enabling this region. */ + reg = <0 0 0 0>; status = "disabled"; no-map; }; diff --git a/arch/arm64/boot/dts/apple/t604x.dtsi b/arch/arm64/boot/dts/apple/t604x.dtsi index dea79511112a3..091adfdfda6df 100644 --- a/arch/arm64/boot/dts/apple/t604x.dtsi +++ b/arch/arm64/boot/dts/apple/t604x.dtsi @@ -915,6 +915,9 @@ iommus = <&dcp_dart 23>; apple,bw-scratch = <&pmgr_dcp 0 4 0x20000>; apple,iomfb-surfaces = <1 1 0 0>; + /* the boot loader describes the piodma's regions with 2+2 cells */ + #address-cells = <2>; + #size-cells = <2>; /* enabled once the boot loader has handed the display over */ status = "disabled"; diff --git a/arch/arm64/boot/dts/apple/t8140-j700.dts b/arch/arm64/boot/dts/apple/t8140-j700.dts index 7cdbf633dbf3f..5841470c3c28d 100644 --- a/arch/arm64/boot/dts/apple/t8140-j700.dts +++ b/arch/arm64/boot/dts/apple/t8140-j700.dts @@ -2029,8 +2029,3 @@ &ane_dart2 { status = "okay"; }; - -&debug_port4 { - swclk-gpios = <&pinctrl_ap 86 GPIO_ACTIVE_HIGH>; - swdio-gpios = <&pinctrl_ap 85 GPIO_ACTIVE_HIGH>; -}; diff --git a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi index 6a00fc2f4ad69..5198e90c72d52 100644 --- a/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8140-peripherals.dtsi @@ -5,7 +5,83 @@ * ownership from firmware or make their registers safe to access. */ -/ { +&soc { + error-handler@220000000 { + compatible = "apple,t8140-error-handler", "apple,soc-error-handler"; + /* ADT /arm-io/error-handler banks; firmware/AP access is unqualified. */ + reg = <0x2 0x20000000 0x0 0x2f000000>, + <0x2 0x80d00000 0x0 0x40000>, + <0x2 0x80900000 0x0 0x8000>, + <0x3 0x00000000 0x0 0x70000>, + <0x3 0x00728000 0x0 0x4000>, + <0x3 0x082dc000 0x0 0x18000>, + <0x3 0x003d0000 0x0 0x4000>, + <0x3 0x00768000 0x0 0x4000>, + <0x3 0x02000000 0x0 0x1000000>, + <0x2 0x4f000000 0x0 0x4000>, + <0x2 0x50000000 0x0 0x4000>, + <0x2 0x51000000 0x0 0x4000>, + <0x2 0x52000000 0x0 0x4000>, + <0x2 0x5f000000 0x0 0x4000>, + <0x2 0x6f000000 0x0 0x4000>, + <0x2 0x5300a000 0x0 0x9a4>, + <0x2 0x54000000 0x0 0x20000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + /* Not yet qualified on the J700. */ + status = "disabled"; + }; + event-log-handler@300700000 { + compatible = "apple,t8140-event-log", "apple,soc-event-log"; + /* ADT /arm-io/event-log-handler banks; firmware/AP access is unqualified. */ + reg = <0x3 0x00700000 0x0 0xcc000>, + <0x3 0x08280000 0x0 0x80000>, + <0x3 0x00000000 0x0 0x70000>, + <0x3 0x08200000 0x0 0x7c000>, + <0x3 0x0028c000 0x0 0x4000>, + <0x3 0x00280000 0x0 0x8000>, + <0x4 0x01878000 0x0 0x4000>, + <0x4 0x01868000 0x0 0x8000>, + <0x3 0x02800000 0x0 0xbc000>, + <0x3 0x02900000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + , + , + ; + /* Not yet qualified on the J700. */ + status = "disabled"; + }; /* ADT /arm-io/dwi. */ dwi: dwi@300200000 { @@ -154,48 +230,6 @@ status = "disabled"; }; - /* ADT /arm-io/dcp0-expert. */ - /* ADT /arm-io/dcp-exclave-ioreporting. */ - dcp_ioreporting: dcp-ioreporting { - compatible = "apple,t8140-dcp-ioreporting", "apple,dcp-ioreporting"; - status = "disabled"; - }; - - /* ADT /arm-io/dcp0-expert. */ - dcp_expert: display-expert@3082b8044 { - compatible = "apple,t8140-dcp-expert", "apple,dcp-expert"; - reg = <0x3 0x082b8044 0x0 0xc>, - <0x3 0x08008000 0x0 0x4>, - <0x4 0x123ac050 0x0 0x4>, - <0x4 0x12370000 0x0 0x40>, - <0x4 0x12384000 0x0 0x40>, - <0x4 0x12378000 0x0 0x40>, - <0x4 0x1237c000 0x0 0x40>, - <0x4 0x12380000 0x0 0x40>, - <0x4 0x12374000 0x0 0x40>, - <0x4 0x123b8000 0x0 0x40>, - <0x4 0x1239c000 0x0 0x40>, - <0x4 0x123a0000 0x0 0x40>, - <0x4 0x12388000 0x0 0x40>, - <0x4 0x1238c000 0x0 0x40>, - <0x4 0x12394000 0x0 0x40>, - <0x4 0x12398000 0x0 0x40>, - <0x4 0x12390000 0x0 0x40>; - interrupt-parent = <&aic>; - interrupts = ; - status = "disabled"; - }; - - /* ADT /arm-io/dcpext-expert. */ - dcpext_expert: display-expert@4163ac050 { - compatible = "apple,t8140-dcp-expert", "apple,dcp-expert"; - reg = <0x4 0x163ac050 0x0 0x4>, - <0x4 0x16370000 0x0 0x40>, - <0x4 0x16374000 0x0 0x40>; - interrupt-parent = <&aic>; - interrupts = ; - status = "disabled"; - }; /* ADT /arm-io/dcp-exclave-mailbox. */ dcp_secure_mbox: mailbox@452e7c000 { @@ -292,9 +326,6 @@ apple,pmgr = <&pmgr>; status = "disabled"; }; -}; - -/ { /* ADT /arm-io/aop-gpio; coprocessor/firmware ownership unqualified. */ pinctrl_aop: pinctrl@310824000 { @@ -479,97 +510,6 @@ power-domains = <&ps_sio_cpu>; status = "disabled"; }; -}; - -/ { - - /* ADT /arm-io/mtp-aop-mux; no qualified host transport/ownership contract. */ - hid_mux: hid-transport-mux { - compatible = "apple,t8140-hid-transport-mux", "apple,hid-transport-mux"; - status = "disabled"; - }; - - /* ADT /arm-io/apple-processor-trace; no qualified host transport/ownership contract. */ - processor_trace: processor-trace { - compatible = "apple,t8140-processor-trace", "apple,processor-trace"; - status = "disabled"; - }; - - /* ADT /arm-io/aod2; no qualified host transport/ownership contract. */ - debug_port2: debug-port-2 { - compatible = "apple,t8140-debug-port", "apple,debug-port"; - status = "disabled"; - }; - - /* ADT /arm-io/aod3; no qualified host transport/ownership contract. */ - debug_port3: debug-port-3 { - compatible = "apple,t8140-debug-port", "apple,debug-port"; - status = "disabled"; - }; - - /* ADT /arm-io/aod4; no qualified host transport/ownership contract. */ - debug_port4: debug-port-4 { - compatible = "apple,t8140-debug-port", "apple,debug-port"; - status = "disabled"; - }; - - /* ADT /sacm; no qualified host transport/ownership contract. */ - sac_manager: sac-manager { - compatible = "apple,t8140-sac-manager", "apple,sac-manager"; - status = "disabled"; - }; - - /* ADT /arm-io/dcp-sac-controller; no qualified host transport/ownership contract. */ - sac_controller: sac-controller { - compatible = "apple,t8140-sac-controller", "apple,sac-controller"; - apple,manager = <&sac_manager>; - status = "disabled"; - }; - - /* ADT /arm-io/nco; no qualified host transport/ownership contract. */ - nco_service: nco-service { - compatible = "apple,t8140-nco-service", "apple,nco-service"; - apple,clock-controller = <&peripheral_clocks>; - apple,clock-selectors = <377 378 375 376>; - status = "disabled"; - }; - - /* ADT /arm-io/exdisplaypipe; no qualified host transport/ownership contract. */ - secure_display_pipe: secure-display-pipe { - compatible = "apple,t8140-secure-display-pipe", "apple,secure-display-pipe"; - interrupt-parent = <&aic>; - interrupts = , - , - , - ; - iommus = <&disp0_dart 3>, <&disp0_dart 4>; - status = "disabled"; - }; - - /* ADT /arm-io/isp-exclave-proxy; no qualified host transport/ownership contract. */ - isp_service_proxy: isp-service-proxy { - compatible = "apple,t8140-isp-service-proxy", "apple,isp-service-proxy"; - status = "disabled"; - }; - - /* ADT /arm-io/audio-hp-mic-proxy; no qualified host transport/ownership contract. */ - audio_mic_proxy: audio-mic-proxy { - compatible = "apple,t8140-audio-mic-proxy", "apple,audio-mic-proxy"; - status = "disabled"; - }; - - /* ADT /arm-io/audio-shared-dart-proxy; no qualified host transport/ownership contract. */ - audio_dart_proxy: audio-dart-proxy { - compatible = "apple,t8140-audio-dart-proxy", "apple,audio-dart-proxy"; - iommus = <&aop_dart 9>, <&aop_dart 11>; - status = "disabled"; - }; - - /* ADT /dock-debug-wireless; no qualified host transport/ownership contract. */ - wireless_debug_dock: wireless-debug-dock { - compatible = "apple,t8140-wireless-debug-dock", "apple,wireless-debug-dock"; - status = "disabled"; - }; /* ADT /dock-connect; no qualified host transport/ownership contract. */ debug_dock: debug-dock@3082d8008 { @@ -580,9 +520,7 @@ ; status = "disabled"; }; -}; -/ { /* ADT /arm-io/eic named MMIO apertures are absolute addresses. */ eic: secure-controller@340700000 { compatible = "apple,t8140-eic", "apple,eic"; @@ -595,6 +533,13 @@ reg-names = "ps", "wd-isp", "gpio", "fpwm", "gltb", "wd-e"; status = "disabled"; }; + + xspmi_controller: spmi-proxy-controller@348614000 { + compatible = "apple,t8140-xspmi-controller", "apple,xspmi-controller"; + reg = <0x3 0x48614000 0x0 0x4000>; + apple,response-vector = <256>; + status = "disabled"; + }; }; &aon_ptd { @@ -627,98 +572,3 @@ status = "disabled"; }; }; - -/ { - xspmi_controller: spmi-proxy-controller@348614000 { - compatible = "apple,t8140-xspmi-controller", "apple,xspmi-controller"; - reg = <0x3 0x48614000 0x0 0x4000>; - apple,response-vector = <256>; - status = "disabled"; - }; - - smc_mogul: smc-mogul { - compatible = "apple,t8140-smc-mogul", "apple,smc-mogul"; - apple,smc = <&smc>; - apple,control-address = <0x10>; - status = "disabled"; - }; -}; - -/* Register-less DP audio interfaces: ADT DMA channels and PMGR gates. */ -/ { - - dpaudio0: audio-controller-0 { - compatible = "apple,t8140-dpaudio", "apple,dpaudio"; - dmas = <&sio 0x64>; - dma-names = "tx"; - power-domains = <&ps_dpa0>; - /* No qualified firmware audio route is assigned at boot. */ - status = "disabled"; - }; - - dpaudio1: audio-controller-1 { - compatible = "apple,t8140-dpaudio", "apple,dpaudio"; - dmas = <&sio 0x66>; - dma-names = "tx"; - power-domains = <&ps_dpa1>; - /* No qualified firmware audio route is assigned at boot. */ - status = "disabled"; - }; -}; - -/* Firmware audio endpoints with no qualified independent host client. */ -/ { - - /* ADT /arm-io/iop-voicetrigger-controller/audio-vt-device. */ - audio_voice_trigger: audio-voice-trigger { - compatible = "apple,t8140-audio-voice-trigger", "apple,audio-voice-trigger"; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/audio-mca-loopback. */ - audio_mca_loopback: audio-mca-loopback { - compatible = "apple,t8140-audio-mca-loopback", "apple,audio-mca-loopback"; - dmas = <&admac_base_ns 6>, <&admac_base_ns 7>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/audio-leap-internal-loopback. */ - audio_leap_loopback: audio-leap-loopback { - compatible = "apple,t8140-audio-leap-loopback", "apple,audio-leap-loopback"; - dmas = <&admac_leap_ns 8>, <&admac_leap_ns 9>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/lp-mic-device. */ - audio_low_power_mic: audio-low-power-mic { - compatible = "apple,t8140-audio-low-power-mic", "apple,audio-low-power-mic"; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/lp-mic-io-buffer-device. */ - audio_mic_buffer: audio-mic-buffer { - compatible = "apple,t8140-audio-mic-buffer", "apple,audio-mic-buffer"; - iommus = <&aop_dart 9>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/siri-listening-device. */ - audio_listening_client: audio-listening-client { - compatible = "apple,t8140-audio-listening-client", "apple,audio-listening-client"; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/audio-speaker-tap. */ - audio_speaker_tap: audio-speaker-tap { - compatible = "apple,t8140-audio-speaker-tap", "apple,audio-speaker-tap"; - dmas = <&admac_base_ns 3>; - status = "disabled"; - }; - - /* ADT /arm-io/iop-audio-controller/lp-mic-injection-device. */ - audio_mic_injection: audio-mic-injection { - compatible = "apple,t8140-audio-mic-injection", "apple,audio-mic-injection"; - dmas = <&admac_base_ns 10>; - status = "disabled"; - }; -}; diff --git a/arch/arm64/boot/dts/apple/t8140.dtsi b/arch/arm64/boot/dts/apple/t8140.dtsi index b98c374805216..dbe9bd0d4e59c 100644 --- a/arch/arm64/boot/dts/apple/t8140.dtsi +++ b/arch/arm64/boot/dts/apple/t8140.dtsi @@ -430,8 +430,7 @@ ranges; uat_handoff: uat-handoff { - size = <0 0>; /* The loader supplies reg and enables the region. */ - status = "disabled"; + reg = <0 0 0 0>; }; /* @@ -459,98 +458,18 @@ /* Only reserved: the GPU node does not reference it */ uat_l2_pagetables: uat-l2-pagetables { - size = <0 0>; /* The loader supplies reg and enables the region. */ - status = "disabled"; + reg = <0 0 0 0>; }; uat_pagetables: uat-pagetables { - size = <0 0>; /* The loader supplies reg and enables the region. */ - status = "disabled"; + reg = <0 0 0 0>; }; uat_ttbs: uat-ttbs { - size = <0 0>; /* The loader supplies reg and enables the region. */ - status = "disabled"; + reg = <0 0 0 0>; }; }; - error-handler@220000000 { - compatible = "apple,t8140-error-handler", "apple,soc-error-handler"; - /* ADT /arm-io/error-handler banks; firmware/AP access is unqualified. */ - reg = <0x2 0x20000000 0x0 0x2f000000>, - <0x2 0x80d00000 0x0 0x40000>, - <0x2 0x80900000 0x0 0x8000>, - <0x3 0x00000000 0x0 0x70000>, - <0x3 0x00728000 0x0 0x4000>, - <0x3 0x082dc000 0x0 0x18000>, - <0x3 0x003d0000 0x0 0x4000>, - <0x3 0x00768000 0x0 0x4000>, - <0x3 0x02000000 0x0 0x1000000>, - <0x2 0x4f000000 0x0 0x4000>, - <0x2 0x50000000 0x0 0x4000>, - <0x2 0x51000000 0x0 0x4000>, - <0x2 0x52000000 0x0 0x4000>, - <0x2 0x5f000000 0x0 0x4000>, - <0x2 0x6f000000 0x0 0x4000>, - <0x2 0x5300a000 0x0 0x9a4>, - <0x2 0x54000000 0x0 0x20000>; - interrupt-parent = <&aic>; - interrupts = , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - ; - /* Not yet qualified on the J700. */ - status = "disabled"; - }; - - event-log-handler@300700000 { - compatible = "apple,t8140-event-log", "apple,soc-event-log"; - /* ADT /arm-io/event-log-handler banks; firmware/AP access is unqualified. */ - reg = <0x3 0x00700000 0x0 0xcc000>, - <0x3 0x08280000 0x0 0x80000>, - <0x3 0x00000000 0x0 0x70000>, - <0x3 0x08200000 0x0 0x7c000>, - <0x3 0x0028c000 0x0 0x4000>, - <0x3 0x00280000 0x0 0x8000>, - <0x4 0x01878000 0x0 0x4000>, - <0x4 0x01868000 0x0 0x8000>, - <0x3 0x02800000 0x0 0xbc000>, - <0x3 0x02900000 0x0 0x4000>; - interrupt-parent = <&aic>; - interrupts = , - , - , - , - , - , - , - , - ; - /* Not yet qualified on the J700. */ - status = "disabled"; - }; soc: soc { compatible = "simple-bus"; @@ -1377,11 +1296,11 @@ status = "disabled"; }; - gpu: gpu@480000000 { + gpu: gpu@482600000 { compatible = "apple,agx-t8140"; - reg = <0x4 0x80000000 0x0 0x4000000>, - <0x4 0x82600000 0x0 0x88000>; - reg-names = "sgx", "asc"; + reg = <0x4 0x82600000 0x0 0x88000>, + <0x4 0x80000000 0x0 0x4000000>; + reg-names = "asc", "sgx"; mboxes = <&gfx_mbox>, <&gfx1_mbox>; power-domains = <&ps_gfx>; memory-region = <&uat_ttbs>, <&uat_pagetables>, From b3d24796357a6ddbedb7d201c8b2611a0dd2bb11 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:14:30 +1100 Subject: [PATCH 77/79] nfc: apple-stockholm: add KUnit tests for the identity parsing Split the CORE_RESET and CORE_INIT response parsing out of the identity read and test it with the responses the J616s and J700 controllers returned, a reader-class response with an RF interface list, every truncation of the init response, a failed status, an RF interface count that runs past the payload and an NCI 2.x style reset response. No functional change for the hardware. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- MAINTAINERS | 3 +- drivers/nfc/.kunitconfig | 9 +++ drivers/nfc/Kconfig | 11 +++ drivers/nfc/apple-stockholm-test.c | 122 +++++++++++++++++++++++++++++ drivers/nfc/apple-stockholm.c | 82 ++++++++++++++----- 5 files changed, 205 insertions(+), 22 deletions(-) create mode 100644 drivers/nfc/.kunitconfig create mode 100644 drivers/nfc/apple-stockholm-test.c diff --git a/MAINTAINERS b/MAINTAINERS index 433fde7181d4d..729b9b1e82f47 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2778,7 +2778,8 @@ F: drivers/iommu/apple-dart.c F: drivers/iommu/io-pgtable-dart.c F: drivers/irqchip/irq-apple-aic.c F: drivers/mfd/macsmc*.c -F: drivers/nfc/apple-stockholm.c +F: drivers/nfc/.kunitconfig +F: drivers/nfc/apple-stockholm*.c F: drivers/nvme/host/apple.c F: drivers/nvmem/apple-efuses.c F: drivers/nvmem/apple-spmi-nvmem.c diff --git a/drivers/nfc/.kunitconfig b/drivers/nfc/.kunitconfig new file mode 100644 index 0000000000000..970a8fbf55db4 --- /dev/null +++ b/drivers/nfc/.kunitconfig @@ -0,0 +1,9 @@ +CONFIG_KUNIT=y +CONFIG_NET=y +CONFIG_ARCH_APPLE=y +CONFIG_OF=y +CONFIG_GPIOLIB=y +CONFIG_SPMI=y +CONFIG_NFC=y +CONFIG_NFC_APPLE_STOCKHOLM=y +CONFIG_NFC_APPLE_STOCKHOLM_KUNIT_TEST=y diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index 7ec08ca367152..1594e97234866 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig @@ -73,6 +73,17 @@ config NFC_APPLE_STOCKHOLM Say M here to compile this driver as a module named apple-stockholm. +config NFC_APPLE_STOCKHOLM_KUNIT_TEST + bool "KUnit tests for the Apple Stockholm driver" if !KUNIT_ALL_TESTS + depends on NFC_APPLE_STOCKHOLM && KUNIT + depends on KUNIT=y || NFC_APPLE_STOCKHOLM=m + default KUNIT_ALL_TESTS + help + Tests for the parsing of the NCI identity responses, built into the + apple-stockholm driver. + + If unsure, say N. + source "drivers/nfc/fdp/Kconfig" source "drivers/nfc/pn544/Kconfig" source "drivers/nfc/pn533/Kconfig" diff --git a/drivers/nfc/apple-stockholm-test.c b/drivers/nfc/apple-stockholm-test.c new file mode 100644 index 0000000000000..3e0c9644f9668 --- /dev/null +++ b/drivers/nfc/apple-stockholm-test.c @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * KUnit tests for the Apple Stockholm NCI identity parsing + * + * The responses are the ones the J616s and the J700 controllers returned. + * + * Copyright The Aurora Silicon Contributors + */ + +#include + +static const u8 stockholm_test_reset_rsp[] = { 0x00, 0x10, 0x01 }; + +static const u8 stockholm_test_init_j616s[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, + 0xff, 0x02, 0x00, 0x04, 0x60, 0x01, 0x01, 0x41, +}; + +static const u8 stockholm_test_init_j700[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, + 0xff, 0x02, 0x00, 0x04, 0x60, 0x01, 0x01, 0x37, +}; + +/* A reader-class response: frame and ISO-DEP RF interfaces. */ +static const u8 stockholm_test_init_rf[] = { + 0x00, 0x03, 0x1e, 0x03, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, + 0x02, 0xff, 0x00, 0x01, 0x04, 0x11, 0x22, 0x33, 0x44, +}; + +static void stockholm_test_reset(struct kunit *test) +{ + struct stockholm_ident id = {}; + int ret; + + ret = stockholm_parse_reset_rsp(stockholm_test_reset_rsp, + sizeof(stockholm_test_reset_rsp), &id); + KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, id.nci_version, 0x10); +} + +static void stockholm_test_reset_errors(struct kunit *test) +{ + static const u8 failed[] = { 0x03, 0x10, 0x01 }; + static const u8 nci2[] = { 0x00 }; + struct stockholm_ident id = {}; + + KUNIT_EXPECT_EQ(test, stockholm_parse_reset_rsp(failed, sizeof(failed), &id), + -EIO); + KUNIT_EXPECT_EQ(test, stockholm_parse_reset_rsp(nci2, sizeof(nci2), &id), + -EOPNOTSUPP); + KUNIT_EXPECT_EQ(test, stockholm_parse_reset_rsp(nci2, 0, &id), -EIO); +} + +static void stockholm_test_init_macs(struct kunit *test) +{ + struct stockholm_ident id = {}; + int ret; + + ret = stockholm_parse_init_rsp(stockholm_test_init_j616s, + sizeof(stockholm_test_init_j616s), &id); + KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, id.rf_interfaces, 0); + KUNIT_EXPECT_EQ(test, id.manufacturer, 0x04); + KUNIT_EXPECT_EQ(test, id.firmware, 0x41010160); + + ret = stockholm_parse_init_rsp(stockholm_test_init_j700, + sizeof(stockholm_test_init_j700), &id); + KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, id.rf_interfaces, 0); + KUNIT_EXPECT_EQ(test, id.firmware, 0x37010160); +} + +static void stockholm_test_init_rf_list(struct kunit *test) +{ + struct stockholm_ident id = {}; + int ret; + + ret = stockholm_parse_init_rsp(stockholm_test_init_rf, + sizeof(stockholm_test_init_rf), &id); + KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, id.rf_interfaces, 2); + KUNIT_EXPECT_EQ(test, id.manufacturer, 0x04); + KUNIT_EXPECT_EQ(test, id.firmware, 0x44332211); +} + +static void stockholm_test_init_errors(struct kunit *test) +{ + u8 rsp[sizeof(stockholm_test_init_j616s)]; + struct stockholm_ident id = {}; + int len, ret; + + /* Every truncation, down to an empty payload, is rejected. */ + for (len = 0; len < (int)sizeof(stockholm_test_init_j616s); len++) { + ret = stockholm_parse_init_rsp(stockholm_test_init_j616s, len, &id); + KUNIT_EXPECT_EQ(test, ret, -EIO); + } + + memcpy(rsp, stockholm_test_init_j616s, sizeof(rsp)); + rsp[0] = 0x03; + KUNIT_EXPECT_EQ(test, stockholm_parse_init_rsp(rsp, sizeof(rsp), &id), -EIO); + + /* An RF interface count that runs past the payload. */ + memcpy(rsp, stockholm_test_init_j616s, sizeof(rsp)); + rsp[STOCKHOLM_INIT_RSP_RF_COUNT] = 0xff; + KUNIT_EXPECT_EQ(test, stockholm_parse_init_rsp(rsp, sizeof(rsp), &id), -EIO); +} + +static struct kunit_case stockholm_test_cases[] = { + KUNIT_CASE(stockholm_test_reset), + KUNIT_CASE(stockholm_test_reset_errors), + KUNIT_CASE(stockholm_test_init_macs), + KUNIT_CASE(stockholm_test_init_rf_list), + KUNIT_CASE(stockholm_test_init_errors), + {} +}; + +static struct kunit_suite stockholm_test_suite = { + .name = "apple-stockholm", + .test_cases = stockholm_test_cases, +}; + +kunit_test_suite(stockholm_test_suite); diff --git a/drivers/nfc/apple-stockholm.c b/drivers/nfc/apple-stockholm.c index cbf8ba841bb96..d4810655bfc81 100644 --- a/drivers/nfc/apple-stockholm.c +++ b/drivers/nfc/apple-stockholm.c @@ -268,41 +268,77 @@ static int stockholm_nci_cmd(struct stockholm *st, u16 opcode, return ret; } +/* What CORE_RESET and CORE_INIT report about the controller. */ +struct stockholm_ident { + u8 nci_version; + u8 manufacturer; + u8 rf_interfaces; + u32 firmware; +}; + +/* NCI 1.x CORE_RESET_RSP payload: status, NCI version, configuration status. */ +static int stockholm_parse_reset_rsp(const u8 *rsp, int len, + struct stockholm_ident *id) +{ + if (len < 1 || rsp[0] != NCI_STATUS_OK) + return -EIO; + /* NCI 2.x answers with the status only and reports in a notification. */ + if (len != 3) + return -EOPNOTSUPP; + + id->nci_version = rsp[1]; + return 0; +} + +/* + * NCI 1.x CORE_INIT_RSP payload: status, features (4), RF interface count and + * list, logical connections, routing table size (2), control payload size, + * large parameter size (2), manufacturer ID, manufacturer data (4). + */ +static int stockholm_parse_init_rsp(const u8 *rsp, int len, + struct stockholm_ident *id) +{ + unsigned int tail; + + if (len <= STOCKHOLM_INIT_RSP_RF_COUNT || rsp[0] != NCI_STATUS_OK) + return -EIO; + + id->rf_interfaces = rsp[STOCKHOLM_INIT_RSP_RF_COUNT]; + tail = STOCKHOLM_INIT_RSP_RF_COUNT + 1 + id->rf_interfaces + + STOCKHOLM_INIT_RSP_TAIL; + if (len < tail + STOCKHOLM_INIT_RSP_MANUF_LEN) + return -EIO; + + id->manufacturer = rsp[tail]; + id->firmware = get_unaligned_le32(&rsp[tail + 1]); + return 0; +} + /* CORE_RESET and CORE_INIT, then log what the controller reports. */ static int stockholm_identify(struct stockholm *st) { - struct device *dev = &st->sdev->dev; u8 reset_type = NCI_RESET_TYPE_RESET_CONFIG; - const u8 *rsp = st->rx_payload; - unsigned int n_rf, tail; - u8 version; - int len; + struct stockholm_ident id = {}; + int len, ret; len = stockholm_nci_cmd(st, NCI_OP_CORE_RESET_CMD, &reset_type, 1); if (len < 0) return len; - if (len < 1 || rsp[0] != NCI_STATUS_OK) - return -EIO; - /* Only the NCI 1.x reset response carries the version (3 bytes). */ - if (len != 3) - return -EOPNOTSUPP; - version = rsp[1]; + ret = stockholm_parse_reset_rsp(st->rx_payload, len, &id); + if (ret) + return ret; len = stockholm_nci_cmd(st, NCI_OP_CORE_INIT_CMD, NULL, 0); if (len < 0) return len; - if (len <= STOCKHOLM_INIT_RSP_RF_COUNT || rsp[0] != NCI_STATUS_OK) - return -EIO; - - n_rf = rsp[STOCKHOLM_INIT_RSP_RF_COUNT]; - tail = STOCKHOLM_INIT_RSP_RF_COUNT + 1 + n_rf + STOCKHOLM_INIT_RSP_TAIL; - if (len < tail + STOCKHOLM_INIT_RSP_MANUF_LEN) - return -EIO; + ret = stockholm_parse_init_rsp(st->rx_payload, len, &id); + if (ret) + return ret; - dev_info(dev, + dev_info(&st->sdev->dev, "NCI %u.%u controller, manufacturer %#04x, firmware %08x, %u RF interfaces; parked off\n", - version >> 4, version & 0xf, rsp[tail], - get_unaligned_le32(&rsp[tail + 1]), n_rf); + id.nci_version >> 4, id.nci_version & 0xf, id.manufacturer, + id.firmware, id.rf_interfaces); return 0; } @@ -419,6 +455,10 @@ static struct spmi_driver stockholm_driver = { }; module_spmi_driver(stockholm_driver); +#if IS_ENABLED(CONFIG_NFC_APPLE_STOCKHOLM_KUNIT_TEST) +#include "apple-stockholm-test.c" +#endif + MODULE_AUTHOR("Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>"); MODULE_DESCRIPTION("Apple Stockholm NFC controller and Secure Element (power and identity)"); MODULE_LICENSE("GPL"); From f04e74a0878906da912e6d633c9efe6419bab362 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 7 Nov 2026 08:36:22 -0500 Subject: [PATCH 78/79] selftests: apple: stub apple_t8132_air() in the host harnesses The PMP graph and supplier tests and the dwc3 teardown test compile production code that now asks apple_t8132_air() instead of matching apple,j713. Give their mocks the same helper, built on their of_machine_is_compatible() stubs. Signed-off-by: Diljit Singh --- tools/asahi/t6030-pmp-graph-tests.c | 6 ++++++ tools/asahi/t6030-pmp-supplier-tests.c | 6 ++++++ tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/mocks.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/tools/asahi/t6030-pmp-graph-tests.c b/tools/asahi/t6030-pmp-graph-tests.c index ca1cde04f1363..f66c94e26fc6e 100644 --- a/tools/asahi/t6030-pmp-graph-tests.c +++ b/tools/asahi/t6030-pmp-graph-tests.c @@ -463,6 +463,12 @@ static bool of_machine_is_compatible(const char *s) { return !strcmp(s, "apple,t6030"); } +/* As in . */ +static inline bool apple_t8132_air(void) +{ + return of_machine_is_compatible("apple,j713") || + of_machine_is_compatible("apple,j715"); +} static bool of_property_read_bool(const struct device_node *n, const char *p) { if (!strcmp(p, "apple,always-on")) diff --git a/tools/asahi/t6030-pmp-supplier-tests.c b/tools/asahi/t6030-pmp-supplier-tests.c index ecb6dcec9fff5..6bbd3b30572e6 100644 --- a/tools/asahi/t6030-pmp-supplier-tests.c +++ b/tools/asahi/t6030-pmp-supplier-tests.c @@ -159,6 +159,12 @@ static bool of_machine_is_compatible(const char *name) { return !strcmp(machine, name); } +/* As in . */ +static inline bool apple_t8132_air(void) +{ + return of_machine_is_compatible("apple,j713") || + of_machine_is_compatible("apple,j715"); +} static struct device_node *of_find_compatible_node(struct device_node *from, const char *type, const char *compat) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/mocks.c b/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/mocks.c index 9ad16b8627902..ae59233cf8b9f 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/mocks.c +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/mocks.c @@ -192,6 +192,12 @@ static bool of_machine_is_compatible(const char *name) { return !strcmp(name, "apple,t8140"); } +/* As in . */ +static inline bool apple_t8132_air(void) +{ + return of_machine_is_compatible("apple,j713") || + of_machine_is_compatible("apple,j715"); +} #define READ_ONCE(x) (x) #define WRITE_ONCE(p, v) ((p) = (v)) From 8d11869d17b71318be1b1220626fc7f233014e05 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 01:00:13 +1100 Subject: [PATCH 79/79] tools/asahi: cover the CLPC ANE input in the host demand test The CLPC host test compiles the driver's sample path from clpc.c, which now also calls apple_clpc_ane_input_demand(). Extract that helper too, stub its client and lock, and check that T8140 ANE work votes DRAM 4 and fabric 3 (0x34) with reason bit 32, that a request shorter than one sample is still seen once, and that the vote expires after the hold. A new negative control drops the ANE demand and must fail. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- tools/asahi/clpc-gpu-demand-tests.py | 30 ++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/asahi/clpc-gpu-demand-tests.py b/tools/asahi/clpc-gpu-demand-tests.py index 68407dd744dd6..c8c2c9d9ad361 100644 --- a/tools/asahi/clpc-gpu-demand-tests.py +++ b/tools/asahi/clpc-gpu-demand-tests.py @@ -37,6 +37,7 @@ def main(): 'static bool apple_clpc_gpu_limited(', 'static void apple_clpc_gpu_floor_count(', 'static bool apple_clpc_gpu_input_demand(', + 'static bool apple_clpc_ane_input_demand(', 'static void apple_clpc_sample(']) code = r''' #include @@ -64,6 +65,9 @@ def main(): enum apple_clpc_rail { APPLE_CLPC_DCS, APPLE_CLPC_SOC, APPLE_CLPC_RAILS }; ''' + types + r''' struct apple_clpc_gpu { bool active; u64 sequence; }; +struct apple_clpc_ane { int lock; bool active, pending; }; +#define spin_lock_irqsave(l, f) ((void)(l), (f) = 0) +#define spin_unlock_irqrestore(l, f) ((void)(l), (void)(f)) struct apple_clpc_cluster { unsigned int request[APPLE_CLPC_RAILS]; }; struct apple_clpc { const struct apple_clpc_hw *hw; @@ -82,6 +86,8 @@ def main(): unsigned long gpu_streaming_samples, gpu_dense_samples; u64 last_vote_ns; struct apple_clpc_gpu *gpu; + struct apple_clpc_ane *ane; + unsigned int ane_states[APPLE_CLPC_RAILS]; }; static unsigned long jiffies; static u64 ktime_get_mono_fast_ns(void) { return jiffies * 1000000ull; } @@ -104,6 +110,23 @@ def main(): } static void apple_clpc_queue(struct apple_clpc *c, bool idle) { (void)c; queued_idle=idle; } ''' + dense_samples + '\n' + tables + '\n' + methods + r''' +// T8140 ANE work holds its DRAM and fabric states while it runs, a request +// shorter than one sample is still seen once, and the hold then expires. +static void check_t8140_ane(void) { + struct apple_clpc_ane ane={0}; + struct apple_clpc c={.hw=&apple_clpc_hw_t8140,.agent=1,.mask=3,.ane=&ane}; + c.ane_states[APPLE_CLPC_DCS]=c.hw->ane[APPLE_CLPC_DCS]; + c.ane_states[APPLE_CLPC_SOC]=c.hw->ane[APPLE_CLPC_SOC]; + read_error=vote_error=0; pmgr_status=0; pmp_floor=0; jiffies=1000; published=~0u; + apple_clpc_sample(&c); assert(published==0 && c.last_reason==0); + ane.active=true; jiffies=1004; apple_clpc_sample(&c); + assert(published==0x34 && c.last_reason==32); + ane.active=false; ane.pending=true; jiffies=1008; apple_clpc_sample(&c); + assert(published==0x34 && c.last_reason==32 && !ane.pending); + jiffies=1012; apple_clpc_sample(&c); assert(published==0x34 && c.last_reason==16); + jiffies=1040; apple_clpc_sample(&c); assert(published==0 && queued_idle); +} + // T8132's G16 firmware keeps graphics powered while the GPU idles: the // M5/F3 floor follows the work the GPU driver reports, as on T6040. static void check_t8132(void) { @@ -205,7 +228,8 @@ def main(): check_read_error(); check_t8140(); check_t8140_dense(); - puts("PASS: T6040 and T8132 host demand; T8140 streaming, dense work, read errors and PMP backoff; idle release"); + check_t8140_ane(); + puts("PASS: T6040 and T8132 host demand; T8140 ANE, streaming, dense work, read errors and PMP backoff; idle release"); } ''' code = code.replace('#define APPLE_PMC_RAIL_SHIFT(r) ((r)*8)', rail_shift) @@ -214,7 +238,9 @@ def main(): for name, text in [ ('fixed', code), ('omit-host-demand', code.replace('if (apple_clpc_gpu_input_demand(clpc->hw, clpc->gpu, demand))', - 'if (false && apple_clpc_gpu_input_demand(clpc->hw, clpc->gpu, demand))')), ('omit-streaming-demand', code.replace('bool streaming = apple_clpc_gpu_streaming(clpc, now);', + 'if (false && apple_clpc_gpu_input_demand(clpc->hw, clpc->gpu, demand))')), ('omit-ane-demand', code.replace('if (apple_clpc_ane_input_demand(clpc, demand))', + 'if (false && apple_clpc_ane_input_demand(clpc, demand))')), + ('omit-streaming-demand', code.replace('bool streaming = apple_clpc_gpu_streaming(clpc, now);', 'bool streaming = (apple_clpc_gpu_streaming(clpc, now), false);')), ('omit-dense-demand', code.replace('if (streaming || dense) {', 'if (streaming || (dense && false)) {')), ('dense-ignores-late', code.replace('if (!threshold || late || submissions < threshold)',