From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 253733EB7FE for ; Thu, 17 Sep 2026 05:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621284; cv=none; b=qiKjfWEdWHS3NmVEwv6iQNO1wofPiY7YofwU1RmaLP1JY82o+VOjihV6BHPLP97cKIXKwnlqXaq9ZRI+2cOZZ8TqXA9Vx3Naql8Ps75mO0/MlMg+6cj4BYGk6WKnnrHnU5BLkdmgUwajqwoPGTInmvUAn1Hqyw9WGhaPANpcqvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621284; c=relaxed/simple; bh=AEn1qZIvtYsDtYW9Jo2rMgEyNXr2DDHQTheOu69T+/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JSeP3AoZBOwfp2HN1yrAwgK7iEbT9Noz7SwRnAG4YzDMyAwGqkpmBZc84BtGZCwiCVYb22ihGTEaYygdwijV1y/0i0TeQYhWf2Y8SsFZK6/W0OutnciDxsr6h+RoFI3FwPxKbHgCS+DO7HJXx1l/lKRn3dPd6pvPmzkloDJMBgU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=KZ7COhJJ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bb8kr1oC; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="KZ7COhJJ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bb8kr1oC" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H2Gron1239351 for ; Thu, 17 Sep 2026 05:01:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= BenidIYy78D5ORho3gGl03C9Pj+mlKVSX0JJ7xNJ3Fw=; b=KZ7COhJJqb47T6tY cQ4ixBaqvBl6F4bQPIE1+5LIoZEhJMRCsMmYtWK28Y2LHVHws52JlmY/LCacLWg9 /+einPn9dugMVb60wA2LJfaNnlTNZRjxaL9vq1o8p2hTVy95TMJpRyipR8ypMErw L8pxlt+bUjN5n06gNMGxUP6nBPSM8RIpsAKdTbgGEHNvjZEfO4tEr8yyT5DmuLeN kb8EH9TlvHe+MFx6alGlpL0RqNptcB+cm5aXayHH/OAKnlqv3uH6YCeOAskmqR7T yPp+QdYFWe3pTVojXr4bcaGRvJDY3M8uGVCQas+2LfDdJpDs5XnHRrmudjAGJG45 9v/VAA== Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gr79m0hep-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:22 +0000 (GMT) Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-48296f34f1dso404235fac.3 for ; Wed, 16 Sep 2026 22:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621281; x=1790226081; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BenidIYy78D5ORho3gGl03C9Pj+mlKVSX0JJ7xNJ3Fw=; b=bb8kr1oCVlbFvuPmYwx5Z8kxmD0EpaMbUkmHYLsCZLYQ9fHt52eiuseIjt2OBPjTCy 9Gl6S/qnCsMCD1Pye6gEQq2UM0Ww39UT719H7Fi4joqOLCbxS20TcI9CYdTfi10LBtJI gFfE31vCKRfc6K8/chsPZqBmb9815Ef43xKv6a4BDjuddOV0Q8IKMb5qCh4RoNSBXkkf k8FriHcJjRLFhHV79s03hN+z1AiXWWh5TxQ1QoqP3MxcLQMv4/JGCRANbiimLbmDvH1K kgres4Hxh9fLOgOgzKx4FhgPrDk7kPWSXcXQpMuEaqKE7y2ZLFe0AQijC65IrBvoIDOR fJKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621281; x=1790226081; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BenidIYy78D5ORho3gGl03C9Pj+mlKVSX0JJ7xNJ3Fw=; b=Ic2tnVW2/ucgFXMTSAjYFqV+d5K+S6agdLcCiIxGeV4i0DSFeiMS6cXX/7J7AlPtd5 pa3Ay2JNa56FGnK5fxJIfR5K0eHky1vj5144vQ7uf/g1Ek7ZR9VkN6FfmwcGdHzYHXu+ 8lQ0ZbKpRL0iHzD3v+DCc4gtnEqD1om9muw1BcA6giJ30/lWbXYCcZEOfEpSv0MwxbnY 4DjC1c8vhVpSDdLU8J/6Me/k08Wfsut98Wry7Wjl069uPriYP/xqV/O1PxIO3NPYTqEx m76HViCKzA/bGMNg0/3z89ogbSvRZMVqxJoPfHPKULnIw1kNgGZwwx699O0UuM6kmPbH Rjjw== X-Forwarded-Encrypted: i=1; AKwUvBzGZE2fVcXdGeJPbHX4G1B4sa4IMby57FuIIsdFAKncjJAr5CvsTNH9RqEn+z2PC97BXuBBYt1WudQpXIs=@vger.kernel.org X-Gm-Message-State: AFuF++my6aJ1AcWA6AiIj/hYChzvIwvgd+yA+kQcgSEt0z6kYGub29bF RSCeCeca0vybPIvY71OaRSEhd3/ldSteM5sxkYV7q1lCcGmfwBu/uLGL7XX87zvy4/6hJdjUAIR 4wfNPYkTZgC6W6Y4hHx1jtdVzI1vru6/f+prm5+JkKkmpLOerLqDkDLinL9V6y65e2s0= X-Gm-Gg: AYBFou3L0OkXLjj3Cc+cJ0ZlyX90PPrISR6SSgMbr9Vqqb7mV61smleaoQ14uWSXZ8D 8bpLEzIigY9oPp07rsFOFP/6LfD6wBjb7VbpWT/ex9l+NelVoZthBejbhwjKNup5p4bCRSIUZBJ s89iFZ0ZRZOIe4IhJai1X7J7tACI93pSC1oeGu+HvvleWZgvmMGUoYlqT907lS5eLcS+j96UEQS xMM/Zi/aUXsuXwkTF+LuxuD2x4UB/zro3cAoBClm/w46DB6VkHMQCsrHlEIUdRb+sDhKsZy9acA avGhJcPGkut3CXB0IZRnUnFbmwDawNKr5XmvHPDZfEeqexE4xZ1JQ6mniIZRcGQ0XOo2cJ9Vyzl 1eoE74OgOEUYeLTI5zESV8LXfC7IT3QKPgQ== X-Received: by 2002:a05:6820:4dea:b0:6b7:8415:d77d with SMTP id 006d021491bc7-6c7d27e0047mr5403610eaf.40.1789621281001; Wed, 16 Sep 2026 22:01:21 -0700 (PDT) X-Received: by 2002:a05:6820:4dea:b0:6b7:8415:d77d with SMTP id 006d021491bc7-6c7d27e0047mr5403585eaf.40.1789621280539; Wed, 16 Sep 2026 22:01:20 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:20 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:20 +0530 Subject: [PATCH v11 1/9] dt-bindings: media: qcom,glymur-iris: Add glymur video codec Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-1-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=10123; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=AEn1qZIvtYsDtYW9Jo2rMgEyNXr2DDHQTheOu69T+/8=; b=wH4GJlnxeys4KCqT3HAYrZSFaR2J34Vlv5vvYpqGef8h8if9qJPqgDElcxfYWHFr/srgQMBCS usMygibwXm4CgBB/sMibCANGrbRM+G6StbJrwhFdo2ellKKTpZLxhQM X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Qf7zLcbv c=1 sm=1 tr=0 ts=6aab7422 cx=c_pps a=Z3eh007fzM5o9awBa1HkYQ==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=dj5hHLeW_VTS2ukcrJ0A:9 a=QEXdDO2ut3YA:10 a=eBU8X_Hb5SQ8N-bgNfv4:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-GUID: F2oRJVtBkaVcABkI09XNcVGnacNJau9f X-Proofpoint-ORIG-GUID: F2oRJVtBkaVcABkI09XNcVGnacNJau9f X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXzxL20iNweb0E iGnpdVcjjpkjOyFfxhwgo4eH6k4b8DTxJviBJRadZQP/ysGJlLMPwCDOMRebexFG1Z9sGgNVCdG 8NCgtKsJwjwbvzEm42VFsEWk20J6FtB7P3Vj6OwqrS5cwD/EpEOzxPKrhWpwWUHZQuHecEqIXdq 6AZMy/gk4JGP68KdGUug37rdMm/L9vuES7mjzMPzzXU14RcB9FCItaZtj1LdsY2URfdXy1BRMIs 0MDzSD5UuxVItjitqbPJvuSWmt0SJCz9bNdAIMlHVRtl/NEu7RJlPC7t96W4eXtGSBs9apEn2zF T5uQbrDrAV8kOti0GcMyjCl5Xe3ahrYP0CfotDlSXXHXB1Kbn1sndBZ3/9wb9XnAyePSKCiCu+W ojF3C+PX09O/vH2ut+jZUuMLqg5wbiMR0ifaaBQxMzgkacwsPwy+FVS3RX69o/5YgsETRk7u2qj E0sueh2alMbBTLjcoEQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXx1ikoqJ1KpjD meWoqOJcJ6wTNeQ8VF4I0yqQrM0QsBMyPSdeVueJggz3nxCTHmadp8bFTiRA8DBSnSIIgpbbGcJ xvI7x2yI7QeHCTy/0JBtfKdH4fnLC9A= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 Add device tree binding for the Qualcomm Glymur Iris video codec. Glymur is a new generation of video IP that introduces a dual-core architecture. The second core brings its own power domain, clocks, and reset lines, requiring additional power domains and clocks in the power sequence. The current maxItems constraints for clocks, power-domains and non-pixel iommus in the common venus schema were sized for platforms available at the time of authoring. The glymur platform introduces a dual core architecture that requires more clocks and power domains, exceeding these limits. Raise maxItems for clocks, clock-names, power-domains, power-domain-names and non-pixel iommus to accommodate glymur platform. The glymur platform specific schema have fixed constraints for these properties, so the common schema only acts as an upper bound. Since the common schema now only acts as an upper bound, add explicit maxItems overrides for the non-pixel iommus in the qcom,sm8550-iris and qcom,sm8750-iris schemas to keep the fixed constraints as before. Signed-off-by: Vishnu Reddy --- .../bindings/media/qcom,glymur-iris.yaml | 218 +++++++++++++++++= ++++ .../bindings/media/qcom,sm8550-iris.yaml | 6 + .../bindings/media/qcom,sm8750-iris.yaml | 6 + .../bindings/media/qcom,venus-common.yaml | 11 +- 4 files changed, 236 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml new file mode 100644 index 000000000000..de4792f3b658 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml @@ -0,0 +1,218 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,glymur-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Glymur SoC Iris video encoder and decoder + +maintainers: + - Vishnu Reddy + +description: + The Iris video processing unit on Qualcomm Glymur SoC is a video encode = and + decode accelerator. + +properties: + compatible: + const: qcom,glymur-iris + + clocks: + maxItems: 9 + + clock-names: + items: + - const: core_iface + - const: core + - const: vcodec0_core + - const: vcodec0_iface + - const: core_freerun + - const: vcodec0_core_freerun + - const: vcodec1_iface + - const: vcodec1_core + - const: vcodec1_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + non-pixel: + type: object + properties: + iommus: + maxItems: 3 + + operating-points-v2: true + opp-table: + type: object + + power-domains: + maxItems: 5 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + - const: vcodec1 + + resets: + maxItems: 6 + + reset-names: + items: + - const: core_bus + - const: vcodec0_bus + - const: core + - const: vcodec0_core + - const: vcodec1_bus + - const: vcodec1_core + +required: + - clocks + - clock-names + - compatible + - dma-coherent + - interconnects + - interconnect-names + - power-domains + - power-domain-names + - resets + - reset-names + +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + + video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0aa00000 0xf0000>; + + clocks =3D <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>, + <&gcc_video_axi1_clk>, + <&videocc_mvs1_clk>, + <&videocc_mvs1_freerun_clk>; + clock-names =3D "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun", + "vcodec1_iface", + "vcodec1_core", + "vcodec1_core_freerun"; + + dma-coherent; + + interconnects =3D <&hsc_noc_master_appss_proc &config_noc_slave_ve= nus_cfg>, + <&mmss_noc_master_video &mc_virt_slave_ebi1>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + interrupts =3D ; + + memory-region =3D <&video_mem>; + + operating-points-v2 =3D <&iris_opp_table>; + + power-domains =3D <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc_mvs1_gdsc>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vcodec1"; + + resets =3D <&gcc_video_axi0c_clk_ares>, + <&gcc_video_axi0_clk_ares>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>, + <&gcc_video_axi1_clk_ares>, + <&videocc_mvs1_freerun_clk_ares>; + reset-names =3D "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0xffe00000>; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0000>, + <&apps_smmu 0x1944 0x0000>, + <&apps_smmu 0x19e0 0x0000>; + iommu-ranges =3D <0x25800000 0xda600000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1943 0x0000>; + }; + + video-firmware { + iommus =3D <&apps_smmu 0x19e2 0x0000>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000 240000000 360000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 507000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz =3D /bits/ 64 <366000000 366000000 549000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 666000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334 533333334 800000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz =3D /bits/ 64 <655000000 655000000 982000000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index 6ee9d23554cf..81d35be565f9 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -81,6 +81,12 @@ properties: iommus: maxItems: 2 =20 + non-pixel: + type: object + properties: + iommus: + maxItems: 1 + dma-coherent: true =20 memory-region: diff --git a/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml index b6d5ded1aae6..6c1ed1b9fdde 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml @@ -43,6 +43,12 @@ properties: iommus: maxItems: 2 =20 + non-pixel: + type: object + properties: + iommus: + maxItems: 1 + operating-points-v2: true opp-table: type: object diff --git a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml= b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml index 68d5e592a028..03b8b8992624 100644 --- a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml +++ b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml @@ -20,11 +20,11 @@ properties: =20 clocks: minItems: 3 - maxItems: 7 + maxItems: 9 =20 clock-names: minItems: 3 - maxItems: 7 + maxItems: 9 =20 firmware-name: maxItems: 1 @@ -41,11 +41,11 @@ properties: =20 power-domains: minItems: 1 - maxItems: 4 + maxItems: 5 =20 power-domain-names: minItems: 1 - maxItems: 4 + maxItems: 5 =20 '#address-cells': const: 1 @@ -64,7 +64,8 @@ properties: =20 properties: iommus: - maxItems: 1 + minItems: 1 + maxItems: 3 iommu-ranges: maxItems: 1 required: --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3BB03EB7FE for ; Thu, 17 Sep 2026 05:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621293; cv=none; b=OqUlzZHfTk5kegUeeDA59+1yyLGyuYCMqySZxyb5vuqhTG3BrcFk2Fh/0n0qlq+gc5N+tK/RLbwLnyZ1wVYOncS03IOMVWD1yak7NSYW34VyDxBaUc0SJEVTu9W39s9iFtV3Ea5zo41zCEgNRtzkTHPKFiRR2xDOfhVsvvFLYos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621293; c=relaxed/simple; bh=vD9rSJDP8x9PwXl9K5hnyRGQ1BA8Zsd0Mk/jziWWWSY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h87rG8dYxhQ3ldwM4mVEnGz5X8qXHU7JcoBJd2ppN7aiyHV14na/fiu8Xk9KhjJSN39JWCFQ6z46msbJiXnvO9H7MubjfWGReXq9eLgPYvLoTQaffetxS7CDCghJPzDW2Y9ORzkMQCji8HtYR4zsoQgNYo0B7YocJUYURhoZJuY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=VmqeEv7o; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=E8z2pDLH; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="VmqeEv7o"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="E8z2pDLH" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H166KG3403376 for ; Thu, 17 Sep 2026 05:01:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ELOxM4ZOEXnb0gqasQYqPct6U4hXPnR2eQW+WWya7Yo=; b=VmqeEv7ouuuOPE88 34a/00gubBS6VfvIIwPkhQnxRrkDhbOEubj5fN8zIDRCd8WEs9Nzij8z8+aLSlS6 qUAyZx+Z9CC23bD4GE8qyqdw0f9gC5qlHpWu6JSWMsVF0bJGwkQZlTL1IQAev0uT vkdb8Ubo9s1BcmZyjpPizfTxs3vVi54aPL3tQN2bSC/1PxoUgisdq+6Hy04Q5SUh 94stlTyEFsY0X0QdgZWO5Bg+2McoEj+Dv5diwnoYmHBe5etP8lNu34WK4YHi7TBp fpBgibPJkRy1MwZhgZvWF+0puHcsqet0DbKchBUI6VuANilBCAocP44LsJ9MCBk1 3IZPRA== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gqy2d2m2x-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:31 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-cc4b524ce78so319018a12.2 for ; Wed, 16 Sep 2026 22:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621290; x=1790226090; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ELOxM4ZOEXnb0gqasQYqPct6U4hXPnR2eQW+WWya7Yo=; b=E8z2pDLHMmYd5TPJsa/hCKkzbLxyJTMdjzMPzKOm9x81ZA6JrVzx3hcTG4IoTMNYXM A0L0pitCVjvZ8HEDkLeUBDKIF4dTCKz0991++Ytu5rLBYxNFwzYrtj28RMUeZsyifFVF qRf8pjYkt+RT9sc09ZRmCzZqCGJX6qJH3m79z95Y7qV6HYjb+hVVmBqbyiVW03Fgr0E2 VbaJXvJEICH0nBRcrlyRrsVrDlFca3o7b5BiJW4jt9bHmlYGIJKbEJEf6gsgHPlz/Wr7 SxJV3koziWraClfJZmKZPxJ3e1uDnxmFwc2bcos7qmEcdY1dV8VgfVlhfS4ILBSFGYWD BPyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621290; x=1790226090; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ELOxM4ZOEXnb0gqasQYqPct6U4hXPnR2eQW+WWya7Yo=; b=eT5HQQUiwnj0VCWw/HCDhEEAbHh4/a5lvi38/1B7eWlMXKmKeEyMW/hJz++oY+DLkL nKVOLaCxGa7VQjWPLIb71rTIbh9FKnXwTefrFDIj4VjdL8oVxrOzw37jAaf/HR2UB4Zh wET48mN28aFC4wEMnHmGsQQ3lys8fBH4aHAUAq/T7+OeIWKHeXz4CI0vjngNG7cx2u9Q R9jFV7INF9wAYi6aVNAXYcDxbNmidjbuxDcbcW7K8D0fAkT7O/DSG+VH5UtXrfV08iVt UQdUEE5vTLEtbp4Ou22N45PnD7KCmptmSCWSbcN2aH/o4sHjV9Kl96d0AGOxFP2aU/Mm Ds1g== X-Forwarded-Encrypted: i=1; AKwUvBxpJ03to+Pga2xqiiEXtmvvh/d0WyKOi0ySZOiJPIMsKXGO5mW/QgXDNnwtMqEzCKM30sd1zdrStS9Dm2g=@vger.kernel.org X-Gm-Message-State: AFuF++m7fnv/HLMVRUTKtrN+QWS+KJGnrXlzrXgMQcrteFfEGkZu31qa cOBHgBqGlhj9mdbF85nE+gztJ3EKWr0HC10LiEUpw/Tr6U4IShUjBrnbQiD2ZdW/8jNTCV1wr/I M6cTNnxQ3OMmPsklxdMpLohDN4sT9iD9Ez1arBI8GZe67eEU0KGkC0us3bzAM/OHeaNA= X-Gm-Gg: AYBFou26K8xYvenBNd7nxP1G5eo24s6SCIwhdMf6EYmG15twXQmsp8WbUXVf2+pN/5g M3i9xFnSL3IwXaITorE7AnzOWNdlQFRatJueFHTyYmh9ngeBP5D+mw3EfNRmuWqbUNAu/GS83TA uK9ZY3SWFSMJmVmBjUs7/8p3oE0VO2U01exLH7EsiX7tcFaNlMFWJDtggqUhDOlCCsZ2WWTy4UN q24spRuCmOIrYxh4FDC/X/DAZ+2KY8GndEGsXL1HiJWqksFQoZFQX9+KSifOLzET6StGNzIWBBH 13Pts0GPekWZ7debkJWY+Yyaj5UoQoK19hgvMR3MZmwVMRwPWP1dtLMnk8Cz71BTHmuqlH3UKK0 = X-Received: by 2002:a05:6a20:a10a:b0:3cc:45cc:c401 with SMTP id adf61e73a8af0-3dd5f5af443mr12800523637.13.1789621288434; Wed, 16 Sep 2026 22:01:28 -0700 (PDT) X-Received: by 2002:a05:6a20:a10a:b0:3cc:45cc:c401 with SMTP id adf61e73a8af0-3dd5f5af443mr12800418637.13.1789621287814; Wed, 16 Sep 2026 22:01:27 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:27 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:21 +0530 Subject: [PATCH v11 2/9] media: iris: Enable Secure PAS support with IOMMU managed by Linux Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-2-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy , Mukesh Ojha X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=8492; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=2/Gq93R9cpgwk7KxsAU2reyrjwlqEiy3PAOkiucUGPw=; b=ysEdEgwI34d1zGh7C9vj0TKupQtTIoDYLMYw4GMTnJKnDbHaUuGOKK8unpHgFyaSsREf99LJb ugAu/qC23BkBKIdPhjr6vM6Bu7ezHMAWD8l4bcb2UY/MZR7aI7ZSx+r X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-ORIG-GUID: HvONxd4YAzpd4naBgAhfJDSe5FRYd9R1 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX3iN7D5bDe6cc spHJRnzTPAF8hHaQbl3rRVNEEdOWv23co3CQ2NjySyFmNhjTBy4UaeT23y39HScsO8Ft/CTSaVC 0UauFc5eFcyEn2kpKS/W+0aeI6ChxAg= X-Authority-Analysis: v=2.4 cv=HbeB3SE8 c=1 sm=1 tr=0 ts=6aab742b cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=gsvzk-epdriNwW7vwuEA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-GUID: HvONxd4YAzpd4naBgAhfJDSe5FRYd9R1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX8EcFscKAc1Q5 POKKl3ty+WQr7+cNyAIw/D0AwOTcGbCOUapUbOQI0D+R1EaS2SCyu4HIEke8dHNsWoV59wbAxhv oqzK04BQCOM4QsERNpgoIHOtDh2GuLKrkf3/ikBOvMEoc4m0AO6tG9lZDU01OAgb9wUxINT84tF U3Z4ASutnPW5TJFFpTVIllHuulrAFSyu/v5y3NiZZQ5qGryfE6xHwlPaptbmQ5EeS5jm7BJgWlq 6uh/SVRM6v20VP1hKnkdUxVkzwe36uX9oFmUfMr4Ar39n1mssdOAJKNpog5yOVbiE08wzIwM4oW dSiPXAs0TVjXiV3sEfKSc6Z1idGn+82tFVkxJ7cglfyln51kGumTWwUX1Tie9ToTPFBlK9Ky9CG rigYdQxeXZD27sw+jbyjpug6OnP0ux+f9iOJwL7fcOzxCm8rS/52p23VK9Tv/Xook8cmVNWNvra 0L1L0W4gzjQb/athVGw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 From: Mukesh Ojha On platforms where a hypervisor is present, all Secure Monitor Calls (SMC) are intercepted. For qcom_scm_pas_auth_and_reset(), the hypervisor registers a Shared Memory (SHM) bridge over the Peripheral Image Loader (PIL) memory region so that TrustZone (TZ) can access it, forwards the authentication SMC to TZ, and upon return maps the PIL region and triggers the co-processor bring-up sequence: HLOS -> Hypervisor(SHM setup) -> TZ(auth) -> Hypervisor(map+reset) -> IRIS On platforms without a hypervisor, Linux drives these steps directly. The SHM bridge infrastructure required for this is already upstream [1]. To isolate firmware memory in its own Input-Output Memory Management Unit (IOMMU) context, a dedicated stream ID (SID) is required, tied to the firmware function ID. This SID is specified via the iommu-map property in the device tree using the firmware function ID as the lookup key. A firmware device is created and mapped to this SID. The presence of a SID mapped to the firmware device via iommu-map is used to detect whether a hypervisor is absent: when the firmware device has a SID mapped, Linux manages the IOMMU directly; when no SID is mapped, a hypervisor is assumed to be present and these steps are skipped. Extend the Iris driver to support Secure Peripheral Authentication Service (PAS) on platforms where Linux manages the IOMMU, by creating the firmware context device and performing the necessary IOMMU mapping when the firmware device SID is present. [1] https://lore.kernel.org/lkml/20260105-kvmrprocv10-v10-0-022e96815380 @oss.qualcomm.com/ Reviewed-by: Vishnu Reddy Co-developed-by: Vikash Garodia Signed-off-by: Vikash Garodia Signed-off-by: Mukesh Ojha Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/lkml/20260105-kvmrprocv10-v10-0-022e96815380@= oss.qualcomm.com/ Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_core.h | 4 ++ drivers/media/platform/qcom/iris/iris_firmware.c | 69 ++++++++++++++++++--= ---- drivers/media/platform/qcom/iris/iris_probe.c | 12 +++++ 3 files changed, 70 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 3c96f46cf567..5ed2ec0b97ec 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -38,6 +38,8 @@ struct qcom_ubwc_cfg_data; * @dev: reference to device structure * @np_dev: reference to non-pixel device structure * @p_dev: reference to pixel device structure + * @fw_dev: reference to firmware device structure + * @pas_ctx: PAS context for authenticated firmware load and shutdown * @reg_base: IO memory base address * @irq: iris irq * @v4l2_dev: a holder for v4l2 device structure @@ -85,6 +87,8 @@ struct iris_core { struct device *dev; struct device *np_dev; struct device *p_dev; + struct device *fw_dev; + struct qcom_pas_context *pas_ctx; void __iomem *reg_base; int irq; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/med= ia/platform/qcom/iris/iris_firmware.c index 21cdf1c39835..8ab8c3cc9eef 100644 --- a/drivers/media/platform/qcom/iris/iris_firmware.c +++ b/drivers/media/platform/qcom/iris/iris_firmware.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -16,6 +17,7 @@ #define IRIS_PAS_ID 9 =20 #define MAX_FIRMWARE_NAME_SIZE 128 +#define IRIS_FIRMWARE_START_ADDR 0 =20 /* Detect Gen2 firmware by scanning the blob for: * QC_IMAGE_VERSION_STRING=3D @@ -110,23 +112,31 @@ static const struct firmware *iris_detect_firmware(st= ruct iris_core *core, =20 static int iris_load_fw_to_memory(struct iris_core *core) { + struct device *fw_dev =3D core->fw_dev ? core->fw_dev : core->dev; const struct firmware *firmware =3D NULL; - struct device *dev =3D core->dev; + struct qcom_pas_context *ctx; + struct iommu_domain *domain; struct resource res; phys_addr_t mem_phys; const char *fw_name; size_t res_size; ssize_t fw_size; - void *mem_virt; int ret; =20 - ret =3D of_reserved_mem_region_to_resource(dev->of_node, 0, &res); + ret =3D of_reserved_mem_region_to_resource(core->dev->of_node, 0, &res); if (ret) return ret; =20 mem_phys =3D res.start; res_size =3D resource_size(&res); =20 + if (!core->pas_ctx) { + ctx =3D devm_qcom_pas_context_alloc(core->dev, IRIS_PAS_ID, mem_phys, re= s_size); + if (IS_ERR(ctx)) + return PTR_ERR(ctx); + core->pas_ctx =3D ctx; + } + firmware =3D iris_detect_firmware(core, &fw_name); if (IS_ERR(firmware)) return PTR_ERR(firmware); @@ -139,22 +149,40 @@ static int iris_load_fw_to_memory(struct iris_core *c= ore) goto err_release_fw; } =20 - mem_virt =3D memremap(mem_phys, res_size, MEMREMAP_WC); - if (!mem_virt) { - ret =3D -ENOMEM; + core->pas_ctx->use_tzmem =3D !!core->fw_dev; + ret =3D qcom_mdt_pas_load(core->pas_ctx, firmware, fw_name, NULL); + if (ret) goto err_release_fw; - } =20 - ret =3D qcom_mdt_load(dev, firmware, fw_name, - IRIS_PAS_ID, mem_virt, mem_phys, res_size, NULL); + if (core->pas_ctx->use_tzmem) { + domain =3D iommu_get_domain_for_dev(fw_dev); + if (!domain) { + ret =3D -ENODEV; + goto err_release_fw; + } + + ret =3D iommu_map(domain, IRIS_FIRMWARE_START_ADDR, mem_phys, res_size, + IOMMU_READ | IOMMU_WRITE | IOMMU_PRIV, GFP_KERNEL); + } =20 - memunmap(mem_virt); err_release_fw: release_firmware(firmware); =20 return ret; } =20 +static void iris_fw_iommu_unmap(struct iris_core *core) +{ + struct iommu_domain *domain; + + if (!core->fw_dev) + return; + + domain =3D iommu_get_domain_for_dev(core->fw_dev); + if (domain) + iommu_unmap(domain, IRIS_FIRMWARE_START_ADDR, core->pas_ctx->mem_size); +} + int iris_fw_load(struct iris_core *core) { const struct tz_cp_config *cp_config; @@ -166,10 +194,10 @@ int iris_fw_load(struct iris_core *core) return ret; } =20 - ret =3D qcom_pas_auth_and_reset(IRIS_PAS_ID); + ret =3D qcom_pas_prepare_and_auth_reset(core->pas_ctx); if (ret) { dev_err(core->dev, "auth and reset failed: %d\n", ret); - return ret; + goto err_unmap; } =20 for (i =3D 0; i < core->iris_platform_data->tz_cp_config_data_size; i++) { @@ -180,17 +208,28 @@ int iris_fw_load(struct iris_core *core) cp_config->cp_nonpixel_size); if (ret) { dev_err(core->dev, "qcom_scm_mem_protect_video_var failed: %d\n", ret); - qcom_pas_shutdown(IRIS_PAS_ID); - return ret; + goto err_pas_shutdown; } } =20 return 0; + +err_pas_shutdown: + qcom_pas_shutdown(IRIS_PAS_ID); +err_unmap: + iris_fw_iommu_unmap(core); + + return ret; } =20 int iris_fw_unload(struct iris_core *core) { - return qcom_pas_shutdown(IRIS_PAS_ID); + int ret; + + ret =3D qcom_pas_shutdown(IRIS_PAS_ID); + iris_fw_iommu_unmap(core); + + return ret; } =20 int iris_set_hw_state(struct iris_core *core, bool resume) diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 4bdb078d83b5..106dbd44ec02 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -193,8 +193,18 @@ static int iris_init_cb_devs(struct iris_core *core) =20 core->p_dev =3D dev; =20 + dev =3D iris_create_cb_dev(core, "video-firmware"); + if (IS_ERR(dev)) + goto unreg_p_dev; + + core->fw_dev =3D dev; + return 0; =20 +unreg_p_dev: + if (core->p_dev) + platform_device_unregister(to_platform_device(core->p_dev)); + core->p_dev =3D NULL; unreg_np_dev: if (core->np_dev) platform_device_unregister(to_platform_device(core->np_dev)); @@ -205,6 +215,8 @@ static int iris_init_cb_devs(struct iris_core *core) =20 static void iris_deinit_cb_devs(struct iris_core *core) { + if (core->fw_dev) + platform_device_unregister(to_platform_device(core->fw_dev)); if (core->p_dev) platform_device_unregister(to_platform_device(core->p_dev)); if (core->np_dev) --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F5F13F104D for ; Thu, 17 Sep 2026 05:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621301; cv=none; b=eS2fZlCQkU3knBZDxjrorhdrOcJxDzozQFOEuqM+4bhZgrGo9/YALcU8AsBP9ncRlMC5/DmFJ7vvtWLPXP9MG3IAbxiCtPmZLiaTOddJLN0y6wFI6C65DJszHbtxZhTkCwGX86DzkF2gm04WjQRZCN2wpbPPTQud7rvc2qm1sWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621301; c=relaxed/simple; bh=CPp1Ej4hFkbj5I33KM7I5uZVYzPRsP+X12HMG4E1M24=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S6X/5Gh+ZI+ThPb7gejMLj/sNREZstCESAxoC3+if++kFdVK4WlW2l0CcEPUkquAfwmadPqmVy6hCqsoOjuiUcYsjuDtJTSGGOlp+meO1tFg+ZOiuoZpann9LN3+O55FN3L6NiSJX/iCHXAfFhGQNZUDgRSh7d3l+BLyZknjOes= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FjuEwJ5b; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QN6wi5xr; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FjuEwJ5b"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QN6wi5xr" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H2GqXg1239348 for ; Thu, 17 Sep 2026 05:01:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ADeHH/R3IwNQGBSsRx4p0F4czvErWTh6b1YMdRHnL/U=; b=FjuEwJ5bwKrmD3Ib bvXoEPPrLQyxkK10yapcgOUlnsjhQUFijDRo1bZadBpYIosJ3UVR9U/pmpkSMUVn 7Pb8RpRqqBZOxMLeHFMp12AmkaSaZqOWKlU7W+0nSXnc7Dt8ciHD2P/JyI/ugHlS 1UDys0u9bdWKTNizrh05p80iei8bhTjobETENbkefcl4HQP/jy+IdTbze0YfJx2W RNHCLfSdoGyOYl3TGsgrs4W60J2C23INNrW3a4BP1nQsJoyvhXEU2KVqqRb9mMkn dAcMp9+vYQPiJGOkKbG5DGGDZWN6rgIvQXRmVJdCqH6hXLYZ4i4TUZmcPmV8bchq yl/Npg== Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gr79m0hft-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:37 +0000 (GMT) Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-7e9fc6dc091so492426a34.2 for ; Wed, 16 Sep 2026 22:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621296; x=1790226096; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ADeHH/R3IwNQGBSsRx4p0F4czvErWTh6b1YMdRHnL/U=; b=QN6wi5xrYQq+iw0TE0/GRQU/mUIfYUoG4FD0UHgY37mjHeCt7X6X2QnHBnBsftehju 36CS2un10r/5rEph4pCeF8O80eaE/n7oFLGW2sKj5Psw/DgmoVIbEr1HkKpofKZ3JdYb fItPEv2ksuWvKh8FcURtbUzq//jJ4W479yIDq1cqjbg7h2ErEYQGXg5NsgRYzD3fNx4T Dtpx//wK27plrnnTsoW1KdvrpdON7MrT6/O5Wyni+gzoxGj55Xt+yCY0ZqKGD7tPHAfL y7epMnO43MaJLoNc477UsoL4lqwmNocBvTo7dACPFISShGm6eHw6YtFIq7Nw+FLl6kwb kSnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621296; x=1790226096; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ADeHH/R3IwNQGBSsRx4p0F4czvErWTh6b1YMdRHnL/U=; b=SeCLd150AbW5/an9LM4pJA7wS3ZxP6E7LQmBcI23nudKgvcCFmOIS5Vzl69R4g68Da EnZkjedQZHOIENwrbmnR2caalzwFxUI1vWMD5TFZF6NWvHQGstPIT2qcimfRHvAXV+Vj R8QdwJ7y9Z3ULfvtoao6dl6QWpC8lGBwR6TIlJI/77QhTish4Ket/g6CnBrbK/+QsvG1 qz69lyuypOBZIGDgOwU9vhSsr8gBtP3L4VQkz2oeqjJtOmdc62mY3a+NeECZBJmSpc+1 b3NxCrNkLpn3JS65AMRotCTK1IgO053C56g10wi1N+S/kCCB9G98djKq6nGs/9WjHk0Q vnLg== X-Forwarded-Encrypted: i=1; AKwUvBxKt04iAeQuG0Shl6CQvHrtIFnSowg/uA9TcDv9un8nOH0DKHJ9fzjaR+706k1L3rBWgw6KHR7k2vzfu+8=@vger.kernel.org X-Gm-Message-State: AFuF++kodk2QNl9ujkMRhq4ZWnQUY1bdtGE39JNV5wPM5bYAZx59pQ3o yM1dW0qSQgJoW5zSbL97E+qV5kc96Z+mUPy0KOaepKbSjgBV0GpojY3J9pp2gzw2OlO5v5G7HC4 Xe55EjDgBDj4TvqI34zikqZvK/M22HuTuO2AK6ROEtzUOaKha8iWGJibamraNTIExZa8= X-Gm-Gg: AYBFou2JAsw+noVJj8dRdXERlorUL+XnepoO28m3U7gkwCvYKXOn6eMacnsNo4mYuk3 +bKar4+rrp1inQKSy529+ip3cXuXCoQoao2H3RtEQOsp86edxYWGMgDlo13iC8ukkHjnkh1eC4U 6swHLYFPCo6iS4cg4Zlr8NbTKOdPTVPob1vD8m0AXv8q03v67ob0YW967pTomYiUuEBPxPsfN9B Gw8T/ywMVqioXc+HmZr7a2h2ZF+GBdD76rg+UEtGrh+tYUz3Gom/OyHOJAGy7AxgKM/0PRkrdj1 0AuUaUNBJZzqqoNZb87gPi1xxqrXolBcD6b1tLjhBGmzver1doS12FWnwsR3L2gPbnU/0LwCjj5 Jav2ZtD7kfYT1gwBWRfRR1QFqaykt9nd7sQ== X-Received: by 2002:a05:6820:1f14:b0:6bb:4fd:e33e with SMTP id 006d021491bc7-6c7d5100120mr5099890eaf.68.1789621295734; Wed, 16 Sep 2026 22:01:35 -0700 (PDT) X-Received: by 2002:a05:6820:1f14:b0:6bb:4fd:e33e with SMTP id 006d021491bc7-6c7d5100120mr5099824eaf.68.1789621295015; Wed, 16 Sep 2026 22:01:35 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:34 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:22 +0530 Subject: [PATCH v11 3/9] media: iris: Replace enum-indexed clock and power domain tables with per-block structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-3-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=44595; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=CPp1Ej4hFkbj5I33KM7I5uZVYzPRsP+X12HMG4E1M24=; b=uqfXXBJvIlmDW5T11CP/OX/Q3V6y6qkHFbMMDuvlN2UrcxO3Y5h58Dq6Zv8i5v/gwrh3weXMY Q+3xdgxa95wD67RiU1lDS/0rRXYrhA9XeAlG0xNnN5JCHouRFvbKtJK X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Qf7zLcbv c=1 sm=1 tr=0 ts=6aab7431 cx=c_pps a=+3WqYijBVYhDct2f5Fivkw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=wsfofgtYRsWIyIBNSKIA:9 a=QEXdDO2ut3YA:10 a=eYe2g0i6gJ5uXG_o6N4q:22 X-Proofpoint-GUID: b0P8AuFGWvXk729GIDi5HzZrx7vjj8dn X-Proofpoint-ORIG-GUID: b0P8AuFGWvXk729GIDi5HzZrx7vjj8dn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX6ilPTAOSme19 sczjxgR0nWuFj1XVoPnhl27pHGeno8zQjipDsZT69W31PAnGOl2Xkpci1mnq4xxDFP3CmB5DdHC iqa57Cji7H14KrJOtPCvDlgmiStIN3WJArilUdBimx/So14IIs34qEMlEVlYZHDq3B43DlBM/uU sn2eWCl+e7OYAsKbt+BWuXwc4UIO1+gA4vc5UdCYq8VdPji76jwV4owq+zl8u+Qb1S0TAwRQO3f dolj4TZjHgYzvW1bCTqFw0jx4Zrd+1p65C3iXc56r9RpPTaZtpuOphpYtJoJBkN/sddCz1mTT6n xmdT/ZaKiHkXVqE6e/speL+aqDgie/7aaL1wU7muMV7+Zv874YPTqegJdfODmkKC4f5oj1/NVlP Y+W43uUeTUfHWS0zuG4DHkvziVCIozgcr5mGI4vUKJHQlyDD6Xbm/5N20m6P0uzysBiX1A6vgxD zw4Ea/hlOSiQmLlwCpg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX/RqVRpPzeEBm AiLkcKQmiIJMNXF2ri+w1zQIIp2gCy/vdhRVBwgRmwnXtFFmrgpJxoOIV/Qk4fCLnAPsG7EFZtD Qoyvr3SbA24KE7oXuPA/Eq8wb7C/Pfg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 As new platforms are added, the platform_clk_type and platform_pm_domain_type enums keep growing. Every new clock or power domain requires a new enum entry, and every enable/disable path has to loop through the clock table to find the right clock by enum value, adding overhead and boilerplate on each path. The enum index space is also shared across all hardware blocks. On the Glymur platform, the VPP0 index for VPU4x and the VCODEC1 index clash, making it error-prone to extend support without breaking existing platforms. Replace the flat tables and enum-based lookups with iris_power_domain, which bundles a power domain device and its associated clocks together per hardware block. Platform data describes each block via iris_power_domain_data, and the enable and disable helpers operate directly on an iris_power_domain instance, removing the need for any index lookup at runtime. Signed-off-by: Vishnu Reddy Reviewed-by: Dmitry Baryshkov Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_core.h | 23 +++- .../platform/qcom/iris/iris_platform_common.h | 41 ++---- .../platform/qcom/iris/iris_platform_sc7280.h | 28 ++++- .../platform/qcom/iris/iris_platform_sm8250.h | 26 +++- .../platform/qcom/iris/iris_platform_sm8550.h | 26 +++- .../platform/qcom/iris/iris_platform_sm8750.h | 29 +++-- .../media/platform/qcom/iris/iris_platform_vpu2.c | 20 +-- .../media/platform/qcom/iris/iris_platform_vpu3x.c | 32 ++--- .../platform/qcom/iris/iris_platform_x1p42100.h | 27 +++- drivers/media/platform/qcom/iris/iris_probe.c | 137 +++++++++++++++++= ++-- drivers/media/platform/qcom/iris/iris_resources.c | 81 ++++++------ drivers/media/platform/qcom/iris/iris_resources.h | 8 +- drivers/media/platform/qcom/iris/iris_vpu3x.c | 37 +----- drivers/media/platform/qcom/iris/iris_vpu4x.c | 137 +++--------------= ---- drivers/media/platform/qcom/iris/iris_vpu_common.c | 98 ++------------- 15 files changed, 347 insertions(+), 403 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 5ed2ec0b97ec..f528f53f20fc 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -16,6 +16,13 @@ #include "iris_resources.h" #include "iris_state.h" =20 +struct iris_power_domain { + struct device **dev; + unsigned int pd_cnt; + struct clk_bulk_data *clocks; + unsigned int clk_cnt; +}; + struct icc_info { const char *name; u32 bw_min_kbps; @@ -51,10 +58,12 @@ struct qcom_ubwc_cfg_data; * @iris_vb2_ops: iris vb2 ops * @icc_tbl: table of iris interconnects * @icc_count: count of iris interconnects - * @pmdomain_tbl: table of iris power domains + * @ctrl: power domain and clocks for the controller + * @vcodec: power domain and clocks for the vcodec + * @vcodec_vpp0: power domain and clocks for the vcodec VPP0 + * @vcodec_vpp1: power domain and clocks for the vcodec VPP1 + * @apv: power domain and clocks for the APV hardware block * @opp_pmdomain_tbl: table of opp power domains - * @clock_tbl: table of iris clocks - * @clk_count: count of iris clocks * @resets: table of iris reset clocks * @controller_resets: table of controller reset clocks * @iris_platform_data: a structure for platform data @@ -100,10 +109,12 @@ struct iris_core { const struct vb2_ops *iris_vb2_ops; struct icc_bulk_data *icc_tbl; u32 icc_count; - struct dev_pm_domain_list *pmdomain_tbl; + struct iris_power_domain *ctrl; + struct iris_power_domain *vcodec; + struct iris_power_domain *vcodec_vpp0; + struct iris_power_domain *vcodec_vpp1; + struct iris_power_domain *apv; struct dev_pm_domain_list *opp_pmdomain_tbl; - struct clk_bulk_data *clock_tbl; - u32 clk_count; struct reset_control_bulk_data *resets; struct reset_control_bulk_data *controller_resets; const struct iris_platform_data *iris_platform_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 974809509146..d6b9e420be44 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -63,26 +63,6 @@ extern const struct iris_platform_data sm8650_data; extern const struct iris_platform_data sm8750_data; extern const struct iris_platform_data x1p42100_data; =20 -enum platform_clk_type { - IRIS_AXI_CLK, /* AXI0 in case of platforms with multiple AXI clocks */ - IRIS_CTRL_CLK, - IRIS_AHB_CLK, - IRIS_HW_CLK, - IRIS_HW_AHB_CLK, - IRIS_AXI1_CLK, - IRIS_CTRL_FREERUN_CLK, - IRIS_HW_FREERUN_CLK, - IRIS_BSE_HW_CLK, - IRIS_VPP0_HW_CLK, - IRIS_VPP1_HW_CLK, - IRIS_APV_HW_CLK, -}; - -struct platform_clk_data { - enum platform_clk_type clk_type; - const char *clk_name; -}; - struct tz_cp_config { u32 cp_start; u32 cp_size; @@ -231,12 +211,11 @@ struct icc_vote_data { u32 fps; }; =20 -enum platform_pm_domain_type { - IRIS_CTRL_POWER_DOMAIN, - IRIS_HW_POWER_DOMAIN, - IRIS_VPP0_HW_POWER_DOMAIN, - IRIS_VPP1_HW_POWER_DOMAIN, - IRIS_APV_HW_POWER_DOMAIN, +struct iris_power_domain_data { + const char * const *pd_names; + unsigned int pd_cnt; + const char * const *clk_names; + unsigned int clk_cnt; }; =20 struct iris_firmware_data { @@ -299,13 +278,14 @@ struct iris_platform_data { unsigned int icc_tbl_size; const struct bw_info *bw_tbl_dec; unsigned int bw_tbl_dec_size; - const char * const *pmdomain_tbl; - unsigned int pmdomain_tbl_size; + const struct iris_power_domain_data *ctrl_data; + const struct iris_power_domain_data *vcodec_data; + const struct iris_power_domain_data *vcodec_vpp0_data; + const struct iris_power_domain_data *vcodec_vpp1_data; + const struct iris_power_domain_data *apv_data; const char * const *opp_pd_tbl; unsigned int opp_pd_tbl_size; - const struct platform_clk_data *clk_tbl; const char * const *opp_clk_tbl; - unsigned int clk_tbl_size; const char * const *clk_rst_tbl; unsigned int clk_rst_tbl_size; const char * const *controller_rst_tbl; @@ -319,6 +299,7 @@ struct iris_platform_data { u32 num_vpp_pipe; bool no_aon; u32 max_session_count; + u32 num_cores; /* max number of macroblocks per frame supported */ u32 max_core_mbpf; /* max number of macroblocks per second supported */ diff --git a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h b/driv= ers/media/platform/qcom/iris/iris_platform_sc7280.h index 0ec8f334df67..f19547a8a51d 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h @@ -15,12 +15,28 @@ static const struct bw_info sc7280_bw_table_dec[] =3D { =20 static const char * const sc7280_opp_pd_table[] =3D { "cx" }; =20 -static const struct platform_clk_data sc7280_clk_table[] =3D { - {IRIS_CTRL_CLK, "core" }, - {IRIS_AXI_CLK, "iface" }, - {IRIS_AHB_CLK, "bus" }, - {IRIS_HW_CLK, "vcodec_core" }, - {IRIS_HW_AHB_CLK, "vcodec_bus" }, +static const struct iris_power_domain_data sc7280_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", "bus", + }, + .clk_cnt =3D 3, +}; + +static const struct iris_power_domain_data sc7280_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec_core", "vcodec_bus", + }, + .clk_cnt =3D 2, + }, }; =20 static const char * const sc7280_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8250.h index 50306043eb8e..7674cf9a330f 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.h @@ -15,10 +15,28 @@ static const struct bw_info sm8250_bw_table_dec[] =3D { =20 static const char * const sm8250_opp_pd_table[] =3D { "mx", "mmcx" }; =20 -static const struct platform_clk_data sm8250_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, +static const struct iris_power_domain_data sm8250_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data sm8250_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", + }, + .clk_cnt =3D 1, + }, }; =20 static const char * const sm8250_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8550.h index 3c9dae995bb2..71de71a75e95 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8550.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8550.h @@ -8,10 +8,28 @@ =20 static const char * const sm8550_clk_reset_table[] =3D { "bus" }; =20 -static const struct platform_clk_data sm8550_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, +static const struct iris_power_domain_data sm8550_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data sm8550_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", + }, + .clk_cnt =3D 1, + }, }; =20 static struct platform_inst_caps platform_inst_cap_sm8550 =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8750.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8750.h index 719056656a5b..45ab78781f4a 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8750.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8750.h @@ -10,13 +10,28 @@ static const char * const sm8750_clk_reset_table[] =3D { "bus0", "bus1", "core", "vcodec0_core" }; =20 -static const struct platform_clk_data sm8750_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, - {IRIS_AXI1_CLK, "iface1" }, - {IRIS_CTRL_FREERUN_CLK, "core_freerun" }, - {IRIS_HW_FREERUN_CLK, "vcodec0_core_freerun" }, +static const struct iris_power_domain_data sm8750_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface1", "core_freerun", "core", + }, + .clk_cnt =3D 3, +}; + +static const struct iris_power_domain_data sm8750_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "vcodec0_core_freerun", "vcodec0_core", + }, + .clk_cnt =3D 3, + }, }; =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c b/driver= s/media/platform/qcom/iris/iris_platform_vpu2.c index bbdbf21961d7..8b026845226d 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu2.c @@ -66,8 +66,6 @@ static const struct icc_info iris_icc_info_vpu2[] =3D { =20 static const char * const iris_clk_reset_table_vpu2[] =3D { "bus", "core" = }; =20 -static const char * const iris_pmdomain_table_vpu2[] =3D { "venus", "vcode= c0" }; - static const struct tz_cp_config tz_cp_config_vpu2[] =3D { { .cp_start =3D 0, @@ -84,12 +82,10 @@ const struct iris_platform_data milos_data =3D { .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_milos), .bw_tbl_dec =3D sm8250_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), - .pmdomain_tbl =3D iris_pmdomain_table_vpu2, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .ctrl_data =3D &sm8250_ctrl_data, + .vcodec_data =3D sm8250_vcodec_data, .opp_pd_tbl =3D milos_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(milos_opp_pd_table), - .clk_tbl =3D sm8250_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8250_clk_table), .opp_clk_tbl =3D sm8250_opp_clk_table, .clk_rst_tbl =3D iris_clk_reset_table_vpu2, .clk_rst_tbl_size =3D ARRAY_SIZE(iris_clk_reset_table_vpu2), @@ -113,12 +109,10 @@ const struct iris_platform_data sc7280_data =3D { .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu2), .bw_tbl_dec =3D sc7280_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), - .pmdomain_tbl =3D iris_pmdomain_table_vpu2, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .ctrl_data =3D &sc7280_ctrl_data, + .vcodec_data =3D sc7280_vcodec_data, .opp_pd_tbl =3D sc7280_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sc7280_opp_pd_table), - .clk_tbl =3D sc7280_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sc7280_clk_table), .opp_clk_tbl =3D sc7280_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -144,12 +138,10 @@ const struct iris_platform_data sm8250_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(iris_clk_reset_table_vpu2), .bw_tbl_dec =3D sm8250_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), - .pmdomain_tbl =3D iris_pmdomain_table_vpu2, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .ctrl_data =3D &sm8250_ctrl_data, + .vcodec_data =3D sm8250_vcodec_data, .opp_pd_tbl =3D sm8250_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8250_opp_pd_table), - .clk_tbl =3D sm8250_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8250_clk_table), .opp_clk_tbl =3D sm8250_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drive= rs/media/platform/qcom/iris/iris_platform_vpu3x.c index 74626b35d9cb..9a62f5c5eb60 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -67,8 +67,6 @@ static const struct bw_info iris_bw_table_dec_vpu3x[] =3D= { { ((1920 * 1080) / 256) * 30, 294000 }, }; =20 -static const char * const iris_pmdomain_table_vpu3x[] =3D { "venus", "vcod= ec0" }; - static const char * const iris_opp_pd_table_vpu3x[] =3D { "mxc", "mmcx" }; =20 static const char * const iris_opp_clk_table_vpu3x[] =3D { @@ -98,12 +96,10 @@ const struct iris_platform_data qcs8300_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -127,12 +123,10 @@ const struct iris_platform_data sm8550_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -164,12 +158,10 @@ const struct iris_platform_data sm8650_data =3D { .controller_rst_tbl_size =3D ARRAY_SIZE(sm8650_controller_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -193,12 +185,10 @@ const struct iris_platform_data sm8750_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8750_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8750_ctrl_data, + .vcodec_data =3D sm8750_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8750_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8750_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -228,12 +218,10 @@ const struct iris_platform_data x1p42100_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &x1p42100_ctrl_data, + .vcodec_data =3D x1p42100_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D x1p42100_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(x1p42100_clk_table), .opp_clk_tbl =3D x1p42100_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, diff --git a/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h b/dr= ivers/media/platform/qcom/iris/iris_platform_x1p42100.h index d89acfbc1233..3444c1c3012b 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h +++ b/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h @@ -6,11 +6,28 @@ #ifndef __IRIS_PLATFORM_X1P42100_H__ #define __IRIS_PLATFORM_X1P42100_H__ =20 -static const struct platform_clk_data x1p42100_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, - {IRIS_BSE_HW_CLK, "vcodec0_bse" }, +static const struct iris_power_domain_data x1p42100_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data x1p42100_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", "vcodec0_bse", + }, + .clk_cnt =3D 2, + }, }; =20 static const char *const x1p42100_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 106dbd44ec02..b36d3d05dd3d 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -39,15 +39,45 @@ static int iris_init_icc(struct iris_core *core) return devm_of_icc_bulk_get(core->dev, core->icc_count, core->icc_tbl); } =20 -static int iris_init_power_domains(struct iris_core *core) +static int iris_init_power_domains_per_block(struct iris_core *core, + struct iris_power_domain *pd, + const struct iris_power_domain_data *pd_data) { - int ret; + struct dev_pm_domain_attach_data iris_pd_data =3D {}; + struct dev_pm_domain_list *pmdomain_tbl; + int ret, i; =20 - struct dev_pm_domain_attach_data iris_pd_data =3D { - .pd_names =3D core->iris_platform_data->pmdomain_tbl, - .num_pd_names =3D core->iris_platform_data->pmdomain_tbl_size, - .pd_flags =3D PD_FLAG_NO_DEV_LINK, - }; + if (!pd_data->pd_cnt) + return -EINVAL; + + iris_pd_data.pd_names =3D pd_data->pd_names; + iris_pd_data.num_pd_names =3D pd_data->pd_cnt; + iris_pd_data.pd_flags =3D PD_FLAG_NO_DEV_LINK; + + ret =3D devm_pm_domain_attach_list(core->dev, &iris_pd_data, &pmdomain_tb= l); + if (ret < 0) + return ret; + + pd->pd_cnt =3D pmdomain_tbl->num_pds; + + if (pd->pd_cnt !=3D pd_data->pd_cnt) + return -EINVAL; + + pd->dev =3D devm_kzalloc(core->dev, pd->pd_cnt * sizeof(*pd->dev), GFP_KE= RNEL); + if (!pd->dev) + return -ENOMEM; + + for (i =3D 0; i < pd->pd_cnt; i++) + pd->dev[i] =3D pmdomain_tbl->pd_devs[i]; + + return 0; +} + +static int iris_init_power_domains(struct iris_core *core) +{ + const struct iris_platform_data *plat =3D core->iris_platform_data; + unsigned int num_cores =3D max(plat->num_cores, 1); + int i, ret; =20 struct dev_pm_domain_attach_data iris_opp_pd_data =3D { .pd_names =3D core->iris_platform_data->opp_pd_tbl, @@ -60,10 +90,57 @@ static int iris_init_power_domains(struct iris_core *co= re) .config_clks =3D dev_pm_opp_config_clks_simple, }; =20 - ret =3D devm_pm_domain_attach_list(core->dev, &iris_pd_data, &core->pmdom= ain_tbl); - if (ret < 0) + core->ctrl =3D devm_kzalloc(core->dev, sizeof(*core->ctrl), GFP_KERNEL); + if (!core->ctrl) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->ctrl, plat->ctrl_da= ta); + if (ret) return ret; =20 + core->vcodec =3D devm_kzalloc(core->dev, num_cores * sizeof(*core->vcodec= ), GFP_KERNEL); + if (!core->vcodec) + return -ENOMEM; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_init_power_domains_per_block(core, &core->vcodec[i], + &plat->vcodec_data[i]); + if (ret) + return ret; + } + + if (plat->vcodec_vpp0_data) { + core->vcodec_vpp0 =3D devm_kzalloc(core->dev, sizeof(*core->vcodec_vpp0)= , GFP_KERNEL); + if (!core->vcodec_vpp0) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->vcodec_vpp0, + plat->vcodec_vpp0_data); + if (ret) + return ret; + } + + if (plat->vcodec_vpp1_data) { + core->vcodec_vpp1 =3D devm_kzalloc(core->dev, sizeof(*core->vcodec_vpp1)= , GFP_KERNEL); + if (!core->vcodec_vpp1) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->vcodec_vpp1, + plat->vcodec_vpp1_data); + if (ret) + return ret; + } + + if (plat->apv_data) { + core->apv =3D devm_kzalloc(core->dev, sizeof(*core->apv), GFP_KERNEL); + if (!core->apv) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->apv, plat->apv_dat= a); + if (ret) + return ret; + } + ret =3D devm_pm_domain_attach_list(core->dev, &iris_opp_pd_data, &core->= opp_pmdomain_tbl); /* backwards compatibility for incomplete ABI SM8250 */ if (ret =3D=3D -ENODEV && @@ -82,17 +159,51 @@ static int iris_init_power_domains(struct iris_core *c= ore) return devm_pm_opp_of_add_table(core->dev); } =20 +static int iris_init_clocks_per_block(struct iris_core *core, struct iris_= power_domain *pd, + const struct iris_power_domain_data *pd_data) +{ + unsigned int i; + + if (!pd_data) + return 0; + + pd->clk_cnt =3D pd_data->clk_cnt; + pd->clocks =3D devm_kcalloc(core->dev, pd->clk_cnt, sizeof(*pd->clocks), = GFP_KERNEL); + if (!pd->clocks) + return -ENOMEM; + + for (i =3D 0; i < pd->clk_cnt; i++) + pd->clocks[i].id =3D pd_data->clk_names[i]; + + return devm_clk_bulk_get(core->dev, pd->clk_cnt, pd->clocks); +} + static int iris_init_clocks(struct iris_core *core) { + const struct iris_platform_data *plat =3D core->iris_platform_data; + unsigned int num_cores =3D max(plat->num_cores, 1); + unsigned int i; int ret; =20 - ret =3D devm_clk_bulk_get_all(core->dev, &core->clock_tbl); - if (ret < 0) + ret =3D iris_init_clocks_per_block(core, core->ctrl, plat->ctrl_data); + if (ret) + return ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_init_clocks_per_block(core, &core->vcodec[i], &plat->vcodec= _data[i]); + if (ret) + return ret; + } + + ret =3D iris_init_clocks_per_block(core, core->vcodec_vpp0, plat->vcodec_= vpp0_data); + if (ret) return ret; =20 - core->clk_count =3D ret; + ret =3D iris_init_clocks_per_block(core, core->vcodec_vpp1, plat->vcodec_= vpp1_data); + if (ret) + return ret; =20 - return 0; + return iris_init_clocks_per_block(core, core->apv, plat->apv_data); } =20 static int iris_init_reset_table(struct iris_core *core, diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index a6c3df892ca9..1287b80e4233 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -9,7 +9,6 @@ #include #include #include -#include =20 #include "iris_core.h" #include "iris_instance.h" @@ -71,73 +70,63 @@ int iris_opp_set_rate(struct device *dev, unsigned long= freq) return dev_pm_opp_set_opp(dev, opp); } =20 -int iris_enable_power_domains(struct iris_core *core, struct device *pd_de= v) +int iris_enable_power_domain_and_clocks(struct iris_core *core, struct iri= s_power_domain *pd) { - int ret; + int ret, i; =20 ret =3D iris_opp_set_rate(core->dev, ULONG_MAX); if (ret) return ret; =20 - return pm_runtime_resume_and_get(pd_dev); -} + for (i =3D 0; i < pd->pd_cnt; i++) { + ret =3D pm_runtime_resume_and_get(pd->dev[i]); + if (ret < 0) + goto error; + } =20 -int iris_disable_power_domains(struct iris_core *core, struct device *pd_d= ev) -{ - int ret; - int pm_ret; + ret =3D clk_bulk_prepare_enable(pd->clk_cnt, pd->clocks); + if (ret) + goto error; =20 - ret =3D iris_opp_set_rate(core->dev, 0); + return 0; =20 - pm_ret =3D pm_runtime_put_sync(pd_dev); - if (!ret) - ret =3D pm_ret; +error: + iris_opp_set_rate(core->dev, 0); =20 - return ret; -} + while (--i >=3D 0) + pm_runtime_put_sync(pd->dev[i]); =20 -static struct clk *iris_get_clk_by_type(struct iris_core *core, enum platf= orm_clk_type clk_type) -{ - const struct platform_clk_data *clk_tbl; - u32 clk_cnt, i, j; - - clk_tbl =3D core->iris_platform_data->clk_tbl; - clk_cnt =3D core->iris_platform_data->clk_tbl_size; - - for (i =3D 0; i < clk_cnt; i++) { - if (clk_tbl[i].clk_type =3D=3D clk_type) { - for (j =3D 0; core->clock_tbl && j < core->clk_count; j++) { - if (!strcmp(core->clock_tbl[j].id, clk_tbl[i].clk_name)) - return core->clock_tbl[j].clk; - } - } - } - - return NULL; + return ret; } =20 -int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_ty= pe clk_type) +void iris_disable_power_domain_and_clocks(struct iris_core *core, struct i= ris_power_domain *pd) { - struct clk *clock; + int i; =20 - clock =3D iris_get_clk_by_type(core, clk_type); - if (!clock) - return -ENOENT; + iris_opp_set_rate(core->dev, 0); + clk_bulk_disable_unprepare(pd->clk_cnt, pd->clocks); =20 - return clk_prepare_enable(clock); + for (i =3D 0; i < pd->pd_cnt; i++) + pm_runtime_put_sync(pd->dev[i]); } =20 -int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk= _type clk_type) +int iris_genpd_set_hwmode(struct iris_power_domain *pd, bool mode) { - struct clk *clock; - - clock =3D iris_get_clk_by_type(core, clk_type); - if (!clock) - return -EINVAL; + int i, ret; =20 - clk_disable_unprepare(clock); + for (i =3D 0; i < pd->pd_cnt; i++) { + ret =3D dev_pm_genpd_set_hwmode(pd->dev[i], mode); + if (ret) + goto error; + } =20 return 0; + +error: + while (--i >=3D 0) + dev_pm_genpd_set_hwmode(pd->dev[i], !mode); + + return ret; } =20 struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type) diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index a9a5bddb19c2..3e9116d05d55 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.h +++ b/drivers/media/platform/qcom/iris/iris_resources.h @@ -7,14 +7,14 @@ #define __IRIS_RESOURCES_H__ =20 struct iris_core; +struct iris_power_domain; =20 int iris_opp_set_rate(struct device *dev, unsigned long freq); -int iris_enable_power_domains(struct iris_core *core, struct device *pd_de= v); -int iris_disable_power_domains(struct iris_core *core, struct device *pd_d= ev); int iris_unset_icc_bw(struct iris_core *core); int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw); -int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk= _type clk_type); -int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_ty= pe clk_type); +int iris_enable_power_domain_and_clocks(struct iris_core *core, struct iri= s_power_domain *pd); +void iris_disable_power_domain_and_clocks(struct iris_core *core, struct i= ris_power_domain *pd); +int iris_genpd_set_hwmode(struct iris_power_domain *pd, bool mode); struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 3dad47be78b5..7cda94601555 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -205,53 +205,20 @@ static int iris_vpu33_power_off_controller(struct iri= s_core *core) val &=3D ~NOC_HALT; writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); =20 - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return 0; } =20 static int iris_vpu35_power_on_hw(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); - if (ret) - goto err_disable_axi_clk; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto err_disable_hw_free_clk; - - return 0; - -err_disable_hw_free_clk: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); -err_disable_axi_clk: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); -err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->vcodec); } =20 static void iris_vpu35_power_off_hw(struct iris_core *core) { iris_vpu33_power_off_hardware(core); - - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); } =20 const struct vpu_ops iris_vpu3_ops =3D { diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index 02e100a4045f..caee9e4351db 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -27,27 +27,24 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core= *core, bool hw_mode, u32 { int ret; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec, hw_mode); if (ret) return ret; =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec_vpp0, hw_mode); if (ret) goto restore_hw_domain_mode; } =20 if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec_vpp1, hw_mode); if (ret) goto restore_vpp0_domain_mode; } =20 if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_APV_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->apv, hw_mode); if (ret) goto restore_vpp1_domain_mode; } @@ -56,37 +53,19 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core= *core, bool hw_mode, u32 =20 restore_vpp1_domain_mode: if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP1_HW_POWER_D= OMAIN], - !hw_mode); + iris_genpd_set_hwmode(core->vcodec_vpp1, !hw_mode); restore_vpp0_domain_mode: if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP0_HW_POWER_D= OMAIN], - !hw_mode); + iris_genpd_set_hwmode(core->vcodec_vpp0, !hw_mode); restore_hw_domain_mode: - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , !hw_mode); + iris_genpd_set_hwmode(core->vcodec, !hw_mode); =20 return ret; } =20 static int iris_vpu4x_power_on_apv(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, - core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_APV_HW_CLK); - if (ret) - goto disable_apv_hw_power_domain; - - return 0; - -disable_apv_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_= POWER_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->apv); } =20 static void iris_vpu4x_power_off_apv(struct iris_core *core) @@ -138,8 +117,7 @@ static void iris_vpu4x_power_off_apv(struct iris_core *= core) writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); =20 disable_clocks_and_power: - iris_disable_unprepare_clock(core, IRIS_APV_HW_CLK); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_= POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->apv); } =20 static void iris_vpu4x_ahb_sync_reset_apv(struct iris_core *core) @@ -158,116 +136,43 @@ static void iris_vpu4x_ahb_sync_reset_hardware(struc= t iris_core *core) writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); } =20 -static int iris_vpu4x_enable_hardware_clocks(struct iris_core *core, u32 e= fuse_value) -{ - int ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); - if (ret) - goto disable_axi_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto disable_hw_free_run_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK); - if (ret) - goto disable_hw_clock; - - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D iris_prepare_enable_clock(core, IRIS_VPP0_HW_CLK); - if (ret) - goto disable_bse_hw_clock; - } - - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D iris_prepare_enable_clock(core, IRIS_VPP1_HW_CLK); - if (ret) - goto disable_vpp0_hw_clock; - } - - return 0; - -disable_vpp0_hw_clock: - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); -disable_bse_hw_clock: - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); -disable_hw_clock: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); -disable_hw_free_run_clock: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); -disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); - - return ret; -} - -static void iris_vpu4x_disable_hardware_clocks(struct iris_core *core, u32= efuse_value) -{ - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP1_HW_CLK); - - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); - - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); -} - static int iris_vpu4x_power_on_hardware(struct iris_core *core) { u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec); if (ret) return ret; =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec_vpp0); if (ret) goto disable_hw_power_domain; } =20 if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec_vpp1); if (ret) goto disable_vpp0_power_domain; } =20 - ret =3D iris_vpu4x_enable_hardware_clocks(core, efuse_value); - if (ret) - goto disable_vpp1_power_domain; - if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { ret =3D iris_vpu4x_power_on_apv(core); if (ret) - goto disable_hw_clocks; + goto disable_vpp1_power_domain; } =20 return 0; =20 -disable_hw_clocks: - iris_vpu4x_disable_hardware_clocks(core, efuse_value); disable_vpp1_power_domain: if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp1); disable_vpp0_power_domain: if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp0); disable_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec); =20 return ret; } @@ -335,17 +240,13 @@ static void iris_vpu4x_power_off_hardware(struct iris= _core *core) writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); =20 disable_clocks_and_power: - iris_vpu4x_disable_hardware_clocks(core, efuse_value); - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp1); =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp0); =20 - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec); } =20 static int iris_vpu4x_set_hwmode(struct iris_core *core) diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index e4847c107709..06e15ea6b58a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -212,21 +212,15 @@ int iris_vpu_power_off_controller(struct iris_core *c= ore) writel(0x0, core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); =20 disable_power: - iris_disable_unprepare_clock(core, IRIS_AHB_CLK); - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return 0; } =20 void iris_vpu_power_off_hw(struct iris_core *core) { - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , false); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + iris_genpd_set_hwmode(core->vcodec, false); + iris_disable_power_domain_and_clocks(core, core->vcodec); } =20 void iris_vpu_power_off(struct iris_core *core) @@ -245,7 +239,7 @@ int iris_vpu_power_on_controller(struct iris_core *core) u32 rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->ctrl); if (ret) return ret; =20 @@ -253,65 +247,22 @@ int iris_vpu_power_on_controller(struct iris_core *co= re) if (ret) goto err_disable_power; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_CLK); - if (ret) - goto err_disable_axi_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_AHB_CLK); - if (ret && ret !=3D -ENOENT) - goto err_disable_ctrl_clock; - return 0; =20 -err_disable_ctrl_clock: - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); -err_disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return ret; } =20 int iris_vpu_power_on_hw(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_AHB_CLK); - if (ret && ret !=3D -ENOENT) - goto err_disable_hw_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK); - if (ret && ret !=3D -ENOENT) - goto err_disable_hw_ahb_clock; - - return 0; - -err_disable_hw_ahb_clock: - iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK); -err_disable_hw_clock: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); -err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->vcodec); } =20 int iris_vpu_set_hwmode(struct iris_core *core) { - return dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_= DOMAIN], true); + return iris_genpd_set_hwmode(core->vcodec, true); } =20 int iris_vpu_switch_to_hwmode(struct iris_core *core) @@ -372,11 +323,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_= core *core) val, val =3D=3D 0, 200, 2000); =20 disable_power: - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI1_CLK); - - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 reset_control_bulk_reset(clk_rst_tbl_size, core->resets); =20 @@ -385,34 +332,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_= core *core) =20 int iris_vpu35_vpu4x_power_on_controller(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI1_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_FREERUN_CLK); - if (ret) - goto err_disable_axi1_clk; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_CLK); - if (ret) - goto err_disable_ctrl_free_clk; - - return 0; - -err_disable_ctrl_free_clk: - iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); -err_disable_axi1_clk: - iris_disable_unprepare_clock(core, IRIS_AXI1_CLK); -err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->ctrl); } =20 void iris_vpu35_vpu4x_program_bootup_registers(struct iris_core *core) --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6117C3E410A for ; Thu, 17 Sep 2026 05:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621306; cv=none; b=O6p0X+TG5LFaYY3r++MJtNtuilDMi9stQdGUu665V2XVF7jrtajPkUhhTZf8/0f8UiCi+70viiR2HoLrmwPPyW+sUnGReMdrYwU7Rnk5/tDh5l6jP0fTOkAydl3QtPIvNDs4KQHopI+IuawZTFDx89o7KJGVTMRSpynfvOs0Qxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621306; c=relaxed/simple; bh=AnqQ3dMMWwjfS1DZyYObOXrVudWl+j4L2KPuJCDobNo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DjuK5kOcYywMpsi7DGpgpj3iDbrOoKYV1jvKYsNGSKkzusXXXTKpwRoo3MAjWkY4OhfH0wXg35omS19h0PA6NaYswlkm5hU9JXXJxHfTgeByU9RfXXrykZ8hj2H/ZyI+MNKaZSPXUy9vEmI9GWmJFppjH4btgZxQlDK59ZXcefE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HAfiTCU3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eoPMB88f; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="HAfiTCU3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eoPMB88f" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H1DILx210481 for ; Thu, 17 Sep 2026 05:01:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= H4Js5Limpe9fDaU3+cneqpv0WTKfYeCktYQ1Y+hEgFk=; b=HAfiTCU3zD0BtAKM DWbomKrCvNrHSGE/0Ob7BfWF/xMC9c2dn9L4bha12p8JG4vlIi3D7qvMIFa4Xj5G dmxs5GHTM/gNvCn/ZCr4dYMoTgt4foFhoUBsUaJQbT8Y6mfShsyP41Mls/S/yC9W qMNExP4Z66J4RW1zPwR/YQnoemjvhw68nEYe1Z8v3FE8BK0FWbKKL8k4K+ZNmZLe 2Xx4bZHMJM/VzElRum4N/MiumsWr3QP97aGt3ugJiPSWI55LRNwg212Qi6VuZq5H IuVNvesBB2DXSUo4Z9mmFh0KawSzyn6xD8GypUqw7Jej07Hymg5qEZ/v38Y/y6kg n32ZtQ== Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gqxw8tnhc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:43 +0000 (GMT) Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-4b3962f71e7so748603b6e.3 for ; Wed, 16 Sep 2026 22:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621303; x=1790226103; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=H4Js5Limpe9fDaU3+cneqpv0WTKfYeCktYQ1Y+hEgFk=; b=eoPMB88f03oVwqY8emHIrqQRXTrap0JrclMaixBPrnqFLUW4ueGku1/dapTt8JvmPg SxtXCjYk4ZsRfDYq5p7js04SXHS0nFOrrq44h3DEisLj3l4OJfZDwGfWjSPH1/yyX/22 SjAHEbSi/Qwj+mtNhCPyKdfMLSISDuLYM67OMwFmkbhGOLbDHuA4jXoLH4eWHK21Civ4 vJqQFvKjXIewfYySnWL/QG4j/EoapWclHMrzaR7ZLyuS7aP9jPd0bA4QdA95fgoMKp+7 LKPzxvvPAapSiFHPpEV6L0h8RZ8qXJRY6fPIXUitVVc0EHt9sD0aoE7s92HM8cD4/TwC /a+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621303; x=1790226103; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=H4Js5Limpe9fDaU3+cneqpv0WTKfYeCktYQ1Y+hEgFk=; b=MgpvGHZZAp2itqLFndBbqh/atC2Eg2P1tIG26yp50PegvUHH9W+L0AgSYf4P8bZwjr d9565MV/Xrbi82jmBGz5wQXR2QoH3Oz2LjknyjQZMXPu/lD2jY3/NKMsqhERfIY0/FTM 0vO4nClPwE3YVHiePpyojh3bpeFSHnjM73nHXgMNoPxuX3YugZLN3DrZm/sGAG3IfvjM fMI0+1yADa/KRkwJm8A9TmGkLYQhSp4Nj/bCs9Ofj96RG18N6xXMIONqlzEHJyXCB032 O13PkEMyvYF7iou3H5tteCa8jwrrgAvhKypLXDfkuMaf6bqrXwpuA0JbWxJQ2qrN/ruI 6JDg== X-Forwarded-Encrypted: i=1; AKwUvBwhOQTo3CAAvFZetXdMfzVin3eTP3vVddsDBfvX0/sca9RvI5C1I5Elj/NKhbxBRCxjBxfwHcXvnji461I=@vger.kernel.org X-Gm-Message-State: AFuF++m1SRT7QGy8lPH78qNArPAgtNlEIU2/8EhFwJGjgaBxOZCCT727 H5XdwqR8/K1yoBSIu3FM6gqA3PJbpjywkQ6M55SO3V4jvZuVcmZtgR+C1LFu4P4+jk8yABazDG9 XuHnEfuWbMsfBxlbH3xvt+/g4x/2pCawfrOHzvSIZZRpT5CZexN9Pb/ECfcIR7vk7vLM= X-Gm-Gg: AYBFou1J2dUvFL07th1w9UsNDfKHokewTmF9knlMHBq7DQ//N9exWzKo4LUZI9ml9ST kY45EuozERfmKAKGGd6Y9WmTINXacSrv0ggFfnD5chonTP2tu+ksa437jQT64jOdRTjaFypUlYQ +hfWztDjQ03jmZ5rJfaddxtkkOmrMfwTIOy7NLGGLS65hlh49LdPH4wgAo2Wyf/173a8b4ydbhK gsVqhZ9+qcjlgYN91h9lhgzXic+FA7PnfQzNAr9A6s2FZR9ZYh5zx3Wu6MLYDII/x1rkbfd16Vn BpTGJhJO1jJ++2QyB20hQCtr9a0EUfiqeF0HsHbe6Et9BYq5h9kJruQZSFNUVXczXSWxLBfe75z 596GzuHBCaGqE72jjDLQ23god6ZEQ5VUu0A== X-Received: by 2002:a05:6808:1921:b0:4b9:a8ac:480 with SMTP id 5614622812f47-4ca4c6bab9emr6269628b6e.30.1789621302550; Wed, 16 Sep 2026 22:01:42 -0700 (PDT) X-Received: by 2002:a05:6808:1921:b0:4b9:a8ac:480 with SMTP id 5614622812f47-4ca4c6bab9emr6269610b6e.30.1789621302068; Wed, 16 Sep 2026 22:01:42 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:41 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:23 +0530 Subject: [PATCH v11 4/9] media: iris: Add power sequence for glymur Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-4-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=9655; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=AnqQ3dMMWwjfS1DZyYObOXrVudWl+j4L2KPuJCDobNo=; b=UB6lXyyNLDOW2wpVeBUy/gkPzzw4bYAnz6RR+cW+uX/X+Klq5X1IZ3h8jVjJGPSQIZphuLMp2 Lz6XJsonrdjBASosDcAN2Pmi08/Zky9TQrH03hg4j4TL5Ezg2VWMXUr X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: SH6Biu1iSsQx4Lit7ttLvNHqRtrBGK7o X-Authority-Analysis: v=2.4 cv=bY3+w+PB c=1 sm=1 tr=0 ts=6aab7437 cx=c_pps a=4ztaESFFfuz8Af0l9swBwA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=j0zrPJlDeI9ZXVQ5fz0A:9 a=QEXdDO2ut3YA:10 a=TPnrazJqx2CeVZ-ItzZ-:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX1t3GigJRpCsp llONsHgulap0fs/WnoCmkELiqdmAfUWeeGDMysCKkwawnMWqODWHC/RFjEKOkO80FbxB64ZfLeY wTPne4gNFkmnmNZFAQJqQECQdmJNWyA= X-Proofpoint-ORIG-GUID: SH6Biu1iSsQx4Lit7ttLvNHqRtrBGK7o X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXyJDwrVWfZMoN 6g3i+rPvX1QE4rkxkU2ZDuC5aXlTWAQa/XX7gUz9cRKZMiRFeHkNYghLtTB9uRxnXr3tQd/x6xb Yf2T7khXLDruOoyFEnbbUgUffflVDvAc+PkKD0sfIlQ3qDGVLib9wfafeF9IuFFkmwY4IucfC2L 4qUj5p6KTucSagRWmjVxnwi601N7ZvXCu5is2aqODBA2hmHeXv3ClNh7cUMAhv1Ox6mmhKFtSPB O1Hsr11d0KtJwmcISS/OTiFXzuJxaTbu7r3ELABxLdXLdNgi8RhpDviSGD7WSV1qHO1mdmwZ14O KlzvWdVcnw5N/ZarzHDi0ArRwti/0L5ByWG+zmchI7kROLkKfos4lFkpXTdR53FzkdxDkMhncdT LP5q5mA6v0sT/gs5jEG91XXAVr7m6wixYQKoarf4vCbL846Cog/GGhikinoRivE0h39WeWugCr/ ol3JJ+QMAX1ws3q9Nkw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 Glymur platform has two video codec cores: vcodec0 and vcodec1. Both cores share a common clock source (video_cc_mvs0_clk_src) and the same power rails. The clock dividers between the source and the branch clocks are fixed. So when both cores are running, the source clock always runs at the highest frequency requested by either core. Since both cores share the same power rails, the power corner cannot be voted independently. Scaling one core's power corner up or down would directly affect the other, leading to under or over-voting. For these reasons, both cores should voted the clock and power rail must be based on the workload of both cores. Reviewed-by: Vikash Garodia Signed-off-by: Vishnu Reddy Reviewed-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 127 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + .../platform/qcom/iris/iris_vpu_register_defines.h | 12 ++ 3 files changed, 135 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 7cda94601555..7b07d33d6119 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -17,14 +17,14 @@ #define NOC_HALT BIT(0) #define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28) =20 -static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core) +static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core, u32 pwr_= status_bit) { u32 value, pwr_status; =20 value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); - pwr_status =3D value & BIT(1); + pwr_status =3D value & pwr_status_bit; =20 - return pwr_status ? false : true; + return !pwr_status; } =20 static void iris_vpu3_power_off_hardware(struct iris_core *core) @@ -32,7 +32,7 @@ static void iris_vpu3_power_off_hardware(struct iris_core= *core) u32 reg_val =3D 0, value, i; int ret; =20 - if (iris_vpu3x_hw_power_collapsed(core)) + if (iris_vpu3x_hw_power_collapsed(core, VCODEC0_POWER_STATUS)) goto disable_power; =20 dev_err(core->dev, "video hw is power on\n"); @@ -78,7 +78,7 @@ static void iris_vpu33_power_off_hardware(struct iris_cor= e *core) u32 count =3D 0; int ret; =20 - if (iris_vpu3x_hw_power_collapsed(core)) + if (iris_vpu3x_hw_power_collapsed(core, VCODEC0_POWER_STATUS)) goto disable_power; =20 dev_err(core->dev, "video hw is power on\n"); @@ -221,6 +221,114 @@ static void iris_vpu35_power_off_hw(struct iris_core = *core) iris_vpu33_power_off_hardware(core); } =20 +static void iris_vpu36_power_off_vcodec(struct iris_core *core, u32 core_i= d) +{ + u32 bridge_hw_reset[] =3D {CORE_BRIDGE_HW_RESET_DISABLE, VCODEC1_BRIDGE_H= W_RESET_DISABLE}; + u32 lpi_status_active[] =3D {NOC_LPI_STATUS_ACTIVE, NOC_LPI_VCODEC1_STATU= S_ACTIVE}; + u32 power_down_prep[] =3D {REQ_POWER_DOWN_PREP, REQ_VCODEC1_POWER_DOWN_PR= EP}; + u32 lpi_status_done[] =3D {NOC_LPI_STATUS_DONE, NOC_LPI_VCODEC1_STATUS_DO= NE}; + u32 lpi_status_deny[] =3D {NOC_LPI_STATUS_DENY, NOC_LPI_VCODEC1_STATUS_DE= NY}; + u32 bridge_sw_reset[] =3D {CORE_BRIDGE_SW_RESET, VCODEC1_BRIDGE_SW_RESET}; + u32 idle_status[] =3D {VCODEC_SS_IDLE_STATUSN, VCODEC1_SS_IDLE_STATUSN}; + u32 power_status[] =3D {VCODEC0_POWER_STATUS, VCODEC1_POWER_STATUS}; + bool handshake_done, handshake_busy; + u32 value, i, count =3D 0; + int ret; + + if (iris_vpu3x_hw_power_collapsed(core, power_status[core_id])) + goto disable_power; + + value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + if (value) + writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + for (i =3D 0; i < core->iris_platform_data->num_vpp_pipe; i++) { + ret =3D readl_poll_timeout(core->reg_base + idle_status[core_id] + 4 * i, + value, value & DMA_NOC_IDLE, 2000, 20000); + if (ret) + goto disable_power; + } + + do { + writel(power_down_prep[core_id], core->reg_base + AON_WRAPPER_MVP_NOC_LP= I_CONTROL); + usleep_range(15, 20); + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); + + handshake_done =3D value & lpi_status_done[core_id]; + handshake_busy =3D value & (lpi_status_deny[core_id] | lpi_status_active= [core_id]); + + if (handshake_done || !handshake_busy) + break; + + writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + usleep_range(15, 20); + } while (++count < 1000); + + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATU= S, + value, value & lpi_status_done[core_id], 200, 2000); + writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + if (ret) + goto disable_power; + + writel(bridge_sw_reset[core_id] | bridge_hw_reset[core_id], + core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(bridge_hw_reset[core_id], core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_= RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_power: + iris_genpd_set_hwmode(&core->vcodec[core_id], false); + iris_disable_power_domain_and_clocks(core, &core->vcodec[core_id]); +} + +static void iris_vpu36_power_off_hw(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i; + + for (i =3D 0; i < num_cores; i++) + iris_vpu36_power_off_vcodec(core, i); +} + +static int iris_vpu36_power_on_hw(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i, ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_enable_power_domain_and_clocks(core, &core->vcodec[i]); + if (ret) + goto error; + } + + return 0; + +error: + while (--i >=3D 0) + iris_vpu36_power_off_vcodec(core, i); + + return ret; +} + +static int iris_vpu36_set_hwmode(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i, ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_genpd_set_hwmode(&core->vcodec[i], true); + if (ret) + goto error; + } + + return 0; + +error: + while (--i >=3D 0) + iris_genpd_set_hwmode(&core->vcodec[i], false); + + return ret; +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -248,3 +356,12 @@ const struct vpu_ops iris_vpu35_ops =3D { .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu_set_hwmode, }; + +const struct vpu_ops iris_vpu36_ops =3D { + .power_off_hw =3D iris_vpu36_power_off_hw, + .power_on_hw =3D iris_vpu36_power_on_hw, + .power_off_controller =3D iris_vpu35_vpu4x_power_off_controller, + .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, + .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu36_set_hwmode, +}; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 09799a375c14..63bf0cec58e2 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -12,6 +12,7 @@ extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; extern const struct vpu_ops iris_vpu33_ops; extern const struct vpu_ops iris_vpu35_ops; +extern const struct vpu_ops iris_vpu36_ops; extern const struct vpu_ops iris_vpu4x_ops; =20 struct vpu_ops { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h b= /drivers/media/platform/qcom/iris/iris_vpu_register_defines.h index 72168b9ffa73..c44c85eac3b5 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -7,6 +7,7 @@ #define __IRIS_VPU_REGISTER_DEFINES_H__ =20 #define VCODEC_BASE_OFFS 0x00000000 +#define VCODEC1_BASE_OFFS 0x00040000 #define AON_MVP_NOC_RESET 0x0001F000 #define CPU_BASE_OFFS 0x000A0000 #define WRAPPER_BASE_OFFS 0x000B0000 @@ -14,6 +15,8 @@ #define AON_BASE_OFFS 0x000E0000 =20 #define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70) +#define VCODEC1_SS_IDLE_STATUSN (VCODEC1_BASE_OFFS + 0x70) +#define DMA_NOC_IDLE BIT(22) =20 #define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000) #define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1)) @@ -35,6 +38,8 @@ #define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160) #define CORE_BRIDGE_SW_RESET BIT(0) #define CORE_BRIDGE_HW_RESET_DISABLE BIT(1) +#define VCODEC1_BRIDGE_SW_RESET BIT(2) +#define VCODEC1_BRIDGE_HW_RESET_DISABLE BIT(3) =20 #define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168) #define MSK_SIGNAL_FROM_TENSILICA BIT(0) @@ -52,14 +57,21 @@ #define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58) #define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C) #define REQ_POWER_DOWN_PREP BIT(0) +#define REQ_VCODEC1_POWER_DOWN_PREP BIT(1) =20 #define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60) #define NOC_LPI_STATUS_DONE BIT(0) /* Indicates the NOC handshake is com= plete */ #define NOC_LPI_STATUS_DENY BIT(1) /* Indicates the NOC handshake is den= ied */ #define NOC_LPI_STATUS_ACTIVE BIT(2) /* Indicates the NOC is active */ +#define NOC_LPI_VCODEC1_STATUS_DONE BIT(8) +#define NOC_LPI_VCODEC1_STATUS_DENY BIT(9) +#define NOC_LPI_VCODEC1_STATUS_ACTIVE BIT(10) =20 #define WRAPPER_IRIS_VCODEC_VPU_WRAPPER_SPARE_0 (WRAPPER_BASE_OFFS + 0x78) #define WRAPPER_CORE_POWER_STATUS (WRAPPER_BASE_OFFS + 0x80) +#define VCODEC0_POWER_STATUS BIT(1) +#define VCODEC1_POWER_STATUS BIT(4) + #define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88) #define CORE_CLK_RUN 0x0 =20 --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A8E93F1AD9 for ; Thu, 17 Sep 2026 05:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621312; cv=none; b=OvubqdTF3D9CbVYuS5+NuEVeEFbvJiiqFpiuWTNJhn58bQCyCAoQPExFUIpHxPsPvb5momvFpw09Sybc9dx2vvmuIcdYrMgqhuxTVo/DdKMuaBa/ouUecTcLIOpfkBaRLFr9IuotzOkRZ1NwvVBAUdB7LCy+Uxbuwd3IbBazpQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621312; c=relaxed/simple; bh=+ExuaRBxQIaOHG6mrK/Olyf/dxovfo+tA3P6mPihs8I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kWn1EP3AyvMx7zeZLHPOHDf4BMyXkV4Bc7o5LEuZeoDepZNnEokYj0OMOrxn0gDZnA6Y0BYsa7D6E8c+CxE3z7L4qy+qGq/IEJjPCuPRqVkxzNE3Ymqz+7ewkd8eoUvJtB5U6WIVURfA8wTgxAe4LyzI/Z3D9U6tKWoIGqLvrYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Y62x5qCQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KhcXbB3+; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Y62x5qCQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KhcXbB3+" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H1KVAW210531 for ; Thu, 17 Sep 2026 05:01:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /c+MG9f2w/9ybbVeA1E4MIJh8UMHBeh5BTpy0MtonQ0=; b=Y62x5qCQTF5ook6J 0nK2Tix3+5H03oXMxmc9qYQE8/2I5EheFVotUsT/MM8dMgI+VVO2UX4YhLa670Z9 bRcD31EPz0rfWVLmbUWYUDQAjGDfIGfcFnnv772GstdDEAsgH58odezGkiP2wmKY 9nSS8X0ujhLiCY9a/6CGnSY/mTeOeksUT5P8aaYVvBu+mufBTIMScZa9q7URKLMt Ko5ZdJlhAC5jDdZxcLYTbyjReXijrUFWM6ExjPDImy7UMeb0vIcydKZ+rVR5Vqpw hetMBWTd91lA5mC0RuZp6+Fs0alDfiOlK6HmCZR0VzfjbBtp97GxSzVmbjnZuqqI VwUT+Q== Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gqxw8tnhu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:50 +0000 (GMT) Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-6c27804563dso664696eaf.2 for ; Wed, 16 Sep 2026 22:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621309; x=1790226109; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/c+MG9f2w/9ybbVeA1E4MIJh8UMHBeh5BTpy0MtonQ0=; b=KhcXbB3+etRiRs28ckoIMlclR9qEdK2UsuoP6wF2hBY/Rd/uPO1cAtak7751U9uUWx mI+sT40bQCSZ3F+01YJYC8zQ9mbmOXebtDduW8FbGbIWxDwdr5QsKgWmhL/VdTIa00NN ihPDypll/43dth2fzSoIVQqckhhZ224GPZoOYZs5jIidPt5TKzboSOddCCRHmOMGNI5T HwJvPme66AsWTxInjXEPf6H+0bktpyhiXKMPXdP+fW9y3IiuU2NqzWwueFqxc9BQMygQ vzbfrWrJqP1zLeL7uD5uGIeaIwr60PuWu4c81E5L4fIg/Zx2MnHL3+AKf27+Aj5V5POn jbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621309; x=1790226109; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/c+MG9f2w/9ybbVeA1E4MIJh8UMHBeh5BTpy0MtonQ0=; b=swUCqh9/38VyzZTEVAo9N7T/YxM1KELC3yL4H6OF9hsKXXgkWGmJQ7kLV84/1+W379 5H8p8UFdtvTOzNU/H8rLryGZ77Aw3hGC/y+gJ/whNqrH/g4zdYJu2njPg1+ZxvWr7dmR YpvOqHcS7eezftwJ8/0FPYZ7a7Be3yh+WY8K3hml5j+Q4YEtiJuDIzkubUMVrwakKdG2 VFVXi2e02g4wBggumj5JVikVaNUd0Al24sKJXn3pakb1DJ8r2U4hvSjDa25oNQdlNjwS Lhw0oA1Q01XYaLpHvRXQDHeh01h1TpnSLRWsCzeb196SPRhuFDw9vq9MaQXS5HDE9I3r M4WA== X-Forwarded-Encrypted: i=1; AKwUvBzMnagB3rNSeg5JpG/UXr96E3l3F6AGeWSKoGRPmmEWjHSrttrajfPnhjlVaCnkOml8SnQU7yoKoSamx0o=@vger.kernel.org X-Gm-Message-State: AFuF++l6czakkhsHpTtSdygRWtjnuiKYakZfeZ6W2/MLEUOlhtZshIzn /6fUwaLHSUzbRY8ZxqZA5tUSG4DwiB8Ha2OauyjEsxut2zU7S39s3Gp1/cSaqmQ1nd1UVL4FtDH cJK09LxUxpx+TEHjOvHFvBgXi9WWjatCvWe6ADR4M5ng5ETekDhsFCK4kMDHt4TT9Vqc= X-Gm-Gg: AYBFou1H5+iNOdo0jjS8uCiPVC/e6tKjrtNRFLtni4nW4q9WSz7gSxQn4h1uIjcNW+x FXYbS/Y8VIZNJJzKWe8YKGf0SxvebbQMvifO8nFA92MUvWWatgfJbwoS6OrO549khcCms2CQ7nX Qptm6ur92RDCOLOPEf8XYdN0raqZEZhRegfPSP67dY1g9pv7AAx1vw7B2X8JPognL3m90ZABoy8 WJ+crgfNW8s8jaPqVTjV0eNlKCwZqVyZ+hjQgVwEyYKnyxtqWEVxjpPmW+CuFAgccl93Bgi892J jkb9unYL7442WFKUynFHgaBCdh3qocJoKnnlkXbCfVQ3zSxMzwCaLG+pJKSRVSLyRoaubfK4XiF YkWz/IeSFsJifi32P7mAhO1TeZ8DEFcbacQ== X-Received: by 2002:a05:6820:150d:b0:6c2:396e:b991 with SMTP id 006d021491bc7-6c7d4df6cc4mr4855152eaf.61.1789621309360; Wed, 16 Sep 2026 22:01:49 -0700 (PDT) X-Received: by 2002:a05:6820:150d:b0:6c2:396e:b991 with SMTP id 006d021491bc7-6c7d4df6cc4mr4855125eaf.61.1789621308953; Wed, 16 Sep 2026 22:01:48 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:48 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:24 +0530 Subject: [PATCH v11 5/9] media: iris: Handle CPU_CS_SCIACMDARG3 register write via program bootup registers hook Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-5-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=3528; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=+ExuaRBxQIaOHG6mrK/Olyf/dxovfo+tA3P6mPihs8I=; b=oxKkYS8uSP03D5D1o6W47/aBAr6ogm01LzMPwRe6kyNUm66j/zgrDfDNo2umQ1RojllKlhbk6 xR/Tc7rQMZxCqqYFOZf4OZxKREVS4PYX0XQSzk/m62wmob2c7UhHCZp X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: Zp7ajr_159gSisHCtQ5GMj08YWQ9Rm06 X-Authority-Analysis: v=2.4 cv=bY3+w+PB c=1 sm=1 tr=0 ts=6aab743e cx=c_pps a=wURt19dY5n+H4uQbQt9s7g==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=_-2Oxswyk2Zu2Y7AJ8cA:9 a=QEXdDO2ut3YA:10 a=-UhsvdU3ccFDOXFxFb4l:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX7ARiBmHBdjCN 9oA1t8Po13o4AkNNGnnpfvNnjnHGdoiHxlCtXSDO5pLWlAa2bTULhSDCevYzJTgROGNvn7oL7S4 AZdx4pGLd4cCaFC8Mkb8iAU8SONxN7I= X-Proofpoint-ORIG-GUID: Zp7ajr_159gSisHCtQ5GMj08YWQ9Rm06 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXycGnewnr9NVW cW/PXL/RrvPXF3nNdKvRFbrRXUq2lgyDbBWxWsYk4l0qe8YGeOkgTdBUwAxboH8i1VUULNQ2lNk tiOcUoiDHBYsuBghk8EUEy++5oR9MVXMhJTZHmCsW2HP8o8LVnJJTX/PiAdhrILnZyfoGrBcfda DkFCI2Z5oQGdDNiyda4ee4msWf753oNokL9z/NDtZHLcjwD7AVRObPx7q9orbvLAsVJgDtgpjpC EZLN2+IjS0akwF3Ia5fibdl3edJAWCdkAfs+pfQhJNwcaVkGZlhD4C71Boob2NsPljBTZt4z+Yr huwDMJ9s5vCnZiTgoADFsp3cYsMIAcMaQfTCCtsK9NtTrxfi9PCZrq0Azk00uLMWqM6UzbsP9xt mPIv9pd6NBG2xb/52o3cwPc89XiCFoTq+SE671ue0eqoqToIj810rjQ92zHUzxurp5S6mimEH0n Kiwvs6ayL7gky88lGMw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 On the Glymur platform, the firmware reads CPU_CS_SCIACMDARG3 during boot to determine the VM count and increments it by 1. Writing the default 0x1 causes the firmware to treat the VM count as 2. To avoid that write 0x0 to CPU_CS_SCIACMDARG3 as a Glymur platform specific. Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 6 ++++++ drivers/media/platform/qcom/iris/iris_vpu_common.c | 4 ++-- drivers/media/platform/qcom/iris/iris_vpu_register_defines.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 7b07d33d6119..f3c4ee2c4003 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -329,6 +329,11 @@ static int iris_vpu36_set_hwmode(struct iris_core *cor= e) return ret; } =20 +static void iris_vpu36_program_bootup_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + CPU_CS_SCIACMDARG3); +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -362,6 +367,7 @@ const struct vpu_ops iris_vpu36_ops =3D { .power_on_hw =3D iris_vpu36_power_on_hw, .power_off_controller =3D iris_vpu35_vpu4x_power_off_controller, .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, + .program_bootup_registers =3D iris_vpu36_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu36_set_hwmode, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 06e15ea6b58a..e357887624da 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -26,7 +26,6 @@ #define QTBL_ENABLE BIT(0) =20 #define QTBL_ADDR (CPU_CS_BASE_OFFS + 0x54) -#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE_OFFS + 0x58) #define SFR_ADDR (CPU_CS_BASE_OFFS + 0x5C) #define UC_REGION_ADDR (CPU_CS_BASE_OFFS + 0x64) #define UC_REGION_SIZE (CPU_CS_BASE_OFFS + 0x68) @@ -67,6 +66,8 @@ static void iris_vpu_setup_ucregion_memory_map(struct iri= s_core *core) writel(value, core->reg_base + SFR_ADDR); } =20 + writel(0x1, core->reg_base + CPU_CS_SCIACMDARG3); + if (vpu_ops->program_bootup_registers) vpu_ops->program_bootup_registers(core); } @@ -78,7 +79,6 @@ int iris_vpu_boot_firmware(struct iris_core *core) iris_vpu_setup_ucregion_memory_map(core); =20 writel(ctrl_init, core->reg_base + CTRL_INIT); - writel(0x1, core->reg_base + CPU_CS_SCIACMDARG3); =20 while (!ctrl_status && count < max_tries) { ctrl_status =3D readl(core->reg_base + CTRL_STATUS); diff --git a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h b= /drivers/media/platform/qcom/iris/iris_vpu_register_defines.h index c44c85eac3b5..3782454b7d06 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -29,6 +29,7 @@ #define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE_OFFS + 0x1C) #define CLEAR_XTENSA2HOST_INTR BIT(0) =20 +#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE_OFFS + 0x58) #define CPU_CS_H2XSOFTINTEN (CPU_CS_BASE_OFFS + 0x148) #define HOST2XTENSA_INTR_ENABLE BIT(0) =20 --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446CC3A963A for ; Thu, 17 Sep 2026 05:01:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621321; cv=none; b=c4ZZb2sL1NOYu1Z4KbvV+qC1tRbCDNYs2jKFjdTgbe4ZxlC0MTjmpwduH22wgDxf0PLJMhytuPqSrSGUzoB/pfMQtY+Sg0WMkamNfsNK3EOlL7tnvgADWIDOmE6/8Rx74jQ9Fy+5o1aSBPBzLNvYNJOM26pR6yzGPKoHTPIS6CY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621321; c=relaxed/simple; bh=MFjdCiIFtje0IFKh3Xra6G/jDUvrMtnFOLx7XQIfVYc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q0xoA3pNJ+3ZUZK7wK6j4xzawBqRSFhWJ4dnrSbFVleQPX/yx0G98Fth6Te20WVmubkE9xVk9zdPArRqddj0C5U3Pz9MTy0pj9EdzhIUxcLcbcpilTNA25CTo4U0tRUM3tdxm4FF3JtP5MbIpjdvY+vh71gyO3XNH41AuNDEg2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=bGw1wujX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=b7wd0Ozz; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="bGw1wujX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="b7wd0Ozz" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GNGBAP2470093 for ; Thu, 17 Sep 2026 05:01:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 70cmDDdanj723Xy7ZFiRtQ56r/+2UB1pDkcwqs2pWtk=; b=bGw1wujXn59mzaAt dWgkIjLLuYmvTIz8OHryhzWKV6s0h2sjvdL9YW5mgXg8BamysMQO6M8fjLnnaoaK BS5T8hQECbMLzDM/bK9sLmu3j66f2vqVbXFD2eQ3CT4/QIBrL3S8vy08sVHwl4be 5zMHEAS/1/OofeKqWhEUk6CuNtQNdR0XBEy7oEVeWM3v/7apPCwIYRZLelYcA+Pv n3X4yRm9IvUdrg5KhtRyjOg4nwWecEF642ozHy4A+u4WINhDsfiAPBrvyKoKyKqp u1DCQ4qTc3vLQNVmxp4y+sboFVyMyxjcb8WBkQjrPYjtn8myIgh+nzN6KsXvisZ3 g9a18w== Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gqtn53u40-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:01:57 +0000 (GMT) Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-4cbc77da654so430637b6e.2 for ; Wed, 16 Sep 2026 22:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621317; x=1790226117; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=70cmDDdanj723Xy7ZFiRtQ56r/+2UB1pDkcwqs2pWtk=; b=b7wd0Ozzf31EaB+6Wh4nIeGHes6hV3WDEVhJcc2wwAMit5TpTiImKyBoO7mcUABicn +qq3EreP+OuTzC0zVdWAIT2KNkCqoMK4C0fgJZs2E4V43w/qtscpm1Tl9SJEmDUx35YG Rk5RPtdHBPPnrVOXMjMFJyncaNsmncjyJWHKHrzreGbZmeoX0g065EHXXrLHnv7z7olg Nyv4kiCINwBjiTi4X7PlbSttbXudlRKwpHVN+jIDdQAgTok/CGdYaZ35UupWDkUwisaa IDxqSa3KVrgUOCaw3Y0KFsVegUTOildmJ/Htvt5TSRgsM9+PW206uI0eZdHcxDaFJLAQ hY7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621317; x=1790226117; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=70cmDDdanj723Xy7ZFiRtQ56r/+2UB1pDkcwqs2pWtk=; b=YMOMyRoSSnNoB8tAR/IK8mx0wXA2GaCxdTRKg1Y7TSe0TN6nAOOXQrgaOSXtImZzev 66eSis1uFhoyCcmD+wy9OBMnPxWgI4UrI8V3VZnjj8soAqku8LPKcWPJg2LjagYGJEVR Jt5gl24G0L6evMMKBA5sM+nNJ/KxmTMKoylKU6VLR/uUe8fiwG2DEmQ+55jXA8TYVUL9 FzZ6ECQLiLErGN5ERNiHg+qClVMp6WZnmWH43z3eEnP71MUEw7/w4ixUnO1PCd43OBnB 69+k649rlsbkLpMRA+g9vk4n5qeOJK3TgogO8axjBsubq+AGJz5dEzy/YYq4Kk68sDuh eCOA== X-Forwarded-Encrypted: i=1; AKwUvBy037W3ji7W0fhdtkne6XkVeVWgXGV2ts20VCS1Muvwu/natnkEMQyhCfB1PXlCL237ZueeWZ9KghXIXdE=@vger.kernel.org X-Gm-Message-State: AFuF++m4EeW9/MjyikA2Qj/yp9Dl2nTxw1vNFYecttcRp+3xCiwis05U LmHFNNg2Q2GE3bzSa2ZD5xZqBjrPH2bJoevUIRXu5RuLYq3WitJqG1coMM2MNWMQ9iuAqhOfOXu ul0oPR6LBxHkSTnerbUZKAHBo/g+74LKF/gNYKSE88KXL3R6JfL/+zv0qStNQY5RX26g= X-Gm-Gg: AYBFou3bDZJaJcrSOoTKm5vtjKibVejtgVEjhd1LQlyjOYrLPc8kuw6NpJVFK1TYS5E V3FBSl/ZPXBPfvvK0PcLj9RbTXQJuQEK5L0LwG1JkVojrYiM68WHTpd8Mx87jrsBQSYSHFYLunI GJggzMbpVJIpzO6WXQlP/zQnMGpfDLYtf4FGpID/yyE7m5oAViX3xnft60DqZUwweuvq9br7jQ4 /1HegyXdBkwV08dcKPMFIW8pyjOJzawhMtnqqxLIbV+4A6YCCDcEAi92Wel7UQ+JYVfjrIQxUww wIiR7XJlaLS0adt1N54+344JAQMPkO4gdp1TA2rtdhsiwS8TVkjHqKe2KjNVkwqFqYS++J0oHs/ zQV2mYOt8jjQ8H+VgMxZXSnxuM58sGjAMOQ== X-Received: by 2002:a05:6808:5190:b0:4b9:a829:f00b with SMTP id 5614622812f47-4ca4bc70415mr5950486b6e.23.1789621316772; Wed, 16 Sep 2026 22:01:56 -0700 (PDT) X-Received: by 2002:a05:6808:5190:b0:4b9:a829:f00b with SMTP id 5614622812f47-4ca4bc70415mr5950437b6e.23.1789621316147; Wed, 16 Sep 2026 22:01:56 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:01:55 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:25 +0530 Subject: [PATCH v11 6/9] media: iris: Add support to select core for dual core platforms Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-6-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=17834; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=MFjdCiIFtje0IFKh3Xra6G/jDUvrMtnFOLx7XQIfVYc=; b=CopaY4iQnvpcvfW9Gy9KQl1/ZtBtGOvoz2JiUQNLyBgPyfFMB4xgFxyARyejFBejEDFHjGiwv ci601l4d2IcBJpgHEAz/9xkPCCznt8T+wlfUYdwWbs7gF/M60e5jrZx X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX2jgLA5YK7KyW 5jF5FAEMCkX4m/D6zkGAiRLbVrwWCE5GHAEtLTSWLrDvV3d61WH/W/64PB/ZU5e6wf5dWFEr/cV GIQhtaKg03fznOgocjtBzhc637j9csysz2LsLTH2VSj2pB6ThMsiboU1lm767+R27R5Xdsb+MYw 4IM8P/TISn5RuW5AnHD10PGiwr4ZOriQPMwS8CC+ZIWRGR/WCXW/HFZYn0HKmNDfouJyrzVGYCv PqLRZoAM0N50g8Ztvbf/ARSjerWdpw5RFEvrl/CoeuvglLmm5IS0rhG9EXdmPx2JtMyM3fouQ7L GBKhV/4QzHwInYyhmNZVhiGp3T/UTzYDiKUAAwr7/36tOR5R9PP5bjPxFlEcjeG4grn6IbQ67we LFdouDPfVKfi6GjbUydqbQsIgploDdOonG+tRArQeLPwQY3H1lPBgr4z3mpF9xsVgBdr2mKMLeX IYf++lZV5Icr6WvQjsw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX9GyKZHEcQuT+ VBnoIvwAKRq87VEdiRvAYJc4DXfcrqYkb9lBla5NECyUo7hR0LE0uR5gbLE8r7ZJhzwPMN+ooGX RmJP3lk59sUAz9QZkAwGlP9Z5VYPBqA= X-Proofpoint-ORIG-GUID: rxfFudmB5-eitEHWUn-GUMlf2DjgRXIW X-Authority-Analysis: v=2.4 cv=K7O3jCWI c=1 sm=1 tr=0 ts=6aab7445 cx=c_pps a=AKZTfHrQPB8q3CcvmcIuDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=-5uF22sGoL6VU8B926sA:9 a=QEXdDO2ut3YA:10 a=pF_qn-MSjDawc0seGVz6:22 X-Proofpoint-GUID: rxfFudmB5-eitEHWUn-GUMlf2DjgRXIW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 phishscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 On platforms with two video codec cores, select the hardware core for a new session based on the current Macroblocks Per Frame (MBPF) and Macroblocks Per Second (MBPS) load on each core. The selected core is communicated to the firmware via the HFI_PROP_CORE_ID property at stream-on time. Since both cores share the same clock source, the required clock frequency is the maximum of the aggregated frequencies across both cores. The total session count limit is scaled by the number of cores, since each core independently supports sessions up to its own limit. Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_common.c | 10 ++++ drivers/media/platform/qcom/iris/iris_common.h | 1 + drivers/media/platform/qcom/iris/iris_core.h | 5 ++ drivers/media/platform/qcom/iris/iris_hfi_common.h | 1 + .../platform/qcom/iris/iris_hfi_gen2_command.c | 19 +++++++ .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_instance.h | 2 + drivers/media/platform/qcom/iris/iris_power.c | 20 ++++++- drivers/media/platform/qcom/iris/iris_utils.c | 58 ++++++++++++------- drivers/media/platform/qcom/iris/iris_utils.h | 3 +- drivers/media/platform/qcom/iris/iris_vb2.c | 4 ++ drivers/media/platform/qcom/iris/iris_vidc.c | 6 +- drivers/media/platform/qcom/iris/iris_vpu3x.c | 66 ++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 2 + 14 files changed, 174 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_common.c b/drivers/media= /platform/qcom/iris/iris_common.c index 25836561bcf3..4e1e7d38e3fb 100644 --- a/drivers/media/platform/qcom/iris/iris_common.c +++ b/drivers/media/platform/qcom/iris/iris_common.c @@ -46,6 +46,16 @@ void iris_set_ts_metadata(struct iris_inst *inst, struct= vb2_v4l2_buffer *vbuf) inst->metadata_idx++; } =20 +int iris_set_core_id(struct iris_inst *inst) +{ + const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; + + if (!inst->core_id || !hfi_ops->session_set_core_id) + return 0; + + return hfi_ops->session_set_core_id(inst, inst->core_id); +} + int iris_process_streamon_input(struct iris_inst *inst) { const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; diff --git a/drivers/media/platform/qcom/iris/iris_common.h b/drivers/media= /platform/qcom/iris/iris_common.h index b2a27b781c9a..34e32c60f768 100644 --- a/drivers/media/platform/qcom/iris/iris_common.h +++ b/drivers/media/platform/qcom/iris/iris_common.h @@ -11,6 +11,7 @@ struct iris_buffer; =20 int iris_vb2_buffer_to_driver(struct vb2_buffer *vb2, struct iris_buffer *= buf); void iris_set_ts_metadata(struct iris_inst *inst, struct vb2_v4l2_buffer *= vbuf); +int iris_set_core_id(struct iris_inst *inst); int iris_process_streamon_input(struct iris_inst *inst); int iris_process_streamon_output(struct iris_inst *inst); int iris_session_streamoff(struct iris_inst *inst, u32 plane); diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index f528f53f20fc..cf75e53524b0 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -37,6 +37,11 @@ enum domain_type { DECODER =3D BIT(1), }; =20 +enum iris_vcodec_core_id { + IRIS_VCODEC0 =3D 1, + IRIS_VCODEC1, +}; + struct qcom_ubwc_cfg_data; =20 /** diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.h b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.h index a27447eb2519..47786529998d 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.h @@ -131,6 +131,7 @@ struct iris_hfi_session_ops { int (*session_drain)(struct iris_inst *inst, u32 plane); int (*session_resume_drain)(struct iris_inst *inst, u32 plane); int (*session_close)(struct iris_inst *inst); + int (*session_set_core_id)(struct iris_inst *inst, u32 core_id); }; =20 struct hfi_subscription_params { diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_command.c index 388a36ff2b07..b071980ddd27 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -1359,6 +1359,24 @@ static int iris_hfi_gen2_session_release_buffer(stru= ct iris_inst *inst, struct i inst_hfi_gen2->packet->size); } =20 +static int iris_hfi_gen2_set_core_id(struct iris_inst *inst, u32 core_id) +{ + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 payload =3D core_id; + + iris_hfi_gen2_packet_session_command(inst, + HFI_PROP_CORE_ID, + HFI_HOST_FLAGS_NONE, + HFI_PORT_NONE, + inst->session_id, + HFI_PAYLOAD_U32, + &payload, + sizeof(u32)); + + return iris_hfi_queue_cmd_write(inst->core, inst_hfi_gen2->packet, + inst_hfi_gen2->packet->size); +} + static const struct iris_hfi_session_ops iris_hfi_gen2_session_ops =3D { .session_open =3D iris_hfi_gen2_session_open, .session_set_config_params =3D iris_hfi_gen2_session_set_config_params, @@ -1372,6 +1390,7 @@ static const struct iris_hfi_session_ops iris_hfi_gen= 2_session_ops =3D { .session_drain =3D iris_hfi_gen2_session_drain, .session_resume_drain =3D iris_hfi_gen2_session_resume_drain, .session_close =3D iris_hfi_gen2_session_close, + .session_set_core_id =3D iris_hfi_gen2_set_core_id, }; =20 static struct iris_inst *iris_hfi_gen2_get_instance(void) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index f43aea10090d..2b70649d7e3e 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -56,6 +56,7 @@ #define HFI_PROP_BUFFER_HOST_MAX_COUNT 0x03000123 #define HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT 0x03000124 #define HFI_PROP_PIC_ORDER_CNT_TYPE 0x03000128 +#define HFI_PROP_CORE_ID 0x030001a9 =20 enum hfi_rate_control { HFI_RC_VBR_CFR =3D 0x00000000, diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/med= ia/platform/qcom/iris/iris_instance.h index a770331d1675..585aa7c51fb0 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -36,6 +36,7 @@ enum iris_fmt_type_cap { * * @list: used for attach an instance to the core * @core: pointer to core structure + * @core_id: specifies the hardware core on which the session runs * @session_id: id of current video session * @hfi_session_ops: iris HFI session ops * @ctx_q_lock: lock to serialize queues related ioctls @@ -83,6 +84,7 @@ enum iris_fmt_type_cap { struct iris_inst { struct list_head list; struct iris_core *core; + u32 core_id; u32 session_id; const struct iris_hfi_session_ops *hfi_session_ops; struct mutex ctx_q_lock;/* lock to serialize queues related ioctls */ diff --git a/drivers/media/platform/qcom/iris/iris_power.c b/drivers/media/= platform/qcom/iris/iris_power.c index 91aa21d4070e..a875647b3162 100644 --- a/drivers/media/platform/qcom/iris/iris_power.c +++ b/drivers/media/platform/qcom/iris/iris_power.c @@ -75,14 +75,12 @@ static int iris_vote_interconnects(struct iris_inst *in= st) return iris_set_interconnects(inst); } =20 -static int iris_set_clocks(struct iris_inst *inst) +static u64 iris_get_required_freq(struct iris_inst *inst) { struct iris_core *core =3D inst->core; struct iris_inst *instance; u64 freq =3D 0; - int ret; =20 - mutex_lock(&core->lock); list_for_each_entry(instance, &core->instances, list) { if (!instance->max_input_data_size) continue; @@ -90,6 +88,22 @@ static int iris_set_clocks(struct iris_inst *inst) freq +=3D instance->power.min_freq; } =20 + return freq; +} + +static int iris_set_clocks(struct iris_inst *inst) +{ + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; + struct iris_core *core =3D inst->core; + u64 freq; + int ret; + + mutex_lock(&core->lock); + if (vpu_ops->get_required_freq) + freq =3D vpu_ops->get_required_freq(inst); + else + freq =3D iris_get_required_freq(inst); + core->power.clk_freq =3D freq; ret =3D iris_opp_set_rate(core->dev, freq); mutex_unlock(&core->lock); diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index ba5c8dc1280c..4608e3f28832 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.c +++ b/drivers/media/platform/qcom/iris/iris_utils.c @@ -7,6 +7,7 @@ #include =20 #include "iris_instance.h" +#include "iris_vpu_common.h" #include "iris_utils.h" =20 bool iris_res_is_less_than(u32 width, u32 height, @@ -23,7 +24,7 @@ bool iris_res_is_less_than(u32 width, u32 height, return false; } =20 -int iris_get_mbpf(struct iris_inst *inst) +u32 iris_get_mbpf(struct iris_inst *inst) { struct v4l2_format *inp_f =3D inst->fmt_src; u32 height =3D max(inp_f->fmt.pix_mp.height, inst->crop.height); @@ -32,6 +33,13 @@ int iris_get_mbpf(struct iris_inst *inst) return NUM_MBS_PER_FRAME(height, width); } =20 +u32 iris_get_mbps(struct iris_inst *inst) +{ + u32 fps =3D max(inst->frame_rate, inst->operating_rate); + + return iris_get_mbpf(inst) * fps; +} + bool iris_split_mode_enabled(struct iris_inst *inst) { return inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_NV12 || @@ -101,40 +109,52 @@ struct iris_inst *iris_get_instance(struct iris_core = *core, u32 session_id) return NULL; } =20 -int iris_check_core_mbpf(struct iris_inst *inst) +static int iris_check_core_load(struct iris_inst *inst, bool mbpf) { - struct iris_core *core =3D inst->core; + const struct iris_platform_data *platform_data =3D inst->core->iris_platf= orm_data; + u32 max_load =3D mbpf ? platform_data->max_core_mbpf : platform_data->max= _core_mbps; struct iris_inst *instance; - u32 total_mbpf =3D 0; + u32 total_load =3D 0; =20 - mutex_lock(&core->lock); - list_for_each_entry(instance, &core->instances, list) - total_mbpf +=3D iris_get_mbpf(instance); - mutex_unlock(&core->lock); + list_for_each_entry(instance, &inst->core->instances, list) + total_load +=3D mbpf ? iris_get_mbpf(instance) : iris_get_mbps(instance); =20 - if (total_mbpf > core->iris_platform_data->max_core_mbpf) + if (total_load > max_load) return -ENOMEM; =20 return 0; } =20 -int iris_check_core_mbps(struct iris_inst *inst) +int iris_check_core_mbpf(struct iris_inst *inst) { + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; struct iris_core *core =3D inst->core; - struct iris_inst *instance; - u32 total_mbps =3D 0, fps =3D 0; + int ret; =20 mutex_lock(&core->lock); - list_for_each_entry(instance, &core->instances, list) { - fps =3D max(instance->frame_rate, instance->operating_rate); - total_mbps +=3D iris_get_mbpf(instance) * fps; - } + if (vpu_ops->check_core_load) + ret =3D vpu_ops->check_core_load(inst, true); + else + ret =3D iris_check_core_load(inst, true); mutex_unlock(&core->lock); =20 - if (total_mbps > core->iris_platform_data->max_core_mbps) - return -ENOMEM; + return ret; +} =20 - return 0; +int iris_check_core_mbps(struct iris_inst *inst) +{ + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; + struct iris_core *core =3D inst->core; + int ret; + + mutex_lock(&core->lock); + if (vpu_ops->check_core_load) + ret =3D vpu_ops->check_core_load(inst, false); + else + ret =3D iris_check_core_load(inst, false); + mutex_unlock(&core->lock); + + return ret; } =20 bool is_rotation_90_or_270(struct iris_inst *inst) diff --git a/drivers/media/platform/qcom/iris/iris_utils.h b/drivers/media/= platform/qcom/iris/iris_utils.h index 228a5f963812..c36ac494f461 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.h +++ b/drivers/media/platform/qcom/iris/iris_utils.h @@ -43,7 +43,8 @@ static inline enum iris_buffer_type iris_v4l2_type_to_dri= ver(u32 type) =20 bool iris_res_is_less_than(u32 width, u32 height, u32 ref_width, u32 ref_height); -int iris_get_mbpf(struct iris_inst *inst); +u32 iris_get_mbpf(struct iris_inst *inst); +u32 iris_get_mbps(struct iris_inst *inst); bool iris_split_mode_enabled(struct iris_inst *inst); bool iris_fmt_is_8bit(u32 pixelformat); bool iris_fmt_is_10bit(u32 pixelformat); diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/pl= atform/qcom/iris/iris_vb2.c index a2ea2d67f60d..dbb89396e651 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -176,6 +176,10 @@ int iris_vb2_start_streaming(struct vb2_queue *q, unsi= gned int count) if (ret) goto error; =20 + ret =3D iris_set_core_id(inst); + if (ret) + goto error; + if (V4L2_TYPE_IS_OUTPUT(q->type)) { if (inst->domain =3D=3D DECODER) ret =3D iris_vdec_streamon_input(inst); diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index 064cf0a80748..79523e42f344 100644 --- a/drivers/media/platform/qcom/iris/iris_vidc.c +++ b/drivers/media/platform/qcom/iris/iris_vidc.c @@ -42,16 +42,20 @@ static void iris_v4l2_fh_deinit(struct iris_inst *inst,= struct file *filp) =20 static void iris_add_session(struct iris_inst *inst) { + const struct iris_platform_data *plat =3D inst->core->iris_platform_data; + u32 max_session_count =3D plat->max_session_count; struct iris_core *core =3D inst->core; struct iris_inst *iter; u32 count =3D 0; =20 + max_session_count *=3D max(plat->num_cores, 1); + mutex_lock(&core->lock); =20 list_for_each_entry(iter, &core->instances, list) count++; =20 - if (count < core->iris_platform_data->max_session_count) + if (count < max_session_count) list_add_tail(&inst->list, &core->instances); =20 mutex_unlock(&core->lock); diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index f3c4ee2c4003..375defbb9594 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -334,6 +334,70 @@ static void iris_vpu36_program_bootup_registers(struct= iris_core *core) writel(0x0, core->reg_base + CPU_CS_SCIACMDARG3); } =20 +static int iris_vpu36_check_core_load(struct iris_inst *inst, bool mbpf) +{ + const struct iris_platform_data *platform_data =3D inst->core->iris_platf= orm_data; + u32 max_load =3D mbpf ? platform_data->max_core_mbpf : platform_data->max= _core_mbps; + u32 max_session_cnt =3D platform_data->max_session_count; + u32 core0_session_cnt =3D 0, core1_session_cnt =3D 0; + u32 core0_load =3D 0, core1_load =3D 0; + bool select_core0, select_core1; + struct iris_inst *instance; + u32 load, new_load; + + list_for_each_entry(instance, &inst->core->instances, list) { + load =3D mbpf ? iris_get_mbpf(instance) : iris_get_mbps(instance); + + if (instance->core_id =3D=3D IRIS_VCODEC0) { + core0_load +=3D load; + core0_session_cnt++; + } else if (instance->core_id =3D=3D IRIS_VCODEC1) { + core1_load +=3D load; + core1_session_cnt++; + } + } + + if (inst->core_id =3D=3D IRIS_VCODEC0) + return core0_load <=3D max_load ? 0 : -ENOMEM; + else if (inst->core_id =3D=3D IRIS_VCODEC1) + return core1_load <=3D max_load ? 0 : -ENOMEM; + + new_load =3D mbpf ? iris_get_mbpf(inst) : iris_get_mbps(inst); + + select_core0 =3D core0_load + new_load <=3D max_load && core0_session_cnt= < max_session_cnt; + select_core1 =3D core1_load + new_load <=3D max_load && core1_session_cnt= < max_session_cnt; + + if (select_core0 && select_core1) + inst->core_id =3D (core0_load <=3D core1_load) ? IRIS_VCODEC0 : IRIS_VCO= DEC1; + else if (select_core0) + inst->core_id =3D IRIS_VCODEC0; + else if (select_core1) + inst->core_id =3D IRIS_VCODEC1; + else + return -ENOMEM; + + return 0; +} + +static u64 iris_vpu36_get_required_freq(struct iris_inst *inst) +{ + u64 vcodec0_freq =3D 0, vcodec1_freq =3D 0; + struct iris_core *core =3D inst->core; + struct iris_inst *instance; + + list_for_each_entry(instance, &core->instances, list) { + if (!instance->max_input_data_size) + continue; + + if (instance->core_id =3D=3D IRIS_VCODEC0) + vcodec0_freq +=3D instance->power.min_freq; + else if (instance->core_id =3D=3D IRIS_VCODEC1) + vcodec1_freq +=3D instance->power.min_freq; + } + + return max(vcodec0_freq, vcodec1_freq); +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -370,4 +434,6 @@ const struct vpu_ops iris_vpu36_ops =3D { .program_bootup_registers =3D iris_vpu36_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu36_set_hwmode, + .check_core_load =3D iris_vpu36_check_core_load, + .get_required_freq =3D iris_vpu36_get_required_freq, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 63bf0cec58e2..0de715bd810d 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -23,6 +23,8 @@ struct vpu_ops { void (*program_bootup_registers)(struct iris_core *core); u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); int (*set_hwmode)(struct iris_core *core); + int (*check_core_load)(struct iris_inst *inst, bool mbpf); + u64 (*get_required_freq)(struct iris_inst *inst); }; =20 int iris_vpu_boot_firmware(struct iris_core *core); --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 415EB3E4109 for ; Thu, 17 Sep 2026 05:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621327; cv=none; b=tmzupwC5/6lxvw3R+hBfxPEDqb9mVxvQXRDXqnLSSNRjaC+749C9MWZ7TCuOzNE5jCOZ/Jm11fVk4i97bz/JB5FGiOltqpLjWAHGPN8drREpalQQTMHGLx0G78pTTzdrfwbhnKsQ/11QnOArRMCs4GdUOss4C1jPbj2vzzmOZNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621327; c=relaxed/simple; bh=UZNbS73oybmrDG7bGYlLhJz6xGFDS3+XV6hx4qTvcO0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s7lD5CMmrUUdaeRzYfVleP2lmmC7KqsUNdPL4YiwO2PY/PQmAb5/Wdhxiu/VzZIxzr+jXNefP48woFiwbom30lbipsNzUpABBPBPE1C+hUpi/nhDHl9TB6QEUef0hF+L77sEAf/F+wfrbZoySXnxClvSFxmy4TnAIv1ynzn8lxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=A1kz/VOp; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LyXE/0jf; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="A1kz/VOp"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LyXE/0jf" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H44AOM4038572 for ; Thu, 17 Sep 2026 05:02:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= b8+vcGM6Pv9ziGSqm1+0G0Ejs7T9TPAZKmNqGArUBE0=; b=A1kz/VOphJFKz3J/ 2DGJjoNVZGN5LyEFaR5KxGab/ci+mgaN91frbUAl4joiu/CwEVOB2BB5gEHcIaWl Y+11qWprGjHBfrGNoNBAVe7TgWBNvsKMkd9C9NkkyfK9awrFoVSIkmFp+enj9066 0zHOMlsWKXfrkXeqnMu/gooA5//74CncFbSKqO5eWdqQsAwCe0yKcpJ4J4S+dJC6 X7R349w02/WeJUkANv2BpijI9SGWQBHLe8m9gBNt5XzFeZkSS3uqfVQjoWKgvgh0 LJMVlOHIIbY5V5AVUvZXpXzMBlLOHEgRaeN4k/F9QsjzVuXYLUJu8Q4VRBcDmXaM y84diw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gr8uw064w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:02:04 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-396901263b6so849278a91.2 for ; Wed, 16 Sep 2026 22:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621324; x=1790226124; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=b8+vcGM6Pv9ziGSqm1+0G0Ejs7T9TPAZKmNqGArUBE0=; b=LyXE/0jfU4v9g7U1qLha7paaF8+JQqDoNhRtJRSI0ihFCfDCfsq55EE/EIClRu9uKH arUhI735+LHis6FINveJPwnGtXrdMYDKeo6qzbf6+abAVbpH3dTpHB7+bLzf8kCMN7Mk NOyI9IrXB3n2U/R1g4pRbp3v0/Eko0cC3F3qBtUpxCeoF6WhRAlpwGuArmf1+RcB05al Qtjg3gFZimjZP2OJleqvjB8gCTGgyGiZK+Q3/wejBHFNJw5lguX2PojgBmYLcK0CGAgJ hcbM1YM45c4vw3rVpWTKxI8TUuj+RZbvOPy4gdFDUTRVgATYuAkenNMHypKbCxUZbFTy Uc8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621324; x=1790226124; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=b8+vcGM6Pv9ziGSqm1+0G0Ejs7T9TPAZKmNqGArUBE0=; b=GMpbsSVaAkFnKdBIsbWrikKWOmx7B/Eoh8R6dljvipDUl3VwjSQ0LP5zLWe6/7XxAG UMFIjTHRog2xgtYEOwOr7ZbUdwEUWE7PHwP4ytbwClNIuandJm1CnnHme2rsb+G+ZlhM qgJTfuAC9yxw8TAbXstRP6D0qUWNau7aq3FGXeyFNxY2UEWHgd29VTwJpthY6dm731d2 aLKm9nFY01igUlBOxGzBqL50etco27yFKawJm29X4LoQoD61yO4sSONPnXyXEkhfr6cV fXKBqaN3ELvgOrFtMurzlO8T3gLncGXMw9oNoHNE+8FVqapBeZxvNQjTQPZ2mPsOIViA D5cg== X-Forwarded-Encrypted: i=1; AKwUvBw8TMwlM+Ej46ZhiquwyoI7u2imGhw41AIPCzTELclqsJKgQJlk6apcm0LTG5JIWDRNwW6uSoQ5rSep8eE=@vger.kernel.org X-Gm-Message-State: AFuF++k9SZQqgciAetKgOmTpJBsWiowLrNytGRlR5+HAEoedKJXD2k/H VlAthiP0+HkYqiJIFbio36Rk/K/PRQZY20wEKN7+3kgciVndmmRY1uBMdP6PWIVjDPLCPuDNNxo Y63ULfmOIkUBHyPerrSQZEcmjdOlrUfyLIUKuFZNz0nUL5sDh+0kXB7PntDG2GCGTLGk= X-Gm-Gg: AYBFou1DB8kGqfOVicWVMO5DSTr/rm2VXSABqMlO5b+HG6nlZ2s1fVMb0Yu9xD1L3wy gjurSTZ1u0RkY2SaNYx53hIUS5YhbCbagV02FKx0gVz2DNIS2FHBTihmIlkjjMfMcHUWs7+TcV3 kVmZ14biwS0ENYB2nL475Q0lS0TAORrEXW088uw6pj2lnXoOGUIZ3nFNEZu8k1kN/oKcFBJZEKa ICxQq3qHyDSa71Cyn3O4imMWXnk/mjToXl8bw8TrVCe61nFicWlM2apNduQG70tVvWfwSlwXJnN Llp/hQUahXB7oFq19A6FaDUrhOnh0sTVDZDuDXPxLKdpYCkVE9oUWM7V3H+mjZERR6KDJbqZf8t /kJMUyAESPYf7VSCG9sbPsDiAZrnFGb0oWQ== X-Received: by 2002:a17:90b:4fcf:b0:39d:ecc8:73b1 with SMTP id 98e67ed59e1d1-39e1e2bd30emr18436704a91.7.1789621323687; Wed, 16 Sep 2026 22:02:03 -0700 (PDT) X-Received: by 2002:a17:90b:4fcf:b0:39d:ecc8:73b1 with SMTP id 98e67ed59e1d1-39e1e2bd30emr18436591a91.7.1789621323182; Wed, 16 Sep 2026 22:02:03 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:02:02 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:26 +0530 Subject: [PATCH v11 7/9] media: iris: Add platform data for glymur Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-7-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=8247; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=UZNbS73oybmrDG7bGYlLhJz6xGFDS3+XV6hx4qTvcO0=; b=U4z7kkjLpeB+x+VauwFnxdHI14IHW/zznLOl6oHbFhSncn84DIUhEjwipEdmtOmeVI/iUAIVJ 4tQ94nnQkH5DIOfjahjxoAP1mapPP/2VwHN9pg0DyUZtD2BgFErOsWr X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-ORIG-GUID: EZmwEuQTn5MP9pbUO7bYcjkmh5TrHH2h X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXzKoVc56JpyCf /PkNmaTOIvFF6zt9d1XeRKa82AKxPFcKbuNVTylFupK4WHkv1uwzDCyqrqLgrIoIWyv+PXYEZeN +dmAcrniyAdcVJkmqqVK+9ceXVy2dCsxW63YlLG8h8M9Ndzsb/ATqhisngRvpRjjqk1o9qgME5h 0uX6mzIw7q9AM1DJ+RoebNHB/GlkPqojDBFrK91Xf+ZPaIbspO/lnmXddSOpVGWXjL1iUrgMMNA BgeQNew68onzP7tGrFMncmmHZPfRz9jmOsaw43dng4AfK4JLfXqkiGf4gK4aCsP+kROdE/DqAtH vlqHuZRTyRqQlA5bTHeRfDBVVsNDUCPK0Ye/GYkgtUEgNtkHbq5vU1hN/wx8oYooCqM+XzzsJ5K lcHhLMb4WHugKzwwWuuKJmhsvYAD+2uz0S1rBrxYN6Rc14uTVs6c+3x3+nmLwEuZ8dx1rRFusJQ g7sNXYNF3/01TdrYXxA== X-Proofpoint-GUID: EZmwEuQTn5MP9pbUO7bYcjkmh5TrHH2h X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX8ldIHELmsTou fhKFdpINFdHXQB9VDrF1apL7gUJYcIu4s9KfbNAN/9l4RXPVgCKZZ1RujnqNAgQ45oFVeZL6cU5 C/naKH5+OjZMVTgNEIf5l9+v6A0n+gY= X-Authority-Analysis: v=2.4 cv=dMUzC+Zb c=1 sm=1 tr=0 ts=6aab744c cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=uD0unFxyaCLUJkKXN-EA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 On glymur platform, the iris core shares most properties with the iris core on the SM8550 platform. The major difference is that glymur integrates two codec cores (vcodec0 and vcodec1), while SM8550 has only one. Add glymur specific platform data, reusing SM8550 definitions wherever applicable. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 5 ++ .../platform/qcom/iris/iris_platform_glymur.c | 78 ++++++++++++++++++= ++++ .../platform/qcom/iris/iris_platform_glymur.h | 15 +++++ .../media/platform/qcom/iris/iris_platform_vpu3x.c | 35 ++++++++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 ++ 6 files changed, 138 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 48e415cbc439..48570da56aa0 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -12,6 +12,7 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_hfi_gen2_packet.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ + iris_platform_glymur.o \ iris_platform_vpu2.o \ iris_platform_vpu3x.o \ iris_power.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index d6b9e420be44..1024a2fd75a3 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -39,6 +39,10 @@ struct iris_inst; #define MAX_HEVC_VBR_LAYER_HP_SLIDING_WINDOW 5 #define MAX_HIER_CODING_LAYER_GEN1 6 =20 +#define VIDEO_REGION_SECURE_FW_REGION_ID 0 +#define VIDEO_REGION_VM0_SECURE_NP_ID 1 +#define VIDEO_REGION_VM0_NONSECURE_NP_ID 5 + enum stage_type { STAGE_1 =3D 1, STAGE_2 =3D 2, @@ -54,6 +58,7 @@ extern const struct iris_firmware_data iris_hfi_gen1_data; extern const struct iris_firmware_data iris_hfi_gen2_data; extern const struct iris_firmware_data iris_hfi_milos_data; =20 +extern const struct iris_platform_data glymur_data; extern const struct iris_platform_data milos_data; extern const struct iris_platform_data qcs8300_data; extern const struct iris_platform_data sc7280_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_glymur.c b/driv= ers/media/platform/qcom/iris/iris_platform_glymur.c new file mode 100644 index 000000000000..49edae8120fe --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.c @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include "iris_core.h" +#include "iris_platform_common.h" + +const struct iris_power_domain_data iris_glymur_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "core_iface", "core_freerun", "core", + }, + .clk_cnt =3D 3, +}; + +const struct iris_power_domain_data iris_glymur_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_iface", "vcodec0_core_freerun", "vcodec0_core", + }, + .clk_cnt =3D 3, + }, + { + .pd_names =3D (const char *[]) { + "vcodec1", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec1_iface", "vcodec1_core_freerun", "vcodec1_core", + }, + .clk_cnt =3D 3, + }, +}; + +const char * const iris_glymur_clk_reset_table[] =3D { + "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core", +}; + +const char * const iris_glymur_opp_clk_table[] =3D { + "vcodec0_core", + "vcodec1_core", + "core", + NULL, +}; + +const struct tz_cp_config iris_glymur_tz_cp_config[] =3D { + { + .cp_start =3D VIDEO_REGION_SECURE_FW_REGION_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0, + .cp_nonpixel_size =3D 0x1000000, + }, + { + .cp_start =3D VIDEO_REGION_VM0_SECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x1000000, + .cp_nonpixel_size =3D 0x24800000, + }, + { + .cp_start =3D VIDEO_REGION_VM0_NONSECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x25800000, + .cp_nonpixel_size =3D 0xda600000, + }, +}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_glymur.h b/driv= ers/media/platform/qcom/iris/iris_platform_glymur.h new file mode 100644 index 000000000000..9f2877ec9901 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef __IRIS_PLATFORM_GLYMUR_H__ +#define __IRIS_PLATFORM_GLYMUR_H__ + +extern const struct iris_power_domain_data iris_glymur_ctrl_data; +extern const struct iris_power_domain_data iris_glymur_vcodec_data[2]; +extern const char * const iris_glymur_clk_reset_table[6]; +extern const char * const iris_glymur_opp_clk_table[4]; +extern const struct tz_cp_config iris_glymur_tz_cp_config[3]; + +#endif /* __IRIS_PLATFORM_GLYMUR_H__ */ diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drive= rs/media/platform/qcom/iris/iris_platform_vpu3x.c index 9a62f5c5eb60..aa03f86d1945 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -12,6 +12,7 @@ #include "iris_vpu_buffer.h" #include "iris_vpu_common.h" =20 +#include "iris_platform_glymur.h" #include "iris_platform_qcs8300.h" #include "iris_platform_sm8550.h" #include "iris_platform_sm8650.h" @@ -48,6 +49,12 @@ static const struct iris_firmware_desc iris_vpu35_p4_gen= 2_desc =3D { .fwname =3D "qcom/vpu/vpu35_p4.mbn", }; =20 +static const struct iris_firmware_desc iris_vpu36_p4_s7_gen2_desc =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .fwname =3D "qcom/vpu/vpu36_p4_s7.mbn", +}; + static const u32 iris_fmts_vpu3x_dec[] =3D { [IRIS_FMT_H264] =3D V4L2_PIX_FMT_H264, [IRIS_FMT_HEVC] =3D V4L2_PIX_FMT_HEVC, @@ -83,6 +90,34 @@ static const struct tz_cp_config tz_cp_config_vpu3[] =3D= { }, }; =20 +const struct iris_platform_data glymur_data =3D { + .firmware_desc_gen2 =3D &iris_vpu36_p4_s7_gen2_desc, + .vpu_ops =3D &iris_vpu36_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D iris_glymur_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(iris_glymur_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .ctrl_data =3D &iris_glymur_ctrl_data, + .vcodec_data =3D iris_glymur_vcodec_data, + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .opp_clk_tbl =3D iris_glymur_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xffe00000 - 1, + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D iris_glymur_tz_cp_config, + .tz_cp_config_data_size =3D ARRAY_SIZE(iris_glymur_tz_cp_config), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .num_cores =3D 2, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((8192 * 4320) / 256) * 60, +}; + /* * Shares most of SM8550 data except: * - inst_caps to platform_inst_cap_qcs8300 diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index b36d3d05dd3d..411ef7ef8dae 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -550,6 +550,10 @@ static const struct dev_pm_ops iris_pm_ops =3D { }; =20 static const struct of_device_id iris_dt_match[] =3D { + { + .compatible =3D "qcom,glymur-iris", + .data =3D &glymur_data, + }, { .compatible =3D "qcom,milos-iris", .data =3D &milos_data, --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABFD03E4109 for ; Thu, 17 Sep 2026 05:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621334; cv=none; b=Wy2J56MegDJMJ7fM+ZVpZB6w/gYX5fG6/q2D8BdViKaGkJpOCAKL6xDbcGio9ynAcDG/D/S1z9CDohb8Uf8RL9msObSgrwMmD44aPpOKtvRELzpueNb88AD7nExoCrWOFORTXL0VVOcSWYAlNAtI9xTVZWUojQgSENJV5bpqbhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621334; c=relaxed/simple; bh=32Kcson1oMyhaRSNmjZ2RwVJm4JSqMWBAMwJs8KH4DY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZNgGkqQHDBdyVWox8GbPmP+s19UvHSA/Io6ISK4Sav/vIb6s3xQE8nKtiHc9CVQ+LaCSBsFYTynaKY+8y9EvA5zrsZ4JM/AgLXSKUHQlfo6TZ0KgCvM52D8iOc1U4uKDKU9Tk5vUPtPx/U496J3dBMsvXhd2f/zWWdrPjJoJAZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=IA0iFFdb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TzZQQIyg; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="IA0iFFdb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TzZQQIyg" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H2spsK3302820 for ; Thu, 17 Sep 2026 05:02:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= BsgoTby7KvPvWqWzFVbbBk7dvHSmCSAsefqrJReaSnU=; b=IA0iFFdb92EnqlGu PpS93n2BjNzAhPxVBhg7UJmyqncsmxDGPL15nECGGr2QvPf9+8r6xnBcKcN+zwrI gO4SGuzHEP7NGFL/Wau34m9ZTYI+0UrPhRg+bTGpFucU+IQJjkgt98QgN34h7HV/ Piid0YiBOA9mgH+3aQgOtxwEKGHlyrMw5Yx3yGcCbI6V2oOdi9D53xi6MCpC0R2j ByC2DXm8OiI3iwhCRYZtLuRYeJEnhfbsTaqfDc0f2OHAIqXExo4RkDhaub1Zkli0 rgxahDuYxsBkwXXKJQK1YVvi5XgKfzdnMjTKamB8tITvY+3Z0OXZ8cuq8e4XOeRw gjB/oA== Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gr7uc8dqe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:02:11 +0000 (GMT) Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-4b2fb8f0df0so667404b6e.0 for ; Wed, 16 Sep 2026 22:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621331; x=1790226131; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BsgoTby7KvPvWqWzFVbbBk7dvHSmCSAsefqrJReaSnU=; b=TzZQQIygsaV1HsxJBcAbK6X8Iutot6rHjQQcIYuVfFjkx6mTs0bHXoxaSkI0BgtYCF v9RYuNaonneo7maMhZEKoCmkWrw/bCzMjI0DWO5ynO92PRSO+rPVG4bc7CV7BIVs8f7/ laYA4xusfq/dps1bDFvEHHcowYJmlmzEtqImIysE7NwRHxJLkAhDIlUGpqwCmYTaHH0B B9KwS5cXgH2OBjZkSNt9HfeiKbgfcJ6P6EGS2WaYmVV3tRTTXJFrbbtnzSAXuNiHTYtG TuV05okWY8hJOAY1zE2yTQ2HocG7PPSLXFY10K05CC9eWk/6lt4E2mIEPRqShYka47P8 r0ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621331; x=1790226131; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BsgoTby7KvPvWqWzFVbbBk7dvHSmCSAsefqrJReaSnU=; b=uZLIZw1wrNJ8As9k0b8cY9Dm7bKP9HMRGxmwY6ocMXkEjG1+kXUnazDKsnieWXSKWn 5ptFvpjUVXJ/q+cVqUyIeGLk8JUBf/VolSqWZwLHjgP3Xg8hmC6f1NB1U+cnLbxGsUQC UTKnlwtB15QvG31IHke7kC5hVuNW5+jRNHZYHEoeH6Z0VqKQDiwhQf6+Fl/fa1wbANAn WhVeKjoq6off8bTNXwa4V92dv3BAXlG8qlzIhsVnb/+5B5boPsu/Ewu8ydQF+vEfuCK6 6ryNGnEO1nUewLO3G73ClHYN/pDC7ZiTsqS56VUf6rYHSEUZEJOOUPTHWZ/xQGL3SPaw DIFg== X-Forwarded-Encrypted: i=1; AKwUvBxj/c4lnaABCS9QON2h7/xDJjnvOM4JzUitvqQqXRgDQQhKN2E2adfi0iOA5d9BuhcL6dlp7DctaYXR1pw=@vger.kernel.org X-Gm-Message-State: AFuF++kSqAyDCWRki9s2tah+8WZ1fyhVAMsdaLEX7XqwuGGu884WUbmF LivzSuv7cA1bIyQRruWsDj2cXPC4Q5v2WtUkp8virNKlRb9e8OSsP8PPol9zaRaAPofKmvOsW3L rcSptd/TE+1CqzUF5Jw9yrcKfToj9iGIY5kPweOvsL70kllO6f36hQ1CmVmsV4x2OWp0= X-Gm-Gg: AYBFou3NFPKGNqHQChNLsCnIyQNHM27aeeM5aICE+MllDg9McVqpiSmWLWJaLYUw5ig KNaBXwEPmaiOQMnqepvhxrIeV/n7qphJmIlczAcKLKYK2WK3tn15Rti+xcaL/mliGMz+1WxGF15 l9jD/FkBtWxYvm/kIMtVSu2sV+QRjIASACrdSN//2/XLxhUBrQtZELqKpkIvwNtJ0/Wmg4+YxAA BmczX45QTabBSaxI+CLpVteUY5ipVzhCByIt9WC9v0K7Ll7TRqEor2H6TnVvXlZ896BN67DFn5R SyhVxIBeQ0tkfigD0vfykuWcy8k3ri9iuPykGjJszLcqlM6ZAERzlnEJONBTxUwpNPZzgK4R0gS tiwxzlNFUbaKVgLh+wb//uOsl9W5RdtdBTQ== X-Received: by 2002:a05:6808:1912:b0:4b9:e5fa:8905 with SMTP id 5614622812f47-4ca4b73867bmr5457330b6e.24.1789621330912; Wed, 16 Sep 2026 22:02:10 -0700 (PDT) X-Received: by 2002:a05:6808:1912:b0:4b9:e5fa:8905 with SMTP id 5614622812f47-4ca4b73867bmr5457299b6e.24.1789621330409; Wed, 16 Sep 2026 22:02:10 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:02:09 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:27 +0530 Subject: [PATCH v11 8/9] arm64: dts: qcom: glymur: Add iris video node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-8-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy , Konrad Dybcio X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=4448; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=32Kcson1oMyhaRSNmjZ2RwVJm4JSqMWBAMwJs8KH4DY=; b=1x7AcP3+WXYocMYL/BdCRca3fBoX6pBhuF5WZ+JSm8e88KtQ+bRYIeJ6YIa2UmfUXx+1sTBSz UozKh7yu23gDGE2AU/McZLg5Pnr/yyvL/RIbSL4A22JfLQJOYMDwEJs X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX29DDemh0GBhR 3uOUy/gBXbZTwOJBgsBvn1VMwFIcubMHA/lOuY/8xWmkW+KdnLNP83dHoR2S+GCSFvGHotrJQap dU9JVRgEeWHXJVsyNZjVpj3dyvoVSAjwkRh+taZrTKV0BmpsMHSb8WoCWcjAJxhBGgevAM5y0cG Sbqg9n3W26B9iSLLh0OyEuZUep4J/Wyqf/jRubHMkDr2lMD0O0FEoGQjliY4dTKmE25AQ7N6xpK 9Orzulx2b+RG+/CZlhTPGdM75cwyMppYQZmNKyI45BCkaBRuXZwwjfXFl23LsW4tN8+FFe1mgI0 1cLEw2viawN+itJuyRhy9JlzVez4FfX4pkEMDrKKKRWj8cfsX2s6Ky/jBTLlGohM6fRV3aqgGNa MEqzizr1WVG7G+0wnIVyuC2CzNlH9gfZTd3iYFBf+a7OrBJYrz6wP3a3zaluJwlEoMY4BLMTqvI 6OjfAdKaYKWlkJBT6Ww== X-Proofpoint-GUID: iMenqxEJmZ8BdMgP_K33ZWG8wH4sCvwH X-Proofpoint-ORIG-GUID: iMenqxEJmZ8BdMgP_K33ZWG8wH4sCvwH X-Authority-Analysis: v=2.4 cv=F9zC5ahN c=1 sm=1 tr=0 ts=6aab7453 cx=c_pps a=yymyAM/LQ7lj/HqAiIiKTw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=su6zD_3c2FXtS07H2BAA:9 a=QEXdDO2ut3YA:10 a=efpaJB4zofY2dbm2aIRb:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX+ZH2NhNSpkXj GrQaqwTWGWsAqHc6JqxIoz+cX7T3kEExjKIynbOIL6zm9Zh5La8MtSJWuKiDUmMBPK9JdphZ2SJ +8CxEoTUbKspmIDqbGvuAPIJIEX5fDg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 Add iris video codec to glymur SoC, which comes with significantly different powering up sequence than previous platforms, thus different clocks and resets. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio Signed-off-by: Vishnu Reddy --- arch/arm64/boot/dts/qcom/glymur.dtsi | 120 +++++++++++++++++++++++++++++++= ++++ 1 file changed, 120 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/glymur.dtsi b/arch/arm64/boot/dts/qco= m/glymur.dtsi index 7dedace8c3c4..cea1d22bba4b 100644 --- a/arch/arm64/boot/dts/qcom/glymur.dtsi +++ b/arch/arm64/boot/dts/qcom/glymur.dtsi @@ -5744,6 +5744,126 @@ mdss_dp3_out: endpoint { }; }; =20 + iris: video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0 0x0aa00000 0x0 0xf0000>; + + clocks =3D <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK>, + <&gcc GCC_VIDEO_AXI1_CLK>, + <&videocc VIDEO_CC_MVS1_CLK>, + <&videocc VIDEO_CC_MVS1_FREERUN_CLK>; + clock-names =3D "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun", + "vcodec1_iface", + "vcodec1_core", + "vcodec1_core_freerun"; + + dma-coherent; + + interconnects =3D <&hsc_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY + &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY>, + <&mmss_noc MASTER_VIDEO QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + interrupts =3D ; + + memory-region =3D <&video_mem>; + + operating-points-v2 =3D <&iris_opp_table>; + + power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc VIDEO_CC_MVS1_GDSC>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vcodec1"; + + resets =3D <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK_ARES>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK_ARES>, + <&gcc GCC_VIDEO_AXI1_CLK_ARES>, + <&videocc VIDEO_CC_MVS1_FREERUN_CLK_ARES>; + reset-names =3D "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xffe00000>; + + status =3D "disabled"; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>, + <&apps_smmu 0x1944 0x0>, + <&apps_smmu 0x19e0 0x0>; + iommu-ranges =3D <0x25800000 0xda600000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1943 0x0>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000 240000000 360000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 507000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz =3D /bits/ 64 <366000000 366000000 549000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 666000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334 533333334 800000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz =3D /bits/ 64 <655000000 655000000 982000000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + }; + videocc: clock-controller@aaf0000 { compatible =3D "qcom,glymur-videocc"; reg =3D <0x0 0x0aaf0000 0x0 0x10000>; --=20 2.34.1 From nobody Fri Sep 25 03:16:24 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8692A3BBFB1 for ; Thu, 17 Sep 2026 05:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621341; cv=none; b=Pw5GjrZcizYLdCpHlvffQXZnJe938LWainPrF/fwh8vGF5Tw0gNJyH8K2FC/5TbX6Y+J9B+HILRLAshWEO6r40tk5E2WVDjsa2h1ELEtSqDYIXBrrggDT52yD7e1Ima+hWiw/0M5yZYiusdwHVt6WbKQFeBttQrUafJQNFwNEzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789621341; c=relaxed/simple; bh=Y9NxHc+xglkqVwfzuTXqVBNNH9QwhOHaAntxIH8RZsI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qFfnzUJst47syzPqkXtTwzos9dcqcExJ/sZF3KlRA/mJiBvVsDT0ARnBBf2Gx+KEBZS1QMWNJBauxSZdNAOFZy3CV5Qmc+m4uMeyYSfw7t2Wfx3QpKXIS+RDogIxccaM5ZvkaU3iNuj3Iajr1forbAb7Z/U56csFSUYqmTAKT2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a0gNgBDe; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BjxpyLz8; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a0gNgBDe"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BjxpyLz8" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H44AOP4038572 for ; Thu, 17 Sep 2026 05:02:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= M3JIU2Ao7wEoQjtG7vqxKzMv1IDq7N5iVzUKdH14XEg=; b=a0gNgBDet3oawHgx i/i9v8FvhTE3LvDlxg6ieqWgsQE3ec+shngtIuwdHjo4hh20QrD3Gr8fjjOSzB5r DOlxzGqXu/Mf87CHx1P1rH/H2nQylf45U1Fv5VIK1E9Ndd/WMQGlDDTO5UdW31na CfTVQsZAYNW7PKkKjqn4QdoG5E15OWnRnTcy99OKmUdGdCJ09QvOaF4CTISZgE1P eZGcYvfto1ttQyRyo4DZnA0x3cRzostYxQv1/3PiW6Um6A+R0UoF6aDUiOAbHEmp fLTV+XrvT0qhlxBs/yINF1qArfuCFFmZD7DSlqlkvj1V1+BAPMWVdFHdHkIF2epd wdPK6A== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gr8uw065p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 05:02:18 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-396901263b6so849692a91.2 for ; Wed, 16 Sep 2026 22:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789621338; x=1790226138; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=M3JIU2Ao7wEoQjtG7vqxKzMv1IDq7N5iVzUKdH14XEg=; b=BjxpyLz8cOD8+7eDwvEblc79CvSTnAxsLCyRcPrzZ6G+xjnvh9kdro3e32vm1b74z/ +0ybbkes3XNfvbTv9HRxtRXQGpkL3yWWtnKHqNg8yb8ILfJgp+6ckxnx3C/khBUfTuKB ykNktzG3K/XGcExBUoUyGSMb/9Apg4O1t3lhvgJXG2BqwTIyQtOPxjctOZGjMULQ64Pb sZs1+n2dcgzWnPEebRal1hLyhgfZSWeXoV4A4n1xOm1wUuMDr+cFLIOi3kKgLlFfFrgh iv2A+9vPE56BMkRdDYO1goX2u28LKtSOR4NdhDJEAlWoEFGbxLUffhzxhKQJgSsVPyql FMog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789621338; x=1790226138; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=M3JIU2Ao7wEoQjtG7vqxKzMv1IDq7N5iVzUKdH14XEg=; b=jDaJXkQhupesdymY8lMNTDX7W1JMGNIOOkg0TrFBqrIPZy61ubPl4qLGrWUIHdKKxR ah2gd5kNpsuFb98T5WCnd59OvzcE/TyekhOzJ7oyTATCD8SnPJRd5ZzBkOSzUecvW+Tj zkbraApEJ0QZaDVzPLYBWiL2awDkMqSafaojwAYQeDIEIUOlkac4tfCOvl8aeB/dojOP 8LXItDgaEqcOyDjbRilWv9g8oLVtbEIAA1NftFf/CGPD6bOS2OgzqS6r5MlX+kGbrvYn mzY5S6yzTeQv7wSOXIxJstHfe4h4i3Oh9NHWUHAKrRgXTM14N5+oBC8GKsoU6HWdNO0E 4vaQ== X-Forwarded-Encrypted: i=1; AKwUvBwccCnin14vP0MvNcB224/z6RbdNew/Pnr1E/ZXGJarIMCB3FWyHPiOLVivBIa50A0VuVif6Y2vgsW+ENM=@vger.kernel.org X-Gm-Message-State: AFuF++mJBsT0z7UL+NQW5b9p51/YhV0HN+85jzCjkV4+cBklyIYaqN3v zTuNp8N7Rgb7POCD0Hvikq/1nm1zGmgDwEInWaQGZ6w4wfT3ZMojcn0HvJudEnBPz44BlraDO1H r14pF4h73uzzS9Fs/2Trbs8D0X9/xoo3CfrLx4tQ1rpn5GPiPf3zN0yAA1/dCOztp0K4= X-Gm-Gg: AYBFou0/RMqsly7B5dc5cQWsKjaiLzHiGneAoBpHLQtrKPyGWa5XK+jxNRTbMvgi+SY /qV6ba6wNqjVGwNbUVDnKyouCUJidTQmkKAk4oQ7RnO2xupjQEZzkdEoZdEuTSobwUSKkjTQwyP vnV8jRDmKoD4jlcyklwP1CtdIXwNjVGyenxnewczJvXjApylc5+pwzTmJ+m/mGzc5hurOLfYnbA enjqWyMJpE1g7RMF1vKof8ZhLyEMSzH/ExJ4dzx41GNqeH/gxZvEUsluEBv09DTIieyPFCGW+Yk w48cAfBpRUGaMiNfSYHml6Vs1SMR05ho5QbyRIc75vFqgzq2ki/5ygesleH9S/fH4yK+lOWd9tZ jLQE8atzd62jNdRaSuYTgUtIWeRay8ThsgA== X-Received: by 2002:a17:90b:5785:b0:39d:ee20:1e2c with SMTP id 98e67ed59e1d1-39e1e5042famr17381544a91.18.1789621337915; Wed, 16 Sep 2026 22:02:17 -0700 (PDT) X-Received: by 2002:a17:90b:5785:b0:39d:ee20:1e2c with SMTP id 98e67ed59e1d1-39e1e5042famr17381376a91.18.1789621337310; Wed, 16 Sep 2026 22:02:17 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33bf5b2753csm23544223eec.31.2026.09.16.22.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 22:02:16 -0700 (PDT) From: Vishnu Reddy Date: Thu, 17 Sep 2026 10:30:28 +0530 Subject: [PATCH v11 9/9] arm64: dts: qcom: glymur-crd: Enable iris video codec node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-glymur-v11-9-e0c8bc914742@oss.qualcomm.com> References: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> In-Reply-To: <20260917-glymur-v11-0-e0c8bc914742@oss.qualcomm.com> To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio , Abel Vesa Cc: Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789621265; l=1017; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=Y9NxHc+xglkqVwfzuTXqVBNNH9QwhOHaAntxIH8RZsI=; b=3U56MsFfuNyaH5fXTSF+gKX7NCUWQjZAG/aLF6qAe2JljJI4XoZVUwImGi0n+tjqEChuaW1XA KhWEvhcURLYDHfPTsVvgXfSCm5/9I1hcbsPjq5bFT0MSjCAL/G62b24 X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-ORIG-GUID: Ec1ly76bzQuBtn_h2H2DCJY4bYyAkcTF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfXzRFRfPSTXbaT lufGuKELynCB5aY72Q7nJNqvtwjGtqr28/4RoqBOd8I25obHNVYssdsgjzbeOR+xXyhXrxizur2 RYcMD343x3Qy0tOGLPa9Oj4qbrDBfYrFcC1/gmYY4TbaQHpiOHx4VMj4XCCL90k4fmTDuE2AFUZ cBuc+wFj02lPlfvW95v/lCQru6ZKsPW0AWvyTPmIaDVOek6+yKiYxXp6C2xE4v0hl5s4Vs4xm80 Pdr1QUD0+iseKfKi8HEFzX4gec+v/RL5cKIBDvRtl09zCeLGu5CtQQEq4YmSlJmZ8zI2qQRr1xV JbKITNtlH4AUmUK9bbUfAFQ0FPDYE8NhcgHOkvoMQ5YIefOljohFhlkZH8OLm1/ZXruF+AzdNvv PQYeY8DU7S9bRffwMjtpGMaKbVX8BF5QsS0IrHr9ws32Payc5uRLxLfjyiLh1o6b6K56Lps2D8j UEpT+IF8n73/HU7yoRw== X-Proofpoint-GUID: Ec1ly76bzQuBtn_h2H2DCJY4bYyAkcTF X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDA2MyBTYWx0ZWRfX2DyyVq4ppUL+ 2OP/sXPbQ4T4ejDrYzRarnBOdEaGI8D9dC5nCHVEeDL05+9KepBxSK4cwGdcSZQUr+Tp0XnHySb RCIq9MRFDfbNauC74X3sIRZtk7yFwY0= X-Authority-Analysis: v=2.4 cv=dMUzC+Zb c=1 sm=1 tr=0 ts=6aab745a cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=jls_Txh2LmBa37OkJYYA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170063 The iris hardware block is described in the glymur SoC DTSI, and enabling it here allows the media iris driver to probe and use the video codec functionality. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- arch/arm64/boot/dts/qcom/glymur-crd.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/glymur-crd.dtsi b/arch/arm64/boot/dts= /qcom/glymur-crd.dtsi index 4df3ccfee106..df36e3ba9816 100644 --- a/arch/arm64/boot/dts/qcom/glymur-crd.dtsi +++ b/arch/arm64/boot/dts/qcom/glymur-crd.dtsi @@ -694,6 +694,16 @@ touchscreen@38 { }; }; =20 +&iris { + firmware-name =3D "qcom/vpu/vpu36_p4_s7.mbn"; + + status =3D "okay"; + + video-firmware { + iommus =3D <&apps_smmu 0x19e2 0x0>; + }; +}; + &lpass_vamacro { pinctrl-0 =3D <&dmic01_default>, <&dmic23_default>; pinctrl-names =3D "default"; --=20 2.34.1