From 88d188d9e64273fa390444b8ca2504f478db16c0 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 23:00:20 +1100 Subject: [PATCH 1/2] arm64: dts: apple: t6050: enable the media engines on every board The video encoder (ave0), the first ProRes engine (apr0) and both JPEG engines were enabled only on the J714s, and the video decoder (avd0) only on the J714c, J714s, J775d and K116s. Every T6050 board's ADT has these engines at the same addresses, with the same interrupts, DART streams and power states, so describe their enables once. Add t6050-media.dtsi with the J714s enables for the decoder, encoder, ProRes and JPEG engines, their DARTs and their power states, and include it from every T6050 board after t6050-peripherals.dtsi. The J714s, J714c and K116s lose their copies of these blocks. The J775d keeps the decoders that t6050-ultra.dtsi describes enabled; the shared file leaves them alone there. Every DART enabled here already carries its engine's power state (dart-ave0 both instances: VENC0_SYS, dart-apr0: SCODEC, dart-jpeg0: JPG, dart-avd0: AVD_SYS). The encoder's firmware preload is handed over by the boot loader by compatible, so it needs no per-board change. The second encoder (ave1) and the second ProRes engine (apr1) of the M5 Max stay disabled: the boot loader hands over only the first encoder's preloaded firmware, which the AVE driver requires, and the ProRes driver's T6050 variant only describes the first engine's window layout. DTBs: the J714s is byte-identical. The J714c gains apple,always-on on FAB1_SOC, as the J714s, K116s and J775d already have. Every other board gains whichever of these engines it lacked, so all eleven now enable the same media nodes as the J714s. The J714s blocks were written by DjDeveloperr, the J714c decoder block by Eduard Moldovan and the K116s decoder block by Jens Axboe. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-j714c.dts | 22 +--- arch/arm64/boot/dts/apple/t6050-j714s.dts | 116 +---------------- arch/arm64/boot/dts/apple/t6050-j716c.dts | 1 + arch/arm64/boot/dts/apple/t6050-j716s.dts | 1 + arch/arm64/boot/dts/apple/t6050-j775c.dts | 1 + arch/arm64/boot/dts/apple/t6050-j775d.dts | 1 + arch/arm64/boot/dts/apple/t6050-j873s.dts | 1 + arch/arm64/boot/dts/apple/t6050-k114c.dts | 1 + arch/arm64/boot/dts/apple/t6050-k114s.dts | 1 + arch/arm64/boot/dts/apple/t6050-k116c.dts | 1 + arch/arm64/boot/dts/apple/t6050-k116s.dts | 29 +---- arch/arm64/boot/dts/apple/t6050-media.dtsi | 142 +++++++++++++++++++++ 12 files changed, 153 insertions(+), 164 deletions(-) create mode 100644 arch/arm64/boot/dts/apple/t6050-media.dtsi diff --git a/arch/arm64/boot/dts/apple/t6050-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts index cf1d62c690fcc..64efe1ac5fd8d 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714c.dts @@ -255,6 +255,7 @@ }; #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" /* * The PMP (ADT pmp0, /chosen, /arm-io/pmgr), as on the J714s. iBoot loads its firmware and the @@ -439,24 +440,3 @@ 05 8a 09 01 00 0e 01 41 70 70 6c 65 2c 20 49 6e 63 2e 00 06 02 69 4f 53 00 00 00 00]; }; - -/* The video decoder, its DART and power states. */ -&pmgr4 { - status = "okay"; -}; - -&ps_fab1_soc { - status = "okay"; -}; - -&ps_avd_sys { - status = "okay"; -}; - -&avd_dart { - status = "okay"; -}; - -&avd { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 383ec08bedbe2..4c3e02e760673 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -554,47 +554,7 @@ }; }; -/* - * The ProRes engine (apr0) and its DART, in the SCODEC power state. Its - * parent fab7-soc also feeds the display pipeline, so it is left to the - * firmware, as fab0-piogw is. - */ -&ps_fab7_soc { - apple,firmware-owned; - status = "okay"; -}; - -&ps_scodec { - status = "okay"; -}; - -&apr0_dart { - status = "okay"; -}; - -&apr0 { - status = "okay"; -}; - -/* - * Both JPEG engines and their shared DART, under the media fabric that the - * video encoder above already enables. - */ -&ps_jpg { - status = "okay"; -}; - -&jpeg0_dart { - status = "okay"; -}; - -&jpeg0 { - status = "okay"; -}; - -&jpeg1 { - status = "okay"; -}; +#include "t6050-media.dtsi" #include "t6050-j714s-pmp-tunables.dtsi" @@ -939,77 +899,3 @@ <&admac_ec_proxy 1>; dma-names = "cout", "cin", "spkr", "sense", "hpai"; }; - -/* The video decoder (J714sAP ADT avd0, as on the J714c), its DART and power states. */ -&pmgr4 { - status = "okay"; -}; - -/* macOS turns FAB1_SOC on once at boot and never gates it. */ -&ps_fab1_soc { - apple,always-on; - status = "okay"; -}; - -&ps_avd_sys { - status = "okay"; -}; - -&avd_dart { - status = "okay"; -}; - -&avd { - status = "okay"; -}; - -/* - * The video encoder (J714sAP ADT ave0), its DARTs and the VENC0 power states. Like - * FAB1_SOC, macOS sets FAB0_SOC active once at boot and never gates it; the PIO - * gateway above it is left to the firmware. - */ -&ps_fab1_piogw { - apple,firmware-owned; - status = "okay"; -}; - -&ps_fab0_soc { - apple,always-on; - status = "okay"; -}; - -&ps_venc0_sys { - status = "okay"; -}; - -&ps_venc0_dma { - status = "okay"; -}; - -&ps_venc0_pipe4 { - status = "okay"; -}; - -&ps_venc0_pipe5 { - status = "okay"; -}; - -&ps_venc0_me0 { - status = "okay"; -}; - -&ps_venc0_me1 { - status = "okay"; -}; - -&ave0_dart { - status = "okay"; -}; - -&ave0_dart1 { - status = "okay"; -}; - -&ave0 { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts index 8fdea5242027b..dad8ddb4d9235 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -232,6 +232,7 @@ }; #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" #include "t6050-max-atc2.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j716s.dts b/arch/arm64/boot/dts/apple/t6050-j716s.dts index 43747a4ce6be7..c3a01629fec00 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716s.dts @@ -570,3 +570,4 @@ #define T6050_J716S #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j775c.dts b/arch/arm64/boot/dts/apple/t6050-j775c.dts index 65d92d3a17480..bd35530cf6f8c 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775c.dts @@ -34,3 +34,4 @@ #define T6050_J775C #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j775d.dts b/arch/arm64/boot/dts/apple/t6050-j775d.dts index 68b4c324aca02..c3dbb5b8a517b 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775d.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775d.dts @@ -696,3 +696,4 @@ #define T6050_J775D #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j873s.dts b/arch/arm64/boot/dts/apple/t6050-j873s.dts index 0a7976e50230f..93e74bc33c069 100644 --- a/arch/arm64/boot/dts/apple/t6050-j873s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j873s.dts @@ -34,3 +34,4 @@ #define T6050_J873S #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts index 13ea865ba58e1..8d6c6f624f005 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -23,6 +23,7 @@ }; #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" / { aliases { diff --git a/arch/arm64/boot/dts/apple/t6050-k114s.dts b/arch/arm64/boot/dts/apple/t6050-k114s.dts index caa609babef0d..5cab2b89b674c 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114s.dts @@ -22,3 +22,4 @@ #define T6050_K114S #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts index ff9e875fb1951..f2ae1bcf75732 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116c.dts @@ -22,3 +22,4 @@ #define T6050_K116C #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index fe6468edc72c1..e85f92630def7 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -22,6 +22,7 @@ #define T6050_K116S #include "t6050-peripherals.dtsi" +#include "t6050-media.dtsi" / { aliases { @@ -885,31 +886,3 @@ &clpc { /delete-property/ apple,smc; }; - -/* - * The video decoder (K116sAP ADT avd0), its DART and power states, as on the J714s. - * ADT: avd0 reg[0] 0x2108000000 + 0x1404000, interrupts 2417/2418; dart-avd0 at - * 0x2109020000, interrupt 2424; FAB1_SOC at offset 0x1b0 and AVD_SYS at 0x1d8 of - * the pmgr's reg[46] (0x2180600000). - */ -&pmgr4 { - status = "okay"; -}; - -/* macOS turns FAB1_SOC on once at boot and never gates it. */ -&ps_fab1_soc { - apple,always-on; - status = "okay"; -}; - -&ps_avd_sys { - status = "okay"; -}; - -&avd_dart { - status = "okay"; -}; - -&avd { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t6050-media.dtsi b/arch/arm64/boot/dts/apple/t6050-media.dtsi new file mode 100644 index 0000000000000..4534c70284e91 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-media.dtsi @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * T6050 media engines: the video decoder (avd0), the first video encoder + * (ave0), the first ProRes engine (apr0) and both JPEG engines, with their + * DARTs and power states. Every T6050 board's ADT has all of them at the same + * addresses, so every board includes this file after t6050-peripherals.dtsi. + * The nodes themselves are in t6050-peripherals.dtsi (t6050-ultra.dtsi for + * the J775D's decoders); this file only enables them. + * + * Not enabled here: + * - ave1, the second encoder. The encoder runs firmware that iBoot + * preloads; the boot loader hands only the first T6050 encoder's preload + * (ADT ave0) to the DT, and the driver refuses an encoder without its two + * preloaded segments. + * - apr1, the M5 Max's second ProRes engine. The driver's T6050 variant + * needs the first engine's named core, wrapper, aux and ctrl windows and + * its SCODEC rows; the second engine sits in the PRORES power state with a + * different window layout, which the driver does not describe. + */ + +#ifndef T6050_J775D +/* The video decoder. t6050-ultra.dtsi describes both J775D decoders enabled. */ +&pmgr4 { + status = "okay"; +}; + +/* macOS turns FAB1_SOC on once at boot and never gates it. */ +&ps_fab1_soc { + apple,always-on; + status = "okay"; +}; + +&ps_avd_sys { + status = "okay"; +}; + +&avd_dart { + status = "okay"; +}; + +&avd { + status = "okay"; +}; +#endif + +/* + * The ProRes engine (apr0) and its DART, in the SCODEC power state. Its + * parent fab7-soc also feeds the display pipeline, so it and fab0-piogw above + * it are left to the firmware. + */ +&ps_fab0_piogw { + apple,firmware-owned; + status = "okay"; +}; + +&ps_fab7_soc { + apple,firmware-owned; + status = "okay"; +}; + +&ps_scodec { + status = "okay"; +}; + +&apr0_dart { + status = "okay"; +}; + +&apr0 { + status = "okay"; +}; + +/* + * The video encoder (ave0), its DARTs and the VENC0 power states. Like + * FAB1_SOC, macOS sets FAB0_SOC active once at boot and never gates it; the + * PIO gateway above it is left to the firmware. + */ +&ps_fab1_piogw { + apple,firmware-owned; + status = "okay"; +}; + +&ps_fab0_soc { + apple,always-on; + status = "okay"; +}; + +&ps_venc0_sys { + status = "okay"; +}; + +&ps_venc0_dma { + status = "okay"; +}; + +&ps_venc0_pipe4 { + status = "okay"; +}; + +&ps_venc0_pipe5 { + status = "okay"; +}; + +&ps_venc0_me0 { + status = "okay"; +}; + +&ps_venc0_me1 { + status = "okay"; +}; + +&ave0_dart { + status = "okay"; +}; + +&ave0_dart1 { + status = "okay"; +}; + +&ave0 { + status = "okay"; +}; + +/* + * Both JPEG engines and their shared DART, under FAB0_SOC like the video + * encoder. + */ +&ps_jpg { + status = "okay"; +}; + +&jpeg0_dart { + status = "okay"; +}; + +&jpeg0 { + status = "okay"; +}; + +&jpeg1 { + status = "okay"; +}; From 93af6fdc9d68009d0f92f191d64b8939df01decb Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 23:33:03 +1100 Subject: [PATCH 2/2] arm64: dts: apple: t6050: name the second window of the AVE and JPEG DARTs The apple,dart binding requires reg-names once a DART has two register windows. ave0_dart, ave0_dart1 and jpeg0_dart have two each but no names, so every board that enables them fails dtbs_check. Name them after the DART instance each window is in the board's ADT: ave0_dart's second window is its address filter ("dapf"); ave0_dart1's second window and jpeg0_dart's (a shared gateway page) are neither a DAPF nor a GAPF, so they are "auxiliary". No functional change: the driver reads a "dapf" window only together with apple,dapf-ranges, which these nodes do not have, and it does not use "auxiliary" windows. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-peripherals.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index 488f3c3ee6d6e..6145093a248a3 100644 --- a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi @@ -3192,6 +3192,8 @@ compatible = "apple,t6050-dart", "apple,t8110-dart"; reg = <0x22 0x830a0000 0x0 0xc000>, <0x22 0x830b0000 0x0 0x4000>; + /* No apple,dapf-ranges: the driver leaves the DAPF page alone. */ + reg-names = "dart", "dapf"; interrupts = ; power-domains = <&ps_venc0_sys>; #iommu-cells = <1>; @@ -3203,6 +3205,7 @@ compatible = "apple,t6050-dart", "apple,t8110-dart"; reg = <0x22 0x83080000 0x0 0xc000>, <0x22 0x83094000 0x0 0x4000>; + reg-names = "dart", "auxiliary"; interrupts = ; power-domains = <&ps_venc0_sys>; #iommu-cells = <1>; @@ -3312,6 +3315,7 @@ compatible = "apple,t6050-dart", "apple,t8110-dart"; reg = <0x22 0x81020000 0x0 0xc000>, <0x2 0x74000000 0x0 0x4000>; + reg-names = "dart", "auxiliary"; interrupts = ; power-domains = <&ps_jpg>; #iommu-cells = <1>;