diff --git a/arch/arm64/boot/dts/apple/t6050-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts index cf1d62c690fc..64efe1ac5fd8 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 383ec08bedbe..4c3e02e76067 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 8fdea5242027..dad8ddb4d923 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 43747a4ce6be..c3a01629fec0 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 65d92d3a1748..bd35530cf6f8 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 68b4c324aca0..c3dbb5b8a517 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 0a7976e50230..93e74bc33c06 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 13ea865ba58e..8d6c6f624f00 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 caa609babef0..5cab2b89b674 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 ff9e875fb195..f2ae1bcf7573 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 fe6468edc72c..e85f92630def 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 000000000000..4534c70284e9 --- /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"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index 488f3c3ee6d6..6145093a248a 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>;