From nobody Mon Feb 9 08:14:37 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 96FEE2F60A1 for ; Mon, 13 Oct 2025 02:09:18 +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=1760321360; cv=none; b=hDSEW8/f+hpPnA7pfG+viFNpW88ipxpbtvjLxm5s1IoHkur+dl+kAyao9UToIhYyympXVFA07Baqu4YDLGy4YCvJ8XGNOEVL/JEraefb/3b6/6x7R3rHSTUkenmfhmdJEDMRwxKS6ruB0fUYae8Wi/hQ94y5swz7KeMlJhb5GQo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760321360; c=relaxed/simple; bh=6FRZ1CpC3MU/4n9iRxLNrUmwxEaMlpAnTQZio3HCtrQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hL6i7MOaEb3eMk+f5ytHXBHI+gGTyIukc7e54/t+4L6tzIHuk+GgnQs8m5goV0dnkjaTjuEdhJA+O1zvfkjnSzNSm6Gx8lBQaqpyQ2G27/ODmnPx342d0H43INmYflzPffWlgNaYWRSitsGRgTMKcf1wsNkUtStLESReNcUXkF0= 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=TXUfPjkm; 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="TXUfPjkm" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59CLsrTF000713 for ; Mon, 13 Oct 2025 02:09:17 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= nBL4RMDsP9fvHNxUhltDF9qa+M/Bza/qq9I2lxvJDRc=; b=TXUfPjkm6dLisSMK I4qqGf9K4FjnrWLmDVqSHz9fHVURTSw0vzRDb8vItmSziK4i9z7sKVUAwqg92FlJ IJ3y8m/siEWyyAO/jOyxsHp50rD7JDuTety+cDFwuumnqpXMcZHSi7zioIyxufU6 406Xi1nBSsSmQK51jUyznDvbnMUj1hmpQIKUjfN2pl2ot3lO0lopxpO0yDkenhu7 uxvWnQBSfkKIJT5MMs2K7qy1YuomAYyZ/LY1UxNOujDySvYAYaTZqGCQhwyGHZCQ 1tUNs+vk/dOmH20Tx7Q6X4cwQnNdwdQDsrjvIuvF8ni6r2KkPhjXp39ju1+dLoXQ TfRNZg== Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49qgdftv14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 13 Oct 2025 02:09:17 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-78ea15d3548so87457786d6.1 for ; Sun, 12 Oct 2025 19:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760321355; x=1760926155; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nBL4RMDsP9fvHNxUhltDF9qa+M/Bza/qq9I2lxvJDRc=; b=QHQxbRNLZcm2a1OF3u8zsQ8UkNtiR5RjlxlmSAogp2E8vMYQwxz0gaj3N0ql0iGrRa N419VgpaWLKTpcKbJ1993wqHwrvWJIjd/YP+0A5LHNjMIkQ6SjgXdovkufq8qMoHZKdU N0Cw1pGdt7huVRIbxdn7Joy/h87ZtmKeQ4C0WmfwML7fMKey0SS36nYabMV9QS8KwKH5 PD0rlf4rZuqRpPnmUcelGVkwQLk69VncWLAV08awtkNs/QrkXSsCWeQWqsMO8vMryfmZ hQYUJqieVzv9Pl5gTuyGqD5e0jAVpRIgl3ZxEUOhqEP9CZY7MvAsiZJXClVyfJhqcOGe 77Uw== X-Forwarded-Encrypted: i=1; AJvYcCXvNZkhe9NLuUQCpo/7yStIax1MwP17TYiQhF0w8kAXkJCHQLmw8sTQOjOxj+dWLG0y306kI6dZlu6ElQw=@vger.kernel.org X-Gm-Message-State: AOJu0YzoYHlCkFDSIv7o6/LGTglw8yS1nksdtmd68/CuTI/uOAtuI2qo +PiFdB4P6v0ua9VOunG+pDCf4YwNMCjHP+Wwl/kr9wG+PqJV+hIJArg9GD/prLKQmnTVuKGXybo vKKg8CMzcNRhEhvwWOxfkTbe2T4NswrRsTUk1jtgypwhJL/QUY/2uGKe4igO7nY0EFs0= X-Gm-Gg: ASbGncuASrMEvnFCsmCZLpj1dM7trs9MF+c7Q48oBwc4DzYBi5b4rlmPQWu1j859aXJ 7Bszbtv0OdRCKR3MWsj/FzGkI7syzGHG+cKTHoMEsdGzq1AoIstXRpNgnqQbHcwI9eeWt2CWp+U we0pwsJxbP764U4Iw8MBaphcdovhgtqv9lWa6uJut82lfAc0VhyV9Lp6Y5ebuuSdcNDaA0n1JqW CJz975ecUPVmnm5plGnPonVo/+0ZsEFKDmZoUT6FwBnNxTu4XpT7UucUBf6ScFZZojl/6G13otu 4L8Oz3P6wnB+2AwrZNzUIZngUWa+7IjfXXAen/TKPaIbE6Xyjz6nzyr5rUm95RsYE4YIc+Q6afl HIY7JIMjs9PYSsJ3uILPCzS/o8Gz1u2hcHfKJFWVUHC/AWIREQDPX X-Received: by 2002:a05:622a:1982:b0:4dc:1e47:ebe8 with SMTP id d75a77b69052e-4e702e32607mr171331141cf.61.1760321355133; Sun, 12 Oct 2025 19:09:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqtvda7Z3Iqyd6KoSZZtpknRNnLsY2ZEhR4nfog4F7Zc3no+ojUZC1laU2qNnZB62byz4tZA== X-Received: by 2002:a05:622a:1982:b0:4dc:1e47:ebe8 with SMTP id d75a77b69052e-4e702e32607mr171330961cf.61.1760321354613; Sun, 12 Oct 2025 19:09:14 -0700 (PDT) Received: from umbar.lan (2001-14ba-a0c3-3a00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a0c3:3a00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-590881e4f99sm3563419e87.7.2025.10.12.19.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Oct 2025 19:09:13 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 13 Oct 2025 05:09:02 +0300 Subject: [PATCH v3 8/8] media: iris: enable support for SC7280 platform 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: <20251013-iris-sc7280-v3-8-f3bceb77a250@oss.qualcomm.com> References: <20251013-iris-sc7280-v3-0-f3bceb77a250@oss.qualcomm.com> In-Reply-To: <20251013-iris-sc7280-v3-0-f3bceb77a250@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=11511; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=6FRZ1CpC3MU/4n9iRxLNrUmwxEaMlpAnTQZio3HCtrQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBo7F86nxhtV+jjO6P5EDwG5509ovKDwPSze4oD/ JXapNb15E6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaOxfOgAKCRCLPIo+Aiko 1VfGCACM/e3+OmeAtEEDdB19BpYFg01/Vt5gGkk1oHjd6N08T8shbRUxhnA29jMNF3dd8VRFOWa saq7aM+1o9ddz80lIJU/8Hva23AXB3+Blzuqf2rGsoC7ajYshvJL74OkNMv5NPPVHmeCjQjhPzz SKCjHavG+nvTDKQUjGb+MM/EkOFnsbqxHi4DdHXfmLCd+IWx65aOopgNf+v0R3pGFz0CP2k0oby ZncF0tzf1dduA7dIW3rqSRhfFTW4G72BbDXwmKd6r2BBWd6CdAzv5OSzg0h3Iq+dRmmg6Wkiiur 4EbmzLGNxKf+JDIzX3hME6p9G4KmzoCqKNS19hXv71RvJSLw X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAyNSBTYWx0ZWRfXzLGdBXjxj5Yp wduZVIVnHphEgWZDl+nhcHTB/TWdF92TnFFX06xuC3ulyDIt2mXCOrz3E5LQdAwvfNYDd76L6Ys kIeftFykerIPIbs+Ahwjm32kfbKWSpduX54lf7COGIdZ1LJa+OlLJ5HceNMkCG/2deMCvBw8+u4 yOVkbXn9536O5ubNNERsgY7cNhx2tvvk5cVv0KS7gKEENNYxudsy5DEZu8OKD5vZuMBNxZ0jlTi m6qn9xH9dGdO1Q0Nc1OUQndcv554A3T1BqYLYpLQt6axllO2eVqHrxXRvSsTBlw5n3M3CRxppRh 4o5hIXpKBVq/5/J+HEtsc2rVwLtfmEymwi0aociuAykbzD9GhctX2VhJF7EJJBvKJmI2srJ6k9V CPvdHkVANElVO1+jOgNjbCDsyXvNNA== X-Proofpoint-GUID: J40l1ATw9OeL1s967bQNlbtfghjjHjpu X-Proofpoint-ORIG-GUID: J40l1ATw9OeL1s967bQNlbtfghjjHjpu X-Authority-Analysis: v=2.4 cv=J4ynLQnS c=1 sm=1 tr=0 ts=68ec5f4d cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=EUspDBNiAAAA:8 a=pG0Ruh8lDxDpiiRDS04A:9 a=QEXdDO2ut3YA:10 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-13_01,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110025 As a part of migrating code from the old Venus driver to the new Iris one, add support for the SC7280 platform. It is very similar to SM8250, but it (currently) uses no reset controls (there is an optional GCC-generated reset, it will be added later) and no AON registers region. Extend the VPU ops to support optional clocks and skip the AON shutdown for this platform. Signed-off-by: Dmitry Baryshkov --- .../platform/qcom/iris/iris_platform_common.h | 4 ++ .../media/platform/qcom/iris/iris_platform_gen1.c | 52 ++++++++++++++++++= ++++ .../platform/qcom/iris/iris_platform_sc7280.h | 27 +++++++++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 ++ drivers/media/platform/qcom/iris/iris_resources.c | 2 +- drivers/media/platform/qcom/iris/iris_vpu2.c | 6 +++ drivers/media/platform/qcom/iris/iris_vpu_common.c | 34 ++++++++++---- 7 files changed, 119 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 104ff38219e30e6d52476d44b54338c55ef2ca7b..43cd6bf94ab600e53f983c9e11b= 63dc0a572e6ad 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -42,6 +42,7 @@ enum pipe_type { }; =20 extern const struct iris_platform_data qcs8300_data; +extern const struct iris_platform_data sc7280_data; extern const struct iris_platform_data sm8250_data; extern const struct iris_platform_data sm8550_data; extern const struct iris_platform_data sm8650_data; @@ -50,7 +51,9 @@ extern const struct iris_platform_data sm8750_data; enum platform_clk_type { IRIS_AXI_CLK, /* AXI0 in case of platforms with multiple AXI clocks */ IRIS_CTRL_CLK, + IRIS_AHB_CLK, IRIS_HW_CLK, + IRIS_HW_AXI_CLK, IRIS_AXI1_CLK, IRIS_CTRL_FREERUN_CLK, IRIS_HW_FREERUN_CLK, @@ -230,6 +233,7 @@ struct iris_platform_data { u32 hw_response_timeout; struct ubwc_config_data *ubwc_config; u32 num_vpp_pipe; + bool no_aon; u32 max_session_count; /* max number of macroblocks per frame supported */ u32 max_core_mbpf; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/driver= s/media/platform/qcom/iris/iris_platform_gen1.c index 2b3b8bd00a6096acaae928318d9231847ec89855..828864902501aef072d60935fe5= 7019a70dcb9f4 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c @@ -12,6 +12,8 @@ #include "iris_vpu_buffer.h" #include "iris_vpu_common.h" =20 +#include "iris_platform_sc7280.h" + #define BITRATE_MIN 32000 #define BITRATE_MAX 160000000 #define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2) @@ -364,3 +366,53 @@ const struct iris_platform_data sm8250_data =3D { .enc_ip_int_buf_tbl =3D sm8250_enc_ip_int_buf_tbl, .enc_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8250_enc_ip_int_buf_tbl), }; + +const struct iris_platform_data sc7280_data =3D { + .get_instance =3D iris_hfi_gen1_get_instance, + .init_hfi_command_ops =3D &iris_hfi_gen1_command_ops_init, + .init_hfi_response_ops =3D iris_hfi_gen1_response_ops_init, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu2_ops, + .set_preset_registers =3D iris_set_sm8250_preset_registers, + .icc_tbl =3D sm8250_icc_table, + .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), + .bw_tbl_dec =3D sc7280_bw_table_dec, + .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), + .pmdomain_tbl =3D sm8250_pmdomain_table, + .pmdomain_tbl_size =3D ARRAY_SIZE(sm8250_pmdomain_table), + .opp_pd_tbl =3D sc7280_opp_pd_table, + .opp_pd_tbl_size =3D ARRAY_SIZE(sc7280_opp_pd_table), + .clk_tbl =3D sc7280_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sc7280_clk_table), + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu20_p1.mbn", + .pas_id =3D IRIS_PAS_ID, + .inst_caps =3D &platform_inst_cap_sm8250, + .inst_fw_caps_dec =3D inst_fw_cap_sm8250_dec, + .inst_fw_caps_dec_size =3D ARRAY_SIZE(inst_fw_cap_sm8250_dec), + .inst_fw_caps_enc =3D inst_fw_cap_sm8250_enc, + .inst_fw_caps_enc_size =3D ARRAY_SIZE(inst_fw_cap_sm8250_enc), + .tz_cp_config_data =3D &tz_cp_config_sm8250, + .hw_response_timeout =3D HW_RESPONSE_TIMEOUT_VALUE, + .num_vpp_pipe =3D 4, + .no_aon =3D true, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K, + .max_core_mbps =3D ((7680 * 4320) / 256) * 60, + .dec_input_config_params_default =3D + sm8250_vdec_input_config_param_default, + .dec_input_config_params_default_size =3D + ARRAY_SIZE(sm8250_vdec_input_config_param_default), + .enc_input_config_params =3D sm8250_venc_input_config_param, + .enc_input_config_params_size =3D + ARRAY_SIZE(sm8250_venc_input_config_param), + + .dec_ip_int_buf_tbl =3D sm8250_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8250_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl =3D sm8250_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size =3D ARRAY_SIZE(sm8250_dec_op_int_buf_tbl), + + .enc_ip_int_buf_tbl =3D sm8250_enc_ip_int_buf_tbl, + .enc_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8250_enc_ip_int_buf_tbl), +}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h b/driv= ers/media/platform/qcom/iris/iris_platform_sc7280.h new file mode 100644 index 0000000000000000000000000000000000000000..f2dea77f2805f48ab00822fe9d7= 0ffafadc47494 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + + +#ifndef __IRIS_PLATFORM_SC7280_H__ +#define __IRIS_PLATFORM_SC7280_H__ + +static const struct bw_info sc7280_bw_table_dec[] =3D { + { ((3840 * 2160) / 256) * 60, 1896000, }, + { ((3840 * 2160) / 256) * 30, 968000, }, + { ((1920 * 1080) / 256) * 60, 618000, }, + { ((1920 * 1080) / 256) * 30, 318000, }, +}; + +static const char * const sc7280_opp_pd_table[] =3D { "cx" }; + +static const struct platform_clk_data sc7280_clk_table[] =3D { + {IRIS_CTRL_CLK, "core" }, + {IRIS_AXI_CLK, "bus" }, + {IRIS_AHB_CLK, "iface" }, + {IRIS_HW_CLK, "vcodec_core" }, + {IRIS_HW_AXI_CLK, "vcodec_bus" }, +}; + +#endif diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 00e99be16e087c4098f930151fd76cd381d721ce..9bc9b34c2576581635fa8d87eed= 1965657eb3eb3 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -357,6 +357,10 @@ static const struct of_device_id iris_dt_match[] =3D { .data =3D &qcs8300_data, }, #if (!IS_ENABLED(CONFIG_VIDEO_QCOM_VENUS)) + { + .compatible =3D "qcom,sc7280-venus", + .data =3D &sc7280_data, + }, { .compatible =3D "qcom,sm8250-venus", .data =3D &sm8250_data, diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index cf32f268b703c1c042a9bcf146e444fff4f4990d..164490c49c95ee048670981fdab= 014d20436ef85 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -112,7 +112,7 @@ int iris_prepare_enable_clock(struct iris_core *core, e= num platform_clk_type clk =20 clock =3D iris_get_clk_by_type(core, clk_type); if (!clock) - return -EINVAL; + return -ENOENT; =20 return clk_prepare_enable(clock); } diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/p= latform/qcom/iris/iris_vpu2.c index de7d142316d2dc9ab0c4ad9cc8161c87ac949b4c..9c103a2e4e4eafee101a8a9b168= fdc8ca76e277d 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_vpu2.c @@ -3,9 +3,15 @@ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights res= erved. */ =20 +#include +#include +#include + #include "iris_instance.h" #include "iris_vpu_common.h" =20 +#include "iris_vpu_register_defines.h" + static u64 iris_vpu2_calc_freq(struct iris_inst *inst, size_t data_size) { struct platform_inst_caps *caps =3D inst->core->iris_platform_data->inst_= caps; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 2d6548e47d47967c1c110489cb8088130fb625fd..f8fd120873ccdcb5239985d0d6a= 8bbda144a98f6 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -179,12 +179,14 @@ int iris_vpu_power_off_controller(struct iris_core *c= ore) =20 writel(MSK_SIGNAL_FROM_TENSILICA | MSK_CORE_POWER_ON, core->reg_base + CP= U_CS_X2RPMH); =20 - writel(REQ_POWER_DOWN_PREP, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONT= ROL); + if (!core->iris_platform_data->no_aon) { + writel(REQ_POWER_DOWN_PREP, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CON= TROL); =20 - ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATU= S, - val, val & BIT(0), 200, 2000); - if (ret) - goto disable_power; + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STAT= US, + val, val & BIT(0), 200, 2000); + if (ret) + goto disable_power; + } =20 writel(REQ_POWER_DOWN_PREP, core->reg_base + WRAPPER_IRIS_CPU_NOC_LPI_CON= TROL); =20 @@ -207,6 +209,7 @@ int iris_vpu_power_off_controller(struct iris_core *cor= e) writel(0x0, core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); =20 disable_power: + iris_disable_unprepare_clock(core, IRIS_AHB_CLK); iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); iris_disable_unprepare_clock(core, IRIS_AXI_CLK); iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); @@ -218,6 +221,7 @@ void iris_vpu_power_off_hw(struct iris_core *core) { dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , false); iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_unprepare_clock(core, IRIS_HW_AXI_CLK); iris_disable_unprepare_clock(core, IRIS_HW_CLK); } =20 @@ -251,11 +255,17 @@ int iris_vpu_power_on_controller(struct iris_core *co= re) =20 ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_CLK); if (ret) - goto err_disable_clock; + goto err_disable_axi_clock; + + ret =3D iris_prepare_enable_clock(core, IRIS_AHB_CLK); + if (ret && ret !=3D -ENOENT) + goto err_disable_ctrl_clock; =20 return 0; =20 -err_disable_clock: +err_disable_ctrl_clock: + iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); +err_disable_axi_clock: iris_disable_unprepare_clock(core, IRIS_AXI_CLK); err_disable_power: iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); @@ -275,13 +285,19 @@ int iris_vpu_power_on_hw(struct iris_core *core) if (ret) goto err_disable_power; =20 + ret =3D iris_prepare_enable_clock(core, IRIS_HW_AXI_CLK); + if (ret && ret !=3D -ENOENT) + goto err_disable_hw_clock; + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], true); if (ret) - goto err_disable_clock; + goto err_disable_hw_axi_clock; =20 return 0; =20 -err_disable_clock: +err_disable_hw_axi_clock: + iris_disable_unprepare_clock(core, IRIS_HW_AXI_CLK); +err_disable_hw_clock: iris_disable_unprepare_clock(core, IRIS_HW_CLK); err_disable_power: iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); --=20 2.47.3