From nobody Mon Feb 9 02:51:04 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 C3ED723EAAF for ; Sun, 19 Oct 2025 07:57:13 +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=1760860635; cv=none; b=lonxdtprz42UVQ7ubAsmkIVWc3TW1BVm8aljKCi3tWcS6/DbEYjgVQck3WsNfuWguzrB2jFVRRkCOseIx35SgJYy/UuSjnMwHgKit6zKqMCBxSgCJwIWZdSI1/z6gsBwMDpnftmc3ZFWJwPgVTQou9hsWMgeKWxNisISH37d/uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760860635; c=relaxed/simple; bh=C+tcorQ5hQe6Y69Mt0PlaH/Ulwn8QpcJFrIQfiZIazU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OKOYhza2z7ANnQ7/PwmeF2rMb4RHUOBOzHKuzR42imcI+zkt/VJWtsVUxeBZ8Q2mvTDMzhtCZNehn58NQcr1F3IEE7seoCFL11UkQ743CSXn/kUEbY2+lC0WU46Dtzd7NrzoFh5zB0BUcTXOzx1sVOtnuvt3/th9xK5DjxerA98= 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=C9gk2Q9w; 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="C9gk2Q9w" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59J5QIfb021065 for ; Sun, 19 Oct 2025 07:57:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= sYG9RnU2JjgBnuLLxHsgQ90XfW5PUsP89Yd/GaNL9c0=; b=C9gk2Q9wpShKnToT kdoJM86cwVi+dATqypNdCq+Bq3/4sZPAJ2Lw40j8kuImWL59BPb8WU9nm0GbKmgG gFTnSR55S6IYmgNwgX9QHnC0ct0ovr63SXC1WGGLH+a1ZDQ9PTANhrZgx4gTwH35 Arxvk/HT0D5yZA8PVwlkRian7+5G/+szyjalG6VEUmPoaH0wQXyvRj7FgDAFmGju J4auCHclu8E92aZZ0WHSA5tkW515k1KwyEw0jk/yRLsPgSG0UJERS//ACUfVxTcb ayKF8PavNbZRolfzSWg95hOVyuc0SRyVtuUT8BQ1+vDQLBNH9JqZfApOXMmBDeEc wWYpGA== 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 49v39820w6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 19 Oct 2025 07:57:12 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-78e5b6f1296so101757866d6.2 for ; Sun, 19 Oct 2025 00:57:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760860630; x=1761465430; 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=sYG9RnU2JjgBnuLLxHsgQ90XfW5PUsP89Yd/GaNL9c0=; b=fdGkDX2pKASJz5NfEDEds6vltLioDbL482jl0q/vo9elZlqRm02NWC3FVJj2KhmmB7 T7vtRsEBhM/MVy5cM0ojI8p8hBkvolTz3PjTUTZNdPvW3WmAutauYQodXj3CovdWFHuR YosGszzt+sJyjr7k6HnfoFC5PzYwnDRmvixWnx8ZQeX55qt4CKAQv8HPGETP2COZCLCE HiK5WTL+Lpj2whcLnVkd+AXkrsK7zvq6H5ePhQ/jbofYd+dcSLoSUjUYp4O7AvOJ4TH4 WNZe3+t/76GBnzdJVNrIWFS3NbcJ6ID2lyVb2Gevhp2XNq1ljUBFrLKkPPqL2x/53iNd T1ag== X-Forwarded-Encrypted: i=1; AJvYcCUhKq3AebQqjbDVTtJPkgKO+ObsvdccgXdvvNUhdXMD3jL1BnRxySOK5/x98/UyTdqZYale0rnX2sLmuZI=@vger.kernel.org X-Gm-Message-State: AOJu0YzplbkUEQRxC5w3D0X70f5354O4gYr/3JuW5Jmgl3mAsGIULSX4 xRsg4yh+xZkyVuDq28oVDDKe/JC6jvXGlclJes+Zm4OH1X6E880hXr3eS5iE8PISqpfaIHNjQDJ fNICBqZ0VWQDfLwPHe+ejNHdIyKxgbZk88vi8Ocofr6UgqMKFPLUsaXwNksnBXDJsP5M= X-Gm-Gg: ASbGncu0qmiZjVT9/fnL5fHvuVOXEBSW4GNJAC+VrcywvCrCcRp9dO47TSiCt5nF1TZ hD5MhiCDRFBV7/F0J47RrJV/EUUaVOJ9u5J4WXY/pqmEUvH9msjr3Z1mIjy8XlCOxVBNsjwgWNi CuJrPAKDQixlWYTsq7ZbtRdtUqnAAqMOR5i4yTt3Nefqd434G+Y9rdvyB1r1B0sF/owbUDJnamN w3gYfrLKzZG21k/k58vSrHmTPXjBmJF/DcP4KYlkGu061stvXliQRNBoqPRDHRYFfvCHKnMZsHv xodm41775r/Ac4FSiyd14367W3gk4U/vMOkvw8+J9E5AVWEGJ9DnuWYygXVnrrG+rehMWm6/9xw R67b3h53rC72rMPrah8huOyBMy3rbo1fVCSL00hsG7+HKM6YmQRMpG0tAcDa0dzOLxag5Y66X3y QUcihWLNEHwWQ= X-Received: by 2002:ac8:5a08:0:b0:4e8:a359:b786 with SMTP id d75a77b69052e-4e8a359bde3mr107281351cf.73.1760860630337; Sun, 19 Oct 2025 00:57:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF4pkxWHCITjdw0m9ZOMLqjuCg5k/N7oiB6DVMVktvfzfp4MRLna+wvK4tda5kxTsa5gFqlQ== X-Received: by 2002:ac8:5a08:0:b0:4e8:a359:b786 with SMTP id d75a77b69052e-4e8a359bde3mr107281141cf.73.1760860629861; Sun, 19 Oct 2025 00:57:09 -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-591deeaf4cesm1357027e87.30.2025.10.19.00.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 00:57:08 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 19 Oct 2025 10:56:53 +0300 Subject: [PATCH v4 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: <20251019-iris-sc7280-v4-6-ee6dcee6e741@oss.qualcomm.com> References: <20251019-iris-sc7280-v4-0-ee6dcee6e741@oss.qualcomm.com> In-Reply-To: <20251019-iris-sc7280-v4-0-ee6dcee6e741@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=C+tcorQ5hQe6Y69Mt0PlaH/Ulwn8QpcJFrIQfiZIazU=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBo9JnEGtex7ObfejIPjVhrc/S8LsahQuLGrblrN 0ORApSj+HqJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaPSZxAAKCRCLPIo+Aiko 1cPECACRiGzBg9v/l3lzQnVnEmH1ULWj1/tAwabxEuQY/M6swJfQbhkhNMq9YTMzzufWQDwv/qm t1a7KF9qAVwGkk5WPEUqQo7t6eekZzQLh2cAZyYyZ82b+fz8Sr+OZ2JbX8+7jIOpF7Zx4t2eE89 Pmg3MW6p5Nv0Wh5WvzzaW/rPkZUxpl8jAv8Mt8QWd8xSP0qbfEvJloqGNBGqUaL1gwaqX1Bj6x3 2R7UKrteJE6T9knplc5QillOFAOVzpng7Z9XqQwLXWl+gvAVE7rdpHzfM4n+qB8xr8FEom1Su6J Mfr9XeOcIeDEwK8v0mYpVgEETu4osMeI1dziVbfclqRUEo/M X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=KcvfcAYD c=1 sm=1 tr=0 ts=68f499d8 cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=pG0Ruh8lDxDpiiRDS04A:9 a=QEXdDO2ut3YA:10 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE4MDAyNSBTYWx0ZWRfX1NnuX/kgpga8 mm6Tjs/dx8Xvi28lbzbhYlIprLQ0ACI2IzjriTrmRWl+OetpKDF9jhebAQ3PfoUN3WcV4M7x18N 7AHrf7OcAGfy1q48q6wRdEdOl00fggcORPHEkSF/BRfW9fjrKMYML4/BFdLIoz8Dosub6jdxTYp XDIwP+SkxA2J7SiKdjSCqi2IokKYmOwI7ZrYQqqIhfysjihskH7mQWLg6TgQ0SwHquoRa86NoaP E4Q3VKqfEP7VfLNL+LoV5p/NNRee0T1ncQCYoNdnzHahTI0L2x5NJEy8KGmgbVlGWDxe36DB5Mz nqtbjr5W/MfZgldsGa00CwKGXQ7N9BEZlrJhBc6tQ5n7ETV5W54GanSwmxk0qjYLO4DSJeA3CdA u5byd7wE1/+YVwgyAjGNDnmMJrRN/A== X-Proofpoint-GUID: 3VlldylXUwRzuUy8MH_WqmP-kRrggFKQ X-Proofpoint-ORIG-GUID: 3VlldylXUwRzuUy8MH_WqmP-kRrggFKQ 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-19_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 clxscore=1015 bulkscore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510180025 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 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 9cb9ddc86ad73daf75383b3253e851394235093d..beea8c79de34d163f113d3449fe= e18d33bfe5fd9 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) @@ -363,3 +365,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 1, + .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..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