From ff0deb533bc021be8600fb23c440c37f2059b22a Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 22:26:51 +1100 Subject: [PATCH] media: apple: scaler: add the M2 Pro, Max and Ultra engines The scaler matched T8103, T6000, T8112 and the M4/A18 Pro engines, but not T6020, T6021 or T6022. Their device trees describe the MSR engines (one on M2 Pro, two on M2 Max, four on M2 Ultra) and keep them disabled because nothing would bind. The driver needs two things from a variant: the number of register ranges and whether the engine has the MSR20 control block (M4 and later). The T602x nodes have the T8112 register map: three ranges of 0x28000, 0x4000 and 0x4000 bytes at +0, +0x210000 and +0x204000, two DART streams, and the "apple,scaler" fallback. The scaler binding already puts apple,t6020/t6021/t6022-scaler in the same constraint group as apple,t8112-scaler. They are M2-generation engines, before MSR20. Use the T8112 data for them. Enable the engines and their DARTs in the T6020, T6021 and T6022 peripheral trees, so every board with the SoC gets them. The DARTs name the MSR domain of their own die (commit 410949741839, "arm64: dts: apple: t602x: give the scaler and external DCP DARTs their power domains"), so the DART's first register read finds its block powered. The engines additionally vote the T602x media fabric domain (ps_afr), which the driver links through its power-domain list. T8103, T6000/T6001/T6002 and T8112 device trees are unchanged. Signed-off-by: Ryan Murray Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/t6020-peripherals.dtsi | 4 ++-- arch/arm64/boot/dts/apple/t6021-peripherals.dtsi | 8 ++++---- arch/arm64/boot/dts/apple/t6022-peripherals.dtsi | 16 ++++++++-------- .../platform/apple/scaler/apple-scaler-drv.c | 7 +++++++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6020-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6020-peripherals.dtsi index a521eb74b9ea2..3a1e1b6d2b3ab 100644 --- a/arch/arm64/boot/dts/apple/t6020-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6020-peripherals.dtsi @@ -600,7 +600,7 @@ ; iommus = <&m2_dart_scaler0 0>, <&m2_dart_scaler0 1>; power-domains = <&ps_msr0>, <&ps_afr>, <&ps_msr0_ase_core>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler0: iommu@40b200000 { @@ -610,7 +610,7 @@ interrupts = ; power-domains = <&ps_msr0>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave0_2: iommu@40d020000 { diff --git a/arch/arm64/boot/dts/apple/t6021-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6021-peripherals.dtsi index 61061f89aeb84..62c0fda0a08b9 100644 --- a/arch/arm64/boot/dts/apple/t6021-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6021-peripherals.dtsi @@ -778,7 +778,7 @@ ; iommus = <&m2_dart_scaler0 0>, <&m2_dart_scaler0 1>; power-domains = <&ps_msr0>, <&ps_afr>, <&ps_msr0_ase_core>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler0: iommu@40b200000 { @@ -788,7 +788,7 @@ interrupts = ; power-domains = <&ps_msr0>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave0_2: iommu@40d020000 { @@ -870,7 +870,7 @@ ; iommus = <&m2_dart_scaler1 0>, <&m2_dart_scaler1 1>; power-domains = <&ps_msr1>, <&ps_afr>, <&ps_msr1_ase_core>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler1: iommu@491200000 { @@ -880,7 +880,7 @@ interrupts = ; power-domains = <&ps_msr1>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave1_2: iommu@507020000 { diff --git a/arch/arm64/boot/dts/apple/t6022-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6022-peripherals.dtsi index 0b41c11853b58..a9a93e286c603 100644 --- a/arch/arm64/boot/dts/apple/t6022-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6022-peripherals.dtsi @@ -1140,7 +1140,7 @@ ; iommus = <&m2_dart_scaler0 0>, <&m2_dart_scaler0 1>; power-domains = <&ps_msr0>, <&ps_afr>, <&ps_msr0_ase_core>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler0: iommu@40b200000 { @@ -1150,7 +1150,7 @@ interrupts = ; power-domains = <&ps_msr0>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave0_2: iommu@40d020000 { @@ -1298,7 +1298,7 @@ ; iommus = <&m2_dart_scaler1 0>, <&m2_dart_scaler1 1>; power-domains = <&ps_msr1>, <&ps_afr>, <&ps_msr1_ase_core>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler1: iommu@491200000 { @@ -1308,7 +1308,7 @@ interrupts = ; power-domains = <&ps_msr1>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave1_2: iommu@507020000 { @@ -1953,7 +1953,7 @@ ; iommus = <&m2_dart_scaler2 0>, <&m2_dart_scaler2 1>; power-domains = <&ps_msr0_die1>, <&ps_afr_die1>, <&ps_msr0_ase_core_die1>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler2: iommu@40b200000 { @@ -1963,7 +1963,7 @@ interrupts = ; power-domains = <&ps_msr0_die1>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave2_2: iommu@40d020000 { @@ -2111,7 +2111,7 @@ ; iommus = <&m2_dart_scaler3 0>, <&m2_dart_scaler3 1>; power-domains = <&ps_msr1_die1>, <&ps_afr_die1>, <&ps_msr1_ase_core_die1>; - status = "disabled"; + status = "okay"; }; m2_dart_scaler3: iommu@491200000 { @@ -2121,7 +2121,7 @@ interrupts = ; power-domains = <&ps_msr1_die1>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; }; m2_dart_ave3_2: iommu@507020000 { diff --git a/drivers/media/platform/apple/scaler/apple-scaler-drv.c b/drivers/media/platform/apple/scaler/apple-scaler-drv.c index d9707d2aec068..fb28e8b3386f9 100644 --- a/drivers/media/platform/apple/scaler/apple-scaler-drv.c +++ b/drivers/media/platform/apple/scaler/apple-scaler-drv.c @@ -895,6 +895,13 @@ static const struct of_device_id asc_of_match[] = { { .compatible = "apple,t8103-scaler", .data = &apple_scaler_t8103 }, { .compatible = "apple,t6000-scaler", .data = &apple_scaler_t6000 }, { .compatible = "apple,t8112-scaler", .data = &apple_scaler_t8112 }, + /* + * M2 Pro/Max/Ultra: the M2 engine. Same three register ranges at the + * same offsets, two DART streams, and the binding's T8112 contract. + */ + { .compatible = "apple,t6020-scaler", .data = &apple_scaler_t8112 }, + { .compatible = "apple,t6021-scaler", .data = &apple_scaler_t8112 }, + { .compatible = "apple,t6022-scaler", .data = &apple_scaler_t8112 }, { .compatible = "apple,t8132-scaler", .data = &apple_scaler_t8132 }, { .compatible = "apple,t6041-scaler", .data = &apple_scaler_t6041 }, { .compatible = "apple,t8140-scaler", .data = &apple_scaler_t8140 },