From patchwork Tue Feb 25 09:05:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 868223 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1950E265CC5 for ; Tue, 25 Feb 2025 09:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474323; cv=none; b=cKNHN4YjWRHZMAmTTUqidTxA56R463pLM/JiYGECljn1H1DAV3mDqdAk/O7NkwWf7esMpsNFhsHPNEQrasEceYGt520DkBpVM5S9Xwp+hTb1lqKVuGsawXB8svB4/Pp13FaeUeoYkWZ00JMLCsCC+G5k03dAyz4eExR7E2b4Cr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474323; c=relaxed/simple; bh=MuVFv0xJA1aIIdUbLAcynY4g87XgdT+Fpu04pLc0qqk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OF/rCvbWin0suJDaaHqJwLaq2tExUqLoxE88ahZpYKonOeJlsbuZBjBM5NrEc3gS1b3iAnPzkTuovjwwz67ygoHSRvy3hTEbdhn0d4+du9FMVPzxVtH77rvvm4ApWFXTslemAXhGUQkbtybo+FLX01piXdU976uWL5BwyR5N2SA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=L13KKHFO; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L13KKHFO" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-38f403edb4eso3057240f8f.3 for ; Tue, 25 Feb 2025 01:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474319; x=1741079119; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n1Wm3m4ktQWXQaRTF4Zc5/MnyxbU+OWxULwpKIAGXso=; b=L13KKHFOhjAuAoG0MGtqsInmAHzPZU0nnhRFxlyJAqkd5/aWiIvmcE0iNJqF/nBjp+ WfOxPHpdb8zTEJeL64kvX591mPIAFvSyo1YKczZKM3+MWAZjZfLrVb6Iak66eg8dM+zw +QJRkJh7YQ9+QXmjZXaRVorbngy9jPvqfVJGzlvI+ii1TcJ5/NcNxZrcegTXq0CR5uis p/4xoz7tAD1UszBPF91b2+uc+MfiPEiSjtYVfoSBpibVBqiskYmoUK5et5HIVMhzsmpE 4Xu4gS57TwBqT6IhOdv64q27Mj++Y+0JZwZnbJuOUmgoekzIQJtbMTYmdOEG1rr813vd SgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474319; x=1741079119; 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=n1Wm3m4ktQWXQaRTF4Zc5/MnyxbU+OWxULwpKIAGXso=; b=tbRbCOjBREvFNU1/YQM5JOWBPkDuBxLQQl/o4Sk376tXWnQSDzmIm67IQG3nJaSRZp 9vegCYNYlmdet59VgjQz8cB6h4mxTclakHiq/tY7D/2/RkrZSteJJzujFrO0EvgEnZi9 WLO+b8OEK3QtmEZmBsex4qwhcqbSNHPr02qsMbc88YToAq/Q6acRSJnn2L13q9gKOKPz glSseo0FRZt4fyBu1Wx0rk3LopdJHrl+ENlnEVdYQt8wb9yMtXDJeGbcf41gUMQK93ZU wqzDF2Xq7Wgm2fX9u/QNJ4mM8rUV7b2CeQdSxnTqAsTDgy5AF2XWlVbv0wZYynlcb8XV niSw== X-Gm-Message-State: AOJu0Yyea5prT6NWvxFePEpVavHxs7xHINROGTAPuVZZlQjazE2UX1Jl 4JLKo8gCqjtveMgzj751b0bI41fpBSqBqpZUi18v9e/3STS0Zxi//KO+gijIHM0= X-Gm-Gg: ASbGncvlzxbxEWYkw4HHmiQHOAe/eW0XLpDgfflmi5RrDltVP0+LUhCRcoIB9Z9jn63 oD1A6wECXhev9YScE09j7Psx24sRiTmYopA9vEHODQJ4Xlng8jS7j3rX6edkTH8M3zhI+f4FARr d1iwZrQdodCICVk2xvP17cE4WHNJfupcXHuN4FYYcHSxRNXdyUCHYTZ5kEgMlFtVo8Xh1Zrf/iQ XmZ6Y2mVlvfTdGmLAkPLySUNa2gsA9nta5pcG5K51MQ6MdtfJyT8ZosQFhG8Yw3jrS3L4cYzyYX 1OXSngApIvr+dpmeXJ2XcVt1RMzEXUt998WJXlnHhWV9wEI= X-Google-Smtp-Source: AGHT+IExJfVX2pa7E8zGHho5gW4/I4CUzeqhG7AuJ1CY8Ss/DePppdeXLqIKsLK4iw25aSCA/hBgOA== X-Received: by 2002:adf:ce12:0:b0:38f:4cdc:5d36 with SMTP id ffacd0b85a97d-390cc630c2cmr1583604f8f.43.1740474319256; Tue, 25 Feb 2025 01:05:19 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:19 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:10 +0100 Subject: [PATCH 2/4] media: platform: qcom/iris: add reset_controller & power_off_controller to vpu_ops Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250225-topic-sm8x50-iris-v10-v1-2-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4781; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=MuVFv0xJA1aIIdUbLAcynY4g87XgdT+Fpu04pLc0qqk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfLpi2ryu2nYjTFw4rJn8OiaJy5B5WJgLv0J0SB noO6oFeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HywAKCRB33NvayMhJ0SJ3D/ 9LqsoPuOuXTSSGjcDIaChAU3qiHXJeQd+SP4Y4Lz51YFykc44TJzIyw2FpeKqPGMGt6/lJ1Am3NOkM oU0cfdc1iGpzgcxt/Mp1guuEFXZRkzSqcceXw/YyE+m7t1AGyu8BRFveUwxTQoaH6BNeLudxBOKLl2 z/wGTmZkMQd1JVzVsX8TLI1F2fmDW38bO1TnQfIGTALiB+kP6LkedkCNaKqD7FQULmr/xYb1lLDOEe bEy/EuP7EuvjCt6vWLh+RC228HcZHFuwyORpP/dNXMJWJxlWGk8x79nfysiG7NSW4i/EiVPD4oxD5e KyZHjoOCsM9JSByZlW7He6usz5D3ZBEp7ievG2E7Ww27GqDH++cynzOFE6meK2fzd8jy25hTrv14Jj STFXGLGt8T1sgdG1WyShCNoNhmwltYzskZGXvzCH5BbvyVEljSSNNpUNxxrIfZGKzLv7wvjWd1rRhF dqZsxiPY4dRnObHfC4DvBIvtaU9rrpT2FCtlj/fRBRlmthEgURkmlqZOXtEGVlQ8991ReN1FOpNBcE utJdBjoQI/61mbJiwpixZNfES81PLGjegIs3Xy6PX3VBE08r4nd3mWWLMeNnaa8Gwl4ONlHnDDFCs+ wyzvJiKy9P0BHNOcAKQqG7gqmGBcuhwl38fwKGA3BgQY+OSK6HGc2q8/gjaA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE In order to support the SM8650 iris33 hardware, we need to provide specific reset and constoller power off sequences via the vpu_ops callbacks. Add those callbacks, and use the current helpers for currently supported platforms. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_vpu2.c | 2 ++ drivers/media/platform/qcom/iris/iris_vpu3.c | 2 ++ drivers/media/platform/qcom/iris/iris_vpu_common.c | 14 ++++++++++---- drivers/media/platform/qcom/iris/iris_vpu_common.h | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/platform/qcom/iris/iris_vpu2.c index 8f502aed43ce2fa6a272a2ce14ff1ca54d3e63a2..093e2068ec35e902f6c7bb3a487a679f9eada39a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_vpu2.c @@ -33,6 +33,8 @@ static u64 iris_vpu2_calc_freq(struct iris_inst *inst, size_t data_size) } const struct vpu_ops iris_vpu2_ops = { + .reset_controller = iris_vpu_reset_controller, .power_off_hw = iris_vpu_power_off_hw, + .power_off_controller = iris_vpu_power_off_controller, .calc_freq = iris_vpu2_calc_freq, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu3.c b/drivers/media/platform/qcom/iris/iris_vpu3.c index b484638e6105a69319232f667ee7ae95e3853698..95f362633c95b101ecfda6480c4c0b73416bd00c 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3.c @@ -117,6 +117,8 @@ static u64 iris_vpu3_calculate_frequency(struct iris_inst *inst, size_t data_siz } const struct vpu_ops iris_vpu3_ops = { + .reset_controller = iris_vpu_reset_controller, .power_off_hw = iris_vpu3_power_off_hardware, + .power_off_controller = iris_vpu_power_off_controller, .calc_freq = iris_vpu3_calculate_frequency, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/media/platform/qcom/iris/iris_vpu_common.c index fe9896d66848cdcd8c67bd45bbf3b6ce4a01ab10..ec8b10d836d0993bcd722a2bafbb577b85f41fc9 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -211,7 +211,7 @@ int iris_vpu_prepare_pc(struct iris_core *core) return -EAGAIN; } -static int iris_vpu_power_off_controller(struct iris_core *core) +int iris_vpu_power_off_controller(struct iris_core *core) { u32 val = 0; int ret; @@ -264,23 +264,29 @@ void iris_vpu_power_off(struct iris_core *core) { dev_pm_opp_set_rate(core->dev, 0); core->iris_platform_data->vpu_ops->power_off_hw(core); - iris_vpu_power_off_controller(core); + core->iris_platform_data->vpu_ops->power_off_controller(core); iris_unset_icc_bw(core); if (!iris_vpu_watchdog(core, core->intr_status)) disable_irq_nosync(core->irq); } -static int iris_vpu_power_on_controller(struct iris_core *core) +int iris_vpu_reset_controller(struct iris_core *core) { u32 rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size; + + return reset_control_bulk_reset(rst_tbl_size, core->resets); +} + +static int iris_vpu_power_on_controller(struct iris_core *core) +{ int ret; ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]); if (ret) return ret; - ret = reset_control_bulk_reset(rst_tbl_size, core->resets); + ret = core->iris_platform_data->vpu_ops->reset_controller(core); if (ret) goto err_disable_power; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/media/platform/qcom/iris/iris_vpu_common.h index 63fa1fa5a4989e48aebdb6c7619c140000c0b44c..c948d8b5aee87ccf1fd53c5518a27294232d8fb8 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -12,7 +12,9 @@ extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; struct vpu_ops { + int (*reset_controller)(struct iris_core *core); void (*power_off_hw)(struct iris_core *core); + int (*power_off_controller)(struct iris_core *core); u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); }; @@ -21,7 +23,9 @@ void iris_vpu_raise_interrupt(struct iris_core *core); void iris_vpu_clear_interrupt(struct iris_core *core); int iris_vpu_watchdog(struct iris_core *core, u32 intr_status); int iris_vpu_prepare_pc(struct iris_core *core); +int iris_vpu_reset_controller(struct iris_core *core); int iris_vpu_power_on(struct iris_core *core); +int iris_vpu_power_off_controller(struct iris_core *core); void iris_vpu_power_off_hw(struct iris_core *core); void iris_vpu_power_off(struct iris_core *core); From patchwork Tue Feb 25 09:05:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 868222 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAE3F266592 for ; Tue, 25 Feb 2025 09:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; cv=none; b=XIT1pmukGgMyvbDkBzctfGLRzxwKj1+RXa2wFjsXI7BbfUINpLBEvPb2mDPv0XpSob/fbltUe4sOBeQjar3QU1fBhPDOQVFWKrZvDJELX17jsrmU6drF/fZLTU8deXJgLj9+MhJfRYgaUTKTUcByO10rtJFJdGFJ+IFW8WTPGEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; c=relaxed/simple; bh=v00FvgOpYb+n3FGLO6d0TWMNJxGJTCgKGQ6XpRBKpZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=khaeTZ778XcLxcD0EY8PUNW4ws2fu2XWC39l9yyrM1bb2G39iCL4FmbUCWIgRGooGbLKNYL3z+NoZz0rOBar2UH/ue3pBkOoYaielEtqcp+FJhEJQGc4sHgXwAjIJDr706AlVHFxLmjaaXG7j4kuHpXqAW6jh+V2ZkwG3I8wvfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dNoRXEcN; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dNoRXEcN" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-38f70170005so3152887f8f.3 for ; Tue, 25 Feb 2025 01:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474321; x=1741079121; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MYmR6wYxHn+OrnAqeln0/aM1+4hC+I2kO2nIYcMMvmw=; b=dNoRXEcNpKTgyENRt2YKRnxuc7ju/CM3DuA82uiDarjV+d0xiIYrd9z+N8rV7GlB5O sJa3NJWhHJAMWX/S6ulxy00O0GbsTiSoCjNLUm2RUQI+WfuEtli+36acp+qidtPGA0tx d5W1pXZbuIjgVzEiKVoVAYUJHf0ShBs8cPISsQoZ8ssJGNtp6pAfkjGF4KjJ2U1lnfzA VF+SGucMWavbnJTPE4SF9a0cjF2SKrjLxf2l0FEzJmtvHnKvimNyUQ44YTae6xRhHaoX 6JfXpj6MB5J+6xfuL4VnLX7j1fW106wwqmiPTsaV/619A7PgIPJTEiFOi3JQaiGh9Jke zuMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474321; x=1741079121; 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=MYmR6wYxHn+OrnAqeln0/aM1+4hC+I2kO2nIYcMMvmw=; b=BkooWXzWSPtPZdUXsrTPpXO7isX9Xm7TvGWOSe/hBDTilzvOWW3sk7KmCDZCdLiBo4 k/QRqoLlbz174r5rJTTGsMUJam/SjeqEHrnbt6+ElmO/uqBOPelQcqplsroLAg5HsKsS PiyjDycKT9wlWTjDo3RRZ7QB+jAcir28cF4d9Ro7CVrsAql+Dg8fIoH3ngILp9FwiUs5 xcNiOqm4vKq/Y6O/oyQTiJZcl1KAfkXG8Fk+hubwJc+LTEFqJ+BEQ9bvORcCO/v/pscg B9Rjg6kwxUGJQBOPUN+vbhvDydQzliuaBQRbgMvGIjKbkV62Qfpt1zEQBe98fPY4D8vG Qeew== X-Gm-Message-State: AOJu0YwqDb/5Sv+VbereqNleQ9hXEEhqUdauNlQGxK21ZFpEM50jRXRs hcEb+fM3pHzLcxC9gu9KjJeddJ5joge4P1CMrHR+J1maseLJ5y0GOsQPsntH/P4= X-Gm-Gg: ASbGnctR4lpqkNDIYoqJmLE/EBYxgcQmobg/4DSR/7bGTgf7vShIXDhZY4+e/NkP2d7 DnchhmHceykKS5FE1fipgpAmmEDhk/ufC/x6nix6vP00+30pZjJm/nPvJBDbWPHBKk+Zz0H1yjj Pro25M9Qqidqw4auCoJ80h078hnssfPK/g0QEmXjIHeZV1lcd+CHeQgdcUGhYHoDllf3f9nIa2y EKkeSIwImaPEO+BBEi7ucwe7Amn3ClRB0XJYcL4/bZnLCQLrNBV2azL9YRoRKHJfAp0Hod57TAA bBBXl52a/0ODuoADa1PdrQerGNzAft5aL16b0ZIcKbJWDSw= X-Google-Smtp-Source: AGHT+IGXsU7hwX2gAxEY6VM940MGo0A6mKVnjChXhYTPaOpxxIOzGvKpEQd12j49B57MKG7ir3Lmxw== X-Received: by 2002:a5d:588c:0:b0:38d:e584:81ea with SMTP id ffacd0b85a97d-38f6f0d1c8bmr14397863f8f.45.1740474320749; Tue, 25 Feb 2025 01:05:20 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:20 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:12 +0100 Subject: [PATCH 4/4] media: platform: qcom/iris: add sm8650 support Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250225-topic-sm8x50-iris-v10-v1-4-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10895; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=v00FvgOpYb+n3FGLO6d0TWMNJxGJTCgKGQ6XpRBKpZQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfM2Pkodfx6ekVFlWwGC6OZlaJQwd1Zg59AtaMQ ll0ke2GJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HzAAKCRB33NvayMhJ0fBPD/ 0ex0MrvnJ4VSu61N+p3fbe5XoMW7FsUtGQlHerBoFYV8dyvkXHnCZ2+ZaVec//9iZVqr9MpWFWxm1v jVGnzgby4nvCV4+oyMkt7P7lkRq9twRscWd9yk2OBrmGSsE7XXjpElGq1xUx9GJFuetiO5wfrn6e6z yhT9daI5GNFgV5Tgl8mwgDDqeH54iGELuw4VjEzJQwFsDW9MXVUUSdBeLhp77kCHOA+Ms1Pm8p8mQn AVf9v531WrAX2RuwVVd/IUOWRrE+g4OkGYdj9GzR39agzDkub9NnUbPV6vQLfgXyTDmJJJ8NuRie6i fMeGkFccjwbdrxwbHVU3kLQcmcYHgSfGd3Tn3ouAkNvUiws+S932ncBGB93O4nitGwN7JwLy/FM4Yv hBGx/S4W/qKccEm4YznMmOMochU57GmpWTlSGDVS5KKDTsjH9BHsFCovNCa/aaumrGKBYhUgPbWlTv hx7WoNhSxrbg/LTFTZBWCKOJJsYcDeq4XRtUcBeCEt1I3pbiI05spvY78B8on2PUPAmo0ml5XOfc5k 0rHcuWDcZoqNS6Gon7K0pa202zm6ThDhJ1Ql8MFOSviFH31j7UhhLjKbCIhfeDOKy3IyD3OOSqMBxD QaASEjQBc9otjwMmnuayINzAqi6vNWQBC+EshgWVc/YLsPz0wMyh55Qz7SCQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add support for the SM8650 platform by re-using the SM8550 definitions and using the vpu33 ops. The SM8650/vpu33 requires more reset lines, but the H.284 decoder capabilities are identical. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../platform/qcom/iris/iris_platform_sm8650.c | 266 +++++++++++++++++++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 + 4 files changed, 272 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile index 6b64c9988505afd9707c704449d60bb53209229f..4caba81a95b806b9fa4937d9c7973031dea43d0e 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -11,6 +11,7 @@ qcom-iris-objs += \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ iris_platform_sm8550.o \ + iris_platform_sm8650.o \ iris_power.o \ iris_probe.o \ iris_resources.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h index f6b15d2805fb2004699709bb12cd7ce9b052180c..75e266a6b718acb8518079c2125dfb30435cbf2b 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -35,6 +35,7 @@ enum pipe_type { extern struct iris_platform_data sm8250_data; extern struct iris_platform_data sm8550_data; +extern struct iris_platform_data sm8650_data; enum platform_clk_type { IRIS_AXI_CLK, diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8650.c b/drivers/media/platform/qcom/iris/iris_platform_sm8650.c new file mode 100644 index 0000000000000000000000000000000000000000..823e349dead2606129e52d6d2d674cb2550eaf17 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8650.c @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#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_common.h" + +#define VIDEO_ARCH_LX 1 + +static struct platform_inst_fw_cap inst_fw_cap_sm8650[] = { + { + .cap_id = PROFILE, + .min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, + .max = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH, + .step_or_mask = BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH), + .value = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, + .hfi_id = HFI_PROP_PROFILE, + .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set = iris_set_u32_enum, + }, + { + .cap_id = LEVEL, + .min = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, + .max = V4L2_MPEG_VIDEO_H264_LEVEL_6_2, + .step_or_mask = BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_3) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_2), + .value = V4L2_MPEG_VIDEO_H264_LEVEL_6_1, + .hfi_id = HFI_PROP_LEVEL, + .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set = iris_set_u32_enum, + }, + { + .cap_id = INPUT_BUF_HOST_MAX_COUNT, + .min = DEFAULT_MAX_HOST_BUF_COUNT, + .max = DEFAULT_MAX_HOST_BURST_BUF_COUNT, + .step_or_mask = 1, + .value = DEFAULT_MAX_HOST_BUF_COUNT, + .hfi_id = HFI_PROP_BUFFER_HOST_MAX_COUNT, + .flags = CAP_FLAG_INPUT_PORT, + .set = iris_set_u32, + }, + { + .cap_id = STAGE, + .min = STAGE_1, + .max = STAGE_2, + .step_or_mask = 1, + .value = STAGE_2, + .hfi_id = HFI_PROP_STAGE, + .set = iris_set_stage, + }, + { + .cap_id = PIPE, + .min = PIPE_1, + .max = PIPE_4, + .step_or_mask = 1, + .value = PIPE_4, + .hfi_id = HFI_PROP_PIPE, + .set = iris_set_pipe, + }, + { + .cap_id = POC, + .min = 0, + .max = 2, + .step_or_mask = 1, + .value = 1, + .hfi_id = HFI_PROP_PIC_ORDER_CNT_TYPE, + }, + { + .cap_id = CODED_FRAMES, + .min = CODED_FRAMES_PROGRESSIVE, + .max = CODED_FRAMES_PROGRESSIVE, + .step_or_mask = 0, + .value = CODED_FRAMES_PROGRESSIVE, + .hfi_id = HFI_PROP_CODED_FRAMES, + }, + { + .cap_id = BIT_DEPTH, + .min = BIT_DEPTH_8, + .max = BIT_DEPTH_8, + .step_or_mask = 1, + .value = BIT_DEPTH_8, + .hfi_id = HFI_PROP_LUMA_CHROMA_BIT_DEPTH, + }, + { + .cap_id = RAP_FRAME, + .min = 0, + .max = 1, + .step_or_mask = 1, + .value = 1, + .hfi_id = HFI_PROP_DEC_START_FROM_RAP_FRAME, + .flags = CAP_FLAG_INPUT_PORT, + .set = iris_set_u32, + }, +}; + +static struct platform_inst_caps platform_inst_cap_sm8650 = { + .min_frame_width = 96, + .max_frame_width = 8192, + .min_frame_height = 96, + .max_frame_height = 8192, + .max_mbpf = (8192 * 4352) / 256, + .mb_cycles_vpp = 200, + .mb_cycles_fw = 489583, + .mb_cycles_fw_vpp = 66234, + .num_comv = 0, +}; + +static void iris_set_sm8650_preset_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + 0xB0088); +} + +static const struct icc_info sm8650_icc_table[] = { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const char * const sm8650_clk_reset_table[] = { "bus", "xo", "core" }; + +static const struct bw_info sm8650_bw_table_dec[] = { + { ((4096 * 2160) / 256) * 60, 1608000 }, + { ((4096 * 2160) / 256) * 30, 826000 }, + { ((1920 * 1080) / 256) * 60, 567000 }, + { ((1920 * 1080) / 256) * 30, 294000 }, +}; + +static const char * const sm8650_pmdomain_table[] = { "venus", "vcodec0" }; + +static const char * const sm8650_opp_pd_table[] = { "mxc", "mmcx" }; + +static const struct platform_clk_data sm8650_clk_table[] = { + {IRIS_AXI_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_CLK, "vcodec0_core" }, +}; + +static struct ubwc_config_data ubwc_config_sm8650 = { + .max_channels = 8, + .mal_length = 32, + .highest_bank_bit = 16, + .bank_swzl_level = 0, + .bank_swz2_level = 1, + .bank_swz3_level = 1, + .bank_spreading = 1, +}; + +static struct tz_cp_config tz_cp_config_sm8650 = { + .cp_start = 0, + .cp_size = 0x25800000, + .cp_nonpixel_start = 0x01000000, + .cp_nonpixel_size = 0x24800000, +}; + +static const u32 sm8650_vdec_input_config_params[] = { + HFI_PROP_BITSTREAM_RESOLUTION, + HFI_PROP_CROP_OFFSETS, + HFI_PROP_CODED_FRAMES, + HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT, + HFI_PROP_PIC_ORDER_CNT_TYPE, + HFI_PROP_PROFILE, + HFI_PROP_LEVEL, + HFI_PROP_SIGNAL_COLOR_INFO, +}; + +static const u32 sm8650_vdec_output_config_params[] = { + HFI_PROP_COLOR_FORMAT, + HFI_PROP_LINEAR_STRIDE_SCANLINE, +}; + +static const u32 sm8650_vdec_subscribe_input_properties[] = { + HFI_PROP_NO_OUTPUT, +}; + +static const u32 sm8650_vdec_subscribe_output_properties[] = { + HFI_PROP_PICTURE_TYPE, + HFI_PROP_CABAC_SESSION, +}; + +static const u32 sm8650_dec_ip_int_buf_tbl[] = { + BUF_BIN, + BUF_COMV, + BUF_NON_COMV, + BUF_LINE, +}; + +static const u32 sm8650_dec_op_int_buf_tbl[] = { + BUF_DPB, +}; + +struct iris_platform_data sm8650_data = { + .get_instance = iris_hfi_gen2_get_instance, + .init_hfi_command_ops = iris_hfi_gen2_command_ops_init, + .init_hfi_response_ops = iris_hfi_gen2_response_ops_init, + .vpu_ops = &iris_vpu33_ops, + .set_preset_registers = iris_set_sm8650_preset_registers, + .icc_tbl = sm8650_icc_table, + .icc_tbl_size = ARRAY_SIZE(sm8650_icc_table), + .clk_rst_tbl = sm8650_clk_reset_table, + .clk_rst_tbl_size = ARRAY_SIZE(sm8650_clk_reset_table), + .bw_tbl_dec = sm8650_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8650_bw_table_dec), + .pmdomain_tbl = sm8650_pmdomain_table, + .pmdomain_tbl_size = ARRAY_SIZE(sm8650_pmdomain_table), + .opp_pd_tbl = sm8650_opp_pd_table, + .opp_pd_tbl_size = ARRAY_SIZE(sm8650_opp_pd_table), + .clk_tbl = sm8650_clk_table, + .clk_tbl_size = ARRAY_SIZE(sm8650_clk_table), + /* Upper bound of DMA address range */ + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/vpu/vpu33_p4.mbn", + .pas_id = IRIS_PAS_ID, + .inst_caps = &platform_inst_cap_sm8650, + .inst_fw_caps = inst_fw_cap_sm8650, + .inst_fw_caps_size = ARRAY_SIZE(inst_fw_cap_sm8650), + .tz_cp_config_data = &tz_cp_config_sm8650, + .core_arch = VIDEO_ARCH_LX, + .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE, + .ubwc_config = &ubwc_config_sm8650, + .num_vpp_pipe = 4, + .max_session_count = 16, + .max_core_mbpf = ((8192 * 4352) / 256) * 2, + .input_config_params = + sm8650_vdec_input_config_params, + .input_config_params_size = + ARRAY_SIZE(sm8650_vdec_input_config_params), + .output_config_params = + sm8650_vdec_output_config_params, + .output_config_params_size = + ARRAY_SIZE(sm8650_vdec_output_config_params), + .dec_input_prop = sm8650_vdec_subscribe_input_properties, + .dec_input_prop_size = ARRAY_SIZE(sm8650_vdec_subscribe_input_properties), + .dec_output_prop = sm8650_vdec_subscribe_output_properties, + .dec_output_prop_size = ARRAY_SIZE(sm8650_vdec_subscribe_output_properties), + + .dec_ip_int_buf_tbl = sm8650_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8650_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl = sm8650_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8650_dec_op_int_buf_tbl), +}; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c index aca442dcc153830e6252d1dca87afb38c0b9eb8f..8e6cc1dc529608696e81f2764e90ea3864030125 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -330,6 +330,10 @@ static const struct of_device_id iris_dt_match[] = { .data = &sm8250_data, }, #endif + { + .compatible = "qcom,sm8650-iris", + .data = &sm8650_data, + }, { }, }; MODULE_DEVICE_TABLE(of, iris_dt_match);