From nobody Mon Feb 9 12:24:55 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 1B99930F94C for ; Mon, 27 Oct 2025 12:27: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=1761568040; cv=none; b=g9SZE/jBIUl2dYXi2ycS2s54qu5GFRFNvknCC7v0Kcn52UrUIDdzQpb2/xFC3ruHjQ1RuUBaVTO3yiBSKeTfi0ISKv+BszOJTQ+jegiLoUFeClvdXXKf6dXxMJ3XaPg3q84vr0GBMsKVBL4mwDcppAu8jM5e2BtHOSfSoTUNbwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761568040; c=relaxed/simple; bh=t1CBvWMfN655XxZugDbjqKvfK7Hnxfownu0/2DhhsmY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tlg+d8sKPj5+NbVNbo3TKuAuBArCvxY3Z3tiX5nfLSngIc6Uz5YnAz2XIos3nJxIDX7tNLKfXAO0TTB9Hcx8Q6QKI+hhXpSdX22ZvVbi7DOpoj3AjWLkzEm4esgMCbJFd1wALBSKbr6lVLBaTNZMSyhA6slXT4e5g7AhNJWSBeU= 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=U0trSPXy; 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="U0trSPXy" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59R8TNTS1094034 for ; Mon, 27 Oct 2025 12:27:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 2MpDl0eFfP/ikR3TYaMdviZ1gWtY2d9Vvp9INB/JJ+c=; b=U0trSPXyNIT0oea6 RxK+46+sUE1EoR3OmhicughVPRFQ2o80bVtwS56vsv0/o6miDy/DS8v1S6IGeCa/ OY3z9jzmaOgn550iqCOazknstDXPqJSUPEkBRuextQwhZlOYgR/I0sjOFvwTXIIP JK9XrlVA2odf/FqS2xls3s90hcIEYx5koACkTn88kKa7lyjQklX7dCLs1sC77vBh owzMUuggnwnxaQELCiXMaHYAgGSSngUT4+1VPqNhCPFDiXdWAWyQ7eNrpW1cGjEL ufdz/WuoOciPN5EwCrqYfx6K4QWt7i2eu1cuhjkE2vda2O7/VEs2W0A9yiYxy7EH khPGAg== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4a0nnb4kn9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 27 Oct 2025 12:27:18 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4ecf0501ec2so32549581cf.0 for ; Mon, 27 Oct 2025 05:27:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761568036; x=1762172836; 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=2MpDl0eFfP/ikR3TYaMdviZ1gWtY2d9Vvp9INB/JJ+c=; b=esPEOIwuuvbKzNmRPbrayyCEOQ8HBriZt2gu42aLcB1tCNSFGCMTq1afdp6oPDe50c N1Iv4oX0Yk8DRYAw01n0HjzxPLswUh578Y7TG0Zd+4SxAlhjbHfk1sKGmXTrS6HKwHbi Ex8ouKFpjb7X1vuYPvT5BZyoQg9lER+uc3ZEjTeAsM/98fAhihioqnDsyTrqZbPtiVbp MnOnm//0dPPprFSM64nYNAq/gi6vLQ356xRd9EI7wfcjWPBYjYInXwvydOIuFDQwI/P/ iZdFMWe6RO55Mq547I7wDQnN/HQVz5BSczNhIOSVzyjyPC2AO9eYx7Svf2OJMGLC2Q9O B1OQ== X-Forwarded-Encrypted: i=1; AJvYcCUf/uEZwwx+nutRQZ8EevLG249NY04XMsR/JgXr02NkaL9D0iMhUEqG37sx4NoeZUbz5SRqCeLAngqEENU=@vger.kernel.org X-Gm-Message-State: AOJu0YymBEM7CjDLYuM6epxhY1l1xV7fUZFmKNTxg6sOfWXx9uXnP1RY M/NqS5uo8XR+L4sqz/ivx0YTV2mHFSMQ1tJ9CE1F4iw6yAjlUXahwQ8GESKvGQaTXnz1BRRltmL TVN6VAJ+2FBcQckEfxzeWT4ExXOBX2XenhD1Fd++VNoge8YHmWHJ47fDzr/5RovTGHDU= X-Gm-Gg: ASbGnctcijyCqTivhI9a9t1dHk12TQO0Nfql5t4+mmftvEDle28nrvv+ovI3nYx5bPP oJtQNFuW7EuHewYGeNGnDKD0JXYrAwAStJoyJeLNGruMKtY7W+5Bqhfyu81G0+5K0O2RwWC8h0F Pjn0GOdNqZzA8qWEmNiQ9OHH9z9hjhvppbnCLcqkoZLN5BrzAXr9oQD1GoO9Q9X5JEdid/1MGrm O2E1WtAg6xwBpBz6UbiTyOwdjp4mAV7ce/1etpiLJFSWmyaVe0g1GzvW1zlclWwGAbgy0NjoOt9 ysZ3J528H2A2SU9X+f41Sap0L0x17A9YJw6EZ6JR5BJIeBJUhGjiZmCyqS5uJFFHrqMlR0SYSyv 8jDuRw9MEnV66KvH3YpddBzqo4a9o3RHFDCQVbevLdQWaE/R73BbKcsg8zLqRBnHVNL+JCU+d8h uYvc7s/dIEWLC+ X-Received: by 2002:a05:622a:1a97:b0:4ec:cffb:9369 with SMTP id d75a77b69052e-4eccffb9a66mr61850591cf.82.1761568035237; Mon, 27 Oct 2025 05:27:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM9qBoEHthGg53mpIEs6JgnkCRakdY1UFvr/V0amj1qqcQCJP0ugEaO0a+P4IvS1oIUmigNw== X-Received: by 2002:a05:622a:1a97:b0:4ec:cffb:9369 with SMTP id d75a77b69052e-4eccffb9a66mr61850311cf.82.1761568034701; Mon, 27 Oct 2025 05:27: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-59301f83cb5sm2253474e87.102.2025.10.27.05.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 05:27:12 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 27 Oct 2025 14:27:04 +0200 Subject: [PATCH v5 6/6] 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: <20251027-iris-sc7280-v5-6-5eeab5670e4b@oss.qualcomm.com> References: <20251027-iris-sc7280-v5-0-5eeab5670e4b@oss.qualcomm.com> In-Reply-To: <20251027-iris-sc7280-v5-0-5eeab5670e4b@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=11575; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=t1CBvWMfN655XxZugDbjqKvfK7Hnxfownu0/2DhhsmY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBo/2UVHzdHaKwryTr5Ve+s9z8lc8kfVUOe//Iee GOD7RDTOqKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaP9lFQAKCRCLPIo+Aiko 1cryB/4mxqclcENIP+UIykLBTJcKwI51oiN5z8igSjTvnTZGX3ChDqikhshF1VWSFzw6QMuCzfe AU6ZjdPiaUnmL5Grx96TAtn+gnDPH0br76315S/aq+vvtm4ReLTbBXL2NXfG76e7tAtqIsQn0Rr UERSekH5v8MeFdpEiXgPwtvkaSf+LFgiWOg4IlSUlsL/y0NQ8C4O8D9L+5MziZhzZKoO8bCb7rI 73THSxHf1DS/n7jmV+WFe/HmsyHUl10lqRd621ffgFjffdDoEf8mXLAc8zuNE0+gPf4Sk3hHMon ck0N3HCmHPUB0w/du/oL4Tsci9S7Veyb8ray4fCH0VnpHQdv X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-GUID: VogsuWEEfotprpo1mfm329ex5TnaZDc9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDI3MDExNiBTYWx0ZWRfX9GG5ibw3TD3v lcZgQ84S+oNmRFZeMWVZQyFqX6JmCWjjg6FpXnujJBc5zzSrQbBbErXEShLxE4v1yB5shcGGRS9 yqlDbd0niwAjnk0WKDCmAejQlZbqvwSL7YkOuqQvhJ/P3J9JIhfw3P+DKaZlVRBfIj6r+t+xYfb all+S/lSzkCcIY0r/ejuDzvqIDpwCluFqTeT2bsZmM4jHubBf5RYaSJphViluGV0n2/qJxbZr+q nKmr/qE+7Rbywb+/Gh4Mfn0yZIYH8TB0hJ0rcytiLgrj0VtzHPHKFz+SmxKBbsIDOWJLiiuTpc3 uZ+C+o0G5rddcvc23moyuUsy29Cm/Heds6FUp0DmJQMv+TUMpWM7RHoltb0fEXQ/kGbSZqG5PLi Ae/DSf9WrWeJu3+AIWhkRqrWCM1E0A== X-Authority-Analysis: v=2.4 cv=AJoZt3K7 c=1 sm=1 tr=0 ts=68ff6526 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=pG0Ruh8lDxDpiiRDS04A:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-ORIG-GUID: VogsuWEEfotprpo1mfm329ex5TnaZDc9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-27_05,2025-10-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510270116 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 | 53 ++++++++++++++++++= ++++ .../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, 120 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 5ffc1874e8c6362b1c650e912c230e9c4e3bd160..8d8cdb56a3c7722c06287d4d10f= eed14ba2b254c 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_AHB_CLK, IRIS_AXI1_CLK, IRIS_CTRL_FREERUN_CLK, IRIS_HW_FREERUN_CLK, @@ -224,6 +227,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 805179fba0c41bd7c9e3e5de365912de2b56c182..abe43557b16b3d41ea1360e7fee= 3e10fd13870e3 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) @@ -362,3 +364,54 @@ 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 1, + .no_aon =3D true, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K, + /* max spec for SC7280 is 4096x2176@60fps */ + .max_core_mbps =3D (4096 * 2176 * 2 + 1920 * 1088) / 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..9e8ade674ff1a8c4e42b1a05a3d= e3097110e5f0d --- /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, "iface" }, + {IRIS_AHB_CLK, "bus" }, + {IRIS_HW_CLK, "vcodec_core" }, + {IRIS_HW_AHB_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 bb98950e018fadf69ac4f41b3037f7fd6ac33c5b..1460e1683025e49cfa55d1afbe2= 81e5db5a0d898 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -222,12 +222,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 @@ -250,6 +252,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]); @@ -261,6 +264,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_AHB_CLK); iris_disable_unprepare_clock(core, IRIS_HW_CLK); } =20 @@ -294,11 +298,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]); @@ -318,13 +328,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_AHB_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_AHB_CLK); +err_disable_hw_clock: iris_disable_unprepare_clock(core, IRIS_HW_CLK); err_disable_power: iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); --=20 2.47.3