From nobody Thu Sep 24 14:28:07 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 CBEBB36B900 for ; Wed, 23 Sep 2026 03:28:25 +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=1790134107; cv=none; b=psgcBOW5OVXY6saOdQCiwH/8lkuysc+J1tiYI/6qHfAg35/BBvhI01MCdWoMyRk/w60MxZPIfZjjpkqWL4ckLBfM3UURKvdK1VkLFf8FyUb1eY5a6I7UiZS3syLHpcEv68oYQ9p8EKHhxOsgrYHDgk7c1DD8WIae0eabE7LcHEU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134107; c=relaxed/simple; bh=+rmEOu8jwbySGTgVv5UO0yGs2DJOOwC3xcgHzPVUKHI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aY4qCs1YKqa3MTmbFreudMqjUUyXvx4HHGRgmguQGpcBNat4/1ELpeXYJH7ExZE6em3VdxsR6ai8JOmdUdcHPm0gJJNXCrWQZYpu6T3kRxJIOw3XwEa75aO3c8AcrSAay8B7tBzvIF5WgBbGu71MJWOqCihsvr1Jb03w+zFNci8= 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=cRM0AvAY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PbhosJ0A; 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="cRM0AvAY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PbhosJ0A" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68N35pcm1153712 for ; Wed, 23 Sep 2026 03:28:24 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= 6QHaFIDZx7qovoKETDKtt+j1Cug7B4ShsOzETEfDwns=; b=cRM0AvAY7u0efmDP x8H2+Jugc8ttGg1rns0Qh4R/G++zhSZmMZ2pgB1xZXXxBvGA4VtcdfNeUPM7i2Gh dAi7yDwdEjns9abj16SHo2viYeNEMCtT8DWJ4d8TpzqUa6SS5S5A2e0358b4HQja 2J0SxEPgkJuJs7Pxz9EGaEIQ7s1WnMqf39iolWnlba5LDWM3XGipn/n+xU4hmpbl LYXMXFnxT97F8ecBCue9on2yrnDCCjpGlS4RJlwTgLPTW0h3M+WNPKY7K+5+npKD mOZyKzEEfLrJCzfkN2uP0nJ5JSr2kp4SqBgHASiHOYEk7IJAvIxvi4dZqYfAbp57 MhYjUg== 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 4guvw7jtt9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:24 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38dbf293831so905050a91.3 for ; Tue, 22 Sep 2026 20:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134103; x=1790738903; 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=6QHaFIDZx7qovoKETDKtt+j1Cug7B4ShsOzETEfDwns=; b=PbhosJ0A9AoPMzbU/7N1YaILSZulHUWZ77XAY0Rt3wS4EJf1KccKWdATBE1UXIzSlY y/Vv+sVjfaVyHBb9e4tR+Nt7GYfGgg6BnMnWsiAZd29RNIEy536ztqBb3voBeFEocF5e pLkAJfBHhkR4jgqx8UtuUHEkTjRi96O52IJu/0WRjlpIpZmoxxo0e7Z73tLhH1egYzoG lB7CqausmdqfEvIynD38GC2dXKYcXMl2alzkZHI76Ku/lPa5UYPwWCjicMRW5sUGbOgW I784ZUQPRIMB56wnYt/jIEmYndvMhj7MR3fkTB7ukHvQRKeZZex1U0WBd4ZoIccctj+J T4Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134103; x=1790738903; 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=6QHaFIDZx7qovoKETDKtt+j1Cug7B4ShsOzETEfDwns=; b=Gmq3MqMtE1yir4V0j7GZVP9RUHXn6CvRH77BaddVdZw7PsO4bmc8gJhZ0peH6pnU54 ZwtNE/zxwbqws/m7YTi0cE4Waw1DbnucUi4yHMK3zUM1GmoNE43Tdyp8mn+HdhSpQadU tdUJM45TltLnhmoUktIIQJjoggO9+nB3KUB9Fmho6KzCrI9v32noVbLx5XZ78FVV/ouL 6xsMwFpC6c1ZidsocQxaKSn/aUyfF3/5bEbVnRqlqk2rh7Wlp/cwTCCECf5ViUb2Djrs +5SShFb7onzH7t21IeYjy0eXZFR449zbdti4CvetU4+2ClLWSA8lySzyqQAAt82vDGM0 jFOg== X-Forwarded-Encrypted: i=1; AKwUvBwLStR409SSi98l/kXW/tUjF8wd0Alb6qEy4tR7DHCjbodoa9rSh+cL/YJhmljGk9adSX3UaoDUwLy9tdM=@vger.kernel.org X-Gm-Message-State: AFuF++klgX8cZnbogdqSwDGCP/CqCnvVp/MuVCkOt44cLwmmTeZlN4s1 AxlCpaCAHmDLZU3iPEFtISU/qNPTMnkJYL+6D5sY9M+/liDJlpy/a1VaM5bvPVvVjZvPGI5LSNP D635hRAvzwEH7ay0gfg+SVMGIytEt0gU3Lx2fLX06FOIluOXxNHw/ft4gWygZHp1TjMU= X-Gm-Gg: AYBFou3umhN6EhG/wmBKA3eRiO6wsKa/5turCbHFaRPiqYuV78ugIwdscT/An8VOJkW SWzwi52Cw21zv95FNDMsSinVGDL7GRCIUbXvaOAo+L+pzP6WQLO/nyMfNj4Nizd6wxOTGEJ9PWX tMtFmSCYunoEavKwrt1NAYVwHCiEO1dFz/7ax/FbFZDYWxLVq0pQHSwj34vRG50gbIbWqLK+8Gs JFPwl8wP/bbPbkNLXhbFgDHfzZN01sl9Fl/gGYhcQvXDzx00GJSZltHQrMHfVnVF4w3LSmk6yFK nU/M2rLsB3YmlsFIFluTxBz/3/FUGPx7cxw3HSMgUk7PiWJTNiWc4sSVohuQ+ZUl3fpmF/XQMFO qOc7CCZ4RIc6QT/lLsp4DC8woJp0p5HVqxoAxWd41Kn3f1tIdw0se/1rz6nhFrV435F5JgMQ2SQ == X-Received: by 2002:a17:90b:58f0:b0:3a0:7d60:450d with SMTP id 98e67ed59e1d1-3a07e640f4amr1184305a91.43.1790134103364; Tue, 22 Sep 2026 20:28:23 -0700 (PDT) X-Received: by 2002:a17:90b:58f0:b0:3a0:7d60:450d with SMTP id 98e67ed59e1d1-3a07e640f4amr1184278a91.43.1790134102822; Tue, 22 Sep 2026 20:28:22 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:22 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:51 +0800 Subject: [PATCH v2 1/7] dt-bindings: media: qcom,hawi-iris: Add Hawi 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: <20260923-add_iris_for_hawi-v2-1-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=8957; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=+rmEOu8jwbySGTgVv5UO0yGs2DJOOwC3xcgHzPVUKHI=; b=HFy8xe07+JablCBW49/lY65OIoAarzsbvaBdT4dksr1umSUm/g99qWYTSfm+73l/tl/S3Wr9l QTmsqMlZQV8BJW9nDxsoH6HdDMGgIJaA1eYhBytJcut2IIEgzbT+vEs X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX84xgCOiNNPt6 UnGvgelqQEi4BbsinU7Ggqt5K+oFUnIlAvNEZn1QafF7pg+IUDMA0LS69M2dTLUmChWB1XpaJWc /c7pTemg5Nakjx+jV2PfyOYpBO8Y8gI= X-Authority-Analysis: v=2.4 cv=ZYqIpcVA c=1 sm=1 tr=0 ts=6ab34758 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=Z9fkTJdRl1zmM-sw7WcA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-ORIG-GUID: q5rNH6XlBJAxFikavBdPBBX9M6oBN0Uh X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX2XCVlIMTV1QG 7CLafgBrveQuG/J3/fPyUzPcv/A1r7DBYppzD8D62RFTHZoSOkv00YTDdyWOyNzb7dzceAzPWEe x6J3Mze3qrK65Qz+GqN/yU5b15H2sKPNVHTvdBXPRyYaxlpRhvWKRSj0M83auF6N0ml30IggOKK DfJ4L97j7MvOlJFCfjLJZ3oi3oiJyvoshepyvYtwhHTtZ2EJqS9yHguZRjKSycO+GPa9jOcW3dO sGxDtqldxmyF3fWGx3V/2ZuFpV27irc/VV4OMzFygeK5X7DbUyhLNppkD+AVSUknKQWe3A36o7v M4LO/YWJLSTGvyrZZLyKfDLd0AimUmNcmnPuczHPcEs75uB1OW76KygSGZDr/XDJmKw8Il7CC2o mWT1h207u8R0rnLpPkpGTLw1x0a1h6R8e6HXvcf/J/sEjmNdzFjJfI0b/D/exma4wD0VAY9QMCK ODm3kohOmy1lOh7WgSg== X-Proofpoint-GUID: q5rNH6XlBJAxFikavBdPBBX9M6oBN0Uh 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 Add a devicetree binding for the Iris5 video encoder and decoder block found on the Qualcomm Hawi SoC. Compared to the Iris4 generation, this block has - additional power domains for internal NoC(cx & mm). - additional clock for internal NoC(cx_iface). - additional power domain and clock for apv codec. - different reset lines. Signed-off-by: Wangao Wang --- .../devicetree/bindings/media/qcom,hawi-iris.yaml | 256 +++++++++++++++++= ++++ 1 file changed, 256 insertions(+) diff --git a/Documentation/devicetree/bindings/media/qcom,hawi-iris.yaml b/= Documentation/devicetree/bindings/media/qcom,hawi-iris.yaml new file mode 100644 index 0000000000000000000000000000000000000000..13e346414a231af9a146076de6a= 3fa9e9c488624 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,hawi-iris.yaml @@ -0,0 +1,256 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,hawi-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Hawi SoC Iris video encoder and decoder + +maintainers: + - Vikash Garodia + - Dikshita Agarwal + +description: + The Iris video processing unit on Qualcomm Hawi SoC is a video encode and + decode accelerator. + +properties: + compatible: + enum: + - qcom,hawi-iris + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 13 + + clock-names: + items: + - const: iface + - const: ifacec + - const: core + - const: core_freerun + - const: core_ctl_freerun + - const: core_debug + - const: cx_iface + - const: vcodec0_core + - const: vcodec_vpp0 + - const: vcodec_vpp1 + - const: vcodec_vpp0_vpp1_gating + - const: vcodec_apv + - const: vcodec_bse + + firmware-name: + maxItems: 1 + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + power-domains: + maxItems: 9 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + - const: vpp0 + - const: vpp1 + - const: apv + - const: mm-int + - const: cx-int + + resets: + maxItems: 2 + + reset-names: + items: + - const: bus0 + - const: core + + iommus: + maxItems: 4 + + dma-coherent: true + + operating-points-v2: true + + opp-table: + type: object + +required: + - compatible + - dma-coherent + - interconnects + - interconnect-names + - power-domain-names + - resets + - reset-names + +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + #include + #include + + video-codec@2000000 { + compatible =3D "qcom,hawi-iris"; + reg =3D <0x02000000 0xf0000>; + + interrupts =3D ; + + clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, + <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0C_CTL_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0C_DEBUG_CLK>, + <&videocc VIDEO_CC_CX_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&videocc VIDEO_CC_MVS0_VPP0_CLK>, + <&videocc VIDEO_CC_MVS0_VPP1_CLK>, + <&videocc VIDEO_CC_MVS0_VPP0_VPP1_GATING_CLK>, + <&videocc VIDEO_CC_MVS0A_CLK>, + <&videocc VIDEO_CC_MVS0B_CLK>; + clock-names =3D "iface", + "ifacec", + "core", + "core_freerun", + "core_ctl_freerun", + "core_debug", + "cx_iface", + "vcodec0_core", + "vcodec_vpp0", + "vcodec_vpp1", + "vcodec_vpp0_vpp1_gating", + "vcodec_apv", + "vcodec_bse"; + + dma-coherent; + + interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_= ONLY + &config_noc SLAVE_IRIS_CFG QCOM_ICC_TAG_ACTIVE_O= NLY>, + <&mmss_noc MASTER_VIDEO_MVP QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + memory-region =3D <&video_mem>; + + power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc VIDEO_CC_MVS0_VPP0_GDSC>, + <&videocc VIDEO_CC_MVS0_VPP1_GDSC>, + <&videocc VIDEO_CC_MVS0A_GDSC>, + <&videocc VIDEO_CC_MM_INT_GDSC>, + <&videocc VIDEO_CC_AXI0_CX_INT_GDSC>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vpp0", + "vpp1", + "apv", + "mm-int", + "cx-int"; + + resets =3D <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_CTL_FREERUN_CLK_ARES>; + reset-names =3D "bus0", + "core"; + + operating-points-v2 =3D <&iris_opp_table>; + + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0xffc00000>; + + non-pixel { + iommus =3D <&apps_smmu 0x1540 0x0000>, + <&apps_smmu 0x1620 0x0000>, + <&apps_smmu 0x1544 0x0000>; + iommu-ranges =3D <0x32000000 0xcdc00000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1543 0x0000>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-150000000 { + opp-hz =3D /bits/ 64 <150000000 150000000 150000000 225000= 000>; + required-opps =3D <&rpmhpd_opp_low_svs_d2>, + <&rpmhpd_opp_low_svs_d2>; + }; + + opp-285000000 { + opp-hz =3D /bits/ 64 <285000000 240000000 240000000 360000= 000>; + required-opps =3D <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs_d0>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 338000000 507000= 000>; + required-opps =3D <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-420000000 { + opp-hz =3D /bits/ 64 <420000000 420000000 420000000 630000= 000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 444000000 666000= 000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-560000000 { + opp-hz =3D /bits/ 64 <560000000 533000000 533000000 800000= 000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-630000000 { + opp-hz =3D /bits/ 64 <630000000 630000000 630000000 110400= 0000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo>; + }; + + opp-800000000 { + opp-hz =3D /bits/ 64 <800000000 710000000 710000000 126000= 0000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo_l1>; + }; + + opp-1000000000 { + opp-hz =3D /bits/ 64 <1000000000 710000000 850000000 12600= 00000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo_l3>; + }; + }; + }; --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 E717438B15E for ; Wed, 23 Sep 2026 03:28:30 +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=1790134112; cv=none; b=LyBRAjqXQEkPwNGN6gJqV+hbFTQUFcI+Sm/sYnWnLYxEHHSiAyQjBCdh0mspgBEDipPKHkDSTf/wSzoARwJbFgRb/2hJ6Y9OV8dPNM/w9uKO1paNSsG8wBALftB5yHyYmWcT0YgXt3OlOISJ50HjlkQYRm6t80Dsgn41tyfl6jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134112; c=relaxed/simple; bh=Xlbwl6Vx4+HGBNlzMqIIKgTeAZAgMjnSyrLdOon688A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jyms/kxEbD4OwItu3crO7r89Jf6SBB22CW06WmWTWmUIB+FHjfZB0RM6883xnJnR9/ovq8FRM8HKZxBvaydqnszZZE8WJncIj6hjF5ijzc/Mx3LSnYQbIw863ucK7dsAa9iKTXrMXMe5S2wUdF+5FULs4sv4tniMVxJJNVcwstg= 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=f59X0lWb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QAyKtu7U; 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="f59X0lWb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QAyKtu7U" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68MN7LcU1529812 for ; Wed, 23 Sep 2026 03:28:29 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= m11kiYCAwMQ7W55vXcbMY21fBGFpt1wSVq3rfYTVbAI=; b=f59X0lWbtAMCILuf kCWvNsAj9GLXLTZImBXrbYDQtYNA26eK/XF6/MsYGRm0HEnWryP4f9R2VSCZhJMY KJC5z2anH3PxYD97u2ctTLUGQrSV9MIG7xJ/Nda/DhNHMTIrEOB5XrDRELzYpzpR Dgox8jfQP4LP2dg2mHl+3cEJ+BTRnkXPkzOVlQTajuzMYiJx6li+rmYanFHTKBo8 t4koR8t2OCi64z5XRxS0oup/FEZNSYDVmYEqb6Qu+WCFcJUmJgLnrQ/Jw6NhmIDF sMI/ImvrjGMOZsH4BpavwtXvrUILmsmCS7ApdYZh9xjI4BdZlIZ9DkcihzFpHwpK RCwI2Q== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gv32qrrxx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:29 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ccb687f82eso3225765ad.3 for ; Tue, 22 Sep 2026 20:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134109; x=1790738909; 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=m11kiYCAwMQ7W55vXcbMY21fBGFpt1wSVq3rfYTVbAI=; b=QAyKtu7ULgPrpEwM3tjqcIyxS4MzxTRUoi6GW04Wj+1jl9iQJscptBHdhVUMblKAZc kWKxk4MIp+HnDqdZ/gaxyQ4gVkhUKdsneBBzR60PFGOtWLb+8pfTiJt/4ekofqTn1vi7 hok96bAbsefb65UEXSvmBaNLyUeAFr3x3MmWM0Q8fOHygmaDxFqShsfk2W0lhkMhohxg hVHuR/nBFNMKxweqYnHeP6ra0kFUJVxctN0W+/bsWH2zJVnGyl2HBdO0mQlQkgdGl/dU 4f8Y+Z6V3vmpBLZyMTNTDc/8l3f+4m8vtbad0YAYvchDemBuNIJVHWsfcVb6aXuUDSiM b8pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134109; x=1790738909; 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=m11kiYCAwMQ7W55vXcbMY21fBGFpt1wSVq3rfYTVbAI=; b=m9UX6265gPiR+q3xsv04PL7LEcx81rpCRO4hd2OP0ctDznDaa5BKfuoYKzLlIXWc9q 40xixgzbNX8dNFuzzgu1YJ2X8p9dQd5XD0oBDWClbEXSXEudLienoXsNfzd4lKByd+7X gq5XPDD2+IauKJJDXVueNwCsItmn5E54Zon4OT6DiVO1D+40QPjg8cvGwP7KHmxKji8V dYmm6FnvzhFrhgK4OQvue+xvLMgFJZKSWAC174rvQX6Mk0pIcg2szUnGUdMbrpm1U0vc hA7GiwwIYJVR4VvFWUOxyCCXs7UFAkkJVI3Up55mnV98f9ZKb/LnidyUfge5yb1LvJgm So4w== X-Forwarded-Encrypted: i=1; AKwUvBxTN3cyR1Phl5sKu+1d3pwV5tWmocllzOVRwmkvAM7+hYDjFz02c46wy7/BfxeMU3YMNHfdOTgibZDcZBE=@vger.kernel.org X-Gm-Message-State: AFuF++mfObgxt5azc1zvuQh9w4OcKtKxEw5TBlDQ6KjDE9ozaMV3CpfB z2G7zxFaap0l7DXx73MZbv25JAzWH+wVRnUUNs2Tswzj8cucVvscBJdBMbb9r7rS/fd1NDevXt+ PwsYYny5fSy+jzWj7aFE1DOaRBkwYwaiS/M+sIPaOs1cNZ4vUT1757hmW9GKwnPujeWU= X-Gm-Gg: AYBFou0Z4Jqmt7sL6Dy0SGPOoFAlXGFy8MzkN79nGme3iQzy2+NwcfqeNz1RaOloCzR XhRbbIes1kaGVttlnD1UZyAQCZnAewWLvugQrvuLCM0dLBf/6y39DudktrxuPlh9gpbD3y6d34i hf2RQX0rWlVCb2hg2Yc0+niimCDh/1Yg4xW9axPnBUGP9Eb1aM5H+pE/5nhDO3GH5oHCJT/Zpjc P1gOFxC3wR9Ni2UzmmnJSU6XKB85VDzz+4tEghG8LC40x28+Lc72jyKlD4EwAu8JBEU32ARGT3n X4vcQ+G3uDvFMEAg2YufT3e7dlnmnkRvHj+XUQnsje/Of3i1610Tovo9BhjrJes43yU6Az0xnz4 9OpA79FwGDBifR7nkLDUBohdSvmiXBzYlE9p09sXj0hT0qKqNb7c/qyA+p1DU4qjmCtUn6mYHGQ == X-Received: by 2002:a17:903:908:b0:2dd:c100:b2cc with SMTP id d9443c01a7336-2df69e1c3cfmr10374195ad.55.1790134108383; Tue, 22 Sep 2026 20:28:28 -0700 (PDT) X-Received: by 2002:a17:903:908:b0:2dd:c100:b2cc with SMTP id d9443c01a7336-2df69e1c3cfmr10373955ad.55.1790134107861; Tue, 22 Sep 2026 20:28:27 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:27 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:52 +0800 Subject: [PATCH v2 2/7] media: iris: move shared APV PM helpers to iris_vpu_common 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: <20260923-add_iris_for_hawi-v2-2-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=12865; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=Xlbwl6Vx4+HGBNlzMqIIKgTeAZAgMjnSyrLdOon688A=; b=/DBn+w7lUN0YvQZsWrIa3iKaFhD6c0MhuVY/Qhz1Wv+DAvs1TmhAwQODqHkbhwcijAodvVt4Y ZYslWFCZaOiDXdzZFZsAm4LU+gJxm+3HiADlbPoi1MJTvITjucWkMgm X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Authority-Analysis: v=2.4 cv=SJnXx+vH c=1 sm=1 tr=0 ts=6ab3475d cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=jRDX25Ug_5KbIaVBG-EA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: H3tpU2-Bihdq2p7FP2VSVGR2lEk_p3wt X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX0esnMwMWzpjp TVhA0AXEWUaQYamS507FzWC128V3uQz2vTtwK4MwPbO5X2S6htoOf9aVp7s9/zh2FzLQINiFBjI qcr5iCOjpkg1DN9iGM6ajfT8Nj5ugWI= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX+pMexbZnSZf0 C05EYojg7mjbjTGoZ9LoqPPqGXx+ou/DofGy+4CFGX/ToFDJ5z5BQgstif95y0bc/PS8z7G5VTg Ra+MSwpEYwCwH/F/+HvRHOh/pdgfQsGPgpox372Tyu/K65PKQWhYo6nPPeFB9EK2XTmHlw4/qT0 7zf6SF1T3fuJKQK3giFbq5VejblTMNuEf+HWi6qWSWoGzTdOHTcWgnOJdVbh+CN/GHDq1rD0AFo xiB6a2vHM3LjwRTRtZKnrpZ+HXrd15nuDdbR0FOT2dfeHPibYdPkssgxBqsh6VMPBdHkgvTPRpt 9dXTTGxiC5CkMxTBBLsKwJo+pnMWHu7XIrObWFlwwfxYQXFupIK2ANVMICAKonq0H408Dx39Jqb scK+RjEbsUV0LpQL9ndFV9Qi6mH54HjNr3nO6ciN+X0vzGIkowiR/qgehr/MdNoUScJfB46j8CM Wf8FCmhEiE96ZK86BPw== X-Proofpoint-ORIG-GUID: H3tpU2-Bihdq2p7FP2VSVGR2lEk_p3wt 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 The APV power on/off sequences and AHB bridge sync reset helpers are currently local to iris_vpu4x.c. VPU5x uses the same sequences, so keeping them in the VPU4x implementation would either prevent reuse or require duplicating the code. Move the helpers to iris_vpu_common.c and rename them with a vpu4x_vpu5x prefix to reflect their shared usage. Move the associated register constants, including APV_CLK_HALT, the efuse control bits, CPU_CS_APV_BRIDGE_SYNC_RESET, WRAPPER_EFUSE_MONITOR, and AON_WRAPPER_MVP_NOC_RESET_SYNCRST, to iris_vpu_register_defines.h so both implementations can use them. Signed-off-by: Wangao Wang --- drivers/media/platform/qcom/iris/iris_vpu4x.c | 105 +----------------= ---- drivers/media/platform/qcom/iris/iris_vpu_common.c | 91 ++++++++++++++++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 4 + .../platform/qcom/iris/iris_vpu_register_defines.h | 10 ++ 4 files changed, 109 insertions(+), 101 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index 02e100a4045fced33d7a3545b632cc5f0955233f..93acbfa0f471fdec1cb75db732f= 37ef6c6ef5cbf 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -10,18 +10,11 @@ #include "iris_vpu_common.h" #include "iris_vpu_register_defines.h" =20 -#define AON_WRAPPER_MVP_NOC_RESET_SYNCRST (AON_MVP_NOC_RESET + 0x08) -#define CPU_CS_APV_BRIDGE_SYNC_RESET (CPU_BASE_OFFS + 0x174) #define MVP_NOC_RESET_REQ_MASK 0x70103 #define VPU_IDLE_BITS 0x7103 -#define WRAPPER_EFUSE_MONITOR (WRAPPER_BASE_OFFS + 0x08) =20 -#define APV_CLK_HALT BIT(1) #define CORE_CLK_HALT BIT(0) #define CORE_PWR_ON BIT(1) -#define DISABLE_VIDEO_APV_BIT BIT(27) -#define DISABLE_VIDEO_VPP1_BIT BIT(28) -#define DISABLE_VIDEO_VPP0_BIT BIT(29) =20 static int iris_vpu4x_genpd_set_hwmode(struct iris_core *core, bool hw_mod= e, u32 efuse_value) { @@ -68,96 +61,6 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core = *core, bool hw_mode, u32 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; -} - -static void iris_vpu4x_power_off_apv(struct iris_core *core) -{ - bool handshake_done, handshake_busy; - u32 value, count =3D 0; - int ret; - - value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); - - if (value & APV_CLK_HALT) - writel(0x0, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); - - do { - writel(REQ_POWER_DOWN_PREP, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CON= TROL); - usleep_range(10, 20); - value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); - - handshake_done =3D value & NOC_LPI_STATUS_DONE; - handshake_busy =3D value & (NOC_LPI_STATUS_DENY | NOC_LPI_STATUS_ACTIVE); - - if (handshake_done || !handshake_busy) - break; - - writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); - usleep_range(10, 20); - - } while (++count < 1000); - - if (!handshake_done && handshake_busy) - dev_err(core->dev, "LPI handshake timeout\n"); - - writel(0x080200, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); - ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, - value, value & 0x080200, 200, 2000); - if (ret) - goto disable_clocks_and_power; - - writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_SYNCRST); - writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); - ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, - value, value =3D=3D 0x0, 200, 2000); - if (ret) - goto disable_clocks_and_power; - - writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + - CPU_CS_APV_BRIDGE_SYNC_RESET); - writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_APV_BRIDGE_S= YNC_RESET); - writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); - -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]); -} - -static void iris_vpu4x_ahb_sync_reset_apv(struct iris_core *core) -{ - writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + - CPU_CS_APV_BRIDGE_SYNC_RESET); - writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_APV_BRIDGE_S= YNC_RESET); - writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); -} - -static void iris_vpu4x_ahb_sync_reset_hardware(struct iris_core *core) -{ - writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + - CPU_CS_AHB_BRIDGE_SYNC_RESET); - writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDGE_S= YNC_RESET); - writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); -} - static int iris_vpu4x_enable_hardware_clocks(struct iris_core *core, u32 e= fuse_value) { int ret; @@ -249,7 +152,7 @@ static int iris_vpu4x_power_on_hardware(struct iris_cor= e *core) goto disable_vpp1_power_domain; =20 if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { - ret =3D iris_vpu4x_power_on_apv(core); + ret =3D iris_vpu4x_vpu5x_power_on_apv(core); if (ret) goto disable_hw_clocks; } @@ -282,7 +185,7 @@ static void iris_vpu4x_power_off_hardware(struct iris_c= ore *core) iris_vpu4x_genpd_set_hwmode(core, false, efuse_value); =20 if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) - iris_vpu4x_power_off_apv(core); + iris_vpu4x_vpu5x_power_off_apv(core); =20 value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); =20 @@ -353,9 +256,9 @@ static int iris_vpu4x_set_hwmode(struct iris_core *core) u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); =20 if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) - iris_vpu4x_ahb_sync_reset_apv(core); + iris_vpu4x_vpu5x_ahb_sync_reset_apv(core); =20 - iris_vpu4x_ahb_sync_reset_hardware(core); + iris_vpu4x_vpu5x_ahb_sync_reset_hardware(core); =20 return iris_vpu4x_genpd_set_hwmode(core, true, efuse_value); } diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index e4847c1077097160cfc8324e807b4aabd9747812..a0129ed39cf2dfd0d56ecdc63d9= 09f26f8acedf8 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -21,6 +21,7 @@ #define CTRL_INIT_IDLE_MSG_BMSK 0x40000000 #define CTRL_ERROR_STATUS__M 0xfe #define CTRL_STATUS_PC_READY 0x100 +#define NOC_RESET_APV 0x080200 =20 #define QTBL_INFO (CPU_CS_BASE_OFFS + 0x50) #define QTBL_ENABLE BIT(0) @@ -501,6 +502,96 @@ int iris_vpu_power_on(struct iris_core *core) return ret; } =20 +int iris_vpu4x_vpu5x_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; +} + +void iris_vpu4x_vpu5x_power_off_apv(struct iris_core *core) +{ + bool handshake_done, handshake_busy; + u32 value, count =3D 0; + int ret; + + value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + if (value & APV_CLK_HALT) + writel(0x0, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + do { + writel(REQ_POWER_DOWN_PREP, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CON= TROL); + usleep_range(10, 20); + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); + + handshake_done =3D value & NOC_LPI_STATUS_DONE; + handshake_busy =3D value & (NOC_LPI_STATUS_DENY | NOC_LPI_STATUS_ACTIVE); + + if (handshake_done || !handshake_busy) + break; + + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + usleep_range(10, 20); + + } while (++count < 1000); + + if (!handshake_done && handshake_busy) + dev_err(core->dev, "LPI handshake timeout\n"); + + writel(NOC_RESET_APV, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + value, value & NOC_RESET_APV, 200, 2000); + if (ret) + goto disable_clocks_and_power; + + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_SYNCRST); + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + value, value =3D=3D 0x0, 200, 2000); + if (ret) + goto disable_clocks_and_power; + + writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + + CPU_CS_APV_BRIDGE_SYNC_RESET); + writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_APV_BRIDGE_S= YNC_RESET); + writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); + +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]); +} + +void iris_vpu4x_vpu5x_ahb_sync_reset_apv(struct iris_core *core) +{ + writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + + CPU_CS_APV_BRIDGE_SYNC_RESET); + writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_APV_BRIDGE_S= YNC_RESET); + writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); +} + +void iris_vpu4x_vpu5x_ahb_sync_reset_hardware(struct iris_core *core) +{ + writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, core->reg_bas= e + + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDGE_S= YNC_RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); +} + void iris_vpu_set_preset_registers(struct iris_core *core) { writel(0x0, core->reg_base + 0xb0088); diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 09799a375c1426d808ab5ea4fdfcac3a203e15b3..cc22c7459c4b77fdcb95b546fb8= a55eea522bfb8 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -41,6 +41,10 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_co= re *core); int iris_vpu35_vpu4x_power_on_controller(struct iris_core *core); void iris_vpu35_vpu4x_program_bootup_registers(struct iris_core *core); u64 iris_vpu3x_vpu4x_calculate_frequency(struct iris_inst *inst, size_t da= ta_size); +int iris_vpu4x_vpu5x_power_on_apv(struct iris_core *core); +void iris_vpu4x_vpu5x_power_off_apv(struct iris_core *core); +void iris_vpu4x_vpu5x_ahb_sync_reset_apv(struct iris_core *core); +void iris_vpu4x_vpu5x_ahb_sync_reset_hardware(struct iris_core *core); =20 void iris_vpu_set_preset_registers(struct iris_core *core); =20 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 72168b9ffa7385d53d7190265d1c0922ee04a656..33f3d01cf79d763a62a2be9eac9= 10a462bcd479b 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -19,6 +19,7 @@ #define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1)) =20 #define AON_WRAPPER_MVP_NOC_RESET_ACK (AON_MVP_NOC_RESET + 0x004) +#define AON_WRAPPER_MVP_NOC_RESET_SYNCRST (AON_MVP_NOC_RESET + 0x08) =20 #define CPU_CS_BASE_OFFS (CPU_BASE_OFFS) #define CPU_IC_BASE_OFFS (CPU_BASE_OFFS) @@ -40,6 +41,14 @@ #define MSK_SIGNAL_FROM_TENSILICA BIT(0) #define MSK_CORE_POWER_ON BIT(1) =20 +#define CPU_CS_APV_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x174) + +/* Efuse bits controlling optional hardware blocks */ +#define WRAPPER_EFUSE_MONITOR (WRAPPER_BASE_OFFS + 0x08) +#define DISABLE_VIDEO_APV_BIT BIT(27) +#define DISABLE_VIDEO_VPP1_BIT BIT(28) +#define DISABLE_VIDEO_VPP0_BIT BIT(29) + #define WRAPPER_INTR_STATUS (WRAPPER_BASE_OFFS + 0x0C) #define WRAPPER_INTR_STATUS_A2HWD_BMSK BIT(3) #define WRAPPER_INTR_STATUS_A2H_BMSK BIT(2) @@ -62,6 +71,7 @@ #define WRAPPER_CORE_POWER_STATUS (WRAPPER_BASE_OFFS + 0x80) #define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88) #define CORE_CLK_RUN 0x0 +#define APV_CLK_HALT BIT(1) =20 #define WRAPPER_TZ_CPU_STATUS (WRAPPER_TZ_BASE_OFFS + 0x10) =20 --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 0998B396D09 for ; Wed, 23 Sep 2026 03:28:35 +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=1790134118; cv=none; b=MRFx51tgL2QJ9hj2rNNAlkr2PDe/oVjkzGPtuSKu0Pt1/gYAEJ7+BTy6DxNHXD5CPujRQFwDoPLIROrQFPrar74SgC3ahjZrRphv3mseUsqwEHUXRUvPM03ydTkf/tooz2tLoCZllkV6xXszm8t5wLD6o0nnSqZNx61F+pQFM70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134118; c=relaxed/simple; bh=Ptc3EuPrDTASPXr8oNRgvpAkz6mIXFcuDPjCgIfXwsY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VlLR/znm8F2+cAw2mEMR/k5qYCBcqk0ngdoa3UtMnzww2do4CCnpjVkDuzuQq4N1+vGGecOh5twPshWTbcw5oslJHwE1ErdUL8nvRFtb5/ha559BcOLWRvgl5xmnPh0akaId2wWjWzRIzJxm7xYqutAQeOUC1HAqUdrMdpjUPhE= 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=D7F2Hv2W; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=P3d6Sne3; 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="D7F2Hv2W"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="P3d6Sne3" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68N170OU1649095 for ; Wed, 23 Sep 2026 03:28:35 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= ozeTsszPxdoMfL7hIKed899S49zq7nlTcGptv2hcNGc=; b=D7F2Hv2WnFfO7IyZ NiwAZ8AeGMdVDjH4/3+o/91yS/+HALTrBCUpZoLC0Uk8Kj+pAIagy0ZKlkkMHOXV ne1UCCOcm6UMudEZEWDENLaSYQ7JRrbC+9FFkaxrlSQOQ1EnO+3uYxqc9WQqqsR6 GvEgiC0zGphnrMIvmpHP/maUNIAZat3wZ+ACBY18h+Armw80V2hjq0UVnstKRM05 erjjrgxmHzB07IFUI+jatEBwBgtkAqV2C4f9Ie245ltGWHaJAMKo0L+rblSQJpd5 Pn7O/8WGNx2P+UoKlhnmbjs/lhAnnl9gT2ZPFAqqDI2ePr6u22Yr2R1cfoxIQ2nZ Qz0GXw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gv3318rvj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:34 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2d001671a54so5232025ad.2 for ; Tue, 22 Sep 2026 20:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134114; x=1790738914; 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=ozeTsszPxdoMfL7hIKed899S49zq7nlTcGptv2hcNGc=; b=P3d6Sne3UdyH/apDAkbvIhFlVjQfRVfSexGgX3vN21QHvUYTRwq5NXfzvUKjgkH5Ih NoQd3yZ4j+zI1dAJOVnCSNm21yiUEaIUaglj6fPndQKTFiEhPDyKIJuxj3fz46JLZ/CX ARKMd0PmfKSN5WCVT7EJbYAXHUiefuGYmZrMArM4YB8NTg2X60UAMRH5OHUgXwmgzVPu aIgjorEW9ccwpwOXiOPGKTnJUOp5i3qcToDt032lEENlCOJHKisfsmg2ln/FS8pCWegS tqwisLvhoY3phMsniAX5tsvQcHam4MZADntbVensnZTJTYmQ/7J/ANgZtvOKVzLvjRXl 6plA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134114; x=1790738914; 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=ozeTsszPxdoMfL7hIKed899S49zq7nlTcGptv2hcNGc=; b=JqkVVllLx/HdrL64/atmvmdtW16j4ArQTMBrRcSQ0YLO1W77XZA+R/b2LXQJFVSZmH Pn6eQiOf4O26y30QvuFbj44zgeE+h9FfjDDoijCp2p08RtWp9P7qY1WXb/xPWMW+vUM8 n6WK5gakC0BGXGrU9cCBE8lBE/3teMA5hSiauwPx01tcp1Qhad7G3kY896eVevLdVDl0 VqsckL98D71I2TGxymmWdoFuRSe7tU1lWIbCi/iVTe9CFrfZWHO9a7PNLHaEojMLEPT8 5BGCCZJrfn6RIRPXL8AfAJcMO4OL/guhDu6oAsszyEEuUkSrWs1rzUCVyUOHNKDqeIwf 09DA== X-Forwarded-Encrypted: i=1; AKwUvBwCGnfCyUr3tYmZHn9nDa6LniuQXQgpKqVzfCoF2sYUt2AHDOW6ngKX7DxPKu7GFxEfuQXykwYJRbS5Q2Q=@vger.kernel.org X-Gm-Message-State: AFuF++liL3KXOyCcTRm+PKeRsYi1/gsDbO8WaU9LtD7GJ3u0OQb6S9eJ V5C3VxISUUb/LA0H2HnhwThJ4GsYJJMDRM8YBDnveN8S5q+tXJL4ei1IJEy4f/iUEaafANDVoha bEM1VUvs8MqcdyTlOW6CT0+ti+BHZsNrPH9NmYedPbU7ItZSAfuBArrjET9pPtFc8D40= X-Gm-Gg: AYBFou0SHWOPNVSEh+g14wEGuCWSMOEDyQd5bOYGa7dOGbElsPqtWFnpH8/mDbPwYsu vrBCp5gHHATHf5iWhPQgLxF9b/txRGwiHZ+kZrZ8FSTmo6txxmbI0CCAUo9f8TiUwnvgdvJOBX/ 59cqUHq4/NJKhbB/S4vCk50uwpyFAfdruGkVulRthscUXFMQVBFz1ooDgGHlOUL43qEKLmVFuBK XofQ6Z/OlPWuCEYMGtcvSmVtwQDV2OOBNjXJG7ojeKpz5K3UmJFG61fHQbkmkIFfp+C2Or63y8+ 2Rl6tN+fEnf8wiXtePCIdn3eMTJzhw79q/kORnmyomSq+xIYqOgVFsH0vjJm8oZcyNeo80UACsY dIqkNRu3/VG63kQEaaFeduD7b+A+SEsIGc8WV4ndeS7olW9hBvm6uM12xm++JZFDzcklLH0s8JT qvlfqhl3mO X-Received: by 2002:a17:903:3c43:b0:2dd:c100:b2c1 with SMTP id d9443c01a7336-2df69e01671mr12352445ad.44.1790134113602; Tue, 22 Sep 2026 20:28:33 -0700 (PDT) X-Received: by 2002:a17:903:3c43:b0:2dd:c100:b2c1 with SMTP id d9443c01a7336-2df69e01671mr12352055ad.44.1790134112922; Tue, 22 Sep 2026 20:28:32 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:32 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:53 +0800 Subject: [PATCH v2 3/7] media: iris: add VPU5x hardware ops 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: <20260923-add_iris_for_hawi-v2-3-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=24148; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=Ptc3EuPrDTASPXr8oNRgvpAkz6mIXFcuDPjCgIfXwsY=; b=tGaI2PnQ6ZSy4pGVgp+KuU4jroqpUacoabb7pv3wPfKSK33W6aZZzpJbE7BdiKsM29U+6GoPe MAP/a+8TUr9DU9vNFG2ZCokJxGrPxWsX2CHMBSO2LsW7wbW4Ola3uhI X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-GUID: s7PfIBgq1A878rV0Z0mmyWKM4Sq-NSIz X-Authority-Analysis: v=2.4 cv=HdaB3SE8 c=1 sm=1 tr=0 ts=6ab34762 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=4L-smajPeleGBe0zsKoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: s7PfIBgq1A878rV0Z0mmyWKM4Sq-NSIz X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX+Lc85Yla+cQU Jt07rFcf3Gu9JONKec+bRlhoytox+2Qw7A6Uxl8Nb+8x/AE6Q8CI7e/TkCVS9pk3Q0Ewssd7vbf ZGHKjpKKlcvEQuF0KA6DGvX1n43PytxrLVfU/OpeJGySZ+/ta8j481dYw2I6kTva9v35mMsWu/A chZlU3hACZegvRhxMPGInMNs0T5eNC8qPo3RXAX7DErDlzpzdt2Qaj1VFxvXRsq92I2HMvHIEiJ c/VBgDgAeCzuE/E27VBBwoaD7OafX2gVgTm7XHRDW5ehDtMWzl8G7TbzbLSTG2OZf37HX7iLYrU Rq8ASu0gmp/CIbG9tS82bX2VxVRtLRat6cK4kFgNRzre+nXHMo4AJPdaZznFo3bk6NiugIhBvFE 3XJsJOocU2+8w+8HW0JVzBsbAgdBxhvyNo+IJFY8ZhwX8CK0u1hytMVI3163qtvtkdE9Ti5ydHq F4KbNflLQM2dosIaruA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX88dvHA6IW40K 3wcKmXx0RNCzXOd4K9gIDnlKgTeSEmGzlr4U0Xo6udZg53QETu/jzNOh0jgHvrZG6MVlizfqmQm 3Oj/swD5OcGerU9keOhidX7k+6xo3Zs= 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 The Hawi SoC uses the VPU5x generation of the Iris video hardware, which requires handling for two new power domains =E2=80=94 mm-int for the intern= al memory interconnect and cx-int for the CX domain AXI interface =E2=80=94 as= well as additional generation-specific clocks. Without a VPU5x vpu_ops implementation the Iris driver cannot power on or off the hardware on Hawi. Move the shared idle and core power status definitions to the common register header so they can be used by both VPU4x and VPU5x code. Signed-off-by: Wangao Wang --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 6 + drivers/media/platform/qcom/iris/iris_vpu4x.c | 4 - drivers/media/platform/qcom/iris/iris_vpu5x.c | 588 +++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + .../platform/qcom/iris/iris_vpu_register_defines.h | 4 + 6 files changed, 600 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index f8a017d878d620fe1d82708624595583aa2ffd99..adaf2f4ab08984bcf10b8ca7ed4= 24a21635eafbe 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -27,6 +27,7 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_vpu2.o \ iris_vpu3x.o \ iris_vpu4x.o \ + iris_vpu5x.o \ iris_vpu_buffer.o \ iris_vpu_common.o \ =20 diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 61639d72bdcc9917983096e5b8f5905936784623..4529f52a30d7f2ef82ec846bced= 6f9b5aef16558 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -80,6 +80,10 @@ enum platform_clk_type { IRIS_VPP0_HW_CLK, IRIS_VPP1_HW_CLK, IRIS_APV_HW_CLK, + IRIS_AXIC_CLK, + IRIS_CTRL_DEBUG_CLK, + IRIS_VPP_GATING_CLK, + IRIS_CX_AXI_CLK, }; =20 struct platform_clk_data { @@ -241,6 +245,8 @@ enum platform_pm_domain_type { IRIS_VPP0_HW_POWER_DOMAIN, IRIS_VPP1_HW_POWER_DOMAIN, IRIS_APV_HW_POWER_DOMAIN, + IRIS_MM_INT_POWER_DOMAIN, + IRIS_CX_INT_POWER_DOMAIN, }; =20 struct iris_firmware_data { diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index 93acbfa0f471fdec1cb75db732f37ef6c6ef5cbf..267139a732d923b8e4939bc7d29= 32d06fac7a006 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -11,10 +11,6 @@ #include "iris_vpu_register_defines.h" =20 #define MVP_NOC_RESET_REQ_MASK 0x70103 -#define VPU_IDLE_BITS 0x7103 - -#define CORE_CLK_HALT BIT(0) -#define CORE_PWR_ON BIT(1) =20 static int iris_vpu4x_genpd_set_hwmode(struct iris_core *core, bool hw_mod= e, u32 efuse_value) { diff --git a/drivers/media/platform/qcom/iris/iris_vpu5x.c b/drivers/media/= platform/qcom/iris/iris_vpu5x.c new file mode 100644 index 0000000000000000000000000000000000000000..726c3f35ece4dd1abe4fd3916a5= db699029d154e --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_vpu5x.c @@ -0,0 +1,588 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include +#include + +#include "iris_instance.h" +#include "iris_vpu_common.h" +#include "iris_vpu_register_defines.h" + +/* + * iris5 specific register defines. + * Many base offsets are shared with prior generations: + * WRAPPER_BASE_OFFS =3D 0x000B0000 + * AON_BASE_OFFS =3D 0x000E0000 + * AON_MVP_NOC_RESET =3D 0x0001F000 + * CPU_BASE_OFFS =3D 0x000A0000 + */ + +#define WRAPPER_MVP_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x110) +#define WRAPPER_MVP_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x114) +#define WRAPPER_MVP_NOC_CX_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x118) +#define WRAPPER_MVP_NOC_CX_LPI_STATUS (WRAPPER_BASE_OFFS + 0x11C) + +#define AON_WRAPPER_MVP_NOC_ARCG_CONTROL (AON_BASE_OFFS + 0x10) + +#define AON_WRAPPER_MVP_VIDEO_CTL_NOC_LPI_CONTROL (AON_BASE_OFFS + 0x2C) +#define AON_WRAPPER_MVP_VIDEO_CTL_NOC_LPI_STATUS (AON_BASE_OFFS + 0x30) + +#define CPU_NOC_BASE_OFFS 0x000D0000 +#define CPU_NOC_ERRORLOGGER_MAINCTL_LOW (CPU_NOC_BASE_OFFS + 0x08) +#define CPU_NOC_SBM_FAULTINEN0_LOW (CPU_NOC_BASE_OFFS + 0x240) + +#define NOC_BASE_OFFS 0x00010000 +#define NOC_ERL_ERRORLOGGER_MAINCTL_LOW (NOC_BASE_OFFS + 0xA008) +#define NOC_ERL_ERRORLOGGER_ERRCLR_LOW (NOC_BASE_OFFS + 0xA018) +#define NOC_SBM_FAULTINEN0_LOW (NOC_BASE_OFFS + 0x7040) + +#define NOC5_RESET_VPP0_ONLY_DISABLED 0x36010E +#define NOC5_RESET_VPP1_DISABLED 0x35000F +#define NOC5_RESET_ALL_VPP_ENABLED 0x37010F + +#define NOC_LPI_PD_QREQ BIT(0) +#define NOC_SBM_FAULTINEN0_PORT0 BIT(0) +#define NOC_ERRORLOGGER_MAINCTL_FAULTEN BIT(0) +#define NOC_ERL_ERRORLOGGER_ERRCLR BIT(0) +#define AON_MVP_NOC_ARCG_OVERRIDE BIT(0) + +#define WRAPPER_INTR_MASK_SS_CPU_NOC BIT(6) +#define WRAPPER_INTR_MASK_SS_NOC BIT(5) + +static bool iris_vpu5x_hw_power_collapsed(struct iris_core *core) +{ + u32 value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); + + return !(value & CORE_PWR_ON); +} + +static int iris_vpu5x_genpd_set_hwmode(struct iris_core *core, bool hw_mod= e, u32 efuse_value) +{ + int ret; + + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], hw_mode); + if (ret) + return ret; + + 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); + if (ret) + goto restore_hw_domain_mode; + } + + 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); + if (ret) + goto restore_vpp0_domain_mode; + } + + 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); + if (ret) + goto restore_vpp1_domain_mode; + } + + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_MM_INT_P= OWER_DOMAIN], + hw_mode); + if (ret) + goto restore_apv_domain_mode; + + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_CX_INT_P= OWER_DOMAIN], + hw_mode); + if (ret) + goto restore_mm_int_domain_mode; + + return 0; + +restore_mm_int_domain_mode: + dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_MM_INT_POWER_DOM= AIN], !hw_mode); + +restore_apv_domain_mode: + if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) + dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DO= MAIN], + !hw_mode); +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); +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); +restore_hw_domain_mode: + dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , !hw_mode); + + return ret; +} + +static int iris_vpu5x_set_hwmode(struct iris_core *core) +{ + u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); + + if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) + iris_vpu4x_vpu5x_ahb_sync_reset_apv(core); + + iris_vpu4x_vpu5x_ahb_sync_reset_hardware(core); + + return iris_vpu5x_genpd_set_hwmode(core, true, efuse_value); +} + +/* + * Perform an LPI power-down handshake on a single NOC interface. + * + * Sets QREQ and polls for the status DONE bit. On a busy response the req= uest + * is toggled and, when @errclr_offs is non-zero, the NOC error-log clear + * register at that offset is written between retries to unblock the fabri= c. + * Pass @errclr_offs =3D 0 for interfaces that do not require error cleari= ng. + */ +static void iris_vpu5x_noc_lpi_handshake(struct iris_core *core, + u32 ctrl_offs, u32 status_offs, + u32 busy_mask, u32 errclr_offs, + const char *name) +{ + bool handshake_done, handshake_busy; + u32 value, count =3D 0; + int ret; + + do { + if (errclr_offs) { + value =3D readl(core->reg_base + errclr_offs); + value |=3D NOC_ERL_ERRORLOGGER_ERRCLR; + writel(value, core->reg_base + errclr_offs); + } + + value =3D readl(core->reg_base + ctrl_offs); + value |=3D NOC_LPI_PD_QREQ; + writel(value, core->reg_base + ctrl_offs); + usleep_range(10, 20); + + value =3D readl(core->reg_base + status_offs); + handshake_done =3D value & NOC_LPI_STATUS_DONE; + handshake_busy =3D value & busy_mask; + + if (handshake_done || !handshake_busy) + break; + + value =3D readl(core->reg_base + ctrl_offs); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + ctrl_offs); + usleep_range(10, 20); + + } while (++count < 1000); + + if (!handshake_done && handshake_busy) + dev_err(core->dev, "%s NOC LPI handshake timeout\n", name); + + ret =3D readl_poll_timeout(core->reg_base + status_offs, + value, value & NOC_LPI_STATUS_DONE, 200, 2000); + if (ret) + dev_err(core->dev, "%s NOC LPI status timeout\n", name); + + value =3D readl(core->reg_base + ctrl_offs); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + ctrl_offs); +} + +static int iris_vpu5x_power_on_cx_int(struct iris_core *core) +{ + u32 value; + int ret; + + ret =3D iris_enable_power_domains(core, + core->pmdomain_tbl->pd_devs[IRIS_CX_INT_POWER_DOMAIN]); + if (ret) + return ret; + + ret =3D iris_prepare_enable_clock(core, IRIS_CX_AXI_CLK); + if (ret) + goto err_disable_cx_int_power; + + value =3D readl(core->reg_base + WRAPPER_MVP_NOC_CX_LPI_CONTROL); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + WRAPPER_MVP_NOC_CX_LPI_CONTROL); + + readl_poll_timeout(core->reg_base + WRAPPER_MVP_NOC_CX_LPI_STATUS, + value, !(value & NOC_LPI_STATUS_DONE), 200, 2000); + + return 0; + +err_disable_cx_int_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CX_INT_= POWER_DOMAIN]); + + return ret; +} + +static void iris_vpu5x_power_off_cx_int(struct iris_core *core) +{ + iris_vpu5x_noc_lpi_handshake(core, + WRAPPER_MVP_NOC_CX_LPI_CONTROL, + WRAPPER_MVP_NOC_CX_LPI_STATUS, + NOC_LPI_STATUS_DENY | NOC_LPI_STATUS_ACTIVE, + NOC_ERL_ERRORLOGGER_ERRCLR_LOW, "CX"); + + iris_disable_unprepare_clock(core, IRIS_CX_AXI_CLK); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CX_INT_= POWER_DOMAIN]); +} + +static int iris_vpu5x_power_on_mm_int(struct iris_core *core) +{ + u32 value; + int ret; + + ret =3D iris_enable_power_domains(core, + core->pmdomain_tbl->pd_devs[IRIS_MM_INT_POWER_DOMAIN]); + if (ret) + return ret; + + ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); + if (ret) + goto err_disable_mm_int_power; + + value =3D readl(core->reg_base + WRAPPER_MVP_NOC_LPI_CONTROL); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + WRAPPER_MVP_NOC_LPI_CONTROL); + + readl_poll_timeout(core->reg_base + WRAPPER_MVP_NOC_LPI_STATUS, + value, !(value & NOC_LPI_STATUS_DONE), 200, 2000); + + return 0; + +err_disable_mm_int_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_MM_INT_= POWER_DOMAIN]); + + return ret; +} + +static void iris_vpu5x_power_off_mm_int(struct iris_core *core) +{ + u32 value; + + value =3D readl(core->reg_base + WRAPPER_MVP_NOC_LPI_CONTROL); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + WRAPPER_MVP_NOC_LPI_CONTROL); + + value =3D readl(core->reg_base + WRAPPER_MVP_NOC_CX_LPI_CONTROL); + value &=3D ~NOC_LPI_PD_QREQ; + writel(value, core->reg_base + WRAPPER_MVP_NOC_CX_LPI_CONTROL); + + iris_vpu5x_noc_lpi_handshake(core, + WRAPPER_MVP_NOC_LPI_CONTROL, + WRAPPER_MVP_NOC_LPI_STATUS, + NOC_LPI_STATUS_DENY | NOC_LPI_STATUS_ACTIVE, + NOC_ERL_ERRORLOGGER_ERRCLR_LOW, "MM"); + + iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_MM_INT_= POWER_DOMAIN]); +} + +static int iris_vpu5x_enable_hw_clocks(struct iris_core *core, u32 efuse_v= alue) +{ + 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_CLK); + if (ret) + goto err_disable_axi_clk; + + ret =3D iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK); + if (ret) + goto err_disable_hw_clk; + + if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { + ret =3D iris_prepare_enable_clock(core, IRIS_VPP0_HW_CLK); + if (ret) + goto err_disable_bse_clk; + } + + if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { + ret =3D iris_prepare_enable_clock(core, IRIS_VPP1_HW_CLK); + if (ret) + goto err_disable_vpp0_clk; + } + + ret =3D iris_prepare_enable_clock(core, IRIS_VPP_GATING_CLK); + if (ret) + goto err_disable_vpp1_clk; + + return 0; + +err_disable_vpp1_clk: + if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) + iris_disable_unprepare_clock(core, IRIS_VPP1_HW_CLK); +err_disable_vpp0_clk: + if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) + iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); +err_disable_bse_clk: + iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); +err_disable_hw_clk: + iris_disable_unprepare_clock(core, IRIS_HW_CLK); +err_disable_axi_clk: + iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + + return ret; +} + +static void iris_vpu5x_disable_hw_clocks(struct iris_core *core, u32 efuse= _value) +{ + iris_disable_unprepare_clock(core, IRIS_VPP_GATING_CLK); + + 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_AXI_CLK); +} + +static int iris_vpu5x_power_on_hardware(struct iris_core *core) +{ + u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); + int ret; + + ret =3D iris_vpu5x_power_on_cx_int(core); + if (ret) + return ret; + + ret =3D iris_vpu5x_power_on_mm_int(core); + if (ret) + goto err_disable_cx_int; + + ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); + if (ret) + goto err_disable_mm_int; + + if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { + ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs + [IRIS_VPP0_HW_POWER_DOMAIN]); + if (ret) + goto err_disable_hw_power; + } + + if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { + ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs + [IRIS_VPP1_HW_POWER_DOMAIN]); + if (ret) + goto err_disable_vpp0_power; + } + + ret =3D iris_vpu5x_enable_hw_clocks(core, efuse_value); + if (ret) + goto err_disable_vpp1_power; + + if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { + ret =3D iris_vpu4x_vpu5x_power_on_apv(core); + if (ret) + goto err_disable_hw_clocks; + } + + return 0; + +err_disable_hw_clocks: + iris_vpu5x_disable_hw_clocks(core, efuse_value); +err_disable_vpp1_power: + if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs + [IRIS_VPP1_HW_POWER_DOMAIN]); +err_disable_vpp0_power: + if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs + [IRIS_VPP0_HW_POWER_DOMAIN]); +err_disable_hw_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); +err_disable_mm_int: + iris_vpu5x_power_off_mm_int(core); +err_disable_cx_int: + iris_vpu5x_power_off_cx_int(core); + + return ret; +} + +static void iris_vpu5x_power_off_hardware(struct iris_core *core) +{ + u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); + u32 noc_reset_mask; + u32 value; + int ret; + + iris_vpu5x_genpd_set_hwmode(core, false, efuse_value); + + if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) + iris_vpu4x_vpu5x_power_off_apv(core); + + if (iris_vpu5x_hw_power_collapsed(core)) + goto disable_clocks_and_power; + + value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + if (value & CORE_CLK_HALT) + writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + readl_poll_timeout(core->reg_base + VCODEC_SS_IDLE_STATUSN, + value, (value & VPU_IDLE_BITS) =3D=3D VPU_IDLE_BITS, 2000, 20000); + + if (efuse_value & DISABLE_VIDEO_VPP0_BIT) + noc_reset_mask =3D NOC5_RESET_VPP0_ONLY_DISABLED; + else if (efuse_value & DISABLE_VIDEO_VPP1_BIT) + noc_reset_mask =3D NOC5_RESET_VPP1_DISABLED; + else + noc_reset_mask =3D NOC5_RESET_ALL_VPP_ENABLED; + + writel(noc_reset_mask, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + value, (value & noc_reset_mask) =3D=3D noc_reset_mask, 200, 2000); + if (ret) + dev_err(core->dev, "MVP NOC reset ack timeout\n"); + + writel(noc_reset_mask, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_SYNCRST= ); + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_SYNCRST); + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); + + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + value, value =3D=3D 0x0, 200, 2000); + if (ret) + dev_err(core->dev, "MVP NOC reset deassert timeout\n"); + + writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, + core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDGE_S= YNC_RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_clocks_and_power: + iris_vpu5x_disable_hw_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]); + + 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_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_vpu5x_power_off_mm_int(core); + iris_vpu5x_power_off_cx_int(core); +} + +static int iris_vpu5x_power_on_controller(struct iris_core *core) +{ + u32 mask_val; + 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_CTRL_CLK); + if (ret) + goto err_disable_ctrl_power; + + ret =3D iris_prepare_enable_clock(core, IRIS_AXIC_CLK); + if (ret) + goto err_disable_ctrl_clk; + + ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_FREERUN_CLK); + if (ret) + goto err_disable_axic_clk; + + ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_DEBUG_CLK); + if (ret) + goto err_disable_ctrl_freerun_clk; + + mask_val =3D readl(core->reg_base + CPU_NOC_SBM_FAULTINEN0_LOW); + mask_val |=3D NOC_SBM_FAULTINEN0_PORT0; + writel(mask_val, core->reg_base + CPU_NOC_SBM_FAULTINEN0_LOW); + + mask_val =3D readl(core->reg_base + CPU_NOC_ERRORLOGGER_MAINCTL_LOW); + mask_val |=3D NOC_ERRORLOGGER_MAINCTL_FAULTEN; + writel(mask_val, core->reg_base + CPU_NOC_ERRORLOGGER_MAINCTL_LOW); + + mask_val =3D readl(core->reg_base + WRAPPER_INTR_MASK); + mask_val &=3D ~WRAPPER_INTR_MASK_SS_CPU_NOC; + writel(mask_val, core->reg_base + WRAPPER_INTR_MASK); + + mask_val =3D readl(core->reg_base + NOC_SBM_FAULTINEN0_LOW); + mask_val |=3D NOC_SBM_FAULTINEN0_PORT0; + writel(mask_val, core->reg_base + NOC_SBM_FAULTINEN0_LOW); + + mask_val =3D readl(core->reg_base + NOC_ERL_ERRORLOGGER_MAINCTL_LOW); + mask_val |=3D NOC_ERRORLOGGER_MAINCTL_FAULTEN; + writel(mask_val, core->reg_base + NOC_ERL_ERRORLOGGER_MAINCTL_LOW); + + mask_val =3D readl(core->reg_base + WRAPPER_INTR_MASK); + mask_val &=3D ~WRAPPER_INTR_MASK_SS_NOC; + writel(mask_val, core->reg_base + WRAPPER_INTR_MASK); + + return 0; + +err_disable_ctrl_freerun_clk: + iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); +err_disable_axic_clk: + iris_disable_unprepare_clock(core, IRIS_AXIC_CLK); +err_disable_ctrl_clk: + iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); +err_disable_ctrl_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + + return ret; +} + +static int iris_vpu5x_power_off_controller(struct iris_core *core) +{ + u32 ctrl_rst_tbl_size =3D core->iris_platform_data->controller_rst_tbl_si= ze; + u32 value; + + writel(MSK_SIGNAL_FROM_TENSILICA | MSK_CORE_POWER_ON, + core->reg_base + CPU_CS_X2RPMH); + + iris_vpu5x_noc_lpi_handshake(core, + WRAPPER_IRIS_CPU_NOC_LPI_CONTROL, + WRAPPER_IRIS_CPU_NOC_LPI_STATUS, + NOC_LPI_STATUS_DENY, 0, "CPU"); + + iris_vpu5x_noc_lpi_handshake(core, + AON_WRAPPER_MVP_VIDEO_CTL_NOC_LPI_CONTROL, + AON_WRAPPER_MVP_VIDEO_CTL_NOC_LPI_STATUS, + NOC_LPI_STATUS_DENY | NOC_LPI_STATUS_ACTIVE, 0, "Video CTL"); + + writel(0x0, core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL); + readl_poll_timeout(core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS, + value, value =3D=3D 0x0, 200, 2000); + + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_ARCG_CONTROL); + value |=3D AON_MVP_NOC_ARCG_OVERRIDE; + writel(value, core->reg_base + AON_WRAPPER_MVP_NOC_ARCG_CONTROL); + + iris_disable_unprepare_clock(core, IRIS_CTRL_DEBUG_CLK); + iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_AXIC_CLK); + iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); + + reset_control_bulk_assert(ctrl_rst_tbl_size, core->controller_resets); + usleep_range(400, 500); + reset_control_bulk_deassert(ctrl_rst_tbl_size, core->controller_resets); + + return 0; +} + +const struct vpu_ops iris_vpu5x_ops =3D { + .power_off_hw =3D iris_vpu5x_power_off_hardware, + .power_on_hw =3D iris_vpu5x_power_on_hardware, + .power_off_controller =3D iris_vpu5x_power_off_controller, + .power_on_controller =3D iris_vpu5x_power_on_controller, + .program_bootup_registers =3D iris_vpu35_vpu4x_program_bootup_registers, + .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu5x_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 cc22c7459c4b77fdcb95b546fb8a55eea522bfb8..888b4b9407d0e0c7222448fe61b= f8a41b669d2d6 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -13,6 +13,7 @@ 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_vpu4x_ops; +extern const struct vpu_ops iris_vpu5x_ops; =20 struct vpu_ops { void (*power_off_hw)(struct iris_core *core); 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 33f3d01cf79d763a62a2be9eac910a462bcd479b..3d08ea15eacb7ababaefd6e233b= 6232ce39f2cb5 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -85,4 +85,8 @@ #define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS) #define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4) =20 +#define VPU_IDLE_BITS 0x7103 +#define CORE_CLK_HALT BIT(0) +#define CORE_PWR_ON BIT(1) + #endif --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 6EC86392802 for ; Wed, 23 Sep 2026 03:28:40 +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=1790134122; cv=none; b=aBgT4sYTUfB8kj3XnhIrRSYvkOwjnvW7QA9szOxcOggjSTJ+xcCwuM7gXZ9t59nDsoix7JWQhd/wiwqLNs0+ufHBl7BKyWXx93undfTxuK9i3bqFRxWhYuB7ymVy6skN2VXN1uErfYO9K2H0RoPKk9QNCgL8rKUy8O7LPC2O+po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134122; c=relaxed/simple; bh=d7DoZGxXmBTMEh6miraAWbbRhEVsOJTv1RurUoDyzRI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jdqqLWG6NIyYN6zzcCkHZN2RszBOQNdkItyUvm8R0Ul/YpYPhSbBfs15P4RQb5y+AUKrocjBwbN7kvrX5jarXG+ULAHB9E4AxL/GBEwRRx7YcZgYyOo8leU+Fz9jRY3PE0PYlegNKV+26P621GbNt6AmmSdn4bHNL410FlisW2o= 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=Urv4uzQK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=JYq+bJO3; 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="Urv4uzQK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="JYq+bJO3" 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 68MIXO5x268297 for ; Wed, 23 Sep 2026 03:28:39 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= akDL6vAW1ZtwmsqI1nhcqQqLQtuOREwfWnRLwSt4onk=; b=Urv4uzQKYoFG3rMJ u9j4LV/LAApSpi+eABBX9KoNLnt6eqIXhqkTPEYUwN/IzFe3IMPgv8pGhTC6AL3K rUGbp3TOPDr49Q9U8zHuLfwJlKa62zRj9nzCK8S6wg9LVALhxcLxhmOOKLS+VH/F lmQigeRbhmLVrKk+1OiPEsGzjQAECYomC5AwJ6qj/fJd9Q6ZaiqYJpZWDPa+1vf9 p9pfxGQBk+28HKSt3fkc0oev36nlHCEFaS0TgFfWphg9jp9are12VeCugFcTUwpn C0DN37e3/tTboBZ+s8xcpR2AAm2Yf9ELykOOEm9kPLuIDg57kG3EHgLGf0qk5m0i JwC0OQ== 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 4guy2c1y2a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:39 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-cbe77d6864dso618358a12.2 for ; Tue, 22 Sep 2026 20:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134118; x=1790738918; 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=akDL6vAW1ZtwmsqI1nhcqQqLQtuOREwfWnRLwSt4onk=; b=JYq+bJO38UCcEuU2+208hTJPWeYZWwuqFxeWnMxh/ZH/PnHbQFm1OgL197dvxoOxQS zWsI+Z1e2wCY/vaaQcT3J+l24DkX4sqja3sSLIGWoGM9rsPtQsQtLyY+80xr3ACxaQMY p6ujmB+kcIjGU8Hv82Guf/B3LwoihOyb4YvvDN4k3DcRBCcy1gewRIJFiC8uKSJXAy8F Yq2Q5ihesB+4mZ4iNzvmmx0Jrb5AMoK7Elly9Cv7dyjRM80djJPQUVMk/KhJovKYl5LL ha+Tw6brmcL+tbF+n3zo8XxaG2kslIwNiCfzEDlftA0qDrLivW6vTw8zIOk6O8KhqzZO sV1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134118; x=1790738918; 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=akDL6vAW1ZtwmsqI1nhcqQqLQtuOREwfWnRLwSt4onk=; b=T3qqNEyXmvxDKJjMFM/wGNilcPwHtrEjL0wGXKh195TU0TYKRDgZPS+K4YXk13C84b cA9HLZhuGlGBaJiKlgFoP6zlwdNjCw/rHx98DJIB2VLkB6YoJMa2TsunSNclrgPvWv9z a8j8IqoWHlCc2ts7Alg/WuHer+vVcTf0FEo0QwiHvtzTIVWwpKGggcjxtLgcUv6l6h8Y itTkmI/TfqtrWhqmogoju6w/U6zUMZLDubVzkApbl7iwETIlYre+Hqfe25/Klw3kaO79 pWjlHDD9JIPLPiDuLVQ70p+Kd93yZMGuFn4yRTf8x4DWCT9p6drcbHes0dNiuvNkQDsw fmbw== X-Forwarded-Encrypted: i=1; AKwUvBxUzyGttVTOQcY0lgNrXS5BxKr4jYL4RZ0hwrdc9sY7jF1kq37FTt/BzAyTYF3KFuf20RuFdM7YBs9OJF4=@vger.kernel.org X-Gm-Message-State: AFuF++lRocfzItWns5btD8h6FKPrXH8PKzNE3vUvNZi32YM7RbZYAFYC nzzilgScg/37WN0hlYDsTaowx5xcnKJSdBAR7YD1nPqvCmuCiojq8pJ0orFrw7McuuwCO1NuAAL knqPKPB8U3AIckP6GrUgd9iCn3zoZ+4Snr9s0bOHBI641P+VaWQPhcQh/bVIAI9WN9FM= X-Gm-Gg: AYBFou0Xdio5y4WhkyNXJAiqa3WmD+mKCYuJJ7fsk94B27aXo3pj0LmEyNxOZj4eAvp Ry+6YpEV7McD++HD4WidqDrHlTEQTUwd/wpkAjc+/w0M510oghU0lXYerFJePJSb7c7VwoLqmaf YffANUSdejDqoEGGMzgPHBbdbjq+93s/Lv82IyMvz7pFQYaYs5+GVTpHcUe2mKr2xZPDwYupMlW hgIpmZtBk4JZi+PuI0ZeiDI3jkconjxqo/UH172aFFqBYPfMPAsPVdXaks5/kWRaVjlMvtUkHb8 a15UYtY9vGISDxpPcX8mfw27nWq/aPAq9gYPzA1VCZlf97HVOIfsxQpY34EV2lPn+2ZYOYr3tI+ glhmxeIdLOdYCLBtXEuJWKo8EJg6Z2Lj4Z0ZTVqscYGn1L/LFmRDb68DafDC4pf4R7nXi2egfz0 CTo4VwTSdu X-Received: by 2002:a17:903:245:b0:2dd:ad74:ac21 with SMTP id d9443c01a7336-2df69db6180mr12082515ad.28.1790134118340; Tue, 22 Sep 2026 20:28:38 -0700 (PDT) X-Received: by 2002:a17:903:245:b0:2dd:ad74:ac21 with SMTP id d9443c01a7336-2df69db6180mr12082335ad.28.1790134117835; Tue, 22 Sep 2026 20:28:37 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:37 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:54 +0800 Subject: [PATCH v2 4/7] media: iris: add VPU5x internal buffer size calculations 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: <20260923-add_iris_for_hawi-v2-4-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=6705; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=d7DoZGxXmBTMEh6miraAWbbRhEVsOJTv1RurUoDyzRI=; b=Bue5huOOfbzCEuSl/l2y5hOKK3KQpkyPfJgiU328+nRpUU9hEZsKCadk8Xs+cFrQsDEGCgdSf XHRXPTiroA3BpKBNPRx6l4MVzcV4rJM9PFvAYK0c6J25f89hLrZTjNd X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-GUID: Kq76hmFF1V9RsYSIqnRTLuu-SX7yYUIp X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX8O9LUuJz3Y/n eS+RqovsSL1ZmuCc4KREnF+Wde9NJ4l9wu+N9C50xfBoeoHo+gq8Y+rpT4wfpIpI5MuXxCx0fFK Bi2kr7SR8biQzT/Q8PqLpiMBHzYQUuw= X-Authority-Analysis: v=2.4 cv=Zsh4uN7G c=1 sm=1 tr=0 ts=6ab34767 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==: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=TQKVwlwO4xRIBFL53c4A:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-ORIG-GUID: Kq76hmFF1V9RsYSIqnRTLuu-SX7yYUIp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX/FsjPpvE47SS pCpyv4NC+4OHSdu1up9JOd1heQC/ZCGArhPDclcXSt3ayvlceD/FbdexZygOmV7VaQ4sCxNQjI/ Tu4YdkjJlpUZb6gyx0xamn9TvF4cGL9fWatMxa9k44Dks3JB3jAg/qJahyywsr/x/X4QRjuxN/T GiVZel3Y7u172KHzxy2kRLBkH8fHPO0LDCCCXEJQc/QAtzrISBfA8eBLZFxwLpT5T7KkrRD3yT7 sztp8P51V+fhPWjUXBABtJAPF9a4lNE2vaEsZEEHP4bcRhnY0sOeeSEXzakAHQQfrohP4PSsRZ+ NFIrlqJPMYRxlJKZbKzlAfWx/UeElMfcfdG4WR61xr6Uzb+wm6fYr7GD1WVW99w0y+QWAE6bFVO EqpiD8dJOfa1F8DM4UI3t/HVl72GMktMXekvdhdUuyol98Tsfs0EpEPDuK2JVP7yOxVvlDAEiAF H/e5BK/W9nXnsl4isbA== 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 clxscore=1015 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 VPU5x firmware uses internal buffer formulas that differ from VPU4x. In particular, the H.265 decoder persistent buffer needs space for SEI unregistered userdata and three-dimensional userdata, and the encoder calculations use a larger lambda LUT size. Add a VPU5x buffer-size dispatcher and a VPU5x-specific H.265 persistent buffer calculation while reusing the existing helpers for buffer types whose formulas are unchanged. Signed-off-by: Wangao Wang --- drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 93 ++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_buffer.h | 4 +- 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.c index bb8135bd238b670fb5806120493b2603d9c2b0fb..cd00785a04870620c04bc4b52b3= 5eda3c730bc93 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c @@ -1895,6 +1895,54 @@ static u32 iris_vpu4x_dec_persist_size(struct iris_i= nst *inst) return 0; } =20 +static u32 hfi_vpu5x_buffer_persist_h265d(bool rpu_enabled) +{ + u32 slist_buf =3D SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265; + u32 frame_info =3D H265_NUM_FRM_INFO * H265_DISPLAY_BUF_SIZE; + u32 tile_info =3D H265_NUM_TILE * sizeof(u32); + u32 per_pic =3D NUM_HW_PIC_BUF * + (SIZE_SEI_USERDATA + SIZE_SEI_USERDATA_UNREGISTERED + SIZE_H265D_A= RP + + SIZE_THREE_DIMENSION_USERDATA); + u32 dolby_rpu =3D rpu_enabled * NUM_HW_PIC_BUF * SIZE_DOLBY_RPU_METADATA; + + return ALIGN(slist_buf + frame_info + tile_info + per_pic + dolby_rpu, DM= A_ALIGNMENT); +} + +static u32 hfi_vpu5x_buffer_persist_av1d(u32 max_width, u32 max_height, u3= 2 total_ref_count) +{ + u32 comv_size =3D hfi_buffer_comv_av1d(max_width, max_height, total_ref_c= ount); + u32 seq_hdr =3D SIZE_AV1D_SEQUENCE_HEADER * 2 + SIZE_AV1D_METADATA; + u32 per_pic =3D AV1D_NUM_HW_PIC_BUF * + (SIZE_AV1D_TILE_OFFSET + SIZE_AV1D_QM + SIZE_AV1D_ARP + SIZE_AV1D_= METADATA); + u32 frame_hdr =3D AV1D_NUM_FRAME_HEADERS * + (SIZE_AV1D_FRAME_HEADER + 2 * SIZE_AV1D_PROB_TABLE); + + return ALIGN(seq_hdr + per_pic + frame_hdr + comv_size + HDR10_HIST_EXTRA= DATA_SIZE, + DMA_ALIGNMENT); +} + +static u32 iris_vpu5x_dec_persist_size(struct iris_inst *inst) +{ + struct platform_inst_caps *caps; + + if (inst->codec =3D=3D V4L2_PIX_FMT_H264) { + return hfi_buffer_persist_h264d(); + } else if (inst->codec =3D=3D V4L2_PIX_FMT_HEVC) { + return hfi_vpu5x_buffer_persist_h265d(0); + } else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) { + return hfi_vpu4x_buffer_persist_vp9d(); + } else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + caps =3D inst->core->iris_platform_data->inst_caps; + if (inst->fw_caps[DRAP].value) + return hfi_vpu5x_buffer_persist_av1d(caps->max_frame_width, + caps->max_frame_height, 16); + else + return hfi_vpu5x_buffer_persist_av1d(0, 0, 0); + } + + return 0; +} + static u32 size_se_lb(u32 standard, u32 num_vpp_pipes_enc, u32 frame_width_coded, u32 frame_height_coded) { @@ -2222,6 +2270,51 @@ u32 iris_vpu4x_buf_size(struct iris_inst *inst, enum= iris_buffer_type buffer_typ return size; } =20 +u32 iris_vpu5x_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type) +{ + const struct iris_vpu_buf_type_handle *buf_type_handle_arr =3D NULL; + u32 size =3D 0, buf_type_handle_size =3D 0, i; + + static const struct iris_vpu_buf_type_handle dec_internal_buf_type_handle= [] =3D { + {BUF_BIN, iris_vpu_dec_bin_size }, + {BUF_COMV, iris_vpu3x_4x_dec_comv_size }, + {BUF_NON_COMV, iris_vpu_dec_non_comv_size }, + {BUF_LINE, iris_vpu4x_dec_line_size }, + {BUF_PERSIST, iris_vpu5x_dec_persist_size }, + {BUF_DPB, iris_vpu_dec_dpb_size }, + {BUF_SCRATCH_1, iris_vpu_dec_scratch1_size }, + {BUF_PARTIAL, iris_vpu_dec_partial_size }, + }; + + static const struct iris_vpu_buf_type_handle enc_internal_buf_type_handle= [] =3D { + {BUF_BIN, iris_vpu_enc_bin_size }, + {BUF_COMV, iris_vpu_enc_comv_size }, + {BUF_NON_COMV, iris_vpu_enc_non_comv_size }, + {BUF_LINE, iris_vpu4x_enc_line_size }, + {BUF_ARP, iris_vpu_enc_arp_size }, + {BUF_VPSS, iris_vpu_enc_vpss_size }, + {BUF_SCRATCH_1, iris_vpu_enc_scratch1_size }, + {BUF_SCRATCH_2, iris_vpu_enc_scratch2_size }, + }; + + if (inst->domain =3D=3D DECODER) { + buf_type_handle_size =3D ARRAY_SIZE(dec_internal_buf_type_handle); + buf_type_handle_arr =3D dec_internal_buf_type_handle; + } else if (inst->domain =3D=3D ENCODER) { + buf_type_handle_size =3D ARRAY_SIZE(enc_internal_buf_type_handle); + buf_type_handle_arr =3D enc_internal_buf_type_handle; + } + + for (i =3D 0; i < buf_type_handle_size; i++) { + if (buf_type_handle_arr[i].type =3D=3D buffer_type) { + size =3D buf_type_handle_arr[i].handle(inst); + break; + } + } + + return size; +} + static u32 internal_buffer_count(struct iris_inst *inst, enum iris_buffer_type buffer_type) { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.h index c7020931a642f0484b6f84af7ab51242e1845458..46210a2ec4942642ef61fc09cb0= cc414f109607f 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.h @@ -64,6 +64,7 @@ struct iris_inst; #define VP9_UDC_HEADER_BUF_SIZE (3 * 128) =20 #define SIZE_SEI_USERDATA 4096 +#define SIZE_SEI_USERDATA_UNREGISTERED 256 #define SIZE_DOLBY_RPU_METADATA (41 * 1024) #define H264_CABAC_HDR_RATIO_HD_TOT 1 #define H264_CABAC_RES_RATIO_HD_TOT 3 @@ -121,7 +122,7 @@ struct iris_inst; #define SIZE_SLICE_CMD_BUFFER (ALIGN(20480, 256)) #define SIZE_SPS_PPS_SLICE_HDR (2048 + 4096) #define SIZE_BSE_SLICE_CMD_BUF ((((8192 << 2) + 7) & (~7)) * 3) -#define SIZE_LAMBDA_LUT (256 * 11) +#define SIZE_LAMBDA_LUT (256 * 13) =20 #define HFI_COL_FMT_NV12C_Y_TILE_HEIGHT (8) #define HFI_COL_FMT_NV12C_Y_TILE_WIDTH (32) @@ -289,6 +290,7 @@ static inline u32 size_av1d_qp(u32 frame_width, u32 fra= me_height) u32 iris_vpu_buf_size(struct iris_inst *inst, enum iris_buffer_type buffer= _type); u32 iris_vpu33_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type); u32 iris_vpu4x_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type); +u32 iris_vpu5x_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type); int iris_vpu_buf_count(struct iris_inst *inst, enum iris_buffer_type buffe= r_type); =20 #endif --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 D231E39CD11 for ; Wed, 23 Sep 2026 03:28: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=1790134126; cv=none; b=rVVs1U+mRQ7QNyUcOqw1HwJ37Q5Zp5OlgWdKKKgdXilmJ3ZfK6jyyE6j2xlBKOrgquYZXNvehtaHYiY0hDQF20yIrO7Kbvoaibvm8axtahG6I5Vg4CVgw1jEc1A7jUs8AOgt5yKc9/E7ZrVELp8wulOJdJ/VNoa/8cqsY71eTmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134126; c=relaxed/simple; bh=zQmRpCs+HKKtuuYeiRQtjz6325OgF/Ird/I0LNF1aZk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WJMl97z+AOctdgdutnVAfMTVnuoMP1c6WDu7r9KR0ik5EzdUt1BLddD9ZDevzXvx1z45ZA6dg1CuGe4hdT80px/vnPaO7G01F7faOpiOHADT4/a3F7fthC95eqmEH5N+fbzR4V3Wt61ZVMbMJ0AGMBw0mf2Act9kDLHPHxLRKrM= 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=Crm3KKW/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IQbmYcRg; 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="Crm3KKW/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IQbmYcRg" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68N37cF8368055 for ; Wed, 23 Sep 2026 03:28: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= Yq0sbOBQ1QRBu0fcaBAnrJTjNUgeA5e7YfagjxNrjFE=; b=Crm3KKW/FcoEHn3j jftCVnjbP0sUw5/PKDsw9ubdCfDlRD7ok/OVpbNKBsS9mENnD/gS2y/jQS36mhx9 ZViatMxsOOo1yzCzfEKEIpLn0s/pezAUj+BdKF0SdOqxouHeigYP570qz+dERfJM Gr8YwtGwgGnel3x38ent7uT7AkXNI5HuISErVTXRSOqP5WdxnuRAbfWs2n3zmWav MPDyVXfpnBCpilO9I/DUUns5VezSVSHMIWyf9xzGFvpp96unxRZ2BC0krg/nUE7C Sr2Q/lm/9j6rp9+SEPhdkV1o+2swqdbDms1cen/N3QnMVraU6tHg2k2Hf45ZX3Uj 610tTg== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gurntc6eq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:43 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2ce7dfd33ffso3655175ad.0 for ; Tue, 22 Sep 2026 20:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134123; x=1790738923; 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=Yq0sbOBQ1QRBu0fcaBAnrJTjNUgeA5e7YfagjxNrjFE=; b=IQbmYcRgJxYHIucruApG7mX4pZxOvg5ibSWe1RrC9XaL8chQVPHoIHGVqUHTikceh8 WNrXdZcPleinRlriCyhh+Y5ddG+d3pulF+gjI2jO8sDPSkVSGD6LwCzCZzS8GdOZfoR/ I62og9ZH4BO11MRloM4CeKRuKlYapWIQPwK5F1AAkHMdcPQ5lRe7T46+aWGzP9bR0R7R r6dPnP9m3nM4Ir1e/nUgSFNcQiELkNL99g+SAf09nyITnnzeH/vxQFsVu0mOlZ0oL7tx DXIAoypNpO05AD5tSy2jxHVEXWYjunUhAr1BaCaf7qzRTTNe+1IlIPVt7ojos7AGZvex fPJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134123; x=1790738923; 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=Yq0sbOBQ1QRBu0fcaBAnrJTjNUgeA5e7YfagjxNrjFE=; b=eeELxYDsVmEQlDJqCPnoME8fjfEAb4PfmMpTXeFEHe9HgmqWc7GiL+OTGVclqoWI7N GPeIHs+7vOkmy/f5ZBLGU3JuqLc8KPM2+FD1qX99o4eiwxgN3Vu89uqes5/Rcq3kCzRt pNn9VLHcN/c6Xu+NjHcGsMFyp5JGYKFv6Es30aoUNYF8HG+AIRn0KRdnZfBOpEUgC60T fCCVqIKresH8+NszTL0cxrv9hZS+x181yT8CLROpi1mItCXhehwOQaNzXQyRqFyOx71n 4L0+Ws83+Il+Mb9qDV+aMhoWvnE/fUGJ5OOhKVoJ6hHmfrqCY/XKm0Rpms1SCkcXfSiX Bv6w== X-Forwarded-Encrypted: i=1; AKwUvBwnnCKqnL0L6KE6Dh4kX3nb+g8o8olDhiY/+wo3JJ05/6FBJhUpcklZES3APqGmAUJss0tDTAsBllk8cfM=@vger.kernel.org X-Gm-Message-State: AFuF++n6h2AkU7DCmCYfOK0POeIFO6YeLEsPs7fnohWOZ8StwF9Ush+t c2YOv/rOZXqa1m61lWSQyt9owuRK0QZ41R5fwBsDQwrswYL06A+hbK+m3rEFa9IEiu1CXK10Mto 3E+EPhfT9w2PUNXWLVHQWbM7L5cLpn0ooy82VEV/YCu7UAguENYsfeqEgqo700V5kH/Y= X-Gm-Gg: AYBFou2J2X+adc/L5CEKKilncVHDnAjKLlprYzwdIFo2K5BH3Gaum8sAknbyl5b6Hb5 FphRW8EJq+Knc/x+Zl7I81xSdUGSldd6PgdzBcg4ipIziVMI10rMBFyEzdxyC9FdHWzHH475tj+ 8C1uLJG7vRtgDi55NPNVZRQba89FabfTicYGoA7s+OdmJqq6lVZOSyGN05hjO5fSBiujJglVcKd o+qu0sFlRb4vB/0NrR8fXZevLOsDcuLDITLrQ/8f6ucqr9D+hgLYG2bmHiMwKS/0IagLTtn+MSN iEtjHwctHBJl7R8vVcR03k41cJj899s0n5gWlKxSTDvQkGKkfn9eDn0JxYCiv7SbQ/DU8MMVKIS jwEP+nYJRaggLGhJ0uruvJdi3Ld7BJ4RdTw8r88Fyx3WsuiXO+DQLJRIAXQYpzxDFRDyUPWe1HA == X-Received: by 2002:a17:902:f60c:b0:2d8:d4cc:be63 with SMTP id d9443c01a7336-2df69d3a9a8mr13716075ad.16.1790134123256; Tue, 22 Sep 2026 20:28:43 -0700 (PDT) X-Received: by 2002:a17:902:f60c:b0:2d8:d4cc:be63 with SMTP id d9443c01a7336-2df69d3a9a8mr13715895ad.16.1790134122782; Tue, 22 Sep 2026 20:28:42 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:42 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:55 +0800 Subject: [PATCH v2 5/7] media: iris: add hawi platform data 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: <20260923-add_iris_for_hawi-v2-5-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=7422; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=zQmRpCs+HKKtuuYeiRQtjz6325OgF/Ird/I0LNF1aZk=; b=cYQV3GpzWK2DHwb06E+AK4+PvPEHH31myr4EBX7EY1mNB56gRDme/4hVTiDZHV5ZgUCUsZhDY 1TCwjuXprLVAPM0AOre/hbNv1Y0V4AN556dYqBXGD0i9HGvSnqCPHZE X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-ORIG-GUID: 4gpg27LWdxzAqlUX3SpTfFJlRD67QjIp X-Authority-Analysis: v=2.4 cv=eauo7LEH c=1 sm=1 tr=0 ts=6ab3476b cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=brcmiJa2iFiq2w5QV1IA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX54U9nFAkggPk PXY7ZECmwyvyVzQRGsPvXKTwCQJaTNcoRlPDywKKTottalRwSvwhdUzl9gFtsHGcAkJNhs2PqJW QvJdxthTmw98tnchR7TswswI/c2mOwmIbEo1v2ke8hTy6B/i+tgRNPwyLfoOUZobQ7TuMrnlLXR pz5flvDBuxB04pohHcQP/Dpe+HVBlxDkZSJw1k0j1Be/3chgACLMYFuvClcEZDhg+Wm++yaIqDN hpYwaPUuv+u7Vqi10+RitLwfc6olKwvd4cPUwoF4JuEOG89AAehVHdBsPupQ9alTlcoDJFgg71t VDj3dhD7mLmpg10X0phsUe30dEPlgCYEIerPGwR6Hw12303i7xGfHnwhZ+cTERn6ATCp+qSGbNn MQ00KhPjqLQ05/3Wb65lASA0bhj441SwOYUC+pXdIszvvdCqOsbJKdP0yJJEfAWDQqvpQ4wGgrD snuYFc+K1Y+dh+M1YNg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX6y0JpD27ZvMJ TOow8aW50EVydadyQjf3S89wxpvRCJbMFNj37LyY2Hj+elNF8YofJ3pforQ9CEj7flUd+OGl5xc +Wz+GykJCFI3XDfKwiv2lt3T4hGa1d8= X-Proofpoint-GUID: 4gpg27LWdxzAqlUX3SpTfFJlRD67QjIp 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 The Iris block in the Hawi SoC is a VPU5 capable of decoding H.264, H.265, VP9 and AV1, and encoding H.264 and H.265. Add the platform data entry describing the Hawi-specific clock tree, power domains, firmware image, bandwidth table, DMA address range, and secure memory regions so the Iris driver can match the qcom,hawi-iris compatible and initialize the hardware. Signed-off-by: Wangao Wang --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../media/platform/qcom/iris/iris_platform_hawi.h | 48 ++++++++++++ .../media/platform/qcom/iris/iris_platform_vpu5.c | 86 ++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 + 5 files changed, 140 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index adaf2f4ab08984bcf10b8ca7ed424a21635eafbe..b3b5c41c0aaf759d6bf82bef4ec= 78ae63769b561 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -15,6 +15,7 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_platform_vpu2.o \ iris_platform_vpu3x.o \ iris_platform_vpu4x.o \ + iris_platform_vpu5.o \ iris_power.o \ iris_probe.o \ iris_resources.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 4529f52a30d7f2ef82ec846bced6f9b5aef16558..ce01f7bf4ea9a4ba667d5dd4d04= ac013a427c6c2 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -57,6 +57,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 hawi_data; extern const struct iris_platform_data maili_data; extern const struct iris_platform_data milos_data; extern const struct iris_platform_data qcs8300_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_hawi.h b/driver= s/media/platform/qcom/iris/iris_platform_hawi.h new file mode 100644 index 0000000000000000000000000000000000000000..90d9282ce59821489c941d7282b= 3f23e8c06622e --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_hawi.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#ifndef __MEDIA_IRIS_PLATFORM_HAWI_H__ +#define __MEDIA_IRIS_PLATFORM_HAWI_H__ + +static const char * const hawi_clk_reset_table[] =3D { + "bus0", + "core", +}; + +static const struct platform_clk_data hawi_clk_table[] =3D { + {IRIS_AXI_CLK, "iface" }, + {IRIS_AXIC_CLK, "ifacec" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_FREERUN_CLK, "core_freerun" }, + {IRIS_CTRL_FREERUN_CLK, "core_ctl_freerun" }, + {IRIS_CTRL_DEBUG_CLK, "core_debug" }, + {IRIS_CX_AXI_CLK, "cx_iface" }, + {IRIS_HW_CLK, "vcodec0_core" }, + {IRIS_VPP0_HW_CLK, "vcodec_vpp0" }, + {IRIS_VPP1_HW_CLK, "vcodec_vpp1" }, + {IRIS_VPP_GATING_CLK, "vcodec_vpp0_vpp1_gating" }, + {IRIS_APV_HW_CLK, "vcodec_apv" }, + {IRIS_BSE_HW_CLK, "vcodec_bse" }, +}; + +static const char *const hawi_opp_clk_table[] =3D { + "vcodec0_core", + "vcodec_apv", + "vcodec_bse", + "core", + NULL, +}; + +static const char * const hawi_pmdomain_table[] =3D { + "venus", + "vcodec0", + "vpp0", + "vpp1", + "apv", + "mm-int", + "cx-int", +}; + +#endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu5.c b/driver= s/media/platform/qcom/iris/iris_platform_vpu5.c new file mode 100644 index 0000000000000000000000000000000000000000..0240b4dad6ad483feaad480a35c= 365c7a211ac42 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu5.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include "iris_core.h" +#include "iris_ctrls.h" +#include "iris_hfi_gen2.h" +#include "iris_hfi_gen2_defines.h" +#include "iris_platform_common.h" +#include "iris_vpu_buffer.h" +#include "iris_vpu_common.h" + +#include "iris_platform_sm8550.h" +#include "iris_platform_hawi.h" + +static const struct iris_firmware_desc iris_vpu50_p2_s8_gen2_desc =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu5x_buf_size, + .fwname =3D "qcom/vpu/vpu50_p2_s8.mbn", +}; + +static const u32 iris_fmts_vpu5_dec[] =3D { + [IRIS_FMT_H264] =3D V4L2_PIX_FMT_H264, + [IRIS_FMT_HEVC] =3D V4L2_PIX_FMT_HEVC, + [IRIS_FMT_VP9] =3D V4L2_PIX_FMT_VP9, + [IRIS_FMT_AV1] =3D V4L2_PIX_FMT_AV1, +}; + +static const struct icc_info iris_icc_info_vpu5[] =3D { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const struct bw_info iris_bw_table_dec_vpu5[] =3D { + { ((4096 * 2160) / 256) * 60, 1608000 }, + { ((4096 * 2160) / 256) * 30, 826000 }, + { ((1920 * 1080) / 256) * 60, 567000 }, + { ((1920 * 1080) / 256) * 30, 294000 }, +}; + +static const char * const iris_opp_pd_table_vpu5[] =3D { "mxc", "mmcx" }; + +static const struct tz_cp_config tz_cp_config_vpu5[] =3D { + { + .cp_start =3D VIDEO_REGION_VM0_SECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x0d000000, + .cp_nonpixel_size =3D 0x25000000, + }, + { + .cp_start =3D VIDEO_REGION_VM0_NONSECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x32000000, + .cp_nonpixel_size =3D 0xcdc00000, + }, +}; + +const struct iris_platform_data hawi_data =3D { + .firmware_desc_gen2 =3D &iris_vpu50_p2_s8_gen2_desc, + .vpu_ops =3D &iris_vpu5x_ops, + .icc_tbl =3D iris_icc_info_vpu5, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu5), + .clk_rst_tbl =3D hawi_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(hawi_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu5, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu5), + .pmdomain_tbl =3D hawi_pmdomain_table, + .pmdomain_tbl_size =3D ARRAY_SIZE(hawi_pmdomain_table), + .opp_pd_tbl =3D iris_opp_pd_table_vpu5, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu5), + .clk_tbl =3D hawi_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(hawi_clk_table), + .opp_clk_tbl =3D hawi_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xffc00000 - 1, + .inst_iris_fmts =3D iris_fmts_vpu5_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu5_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D tz_cp_config_vpu5, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu5), + .num_vpp_pipe =3D 2, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D NUM_MBS_8K * 60, +}; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index be8a102e239c34620d540c54f1f034a9236da7a7..8bfef0df073765d603ada4b06b0= 7162b76067ed7 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -427,6 +427,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,hawi-iris", + .data =3D &hawi_data, + }, { .compatible =3D "qcom,maili-iris", .data =3D &maili_data, --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 8EB733A9637 for ; Wed, 23 Sep 2026 03:28:49 +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=1790134132; cv=none; b=TD7qbR+lGq3LvkQyYvD5MSisDiPGHirxe2S+E7RkyHehCzGMg1BV7oCTCKcwgFRLz8mC04XiG1CyO1MhRJ2DWkKrDXdhi+Sc6JFdVFQt1wucJKnGRV9ONGoMwBuQjwO3NQH8u5hIQvibex4vW2jKqNxuBexbJxUvTBGETzNzqtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134132; c=relaxed/simple; bh=XIbh0A0n8yoCCDWKUVXL1zSwiF9pQIz0PM7OrHTUx0A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ISBND1aaU8bTCXPVkM8eI72srMgnXAalgB09jpJut/AJAl/WH4e9EmXcewHsk8WeGwYYOSngEtCkzO77Daqr8Oy3UkB3YuCB7pzKb2pAGQbgQjqV2aTD5rGjxsMbjC1c7UCErjngARllzL9N/7boWRN72wfyDy2mWGQWL0sxJrg= 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=R+wdzf2r; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TwQJXVZR; 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="R+wdzf2r"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TwQJXVZR" 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 68MJBm783897644 for ; Wed, 23 Sep 2026 03:28:49 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= M/phS+itLBeRjhg/R8jZ2IfOoTAgnhICtkcRDhfw1qY=; b=R+wdzf2rNsnf4XB5 JC/b4s1lbtPnQIxjO7WPlaZQ6P1suN+zBpT1PBQeKltgK/UlhYT7yy65ypycmBcI WrdtHFN2OXl0DgYP5m3scSw3VoC1a7luetY5XRb170Ob5zWvOO0Laxa6YZ/2j6di JhuefL+bZPEAC9h1lvy3QbS/UZioRSqlMbVPSTm+qB/n0sm/nGzEok2nwH5/NwSu hjXobM0msmmHcJ3ubjdwtZN40ari248leikyjbmjlqoWKYZu7r3/Iz5+iAcN7aLr cMRdwRSugDW+/SDEh7ZeOxeS/PXKFQiyp3dO3pfKqR555aVa9yEXUwrll1ua9AII 222Seg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4guyma1s5v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:48 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d55d8cd938so7269595ad.1 for ; Tue, 22 Sep 2026 20:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134128; x=1790738928; 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=M/phS+itLBeRjhg/R8jZ2IfOoTAgnhICtkcRDhfw1qY=; b=TwQJXVZRnuhNJJ/6wgSgIalkl3AT/I3BYK4K0tnCfenrUK0YjO4w0tJcHuQzpMneFa f+35vaEeoGKiEJQG1/vAp0rizDqIetISNqpFG0d2aCNJlaK6SPrO5Jh70C/Yj903clGt aVvw60KRHT+sdpP1utHjzeEuTrPVYdF6tp5F/Qg/C2dKiQ65FIFBs2tUhfL8d2n8cH5h oHYuuXKTYyWglORiu6IYLpzVzhM6RcHnpbhnBHRYgbD6zTOrFrRnpFHcgtKUixEHNI+G zAJXxnS40Bo0jvkqwHk96fWnxEAg/S5TtzkOwzz5JumKLFNSIEGi4sKI7xxjeydRHW4a px3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134128; x=1790738928; 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=M/phS+itLBeRjhg/R8jZ2IfOoTAgnhICtkcRDhfw1qY=; b=0/u66SLE9hPfz4Ef7NKjPjDU1zH6cPBdECSVMZ5C52dgu41eggJVIbNWY6wtuAlyAC 0u/BjUtNRZpLLFUOt4ojO5NmHemFNDIj4nBG7Vrmh1U6qwKimTb6oXDswyyzw1Kj1OIk XTkTXRoCBUMemNMmt8R8OY0ZruSVZO7o6UxxGkG11oC5V+JPqlzYmTjbsXerVaFx0d7f 4l8LCi9zcjoEbmXOhVJicipVNBJZOJu+vHLtfiVPGGupor0OgQgY8dfXP11nV18J+2H4 c0X4NOpHrWf7AF1GP0mE55qTFBfBdM+3VvYTCPO6cm5vBpQmqnwafEKevBop5GoqxhOj Nw/A== X-Forwarded-Encrypted: i=1; AKwUvBxUOAlL4oCW8xbIhE5nGmSAVtI3+o2lI1stv9Vb3dXupYFIt2D/GJ4N+nRDiBwRcKYwo4yWv8XOyXOBOPw=@vger.kernel.org X-Gm-Message-State: AFuF++lpsjAKQHSCrBFbz8Rc0/m4D1OTgVxZMrs9XnQzZRMi1ELjQdOQ 5PMtYjWoiLX7f8jxtlgnaGlgrWLiVvTSe1jZk55kMldWWZMeeqoOva8+fxyAMG+DvPS7bBvdsrc qzZCvdwDsttVaa4Kc4+1pMuEJULFmkXKek1CZwitHILoQAOpBvym0A0WxteUsGuXvZmM= X-Gm-Gg: AYBFou20JzYWbNe7jIvhwlStXCmvogRXWP3pPjoXGLsHk/Xu1PRaqmX+QQZjLWyKAf7 FLElrGMxrXbnYcwL+Mhj0y7YRZNLB4UwlqH7HZQRcrIeS7c8bboHKf2q4qva0uHlHrRF/XJz/NR A4oeiw7u9BwWB4uLAdZQqshvIgDKhvsEFgT8FYHv842uajTzj9xQLu5rG0+493HmMPwSgmqyCKJ WF2ByyKc8GgBwu0vivt3/A6M+k4KdD28Na9/Ew84jpV9h451kvq7ZLzUEVsgVf5e26HtLorX38P DPCOEmA6QlpOOKpel3EBDwoBI8uBkfLg9kMRwvyOBybixBZ2FIHTsGQ10J3RJjF0X3E2HZR24dJ PE24fAQJ35caWPdJa1deP5L5b9FqFuyyFUYiJdmYQXfwvIXaDTdzYCZvNdgoUsfa3uiKlPUh1ak T0kRsNFzu7 X-Received: by 2002:a17:902:f551:b0:2dd:c100:942d with SMTP id d9443c01a7336-2df69dec1c9mr10852865ad.43.1790134128107; Tue, 22 Sep 2026 20:28:48 -0700 (PDT) X-Received: by 2002:a17:902:f551:b0:2dd:c100:942d with SMTP id d9443c01a7336-2df69dec1c9mr10852615ad.43.1790134127639; Tue, 22 Sep 2026 20:28:47 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:47 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:56 +0800 Subject: [PATCH v2 6/7] arm64: dts: qcom: hawi: add 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: <20260923-add_iris_for_hawi-v2-6-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=5477; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=XIbh0A0n8yoCCDWKUVXL1zSwiF9pQIz0PM7OrHTUx0A=; b=1ZAswR2/0ecJqOaJVAmX2zc3+C7dnskRcqAny8Bklp5Zp2pfC0GWddBXni6wyxmMmmyWVwRMz TLl5eDAADs+DMzBBEHSOizyMlO5aqyQcJwwQ23E6sGymCcFitrL37P1 X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-ORIG-GUID: v-icABsjPiHU3mFatKyBGLn-pxO9n9rO X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX27pzM7udrI+q buvOvKsmBeEM8WwY2OCjNhIMSv/PRnd538mhk/3Ahd0Lcvxzy9Ql/dDkF4vU4GlMUTD9BKLjMYv ZYAmnFA/H2Lqz//++1wEYVKAcFXQ6zc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX4JEYcGnYe+T+ yheAZYP++PVcAqS7qPyd1fCBkrEPifFw7Wt+p8GQmmmejsvJVFDPFXItuKF+9ozjgqDY7tpIguz e0Xjsq500iyb14HwriCF7/fTurJvJzp+e+JCzGM/2TMdvfAC1R3H9GfzqroRJNmkxUDaIeWjfcp /k3SQIIXRuzC9pxeTxnmmUW8z7MubqaFJqSMJTD/Jmp2k1fZBLND9+VDJFsbwnpODwusCMZKpno HCqaGGfU11VjxxsQFbIPyU08xolr8CA1trWmzrrWfhI6wNfMFAow2etKuOno6KdgP1jBmbdnw9B ikPMSlSS/cwNEuIhdFSq87Hu4/VyXweJnlme1aawcMTjhigFNNU3CDTi2wry7nL4DOfQmm/A1/r wogzPKZ09pHVWMg3ULz9jdo6Caf2U/wIOq/xzxqHLCVVIPgaOD39DCPc1thhf/VvLlrN4uiQRgh Hi0DD+EIhMHU3ux2SaQ== X-Authority-Analysis: v=2.4 cv=N828hG9B c=1 sm=1 tr=0 ts=6ab34770 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==: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=qJL271BKxqclmSQN1U8A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-GUID: v-icABsjPiHU3mFatKyBGLn-pxO9n9rO 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 impostorscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 Add the iris video codec device node for the hawi SoC, describing the register space, interrupt, nine power domains (including the VPU5x-specific mm-int and cx-int domains), thirteen clocks, two interconnect paths for CPU config and video memory bandwidth, IOMMU mappings, and the operating point table covering 150 MHz through 1000 MHz. Signed-off-by: Wangao Wang --- arch/arm64/boot/dts/qcom/hawi.dtsi | 155 +++++++++++++++++++++++++++++++++= ++++ 1 file changed, 155 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/hawi.dtsi b/arch/arm64/boot/dts/qcom/= hawi.dtsi index c7ae8133b9cdc88133f6dccdf87bfa8bc88677e1..dbd13c9aa10fb4230c226a207b2= 78e8ca698a92a 100644 --- a/arch/arm64/boot/dts/qcom/hawi.dtsi +++ b/arch/arm64/boot/dts/qcom/hawi.dtsi @@ -3421,6 +3421,161 @@ ice: crypto@1d88000 { power-domains =3D <&gcc GCC_UFS_PHY_GDSC>; }; =20 + iris: video-codec@2000000 { + compatible =3D "qcom,hawi-iris"; + reg =3D <0x0 0x02000000 0x0 0xf0000>; + + interrupts =3D ; + + power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc VIDEO_CC_MVS0_VPP0_GDSC>, + <&videocc VIDEO_CC_MVS0_VPP1_GDSC>, + <&videocc VIDEO_CC_MVS0A_GDSC>, + <&videocc VIDEO_CC_MM_INT_GDSC>, + <&videocc VIDEO_CC_AXI0_CX_INT_GDSC>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vpp0", + "vpp1", + "apv", + "mm-int", + "cx-int"; + + clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, + <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0C_CTL_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0C_DEBUG_CLK>, + <&videocc VIDEO_CC_CX_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&videocc VIDEO_CC_MVS0_VPP0_CLK>, + <&videocc VIDEO_CC_MVS0_VPP1_CLK>, + <&videocc VIDEO_CC_MVS0_VPP0_VPP1_GATING_CLK>, + <&videocc VIDEO_CC_MVS0A_CLK>, + <&videocc VIDEO_CC_MVS0B_CLK>; + clock-names =3D "iface", + "ifacec", + "core", + "core_freerun", + "core_ctl_freerun", + "core_debug", + "cx_iface", + "vcodec0_core", + "vcodec_vpp0", + "vcodec_vpp1", + "vcodec_vpp0_vpp1_gating", + "vcodec_apv", + "vcodec_bse"; + + operating-points-v2 =3D <&iris_opp_table>; + + interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY + &config_noc SLAVE_IRIS_CFG QCOM_ICC_TAG_ACTIVE_ONLY>, + <&mmss_noc MASTER_VIDEO_MVP QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + memory-region =3D <&video_mem>; + + resets =3D <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_CTL_FREERUN_CLK_ARES>; + reset-names =3D "bus0", + "core"; + + dma-coherent; + + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xffc00000>; + + status =3D "disabled"; + + iris_non_pixel: non-pixel { + iommus =3D <&apps_smmu 0x1540 0x0000>, + <&apps_smmu 0x1620 0x0000>, + <&apps_smmu 0x1544 0x0000>; + iommu-ranges =3D <0x32000000 0xcdc00000>; + }; + + iris_pixel: pixel { + iommus =3D <&apps_smmu 0x1543 0x0000>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-150000000 { + opp-hz =3D /bits/ 64 <150000000 150000000 + 150000000 225000000>; + required-opps =3D <&rpmhpd_opp_low_svs_d2>, + <&rpmhpd_opp_low_svs_d2>; + }; + + opp-285000000 { + opp-hz =3D /bits/ 64 <285000000 240000000 + 240000000 360000000>; + required-opps =3D <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs_d0>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 + 338000000 507000000>; + required-opps =3D <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-420000000 { + opp-hz =3D /bits/ 64 <420000000 420000000 + 420000000 630000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 + 444000000 666000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-560000000 { + opp-hz =3D /bits/ 64 <560000000 533000000 + 533000000 800000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-630000000 { + opp-hz =3D /bits/ 64 <630000000 630000000 + 630000000 1104000000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo>; + }; + + opp-800000000 { + opp-hz =3D /bits/ 64 <800000000 710000000 + 710000000 1260000000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo_l1>; + }; + + opp-1000000000 { + opp-hz =3D /bits/ 64 <1000000000 710000000 + 850000000 1260000000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo_l3>; + }; + }; + }; + videocc: clock-controller@20f0000 { compatible =3D "qcom,hawi-videocc"; reg =3D <0x0 0x020f0000 0x0 0x10000>; --=20 2.43.0 From nobody Thu Sep 24 14:28:07 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 ACB6C3AC0FB for ; Wed, 23 Sep 2026 03:28:54 +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=1790134136; cv=none; b=OxjEapveGwSUxsfE0zfYB+5PaB7O50Sy1ZfZCQN+owF/YFOyLg+sPNuDEfAgqQF6rdqgfDO0HUAun1pxlA6y1mHQov1zy7876GuEb5sRrcg9J9lbEPm8AaWJhKFqqCb+aBAM3Jk4cm6DEXMqoV1bqttp0OJZcYbqD+17n/+iVZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790134136; c=relaxed/simple; bh=lVtM4gNQhK5diSNalLrFRgiXw9n7yN3qfT1UFSHTtgk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A+GGt6MZG+jM8CMY1V7CSnA/awej8Qse5iavQfbdUE/OUs/c8rj1VWYdeyiXxUlt71TfzevnQ5VptUH/ARUuUyBsXu1rrrY2Y2PRvjmcaYszUBYxZxPHhb6DUBd3Fw7IWt8qCio0NfKlLEZWPhx+TITz71m0uGq/VX4N29vdCA0= 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=BSOHTU7p; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KcrH878M; 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="BSOHTU7p"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KcrH878M" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68N37djf368041 for ; Wed, 23 Sep 2026 03:28:54 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= XtMmYfH53gR4AdhKWOmoFIiBUnMjy+NZFN/cLLiTJsQ=; b=BSOHTU7pFuhEYs/s YLTwu9uZD5YigWvPekC7NNam7057b6Vdz6v6OqwWKU/ELcRnY/SAXvgbtu3iSx86 lpvq3NsWJQXORsDCfjA1V1O3CpPyHr1LTinvqEOruJqs2NhRu+jk/E/xUuQ+oOdT /Tpkv68Gu/8J4QKqEC32fdiUVSNnY1MMstXQeAbPNM1etNg3PpaYBex1io8+wivY 29v5hh0tRtCHNYXka4FLQfiTS/w24x4DZnfuZ+Hkll8eBrwMokEy3Em8B1UJP5cn LaLGnYimmijtutn9OG4inpaQbOyKTR5lfG3C9Hw2D5J2AoXuwK3thBms+LJh5Rap ZyGIbA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gurntc6ff-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 03:28:53 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d94f086fedso5178115ad.1 for ; Tue, 22 Sep 2026 20:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790134133; x=1790738933; 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=XtMmYfH53gR4AdhKWOmoFIiBUnMjy+NZFN/cLLiTJsQ=; b=KcrH878M8FGB23U6eQlkdJXrG4Se1Edw9GbEOvfxCfMnSpHQY03QaxL4aJSNA7LqQU Y5aWt+EaX3+yv+31Xagyq+gy+8kL+mXMAHe4QKRRRmkjvl2C+C7sH92muN4s+2nDpVnv vWlxbfs9FbeJ/t2Um8kbdUjFgDMDwNQI2tZ/uePa73OTHfDqVA9byzw9OUhvh72iDe2p X+Q1/lu11ZuZBwQy0k0C3qy68cuLvIuFVHBsEHMjW1UzDtOkMaKd6rPmvGYq/SfaA6fz AixIwPM09xGp4QCjyCqlW/KqfcLX3NbiWUwHmz+9zA4TNtOa8rCxslVUMwxC7NHdoi1F Pqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790134133; x=1790738933; 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=XtMmYfH53gR4AdhKWOmoFIiBUnMjy+NZFN/cLLiTJsQ=; b=QTcYlYY6YNukHg5rGTYerDTsI5kMyoKLY31CW8lLiNU0CYsBg5TqBwMYtSXmbAChC1 wOaCHPbrmUpCoFsjNDmgkAhXnJW8GAyMzTCqiXXbDpBkYrD006WV9Un+KYib0xUS+UPa lLCJtuq9qZPzjNErgTwNLgr/DJIiKWhGu0YREpjikFyQ9y2NqRtuuDoIKUI9OsfqtU72 bIQi4zLcgeKNcFIU4FxedknJz46KxRTpjk/Aayd3HH1pxLjBOKcrDtXqrq3sgrQxT6hy VKl3HZtDJ/A1lvwCMFLfgIkcah+1qJsoYTLoOrhdhfktsLb8DNnReeMV1FcvI8EzFVbg xz3w== X-Forwarded-Encrypted: i=1; AKwUvBy5bOMcCI7e0ycDz8iCbQXZ6QOqMQ0PE6PI3rKiJfzL2wtpNJCuSSNZQZ+OzL0AzrB0b/VabaH+zqlZUfE=@vger.kernel.org X-Gm-Message-State: AFuF++mmImzp4XbD+4EUj1B2sVC94ePqjTap7kfoeI+GMKt91/4D7Vd8 sQIxkvREXSiHba2XC63nPKEkYQHKNQfq2F30LpTPWI7p4uEWT2q9TccZKqV34LhB6p70LfvqAgE Qeqzx8wRhM+5XZrAx7rI+xsQkKsr/W8msOlUjUhR+WfQ6iNqi+CMjyjmUr/R5U0OROf4= X-Gm-Gg: AYBFou2XC0ajF9GZqj3wB9SBGtPI7ZfWSVEoa2eUSFQwtxqnDNzLASY7iNK758GZq1s b/xWPBBWI1dWIE4yJD18jaUvnytHYtaCnS1AGjSvEVMaqMgJmC91L9z/NfmpJxP0c9wxJRE4PN5 NRyA3iFslieGh31pokJnswqFi4XDHnPzWiUHSFTiS4H89Be2wE4cVQJLI7E4YWMry+IS0NSNAwU ixnMfnS0FDEv7JQTVNnSUQmpy0oOZFeaiBqju4EPKKeP449MsRk5SbLlIFArm+tN0PM4cAHzG9l G9VlPNRK3ze0zKCh38QLMwo2kJrEx5+Q2E8LGm73sKkWKRU2M522O7pypjc+kNPgSOAfTfv8/1/ Am1sCTnxcb2+gJQrf/LoSOQgXc9QfwS/aGWpjkl/GFMeewNo0XeptcWc5yE/aSblaHQFwHIgN1A == X-Received: by 2002:a17:902:ce8e:b0:2dd:c053:ec70 with SMTP id d9443c01a7336-2df69dc7b77mr11286735ad.35.1790134132989; Tue, 22 Sep 2026 20:28:52 -0700 (PDT) X-Received: by 2002:a17:902:ce8e:b0:2dd:c053:ec70 with SMTP id d9443c01a7336-2df69dc7b77mr11286495ad.35.1790134132491; Tue, 22 Sep 2026 20:28:52 -0700 (PDT) Received: from WANGAOW-LAB01.ap.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2df6a5c3733sm3603525ad.41.2026.09.22.20.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 20:28:52 -0700 (PDT) From: Wangao Wang Date: Wed, 23 Sep 2026 11:27:57 +0800 Subject: [PATCH v2 7/7] arm64: dts: qcom: hawi: enable iris on mtp board 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: <20260923-add_iris_for_hawi-v2-7-016ec3d24b79@oss.qualcomm.com> References: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> In-Reply-To: <20260923-add_iris_for_hawi-v2-0-016ec3d24b79@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Abhinav Kumar , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Wangao Wang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790134092; l=638; i=wangao.wang@oss.qualcomm.com; s=20251021; h=from:subject:message-id; bh=lVtM4gNQhK5diSNalLrFRgiXw9n7yN3qfT1UFSHTtgk=; b=//rqu5HQQtquSPF4r4bzuxK1mF38mMhJ/UBBRtYKaUQ1NeAzTJb1rFds/rxI7zQ9T6sZpGovL lnf9Kyi0FglAyYnzaH2youZIEsV390V0BINAWqGKvs6L00HawZa+vcz X-Developer-Key: i=wangao.wang@oss.qualcomm.com; a=ed25519; pk=bUPgYblBUAsoPyGfssbNR7ZXUSGF8v1VF4FJzSO6/aA= X-Proofpoint-ORIG-GUID: tnPfdou8NfFMeOhkPskcHn8RNxLilpgH X-Authority-Analysis: v=2.4 cv=eauo7LEH c=1 sm=1 tr=0 ts=6ab34775 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=ZfE5abJMpLnrTF1vLU4A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfXygah1hL6/xTs 1hUHMUIjjnt1daPB7i2TgNf/jSNwPilFkt/4ez4JSuzTy4PzEeuA8HQM3khA0Zg4DRqJmwNpvVT DmO8mJVOE2UyLMAQ2IETpVifJDJH6N7sJWG/ePh+1KSkocyXpTfjpxwjox7emoNVXhtdq8AExUr BCgQzKdQ5fj66Tr//Hcu3Il78T/oMvnF27QVGaLf24QA3KemMUX0wksTG8neprBTYCzl8yMjGnj 7KD3XghaSwbRd6wt0gjX8RgEL4ez5T+0jX1jT5dk0OKCPL+e0E5Eb1AqYFgEEQVY0wp0YGqYuek 1kCj4tQEaMIlO2cQnDNT5GXm8MfOoVqvrfqtrieg6OjSm58s6ShIoVv9ay8y6/I7vkOeJX3dykM aL0ZuCoeTAiyIzjfyY8Y0vglHzvqyzslxA55RtLITr9m2JtpgPLqZFAkVXCboikSOJZBQ1XY4VW QxgLWD50nYD8Lvj+x0Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDAxMyBTYWx0ZWRfX3/CVxL0pT8AT kGRuQ9xnPVbQEyOYpx/cjuysYSRLRrHhbcK7TafphRk4HY+wNKKya8SrIHB82hrAE6B1c6PoNPz ea9G2lKLy88Xn0J7HO56c6ZQqKIPchY= X-Proofpoint-GUID: tnPfdou8NfFMeOhkPskcHn8RNxLilpgH 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-22_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230013 Enable the iris video codec on the hawi MTP reference board. Signed-off-by: Wangao Wang --- arch/arm64/boot/dts/qcom/hawi-mtp.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/hawi-mtp.dts b/arch/arm64/boot/dts/qc= om/hawi-mtp.dts index 7709582491f9d426886a6afced6d3706b629e620..9b8616221b9c0d227f2ec97363b= d4c076d8dc247 100644 --- a/arch/arm64/boot/dts/qcom/hawi-mtp.dts +++ b/arch/arm64/boot/dts/qcom/hawi-mtp.dts @@ -781,6 +781,10 @@ vreg_l7n_3p3: ldo7 { }; }; =20 +&iris { + status =3D "okay"; +}; + &pcie0 { status =3D "okay"; }; --=20 2.43.0