From patchwork Thu Apr 10 16:30:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 880726 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 9B1461C5D7E for ; Thu, 10 Apr 2025 16:30:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302615; cv=none; b=dnXrpoPrA4bEi1fp3rsiagF/5EWpjJKJP24Z7VYnxh4Or7B5/uyRdPKanBQcD/vtP0rRVDm/9YSi17UGKbqxXnnVO3geEf88eAt6/26tCfXdApei4ZGGTTbvgglwTcPI0jCHu3D8umc2YGvxwBDhCMYsuxWmDNB0J3zLilJnl6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302615; c=relaxed/simple; bh=tCEOYGPmIc1SPAM1HF+UO1/NYRAAsIsKLUXJIESOnu8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PBzim029wzjv9ahfvb2hBkfCD8kIXKx8m1NQGIOTyHk0AVKLf8fMyCpK2xjXx9PLwQeaQcsVs7V8cU15wTZXkr/QhHuAXnnGdxTYbZhog8vKIQB822Tc1SDRYVQSq8ueNAXlJqLkY9tyIyEiqjgEmHunZ7lzDOR+4RYYCp4kxUc= 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=KOenOsFU; arc=none smtp.client-ip=209.85.128.41 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="KOenOsFU" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43cf05f0c3eso7973105e9.0 for ; Thu, 10 Apr 2025 09:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302610; x=1744907410; 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=EfgoiISEI6CCBXz+KLnorq2mkzdptbjBXDbJbv0ENcI=; b=KOenOsFUYl1MszShGxzm6w4IkmvEmCf15tkHW6HQ94NGCjzhXE/D+c/guxGlsMXC+8 5YAmZvhxSQYv7j/fQUwVVHCCm6IxfllWb5NZ5Wv1rLSBFugLS46xkdLfKO0MiwPQWytH bNB91sWbKbJCVrjz3/D/D2YmNAiynxhEC42f51vMxe6Gh26KwHnhDAHLluoajQ2jFYwB kAYQfq1HhN+RLEKa5URPU2ytFAKjgP1iGG1UQKbpgnNsGDQ++amA33l6KqVRHIhIXk+6 Pyv9hVtWulP0f/jc1RKxLnQYHV4ZW/JSq6zB2jj8Hdm3kpmB2Myg6ASsISxzlqR2PUvN MFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302610; x=1744907410; 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=EfgoiISEI6CCBXz+KLnorq2mkzdptbjBXDbJbv0ENcI=; b=IvbYw5avR1GFL/GRqDRd5VmYRc8fjnF23A1fj+jEQwhuxDGas2cknbYckTE2U8xU5U uNFIBkv+fq7Fy7a4AVhCSIptcebBXwlBlqrVtxjyvbTt8lnRrcUAyQ9Z4k+/jGrZPvOS aszXcfADnxtQ6fojWs0F0z2/BuQjJA6nmu1PdKDLaJ43ASevvFFHZXgPi5ewBlzcG04E vOs7Jfm8Y3NsTsTIKezeNr5MhB5E25Vlatb7/OFNyOwbsFWeoImxt0871GetsW1ann0E tuDgEyJ9syCSSJ/QYexxqbSksWQj5yMz6B+5M0SswWLfSlrcEhYxYhWkmstrW1R9JvlE BTFg== X-Forwarded-Encrypted: i=1; AJvYcCVucKbkivLxdgrTzxLNOaKlZ27+TkReVYnizkOCmgH34MPTvUtkYEnF2pwnAnUb2Cl7GWByLFb1xGGzUQ==@vger.kernel.org X-Gm-Message-State: AOJu0YyibphTG+rqLpu4iF9QgByX7sw2aeczpKguJz9zpw0NmIu059An 0Xqzy9KY8f5lRosiw5kGGxhF4FNGVzC13xpb0IiXqa9JFWBFe9XHm2vpkZQgxMQ= X-Gm-Gg: ASbGnctxBF1KyfAPro5WAuA4nuzDaclqRxsHhJidvPO05VoH4/9i4w5eUG0V+VzyiZ0 yz3R2pRcnXmidrWmhMQlNgf78fxyO7nqTtitxeLRkB2mNNMOibJ6Kbqi1e7fuLeuz8VVtHoFBF7 /pS8egU5kpLBiW8HpahkzdWvMGaaRp70Lq8JsIskATwqOwqvNqLQ+DbwKwYocBLyNjBrg5PZ/BX wsW4IupCiMwRIIKSTAj24g9TcxpZAV/1zUkP0GSK5Is6PaHJlbYr50P2Tm1QGoLjoVteFYidSpS vOexpGRYN93eQE74Cg6L8zw+zhuEcIlB9uNDh9NvA+Fh3obY1caUvtR+4eFKQw== X-Google-Smtp-Source: AGHT+IF7YxresxxIUSbFvKOXhrMSn92TtBy4rTG0L/x99604fWMt5TARqsw/+/xZMRt9jngqCpO+LA== X-Received: by 2002:a05:6000:240b:b0:391:ba6:c066 with SMTP id ffacd0b85a97d-39d8fd526f8mr3324426f8f.35.1744302609788; Thu, 10 Apr 2025 09:30:09 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:09 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:00 +0200 Subject: [PATCH RFC v5 1/8] media: qcom: iris: move sm8250 to gen1 catalog Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-1-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6915; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=tCEOYGPmIc1SPAM1HF+UO1/NYRAAsIsKLUXJIESOnu8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IMfeilWuF7TCcmZY4Vf7hudfDLAqCN0DgvzgK+ br44w/SJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDAAKCRB33NvayMhJ0U6SD/ 9eu8VP5fZKJUmWqiNhVFsP9SryZn/Pch5CB3w0UsohBaxx5ZsdmQ/hOV2noeGbQVAA3Y+ZuPPHEUFq XG5qS3iWPxny7ZWiv84OANxwLyeVo92A4cf/yFN/UD0xpRRh+OY1gs0gj4hmu2WaJ8AMuvwIx6Y7YI Wa1PRKGm6IFlwUAQLPbn0w1hjDu5Qq49NTvgSP+ZRuob350ZBM/F8KmeRQGypHOShJD4YZIAGrO0m1 peYZvwEDaD/q4I8QXH3XrRYM229nEbp2rOUhGR1eyxdxiLmDNwW5LjX/Tit2Hy548v/Ekbfyc0Adtb vLRISSZLyGHx4NtWa1/oTXLn5GRFHwjZw/IESaujA2+NrIKHncSUk5z1XQdQuyNt6Wv3dUJGz0RpyJ RPO8ijfo960Popy9dvNzz9FIamuyo+P8Jt7xOPhmYDl9SPPrHfE7kyebOkx9VPuejQMyvX9dVQ8CFT dUXQrcRu9MY4tRsWkKVc41XhqKV9x8SzXznOuTNCY8QPhXH48jpwfrHVqNyf9yjkTlqBw3P25tcp98 qZck9hdzUfJcTO0aFLvnG4plAQyNpeOnAFXT0JAhYMvo4YgjZ7DQJMyJDFU+DHIB0el3soh1FPLN+D WATjkT2LrgGa7QXhQ/x9z4yghkEeR0MKNAH3RAR/R4dfGUxFw1yMzQVTE7dQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Re-organize the platform support core into a gen1 catalog C file declaring common platform structure and include platform headers containing platform specific entries and iris_platform_data structure. The goal is to share most of the structure while having clear and separate per-SoC catalog files. The organization is based on the current drm/msm dpu1 catalog entries. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 2 +- .../media/platform/qcom/iris/iris_catalog_gen1.c | 83 ++++++++++++++++++++++ ...ris_platform_sm8250.c => iris_catalog_sm8250.h} | 80 ++------------------- 3 files changed, 89 insertions(+), 76 deletions(-) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile index 35390534534e93f4617c1036a05ca0921567ba1d..7e7bc5ca81e0f0119846ccaff7f79fd17b8298ca 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -25,7 +25,7 @@ qcom-iris-objs += \ iris_vpu_common.o \ ifeq ($(CONFIG_VIDEO_QCOM_VENUS),) -qcom-iris-objs += iris_platform_sm8250.o +qcom-iris-objs += iris_catalog_gen1.o endif obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o diff --git a/drivers/media/platform/qcom/iris/iris_catalog_gen1.c b/drivers/media/platform/qcom/iris/iris_catalog_gen1.c new file mode 100644 index 0000000000000000000000000000000000000000..c4590f8996431eb5103d45f01c6bee2b38b848c2 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_catalog_gen1.c @@ -0,0 +1,83 @@ +// 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_platform_common.h" +#include "iris_resources.h" +#include "iris_hfi_gen1.h" +#include "iris_hfi_gen1_defines.h" +#include "iris_vpu_common.h" + +/* Common SM8250 & variants */ +static struct platform_inst_fw_cap inst_fw_cap_sm8250[] = { + { + .cap_id = PIPE, + .min = PIPE_1, + .max = PIPE_4, + .step_or_mask = 1, + .value = PIPE_4, + .hfi_id = HFI_PROPERTY_PARAM_WORK_ROUTE, + .set = iris_set_pipe, + }, + { + .cap_id = STAGE, + .min = STAGE_1, + .max = STAGE_2, + .step_or_mask = 1, + .value = STAGE_2, + .hfi_id = HFI_PROPERTY_PARAM_WORK_MODE, + .set = iris_set_stage, + }, + { + .cap_id = DEBLOCK, + .min = 0, + .max = 1, + .step_or_mask = 1, + .value = 0, + .hfi_id = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER, + .set = iris_set_u32, + }, +}; + +static struct platform_inst_caps platform_inst_cap_sm8250 = { + .min_frame_width = 128, + .max_frame_width = 8192, + .min_frame_height = 128, + .max_frame_height = 8192, + .max_mbpf = 138240, + .mb_cycles_vsp = 25, + .mb_cycles_vpp = 200, +}; + +static struct tz_cp_config tz_cp_config_sm8250 = { + .cp_start = 0, + .cp_size = 0x25800000, + .cp_nonpixel_start = 0x01000000, + .cp_nonpixel_size = 0x24800000, +}; + +static const u32 sm8250_vdec_input_config_param_default[] = { + HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE, + HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SELECT, + HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO, + HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL, + HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, + HFI_PROPERTY_PARAM_FRAME_SIZE, + HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL, + HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE, +}; + +static const u32 sm8250_dec_ip_int_buf_tbl[] = { + BUF_BIN, + BUF_SCRATCH_1, +}; + +static const u32 sm8250_dec_op_int_buf_tbl[] = { + BUF_DPB, +}; + +/* platforms catalogs */ +#include "iris_catalog_sm8250.h" diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c b/drivers/media/platform/qcom/iris/iris_catalog_sm8250.h similarity index 59% rename from drivers/media/platform/qcom/iris/iris_platform_sm8250.c rename to drivers/media/platform/qcom/iris/iris_catalog_sm8250.h index 5c86fd7b7b6fd36dc2d57a1705d915308b4c0f92..4d2df669b3e1df2ef2b0d2f88fc5f309b27546db 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c +++ b/drivers/media/platform/qcom/iris/iris_catalog_sm8250.h @@ -1,55 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0-only +/* 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_platform_common.h" -#include "iris_resources.h" -#include "iris_hfi_gen1.h" -#include "iris_hfi_gen1_defines.h" -#include "iris_vpu_common.h" - -static struct platform_inst_fw_cap inst_fw_cap_sm8250[] = { - { - .cap_id = PIPE, - .min = PIPE_1, - .max = PIPE_4, - .step_or_mask = 1, - .value = PIPE_4, - .hfi_id = HFI_PROPERTY_PARAM_WORK_ROUTE, - .set = iris_set_pipe, - }, - { - .cap_id = STAGE, - .min = STAGE_1, - .max = STAGE_2, - .step_or_mask = 1, - .value = STAGE_2, - .hfi_id = HFI_PROPERTY_PARAM_WORK_MODE, - .set = iris_set_stage, - }, - { - .cap_id = DEBLOCK, - .min = 0, - .max = 1, - .step_or_mask = 1, - .value = 0, - .hfi_id = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER, - .set = iris_set_u32, - }, -}; - -static struct platform_inst_caps platform_inst_cap_sm8250 = { - .min_frame_width = 128, - .max_frame_width = 8192, - .min_frame_height = 128, - .max_frame_height = 8192, - .max_mbpf = 138240, - .mb_cycles_vsp = 25, - .mb_cycles_vpp = 200, -}; +#ifndef _IRIS_CATALOG_SM8250_H +#define _IRIS_CATALOG_SM8250_H static void iris_set_sm8250_preset_registers(struct iris_core *core) { @@ -80,33 +35,6 @@ static const struct platform_clk_data sm8250_clk_table[] = { {IRIS_HW_CLK, "vcodec0_core" }, }; -static struct tz_cp_config tz_cp_config_sm8250 = { - .cp_start = 0, - .cp_size = 0x25800000, - .cp_nonpixel_start = 0x01000000, - .cp_nonpixel_size = 0x24800000, -}; - -static const u32 sm8250_vdec_input_config_param_default[] = { - HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE, - HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SELECT, - HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO, - HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL, - HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, - HFI_PROPERTY_PARAM_FRAME_SIZE, - HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL, - HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE, -}; - -static const u32 sm8250_dec_ip_int_buf_tbl[] = { - BUF_BIN, - BUF_SCRATCH_1, -}; - -static const u32 sm8250_dec_op_int_buf_tbl[] = { - BUF_DPB, -}; - struct iris_platform_data sm8250_data = { .get_instance = iris_hfi_gen1_get_instance, .init_hfi_command_ops = &iris_hfi_gen1_command_ops_init, @@ -147,3 +75,5 @@ struct iris_platform_data sm8250_data = { .dec_op_int_buf_tbl = sm8250_dec_op_int_buf_tbl, .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8250_dec_op_int_buf_tbl), }; + +#endif From patchwork Thu Apr 10 16:30:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 880725 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 697961EF377 for ; Thu, 10 Apr 2025 16:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302615; cv=none; b=VyJ0sQ5yQXJsYLK6MRxG+ZS/yX5TkjjT/5fbl+GMCcXslTFYAWtRJtZIv7phVUBJhoYqxvJU6MkYUMwk2SeA89UJH5P2Mny4+LLdrvrb6Dw1m52tHut1HAH229lxDb6WR0zRaq/PuDaxk4PZ3MElw4Pn5r2mx8x22QKEYCdBm7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302615; c=relaxed/simple; bh=L4NXBpzPMKFNxMKi5oizC54iyk+GaNvSqVtucu7YlsU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fLLdij7y+OS377FbIuIlzjjRU1pbYjly/JiWKOZV3lyXo2AgnT7R/nPeazqyB80djUNlQwbkgL5UfCqdmpzbnb5TcFrpCwlZV0+pDOmdvxK7Rz8gJLHZGvJ+Xy04bdqFCR8+RfBPT+z4anVfrdVJhtjd1/YMYoJemvUBN0VEAe4= 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=xZaP7lrx; arc=none smtp.client-ip=209.85.128.51 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="xZaP7lrx" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43d0359b1fcso7416735e9.0 for ; Thu, 10 Apr 2025 09:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302610; x=1744907410; 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=stq3gy3C89gBLCbNpoC1WtQHytzE8kSphcRK2tdRkZU=; b=xZaP7lrxgGTX9JAONUp42ojzJ3k2ikSc+4gU40ZPRyg9aFwP6Kt/KYyiC2JM69QLNR 1eElPBctdJeFU5VH/LVvl4Zs8UWtzImd3auMdgG1TI0vP6PgAcg3jJmKWZo6VA3EcWKu 9vPyQTzg4FEqVjuwVD8h/9OM7f/jCLKEcDOa2cyDm1P67ja9AwG8VlrD4W6oAvIsD5sA eCN9ADOP4cqFKMHuiFitCzvwKK17KtY+7rLZmSFYkgTfCp1cPVzHoHDN+NMSWlDbTD7C C/YEWYeooHQhve/ZSRqtsgdTR3KV0t18ZwfJoK4pD+5/7owX3iZ50OtG1/GApskevnTM 2Mcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302610; x=1744907410; 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=stq3gy3C89gBLCbNpoC1WtQHytzE8kSphcRK2tdRkZU=; b=TzzXmZ4X71x5thp/tXL3e0r+el4JXK0Glzde7Bil/u7Nusqh4/tftt1g6YR9Bsky4N HYGvduAFTNmtxzbdo+dSZ0gP/cIEZtAbIp/SW3PLGu5Bxw8jzVCd5c5KKAf3a1e7duSA qCideRYhMaQL7H/XKCXaUI7l+4Xfc/ZpWoIRqxEHBCgkb9jin2Pv+HIN8t7RkzfD7bDT E0dcnj+ao7qEBCyqSC5h4t4gvowcxI0JVwHE0bCeIYe+UwEVR0QDVHBwcO1IQktaPUrm OkbMqW2S9nIp+X8VymOHF3zmnmahaJAkyNVSNNjupfMT9KmC4Nq34YghPfUfUjgvgnuG WnNA== X-Forwarded-Encrypted: i=1; AJvYcCXXItdSmkX6AzlTSGQiR7xSmZrWarcU61jYF/j485NZrK6FEKu9XBk2+LAfnTUpoltyWk/N60oQ8zGZwQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwZDqkrlq4ZGv6jwwOTIxkge1CmdfvZS9mjEQa+dTEXdOmmK720 lMbJSQQYAUBfSG8L3ucLArAwo6dVXv+GWOAM2fabR6L31YXffqdyxoiiTuzz5do= X-Gm-Gg: ASbGncuBR69QLbgJTXOqqYMgNrdTYs4TKDJ0pL8ZUv/5JeG3Vaf//ii5TKqRuohBAmA Dohs//EQaQgd5D64jEJQ0LDf8H01nY+6h6kqKSj2M0IPzrok8ZQVNOMJ23yFsrXr07CPi0ot/ej dcAZCEvfbeQXUN1E2oOlP6sRAr9OdIBJhHDxKmtVorVv17nMh4dx9b/OQf8Ih2Y2qqhIywyaUNt 0NW7DgfgnwYs/EuhU5Owup4uLQhKGJ263qWqwn2XH8eLavhZa/SqwwCNnZUE3yDLLtoxKzUW4ET y8MvdVls15u/rZHlK0LYAvry2pkietkGqIK9W28I6B4We0DhkSqwtUth/eEQCRWo97D1cHkY X-Google-Smtp-Source: AGHT+IFmLMreu/PX6gbj+vVUdVfkhJz3KnC+d9rJ+ne/nkWs0nvjTnHvLHfgwvW0aBBJ3zngwn5A0A== X-Received: by 2002:a05:600c:350b:b0:43b:c7f0:6173 with SMTP id 5b1f17b1804b1-43f2f0283cemr31704965e9.4.1744302610494; Thu, 10 Apr 2025 09:30:10 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:10 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:01 +0200 Subject: [PATCH RFC v5 2/8] media: qcom: iris: move sm8550 to gen2 catalog Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-2-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9291; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=L4NXBpzPMKFNxMKi5oizC54iyk+GaNvSqVtucu7YlsU=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/INaOefYh4X6fHWldzKKbLL1CkFKQZgGtWfq7X0 qM55IY6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDQAKCRB33NvayMhJ0RL+D/ 9zEaAjnZBFGe8gFlUKzIXOvbEsGV/mi2eG5S+8I9yaKDynkSAua9YLXDEnwXO2Y+yw5GfPxv+m1wuC szV2IoKY+AdyXOm1GN2z9agiRD/uoO0bndPeAILKtFtJG22EhAwk8m4Zz4IFfLiyIMqHG2F6+aLiK2 ryxIFZ//YKO2Fk3X5vn9hOD7VE+8sll+J/LaPTG/QW0OnLm0DKVXFKkkjk51LFYYJt4rEEd48C1Nse 7YjwVt2TQtyX9tSnQbPBmzE8x8nL2/pflywS9aNEkRli66Zq10exLn1kqI74LenUcFFmdlDzE6NRB1 wm7ePzbzWOoSSqilvXQzk71CyAm6gp3b625YYqnvN8MJiGEWgesRigSVH4tyms5kxEu1UdX0lbTtx8 m54KUm8R/QeROlZ2dwqm8ZgtHbQ1rghMxLRZme19NixySS+k3DFWdUjHjtu4CBW5zu/8WqaBu3dFQI 0YrlOsYhVMtlfkRNF5/XuvqkvSTR1I+nO1jiIzCBP1JZqqZI8Ap29MmBGRcQ0iQ06Xu93dGibmOr4F u5CeFiCTcSzIF6wPc7yhXweLGzWtunq8Ea2veG2uTSFBwAEtmgJyzwS8QzfKebIyoWAxHhLI/cz9yc u0Y/Rt4jWs2AJRFpBCL0EfcbfUj94uzmmJokUkldekKaFJ7XQNNDgzLK5jeQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Re-organize the platform support core into a gen2 catalog C file declaring common platform structure and include platform headers containing platform specific entries and iris_platform_data structure. The goal is to share most of the structure while having clear and separate per-SoC catalog files. The organization is based on the current drm/msm dpu1 catalog entries. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 2 +- ...{iris_platform_sm8550.c => iris_catalog_gen2.c} | 84 +------------------- .../media/platform/qcom/iris/iris_catalog_sm8550.h | 91 ++++++++++++++++++++++ 3 files changed, 95 insertions(+), 82 deletions(-) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile index 7e7bc5ca81e0f0119846ccaff7f79fd17b8298ca..379359c5c7e1e4ca39b1216335cd8cf2317b6308 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -10,7 +10,7 @@ qcom-iris-objs += \ iris_hfi_gen2_packet.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ - iris_platform_sm8550.o \ + iris_catalog_gen2.o \ iris_power.o \ iris_probe.o \ iris_resources.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.c b/drivers/media/platform/qcom/iris/iris_catalog_gen2.c similarity index 61% rename from drivers/media/platform/qcom/iris/iris_platform_sm8550.c rename to drivers/media/platform/qcom/iris/iris_catalog_gen2.c index 35d278996c430f2856d0fe59586930061a271c3e..c3f8ad004cb7f9317859b2594640c7138dbb6534 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8550.c +++ b/drivers/media/platform/qcom/iris/iris_catalog_gen2.c @@ -10,8 +10,7 @@ #include "iris_platform_common.h" #include "iris_vpu_common.h" -#define VIDEO_ARCH_LX 1 - +/* Common SM8550 & variants */ static struct platform_inst_fw_cap inst_fw_cap_sm8550[] = { { .cap_id = PROFILE, @@ -132,35 +131,6 @@ static struct platform_inst_caps platform_inst_cap_sm8550 = { .num_comv = 0, }; -static void iris_set_sm8550_preset_registers(struct iris_core *core) -{ - writel(0x0, core->reg_base + 0xB0088); -} - -static const struct icc_info sm8550_icc_table[] = { - { "cpu-cfg", 1000, 1000 }, - { "video-mem", 1000, 15000000 }, -}; - -static const char * const sm8550_clk_reset_table[] = { "bus" }; - -static const struct bw_info sm8550_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 sm8550_pmdomain_table[] = { "venus", "vcodec0" }; - -static const char * const sm8550_opp_pd_table[] = { "mxc", "mmcx" }; - -static const struct platform_clk_data sm8550_clk_table[] = { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, -}; - static struct ubwc_config_data ubwc_config_sm8550 = { .max_channels = 8, .mal_length = 32, @@ -214,53 +184,5 @@ static const u32 sm8550_dec_op_int_buf_tbl[] = { BUF_DPB, }; -struct iris_platform_data sm8550_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_vpu3_ops, - .set_preset_registers = iris_set_sm8550_preset_registers, - .icc_tbl = sm8550_icc_table, - .icc_tbl_size = ARRAY_SIZE(sm8550_icc_table), - .clk_rst_tbl = sm8550_clk_reset_table, - .clk_rst_tbl_size = ARRAY_SIZE(sm8550_clk_reset_table), - .bw_tbl_dec = sm8550_bw_table_dec, - .bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl = sm8550_pmdomain_table, - .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table), - .opp_pd_tbl = sm8550_opp_pd_table, - .opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table), - .clk_tbl = sm8550_clk_table, - .clk_tbl_size = ARRAY_SIZE(sm8550_clk_table), - /* Upper bound of DMA address range */ - .dma_mask = 0xe0000000 - 1, - .fwname = "qcom/vpu/vpu30_p4.mbn", - .pas_id = IRIS_PAS_ID, - .inst_caps = &platform_inst_cap_sm8550, - .inst_fw_caps = inst_fw_cap_sm8550, - .inst_fw_caps_size = ARRAY_SIZE(inst_fw_cap_sm8550), - .tz_cp_config_data = &tz_cp_config_sm8550, - .core_arch = VIDEO_ARCH_LX, - .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE, - .ubwc_config = &ubwc_config_sm8550, - .num_vpp_pipe = 4, - .max_session_count = 16, - .max_core_mbpf = ((8192 * 4352) / 256) * 2, - .input_config_params = - sm8550_vdec_input_config_params, - .input_config_params_size = - ARRAY_SIZE(sm8550_vdec_input_config_params), - .output_config_params = - sm8550_vdec_output_config_params, - .output_config_params_size = - ARRAY_SIZE(sm8550_vdec_output_config_params), - .dec_input_prop = sm8550_vdec_subscribe_input_properties, - .dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties), - .dec_output_prop = sm8550_vdec_subscribe_output_properties, - .dec_output_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_output_properties), - - .dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl, - .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), - .dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl, - .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl), -}; +/* platforms catalogs */ +#include "iris_catalog_sm8550.h" diff --git a/drivers/media/platform/qcom/iris/iris_catalog_sm8550.h b/drivers/media/platform/qcom/iris/iris_catalog_sm8550.h new file mode 100644 index 0000000000000000000000000000000000000000..e101eed6568bfc7c62651491daad0e9e5b0224e5 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_catalog_sm8550.h @@ -0,0 +1,91 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef _IRIS_CATALOG_SM8550_H +#define _IRIS_CATALOG_SM8550_H + +#define VIDEO_ARCH_LX 1 + +static void iris_set_sm8550_preset_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + 0xB0088); +} + +static const struct icc_info sm8550_icc_table[] = { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const char * const sm8550_clk_reset_table[] = { "bus" }; + +static const struct bw_info sm8550_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 sm8550_pmdomain_table[] = { "venus", "vcodec0" }; + +static const char * const sm8550_opp_pd_table[] = { "mxc", "mmcx" }; + +static const struct platform_clk_data sm8550_clk_table[] = { + {IRIS_AXI_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_CLK, "vcodec0_core" }, +}; + +struct iris_platform_data sm8550_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_vpu3_ops, + .set_preset_registers = iris_set_sm8550_preset_registers, + .icc_tbl = sm8550_icc_table, + .icc_tbl_size = ARRAY_SIZE(sm8550_icc_table), + .clk_rst_tbl = sm8550_clk_reset_table, + .clk_rst_tbl_size = ARRAY_SIZE(sm8550_clk_reset_table), + .bw_tbl_dec = sm8550_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec), + .pmdomain_tbl = sm8550_pmdomain_table, + .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table), + .opp_pd_tbl = sm8550_opp_pd_table, + .opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table), + .clk_tbl = sm8550_clk_table, + .clk_tbl_size = ARRAY_SIZE(sm8550_clk_table), + /* Upper bound of DMA address range */ + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/vpu/vpu30_p4.mbn", + .pas_id = IRIS_PAS_ID, + .inst_caps = &platform_inst_cap_sm8550, + .inst_fw_caps = inst_fw_cap_sm8550, + .inst_fw_caps_size = ARRAY_SIZE(inst_fw_cap_sm8550), + .tz_cp_config_data = &tz_cp_config_sm8550, + .core_arch = VIDEO_ARCH_LX, + .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE, + .ubwc_config = &ubwc_config_sm8550, + .num_vpp_pipe = 4, + .max_session_count = 16, + .max_core_mbpf = ((8192 * 4352) / 256) * 2, + .input_config_params = + sm8550_vdec_input_config_params, + .input_config_params_size = + ARRAY_SIZE(sm8550_vdec_input_config_params), + .output_config_params = + sm8550_vdec_output_config_params, + .output_config_params_size = + ARRAY_SIZE(sm8550_vdec_output_config_params), + .dec_input_prop = sm8550_vdec_subscribe_input_properties, + .dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties), + .dec_output_prop = sm8550_vdec_subscribe_output_properties, + .dec_output_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_output_properties), + + .dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl), +}; + +#endif From patchwork Thu Apr 10 16:30:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 879960 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 332E21EE02F for ; Thu, 10 Apr 2025 16:30:12 +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=1744302615; cv=none; b=m4CxCSjFunmgEheGcITmTU8/adQptlbmSJ9uD2phPVfDlv0pzsAO+HxF58eKy7YL2anV11w5+wTRi+cNCp/Ta4CdwWi06Sff8WpT2UjvLfnfnKfkxXe5OAYckRPH71StG5mW6YYtVfxhGKbes/afYLPXFjMW3ptRrehoNSIMlhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302615; c=relaxed/simple; bh=ykuyFmkKMHJIXqo4oh3w0kqcgoBIO3smwRfR/rRJkQQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NCyAl1U4yEEs4/IhvWsMbl/Fpnoag0MJyNZ67RekuB9qHVhCL5V3NOyC6Ii6fxzLXiMoZKTFZOwO+LBR8RoMGT68lya2nzW54z871dgXhaQBc+K5/289n2TsTuEwj7GF/1KAR3FDxCLXI49QggjYlJlD4dGet5/S5ET44MdzlsA= 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=wWCq0unH; 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="wWCq0unH" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3965c995151so456098f8f.1 for ; Thu, 10 Apr 2025 09:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302611; x=1744907411; 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=sYQ/bnYqcpDq9DEnr3MypQ+/gd8s486fsMpMYGxMvlw=; b=wWCq0unHeB4wHikVtMnq1FTGPC3uBR8GacH6WxkmFlmE+QmcrBE0IXjmvNB/U+HMYa hT/DO4Q/KGQPzf37eqtBd/7U7TC/fwFLsZpQ3pgz+bkFEp+1GIhZibUVedfb30xdHn5o xk8jA/oLzbEdPNVuWIE0eJGZj66ZdPlosa+64f1SZwihvKalqP3KSS9f9S14iZmAjLo2 gGB1kWBBSPhKYMi1+NvCFAiHq5WBgSMpPS48fblitpY6yQADE359Z3iQ3FuCLxHj0bLX DIcKAQvKz2S76BdE00oO8KMU1erxf7cl4FXJ8qG5ogPxo1gmcoGAfuitOX7mLEFskXNt U2sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302611; x=1744907411; 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=sYQ/bnYqcpDq9DEnr3MypQ+/gd8s486fsMpMYGxMvlw=; b=nGWof1PJ3aLLbJGktqXFtxpvsCzRPiuIUOPhsJXTNNzGjcJs6InpOFTZJ52r4MDoLZ jGlmpR1TmU9TBFRnEVqFOqqbaPs+vk04iqqwvo1JWA/FdfmY1yf8NqxyNdleoNfCBBJu UYdB+5p4HklRrrucZxXofBtFQtbdWpSvU2r/UKu+m/5XvnFNLA016M4s43IAArGvRyYq 82bXeYpxQHDZxo24VxeauDWF0Xh+YHmVHi2+Tu9VaBeHlXjybARL8av/U1UmqgHMwso9 Ybndo0+rXBnll9q9W7duSQlhZY3R46DQvbsqCo6idL1r4zTjDbK/cp366Hfv2XjgKtE0 a+SA== X-Forwarded-Encrypted: i=1; AJvYcCWRRKUXcHCfv5wYuOZMekJcB+xmmGUBRxnjIfxf12eVNIt6zNzBAmBLl5suq4tqKEszwaMOLwxydKs23g==@vger.kernel.org X-Gm-Message-State: AOJu0YypG4Lbe0f5Y6IdPYBabYEAMkkmVoC43Aoz8dwrNBc/XkbdjEpq X+yh3zHLRL36M6LzizSi+jkabKg+RDOYCvALwHVbJYdy45Saws6sPpmshWh3sqA= X-Gm-Gg: ASbGncspje9tUXFPXIuChXGYEDY8G9PW8BLcoqrZpoP1HimTi4ANzoGkGTK6f+HRDr1 34lr69MuNoz9joM+UZOrPnax9/5PE6tSC8hnMVaTtApg0EV74riZIjqQL0bYJSCyPUTNbZMknwK Ww0pztAt+8h0sr4Yl+z+NzcsqXPiLIMWmFhZzKwb3hSes1pzWNxOziHY70bn/FvJigWI/jzuOAI eWRGHaNsbUEGCi6ThP0/e43ngU4e6XniKYaPzISLYzd4X5Gdsshq/Dti8Xinjli3nVPO/U6grPb onqsCXD2DOGswAaeNAfIRrJ14ZkNMQc0j1U48IjH4vALKbYhkns9tkdIHbyM0Q== X-Google-Smtp-Source: AGHT+IFV6YhdZkPcWRiBwQVYxNCnscM5FEJq3aM7UfRULZk1GKfyFRsc4++grb2K1Ep+6ZyvjZSzCA== X-Received: by 2002:a05:6000:4404:b0:39c:268b:8b66 with SMTP id ffacd0b85a97d-39d8f4e4407mr2261773f8f.43.1744302611222; Thu, 10 Apr 2025 09:30:11 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:10 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:02 +0200 Subject: [PATCH RFC v5 3/8] dt-bindings: media: qcom,sm8550-iris: document SM8650 IRIS accelerator Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-3-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2152; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=ykuyFmkKMHJIXqo4oh3w0kqcgoBIO3smwRfR/rRJkQQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/INPzUYtOoyWklDXoeefSnzcVEVy7d/Jx/eXS+2 aoWQIyOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDQAKCRB33NvayMhJ0Vs1D/ 95RLXTgsq4KVMRGQZkrlZnwR/LV+zfacDGth7gKK/ThiW+Xi9ACiccImr49qLwzT75s5UxHKGQzhWF dFyIWUEwidNffW9+q374IC6ZU0AeacHAH/08jLdhlQtOqrItFPTqTooMO3JWQd2AKeNWWwO0dJtIRd uH4ZJsbFxWKmfTaUW1G0tLwwPaOyUPM/m/uUrPWctQFJrWBb6UbKEmLDK3kBy737jVk4Bf9F594cms LY1KxTKP+7dO5AQpkknqDbwphbIvjO1OkgJMET4BCUrbv8n9VVLw5GKsjo81UNdJ1qWAbhrWow/lI4 ZhMYyb9OoxEKR7z3SXVC+oqdD92eR+pVF4Ucb3YY8oZm8joCGxP8gsFqc4T2a8y6AFY2X6nv21OIP6 Grihg2/RHJlUiSSUrp+0Nv6LNS3HVqf+EEpVFYoxHZ1ROrjPNpAUnsNKQLZQQDvPaWa8Fr5E1BQ9B0 cdFdytU9aiHdLz5mrAoHRAS8F0m+UGC8SNculetNxMdUmKHDS4KNgWgBsEYSz8cC6nWebnOcxEackU PUBfsFI8xHGeJJk11bS5VggRZ+eMJmvUrBkOQhtubEVJpH/Muf+bSKz0P8Wuz48GVjR/uzcwxKsMhj nE2zHZeF9v+0EjeY2zXBlKp8rw+Iu8ukLwjTERSCncY3M9HBpq8QtmahTNcQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Document the IRIS video decoder and encoder accelerator found in the SM8650 platform, it requires 2 more reset lines in addition to the properties required for the SM8550 platform. Reviewed-by: Rob Herring (Arm) Reviewed-by: Vikash Garodia Reviewed-by: Bryan O'Donoghue Tested-by: Bryan O'Donoghue # x1e Dell Signed-off-by: Neil Armstrong --- .../bindings/media/qcom,sm8550-iris.yaml | 33 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index e424ea84c211f473a799481fd5463a16580187ed..536cf458dcb08141e5a1ec8c3df964196e599a57 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -14,12 +14,11 @@ description: The iris video processing unit is a video encode and decode accelerator present on Qualcomm platforms. -allOf: - - $ref: qcom,venus-common.yaml# - properties: compatible: - const: qcom,sm8550-iris + enum: + - qcom,sm8550-iris + - qcom,sm8650-iris power-domains: maxItems: 4 @@ -49,11 +48,15 @@ properties: - const: video-mem resets: - maxItems: 1 + minItems: 1 + maxItems: 3 reset-names: + minItems: 1 items: - const: bus + - const: xo + - const: core iommus: maxItems: 2 @@ -75,6 +78,26 @@ required: - iommus - dma-coherent +allOf: + - $ref: qcom,venus-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sm8650-iris + then: + properties: + resets: + minItems: 3 + reset-names: + minItems: 3 + else: + properties: + resets: + maxItems: 1 + reset-names: + maxItems: 1 + unevaluatedProperties: false examples: From patchwork Thu Apr 10 16:30:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 879959 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 AFE841EFF9F for ; Thu, 10 Apr 2025 16:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302616; cv=none; b=rDTmbS1Qrw7L0eGPVMqpZTQt1DycYkA8mrA15vdzPK0kEtFkI35E+kdqWGlxmrdnUVySPhiNlxHFhW0eQxcfyGqToz05B+A7vj4PHe3Hmw/QvzhX9/iJhb0F4obrS5iTezxPDfXuQpIGrGdEIJJ9CF9RioHZK+bRF4OLYb9V+aA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302616; c=relaxed/simple; bh=9hnSK/z/at7Q/XPaFDHxC32ZrhxYmQz5KS3r7i8xong=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lSXS3HDGdU0M64zFL4667uQXuKDyU5IA5Ezm7weW+AbCxGOxzmQIA7Yam4G5/hql2AkR3G+BkgaVCpJStCTtgy1Ph7O9/gNhrv8F+a4qpRl5XGLUfWlwWM+S6ts2mBMi4VvceMvwYR1bLl0ZPMJbWPRbWi3PnUiKziw34h5fJdI= 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=SkidFJrO; arc=none smtp.client-ip=209.85.128.46 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="SkidFJrO" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43cfdc2c8c9so5941375e9.2 for ; Thu, 10 Apr 2025 09:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302612; x=1744907412; 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=XUkiFVraV2V5GiQVRCmgiYRRVnT/EoG7D4jFzUZHq4g=; b=SkidFJrOGFs0LDSdMC7Mvnlt7Vi5/0XEdnJ/yYLMYaxDLUgD4FAbkzY70aqzo6WLZw MABvUTb/2a55YQBh9fL6/PNwwRXSckY3SG8vg5sdNcp4uW0omaWUVXbYat70thgFPpIn cNeRwZdxBtxOrWKJfIpC33QvB4Jb/0ucz39tQvaes8/AuFrxdFeib2evBQC6rp5WIdCj eVbjI8BjroGPjXihmNe1RQ9Gp5OOo88mQjWMo323m55BV5FutE3MnkQeUvJhSZYpXKr8 6wtSYMpmChU9ld2fQ7FI4XB1m99jxlmkvWgQSi7D80wrLhJZIfWWh8NOMZOOkyTplbGE R18w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302612; x=1744907412; 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=XUkiFVraV2V5GiQVRCmgiYRRVnT/EoG7D4jFzUZHq4g=; b=R4d5o1CfH+sohF/GqCeOTQtGyRQqY3Kpfn8eirKiIHulPgsZkVEmnMZ8KTWGLahDwe O0W1vANym1P3rRPCVp/bC4kxlkw+zrjn2jHMmxeSdLnJ9grZSoIfIpViTX3WXDVnrEjZ qOagEQSIhvTP637wZtzpw8PLyGdTwMVbHLfdg+iuCIvqVFqjxlAMNfXFuCETv/z7MQmb FAER6Lca6mNWuVtSVJDyr6vB6yj2rAX/uyFDWT3MA6Fxe+tYjsz5jBxKmRsPEnA/u2Nz tIKKM66PfKcpPw7/k3Z4spdmkYaTaEbnoyg4e+pbDK7gvKqShF8hcqP0w2GK3nc6A7Do pweA== X-Forwarded-Encrypted: i=1; AJvYcCWhvqUVfvLOpLT/sBMHCpU50XjFLGrqfLEvpfN6dnoHRX7Urybl82r6N+gqZiqideogj9EsbCem5QdhqA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw0nzOapDksNEWh7KyzQOZzGQMk8wizmeIC/y+wbNece2Rsrxut btH313Hd++jmhHUswS/epW4CgzSlZIsnFsF4Kb2Go5qhs1miFdNuYqNsa2GT1P8= X-Gm-Gg: ASbGnctWmLrfZw7ldDozI37+bm/MK4GbPclDv8BaYlORfV8FA9usXBo1GAjF1BH1Bn7 ERJVN0xArKaDZa35bV4JiWWxpBZmaz+/kq2SO1b4EWZ5+eOt6rWcHTv3OfDz5KZn26o7ZgipuQO MeJQ1aOiJKtVadYvwppiI+Nz6wHPxRzgf8cTS63NwTahbLABb1YFB51NUymI58S42zu3VQdytse PkBbGE21iTjizGzksDauyQUPT51hd/DzQBaOvYCNet2iOwWL7KBPv2hEs4F1+JTjed11Cj/VPio 5ipQD6ggK58UVMu/yzn/3GzYszYPbAEz3WkVX2kZ0RPn3Mq2mq2QTTwuCQAwkw== X-Google-Smtp-Source: AGHT+IFxjF2gHLiKfg5QgRRMqEL6azQIXI7YefMvmf03mZOpilzBQB8kYkVimEZ402PU9nPvEnk/nQ== X-Received: by 2002:a5d:598b:0:b0:39c:1258:2dc9 with SMTP id ffacd0b85a97d-39d8f4fabf8mr2980744f8f.58.1744302611961; Thu, 10 Apr 2025 09:30:11 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:11 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:03 +0200 Subject: [PATCH RFC v5 4/8] media: platform: qcom/iris: add power_off_controller to vpu_ops Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-4-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3981; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=9hnSK/z/at7Q/XPaFDHxC32ZrhxYmQz5KS3r7i8xong=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IO7fY/TiYLmUCrygDjWc4Pe2AD87n+YDOZ7KCT UwU8KPqJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDgAKCRB33NvayMhJ0dLUD/ 9A1TPXjDCxWywg98LnlS1ERRlAGO3nuT4o1cQJHKoOihdlkkS4nzqip4yr92WqARIt+mEH5gCYxgWw AZF7rbYuyDnZICt5fuMWHZoEm2Qcs7KXFhG/peS+dzH5qH8ByrEOnP5omnmQg6FAcKFek6GHZG/tO8 lh+y8PXEnQhwlXejW0CSS1Wz6K9HOgRwHvkrN8t/PGez7T8YmdklBboXJOxz50pOaGbpuFEb/PPnln xCXmpwXGpsSIgE0GPdn2TQcq2knEwfXiqOXSmwwV6wvk9IHX92Vt1E9ZPepKHNQ0qNaURIhKYxmjE8 a/xakMKb/O/7OzMcT8UEfsk1APHpK+XIv+RmW77lM8DlJmdDAOhFz91FmBFBCU+IIbO/WuS4BuXDt6 awHGcNj5I7ulxY5IFIn9nkIYK019/DujZO6JHFXrnvf6lu88IVYoAt4wM8rvXubxb2ooaykqBXBLv5 LtSk+FBQF/eP2XKa0eGghzp9D6XlGE0it2Mpo+VsKozE7cX6LRZYT5xY3otoj6JW+iHMAqLw6eIqki IluZJzB8Rf4sx2YxFhWpNX0IEO66/TM7Kv7i+HJVBf219pLKbcwxEYiyQ5gWkZNjTzKAkXRljsD7DZ SxkHLI88FydvWuqh0qeFIRhf1q0xoc8jyNKttNQgg3zoXFCemXp+2cZJ/MSQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE In order to support the SM8650 iris33 hardware, we need to provide a specific constoller power off sequences via the vpu_ops callbacks. Add the callback, and use the current helper for currently supported platforms. Reviewed-by: Bryan O'Donoghue Reviewed-by: Dikshita Agarwal Tested-by: Bryan O'Donoghue # x1e Dell Reviewed-by: Vikash Garodia Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_vpu2.c | 1 + drivers/media/platform/qcom/iris/iris_vpu3.c | 1 + drivers/media/platform/qcom/iris/iris_vpu_common.c | 4 ++-- drivers/media/platform/qcom/iris/iris_vpu_common.h | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/platform/qcom/iris/iris_vpu2.c index 8f502aed43ce2fa6a272a2ce14ff1ca54d3e63a2..7cf1bfc352d34b897451061b5c14fbe90276433d 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_vpu2.c @@ -34,5 +34,6 @@ static u64 iris_vpu2_calc_freq(struct iris_inst *inst, size_t data_size) const struct vpu_ops iris_vpu2_ops = { .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..13dab61427b8bd0491b69a9bc5f5144d27d17362 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3.c @@ -118,5 +118,6 @@ static u64 iris_vpu3_calculate_frequency(struct iris_inst *inst, size_t data_siz const struct vpu_ops iris_vpu3_ops = { .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..268e45acaa7c0e3fe237123c62f0133d9dface14 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,7 +264,7 @@ 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)) diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/media/platform/qcom/iris/iris_vpu_common.h index 63fa1fa5a4989e48aebdb6c7619c140000c0b44c..f8965661c602f990d5a7057565f79df4112d097e 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; struct vpu_ops { 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); }; @@ -22,6 +23,7 @@ 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_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 Thu Apr 10 16:30:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 880724 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 8E06C20371E for ; Thu, 10 Apr 2025 16:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302617; cv=none; b=e6XNDSQiAidTCJOFSydkzU9k2jWGFgfdtBaTZnM7+BlLOxi2OH2PRVVg1ce1YvYT7r0ldLLtLRCOiLUCs2Sem71rbh6QhjfvY+JmIGZ+qRNBOSqcWrfhfLSGdDlDo8rPloCDrizoZGd5ZKhtGuY3e0zKE36frjqNPO8o600MDjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302617; c=relaxed/simple; bh=UkC2xQ49cwtjimQJomEXRVHWedJyZAC8YoJhIXvmiUg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CDhvHK5SnN9FR4h8l3002MAtylQHEqyaKJFyiGSQ0/N42DwR/rFEYXCrIAFvzC0J6uJCsfpWFS28iIfZVQllXeMi13HD+CBI8dirCjYrNXfzNtql6Ax5YR6KhhhqXmaHsnr+kySt8RYJrURX1nNnl+alvOo8N8j+LHCGUIpXSYw= 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=wLpeftR2; arc=none smtp.client-ip=209.85.128.43 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="wLpeftR2" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso11391385e9.1 for ; Thu, 10 Apr 2025 09:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302613; x=1744907413; 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=Bo4P1zkBy5ZJ7KB9fJf8Jg+rHcpVMabyPlCyrK4lEHg=; b=wLpeftR2AHtHlo/wynMiGvrIlWrB6uaakG/jZKGqHBOR3qD2S3PlgKqDNiUYHsUhfK jkGjrT2B/Xug3whCwufJ9TWxDoTCdE1S58gfEXuOuGhTPjAEntDVDxYIU9aVHf6j+MKu Tnx06/Qyz1uKhDns/2G5hYaUQzf6smxvAqj5Ov6alRDvkxy9qwWOSfkVJK18iW8pvgjN 99WSRShbj4L+Nh7go4kb5tmdwiYgdttNLO4JQvt9jgra7WAcQzKx5dn4oVVcYSE3j5PM qbLcCZfqwMbQALL2AiY7GiXbIsMtArgKHuQ9IRA742vsbON+jKPYLDNtWDW6/o6ijmhL WoPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302613; x=1744907413; 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=Bo4P1zkBy5ZJ7KB9fJf8Jg+rHcpVMabyPlCyrK4lEHg=; b=m7h6khjJSeYJDvv+RZ1tLGC6+LuqyeoX5ebOOQN4jiTY9uXKg4UIZ526wUlKTE1knW BUN+h9lYwizuM+Ojftu0vPp35R6ouAzS7iTjr8KVBll9auei6ZoXAklVUFD5EqyHqpnn 9xKYwFh+H5yTp/R9jg8SuEcwLDxdUtu3HzBcvDKxy6cO2Bj2e1M9zM/muqGWx3+PE7cJ UM9yQEoWlwtFKJbM9dQnlGZcp6qnqw/XukWKEyboV/LVjpsXV7tNoENG48rGgd+jWHO9 +e9Jwev5Jw0wMYSLsNs5hJ8XJ1rkrUHLomLVUXiSo745B+be/wrK31kYx0ZxISAKJeHO MIXg== X-Forwarded-Encrypted: i=1; AJvYcCWuR37O5iNS5ZLJ4XiV9+uUkp38ZnaOqfzJNs7L+YsSihvaZZcgRRsgtEa38MPXxJAP7p8LSCsJYXLzpQ==@vger.kernel.org X-Gm-Message-State: AOJu0YydGMSyHa2h05t6uEtzXzYy7LPUbB4lSnj9wpPUpjO5eYwAYpkA 1PtL4OEcLnhZXRan0TP9n2XOCGYEe1RqtrDjrbSW3HJAjHkxeMVhM93xcI7gp14= X-Gm-Gg: ASbGncvllAUu1jgtdu6mhSQSqkfJQQsgLD+LRY6g0eUxPv+QFKf2UZ9ao+npMnzE6IY YqTuA2R4AyOK8CD78uZ1MVzsYBhzSJvw+Dp8bbGntXep6IZ3Vbg4O6dDsd4xid15rueM2CYoXkI aAd9t1FT0XjvIinrSF2+tLrWknisosJJD1eXi+nAVCivbbDuErCwceqo+0skgUTv6XEgl2QiSKZ H48mjjouqURObdG379SFRXa2xjUvvxCvFPbW/qhd6qUbztV277CMAbm5gS0z6eHQjkTRRelDIeY eQmAfW4XNgNsHxdKRO0wqYcrt8Anxt2SsJL8s/3Mo7NJECkF6eAPLSI1TWKjKO/er6UcKLmu X-Google-Smtp-Source: AGHT+IE9G6rweHJg5MaCovI5Z4ztNCtTUYulhsgxLzS32BNlAsLoCeAGzQtHu9bhc3mmPUNTGYj7jA== X-Received: by 2002:a05:600c:4e54:b0:43c:efed:732d with SMTP id 5b1f17b1804b1-43f2d7da910mr46432145e9.16.1744302612669; Thu, 10 Apr 2025 09:30:12 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:12 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:04 +0200 Subject: [PATCH RFC v5 5/8] media: platform: qcom/iris: introduce optional controller_rst_tbl Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-5-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4061; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=UkC2xQ49cwtjimQJomEXRVHWedJyZAC8YoJhIXvmiUg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IOqo/GpXdVG4Zvz4PTj10jJM0BhDDEqVLReD8Q nRBNpx+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDgAKCRB33NvayMhJ0f2ED/ 0bJekcRGAmF6RO5h6BrXQCtAncZ/lbnblsmjd4eR44TnDGZKXlfYwn5OX0gZP7oFdYDth0hkeKZeXE ppuhZhHfo5kBYVRbvrGuw/lC6CZU6hFXd08dDfIW+EiMLXR2eL8Z/MqZy2fuvHlcOTm5YW6c9Iczt9 mSSoq5bwi8JUYm8Wycdeb4ejT56i2PcNXinh4IbjL3eT+orlO5gjXSkVfa8Xe5lqbZ5qwpWS6elWu2 1zvRmbJTw0Zkl3ThTh37dyGMQ9LL6NqYIsmA6B8QPOzTSFSm4hYtn5dA/rN8Mj/KvZEU5uWfjW7rEO mXf2GCNlXfYfAUIE0tPBzTcE0v+OiqUWo1zUTpyJnXdRQfaN4ECElEYH4seGWciiA93M5oSIheP8qj YpW6+sP1cSyXYwuypz6jLNsK7+YebRinipmqj59iImgyg0DZ3E0mA2X4XdhlQSzqN93+iOTgq2fhX7 5uFEKMJe+c4ZSgMn5iJuujSlnjlyLY0twCQEOcZryqckfW+VwiEUm1MXJBePn1BGGXcmgklnldgCRW KAGQy87UkTbaTKx5w6vPadOt7+MfvkVcBoMl1Ew/DwDuJYeq/mM+QGzbzH2xB8AQzYMvgFCf2M5ybA 2PNkP3CWZlncISBtwnzE8mNfqeRnheoddDi5rCAZXfGSecu67485AJFdFMrQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Introduce an optional controller_rst_tbl use to store reset lines used to reset part of the controller. This is necessary for the vpu3 support, when the xo reset line must be asserted separately from the other reset line on power off operation. Factor the iris_init_resets() logic to allow requesting multiple reset tables. Reviewed-by: Bryan O'Donoghue Tested-by: Bryan O'Donoghue # x1e Dell Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_core.h | 1 + .../platform/qcom/iris/iris_platform_common.h | 2 ++ drivers/media/platform/qcom/iris/iris_probe.c | 39 +++++++++++++++------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h index 37fb4919fecc62182784b4dca90fcab47dd38a80..78143855b277cd3ebdc7a1e7f35f6df284aa364c 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -82,6 +82,7 @@ struct iris_core { struct clk_bulk_data *clock_tbl; u32 clk_count; struct reset_control_bulk_data *resets; + struct reset_control_bulk_data *controller_resets; const struct iris_platform_data *iris_platform_data; enum iris_core_state state; dma_addr_t iface_q_table_daddr; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h index f6b15d2805fb2004699709bb12cd7ce9b052180c..fdd40fd80178c4c66b37e392d07a0a62f492f108 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -156,6 +156,8 @@ struct iris_platform_data { unsigned int clk_tbl_size; const char * const *clk_rst_tbl; unsigned int clk_rst_tbl_size; + const char * const *controller_rst_tbl; + unsigned int controller_rst_tbl_size; u64 dma_mask; const char *fwname; u32 pas_id; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c index aca442dcc153830e6252d1dca87afb38c0b9eb8f..4f8bce6e2002bffee4c93dcaaf6e52bf4e40992e 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -91,25 +91,40 @@ static int iris_init_clocks(struct iris_core *core) return 0; } -static int iris_init_resets(struct iris_core *core) +static int iris_init_reset_table(struct iris_core *core, + struct reset_control_bulk_data **resets, + const char * const *rst_tbl, u32 rst_tbl_size) { - const char * const *rst_tbl; - u32 rst_tbl_size; u32 i = 0; - rst_tbl = core->iris_platform_data->clk_rst_tbl; - rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size; - - core->resets = devm_kzalloc(core->dev, - sizeof(*core->resets) * rst_tbl_size, - GFP_KERNEL); - if (!core->resets) + *resets = devm_kzalloc(core->dev, + sizeof(struct reset_control_bulk_data) * rst_tbl_size, + GFP_KERNEL); + if (!*resets) return -ENOMEM; for (i = 0; i < rst_tbl_size; i++) - core->resets[i].id = rst_tbl[i]; + (*resets)[i].id = rst_tbl[i]; + + return devm_reset_control_bulk_get_exclusive(core->dev, rst_tbl_size, *resets); +} + +static int iris_init_resets(struct iris_core *core) +{ + int ret; + + ret = iris_init_reset_table(core, &core->resets, + core->iris_platform_data->clk_rst_tbl, + core->iris_platform_data->clk_rst_tbl_size); + if (ret) + return ret; + + if (!core->iris_platform_data->controller_rst_tbl_size) + return 0; - return devm_reset_control_bulk_get_exclusive(core->dev, rst_tbl_size, core->resets); + return iris_init_reset_table(core, &core->controller_resets, + core->iris_platform_data->controller_rst_tbl, + core->iris_platform_data->controller_rst_tbl_size); } static int iris_init_resources(struct iris_core *core) From patchwork Thu Apr 10 16:30:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 879958 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 09E7E27EC65 for ; Thu, 10 Apr 2025 16:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302618; cv=none; b=ZA3S2dEbn96azuEk+CLOkHLVVPIOHQ+Rzjcu0WdFDwl2BLc8wVbcAwAT4GP6BOH9cJS1QLSkt0tBy+KX1+0IbA4tqZ+d5XMevU7FAcRW4RNkcL99/m1sE4kqjm5truXBwPUGqx3B3m1A+Srqxx4Pc9BrbFGg7GlDYEj6TWxPGIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302618; c=relaxed/simple; bh=1DA4EahdV3iTAAHe9xKki0mAkcrYdEERZmB4u+gnX4A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c+jWDFRgo2aHT1oG1cXDcg424pB0WrlprsegVdQcYLBsJzhUYOKWcbRj1cX96WoVhTHHcfcSzxKkMESLKZHde43KhIy/0l6fnFUP51WVJQCnuJHzWHa8SzyYzHkWjk45filcouPxSyRZIM0WCJaaOmB4ZGYHJFpSuaO8cFsLM/k= 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=uCeEvlRZ; arc=none smtp.client-ip=209.85.128.42 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="uCeEvlRZ" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43cf848528aso8052065e9.2 for ; Thu, 10 Apr 2025 09:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302613; x=1744907413; 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=UdxN9N+HI7dt/tS1Aq2Bnv9Sxoi8pNvlWmvGXY6b/d4=; b=uCeEvlRZ9imEngwPPxNnvbU0Lo5fdXY1BheakgI2+jEUUCTTh3t4TACIZCaeNdUUDV njdBNTUkN5Yt1HF0HUUUSSaMqj6rzwtYk1MhQEi3ONFjm8KmAZiBYHRtnb1sT3A/v/X9 jqAQw8e+nyQ/KwWx8fgaZihE2NwNWoxCCF6hKWZxXBVRfboS/9pvfng/M1+QE/O0MUl5 qvq5k22FKYlujELUROQdC2oFDISeqVM+++HZj48WjTDLE8T302598suW0w2l6HluGjuA OafPPAfARaD4yH/gOptW+llvwXSQJqdVLUq4AgUSq4ze4BS8fTQ6KrDeLH6UNnDTol6P HfHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302613; x=1744907413; 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=UdxN9N+HI7dt/tS1Aq2Bnv9Sxoi8pNvlWmvGXY6b/d4=; b=IsfA4hpSL2spVUz+yKwThE7BP5oXCoquVhpR9NtqLgKNZZpJm+XDbMSv1xNHIj7zjn 2+lQA7xrYQScDjMxgjhRfyT+ba0oEO9t2ZGq5sKf01Ris2rhv9amE3UGMVwNCWI+XpWR Yjmk1Qi9eQua2LpSBHwtx+HpcM2OJbk6z37Dqaps+/3JqPwZdxVi4ZjGIq3XLZBEmVNU vL0aLhPaUWiggJU8u+JM8WOSujz4jtyRGI/08UvvegxP11V1scyJ0O52ynyw17nMK+OB cYiebwSmFk8cFL+Wowb66csD+aWe8WsYHrgkTEmD+Ee8yoAoDRgvmO8R2UrcWDc/xVFE l69w== X-Forwarded-Encrypted: i=1; AJvYcCVIzJa8RSB5bGMLxYPkAuTSm61rmZNGA532/Z/Y53jfpdXJASdIpTPBzAFvGyi1c7i6Y7jOyZUMXpJoGw==@vger.kernel.org X-Gm-Message-State: AOJu0Yxta5Qsw9LXjTjW/CuDBbnRNgP0wab7ecrVIupb1NmYhPVQ/frA 0eKOvachpia0MxyhrA98+JjMQ2rlMOryvEQH4ZYfWTf1BuHi4qCIB1n3nazTDx8= X-Gm-Gg: ASbGnctv5m9COm0AphtPgPFpUpDOWxQlqK9GPJC5DpIr17nrRduiupkZHL5RPwTohiK GC/4wuo37tkma2F9GoqQUFyNphYT+vQ5zgb6o2vAATUhV7VR4C2jR0DEh2smQHzjeJisDVI/Dqy vF0zIZFxLXmI25LHsEgmKI7V8nKOA51yqJCGXvTnfLE7Qw53C7qtUpRrv8p4GG7mlRSDwC2guU0 9RxojfjEpB3LtCbGrhTbI+meOZrVCMu0sGfFeWOO2HmV3GT7T0pQcHVec857BYzefYGuC7FNrsX B9D8LQ1LlDbR/XVl9KppXLupjvpPEP0Cyrl7Re/cBv7Y0S7Y3UfzP8/bpGLh4w== X-Google-Smtp-Source: AGHT+IG08fcniG+psD/Re+jJNr7zI1N0PIiz/Lj72gMr0q0L3ahiGBbdEnNzESEEDYf6AFVsdEAQkA== X-Received: by 2002:a05:600c:5023:b0:43c:f87c:24d3 with SMTP id 5b1f17b1804b1-43f2d9529aemr31603555e9.20.1744302613405; Thu, 10 Apr 2025 09:30:13 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:13 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:05 +0200 Subject: [PATCH RFC v5 6/8] media: platform: qcom/iris: rename iris_vpu3 to iris_vpu3x Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-6-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1397; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=1DA4EahdV3iTAAHe9xKki0mAkcrYdEERZmB4u+gnX4A=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IPKL7tW3fErn/lfXmFvsA1xEDIc+bFytl3Ine0 wKjjQUiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDwAKCRB33NvayMhJ0T/jEA CkOX0mqi9c15zdSf0OSefvmbdBYW4kI5ZPYmGvrfemC3gS162EGYIUrdHzqdWKr/rIH5d31D6D1q/S hkCyn3TiS6a1DBZ1Gvc9ACtbikbVBroM+Dtl6gLvAF1THPVNGDGWma8gu1DelV7fedCX80ljwsH1Bf cAv+RskMCHuApGdCIqzIue1dTQauP9rr5JzUACUHeXX5iioT2RC/1Pd97rEtVLDSGkdi4n21JPaRtg SM/Uak3+XIfnTSU21A0+xYQaM4OjQ1zvspC5YEBc4UaDBfAyXRMiDYQ6MFpyp+gtCVofZyB7kTrR8o UnOwT3Pv/qG8CcDo4+oJ6X74nYXrdbid3ariuPh8hRP7a5E/BQuI2B/m77MmwrMTd7v6cKqtMbVZ2V 3X6tzE0VwNwMrxo5TrnFbgwHREK9JPkDJ29v2egtQLWT4fmeVBwsoEapkhuolr9KVIxuf24Pt9EijL UlMg890OeJtxcDTCC02/GTkZ+W+O4N4AFPbUtfgWGeEaTO8IDvHMCxqEUEygowHMJaQBlK9UmRs5pq 8q/fvHBIzq5KxkjHVjuuBqvhF7mpmjbyOBF+bzHf9FbscfOXCtozWuYuNLVXcIvIOoIRsFZ9GR5+1l +CmhCF+JA/IvMCPW2PZ+3rIJRtgPDMG4fnswiEaJlIJLQYOXakkiF2EIOkkg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The vpu33 HW is very close to vpu3, and shares most of the operations, so rename file to vpu3x since we'll handle all vpu3 variants in it. Reviewed-by: Dikshita Agarwal Tested-by: Bryan O'Donoghue # x1e Dell Reviewed-by: Vikash Garodia Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 2 +- drivers/media/platform/qcom/iris/{iris_vpu3.c => iris_vpu3x.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile index 379359c5c7e1e4ca39b1216335cd8cf2317b6308..15ca63084ddc5c5ca34a79ff37064c5f7c5bfa7e 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -20,7 +20,7 @@ qcom-iris-objs += \ iris_vb2.o \ iris_vdec.o \ iris_vpu2.o \ - iris_vpu3.o \ + iris_vpu3x.o \ iris_vpu_buffer.o \ iris_vpu_common.o \ diff --git a/drivers/media/platform/qcom/iris/iris_vpu3.c b/drivers/media/platform/qcom/iris/iris_vpu3x.c similarity index 100% rename from drivers/media/platform/qcom/iris/iris_vpu3.c rename to drivers/media/platform/qcom/iris/iris_vpu3x.c From patchwork Thu Apr 10 16:30:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 879957 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 0033E2857E5 for ; Thu, 10 Apr 2025 16:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302619; cv=none; b=ltD5t+ryInNUB31S2yVU/TI/ZHSp94SPxrgeAwEW4rW3sFpOhS21kR6HlTB4wXsN8TJc+555gpuJlVrHKkb0L5kS6lEsKesxoAcXQereaydQor6dYVDTWfadFCCejkwJ6rttNNlnx+w4wichbHwMDmGO6F71PLv/1dgP8lUOYU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302619; c=relaxed/simple; bh=fdVB/WDnUbOKrbnaFpC+5KLneXfwe1Hbvq+oQZ56p8Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lMfHF/Astuzrl9MP8WjXyqcozSc4aWtDEol138JaGA2tmiSCmFXFF0hODTEbQWn8JlOospz/fQxnIG8Cj9KPYgTjjQK92bc+E6sg57pCEl9OFzvEB9iixIeCzMxHki/fOGKGZsqp4dRNChexgevSWUkZ0V+Q+KCygP5uUmerR74= 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=DPNGujKJ; arc=none smtp.client-ip=209.85.221.53 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="DPNGujKJ" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso1199650f8f.0 for ; Thu, 10 Apr 2025 09:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302614; x=1744907414; 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=CjNA/3yEeV6k5zGB03XZkp0NfQT5RQXMDZFss0yeJfc=; b=DPNGujKJm9+lOg8gxkF9EOdXkLJlt2evMF0we3gXbeMKoLTIqst/v1KATULdZf2/NE 0jXFLKRT95iQyjjMm4JpByD5t61Ls6mfvIDyKC4yRanXWUc4+T94L/dSb3uMOyAtnPN0 qrYo7WlgntrnEa3hzExCeNbYP4EYxCcvEgHladlQ1MwxBI0yuhT4onsvR92KM3qyqPqg C7+4abFirYv/lDndfPIdoYlISyAEdm99VEVbanZpjkdD9pkYrIhTnITi+eDLmlsnS8B+ B6Gmdz+y3+Fx6cgjWasqygfacRN6IAhO8+Sv8GFbhsrFzpy4w4Zda6kWLX9tglKtOqLQ tc+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302614; x=1744907414; 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=CjNA/3yEeV6k5zGB03XZkp0NfQT5RQXMDZFss0yeJfc=; b=RP3OZtvB+3vXvkQrObB79EZkCfjfGiSeBk64zAl3T5Kn3HbDM0y2wXnx/p2F3IiIzN FN3olXX46vpPHgtqV6+w/SQprLPKZ3FmLR3wAgX4E+mnZgqyI/6kt3UNPFdoIdzxY/fQ Lh1ZeVr6MWHWYdE1+gk16yIGxC20suIZ3PGkR06aeAT4+6SS04xC18mFv4uS26KHT7UD Ft47T8tMz5Ld/gM0bCTYb0P+83+TJyOf0Oi5pmeGlzibvj2y8+Zr/e0uCxoaIIrrPNLI /5jriO7N/qjQW7BBLCSFdOExMBjW8R235i3X3rytdRKM63lpFJhJqZPupMxXV70buEAp 1ECg== X-Forwarded-Encrypted: i=1; AJvYcCUlYUEKvnEpJbi+y43VynD1A8VzO19sISCgelvp+llH2m7nzv950sCFNYQDgf+xOaDz1dUGvZgApSESBw==@vger.kernel.org X-Gm-Message-State: AOJu0Yzt4FxYprNiujGxTuJsGNE+SbfGnnjQ5WlmP5q7FJ3R1ELPpkVK 7AglvNhcaxGDbv0F1++KwXLWgOowKiRyrXdqBnf+xGE8jW0KJkGVkauT03ONgD4= X-Gm-Gg: ASbGnctnU3j7z3ss6mcP/B2WX/ddDfrgyAU8B79y1+Z2dzFpSsxtAMyLy04OfwolSMm 9qq3BAwsMlxOTzSsW0NaLLlwHQtABAmieNpAhtNeYq2Lowi299CF1qozFHsIKl/zOai5Zdocirm DXH6rIJVgU/iLuOS8RCM/wT3VAPlFmEX3Ko7XnQpx8l6S1cCtg5t4hAyJl97nWTdigMvP4CrqQI FRBJKsOkMvDdkQaLvqJ6LbSB6Jw6j8dixS2QrfBfyIthhIwt2wyzePnBdtKQ6ffKi+pERulptLf 2r69BRom22eKCygtRyetX1QkMn/En+SIV/lxV+eKTrialponqjIr8Ds5GxrH2+ycWusJhKxF X-Google-Smtp-Source: AGHT+IEc2hRHPm90L8+bOMpn1K90rBl2QhK08WG2zHjVONTwafd6NWiy8ImXJhSkHuRLK5Eescw2og== X-Received: by 2002:a05:6000:18a2:b0:39c:d05:3779 with SMTP id ffacd0b85a97d-39d8f4f1184mr2774000f8f.49.1744302614144; Thu, 10 Apr 2025 09:30:14 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:13 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:06 +0200 Subject: [PATCH RFC v5 7/8] media: platform: qcom/iris: add support for vpu33 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-7-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=8847; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=fdVB/WDnUbOKrbnaFpC+5KLneXfwe1Hbvq+oQZ56p8Q=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IPczInuSLZwVja3d3jiyoxiTXla2evIzirY8rq 4Ngc6WSJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyDwAKCRB33NvayMhJ0TeuEA Cwdk+n+IOTjMtCq2V6cOsu7UVBlt7LGqqv4VD8yK6AiJOIBE4n9FElR/RZaAROYEujkKnKmLBb/68d 4Nmusmo7B1C0ou77BKQ2B9+lPPdjIGqOaLZjPWfAAgSId9B31wpLnPTFI2AJuo5z/CV5oLLUbobGLS OWz0VpPPnfdEeTM3DavkEBXDgRBEkukYgIQGuTBm1R+lGpzg2fbGIkG6a3rZAVwuVLkx/kj+Ornmdr ytwH4AfDkyFkZynSdhVgIS8oXFamzm55hVfjzg1WV2i7Ow5tgAAPaPWbH4qBMexzPxuCCQgARMr6lv lrmakXgcmluKm4vtypnkqLMTADcef5MHiU3ulaeLLizpj51fJdcVKgL3RABsIJyawu/VWTYRMJNJWl 6DVTiBfALCQoBZ1st7Qf6ypGJ6w6W+d0w8bHA9HkHbFflAIImydvmGIGe2CD+WQbZinT0Jj4Wsux/n js8Tdd6ufawTk7stFlioC8Cd3xmkiZQNaGROo2iavIrAdHjJrWQzBvOxMl1W6qDOTrXCXN8MQSp224 cj2nyYjTD0u1m4uWRM2FG5pHsALkXRgiZaG9CD22xPp5HIZPKV8ukcTk0WkniH6QxX3QdsjmmlwMZX EEKwfxr2d+JGYmXe1kCiGyzYwpjuT/UyPlVgBAJsh1WqzZ838Kbsk3LB2c6w== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The IRIS acceleration found in the SM8650 platforms uses the vpu33 hardware version, and requires a slighly different reset and power off sequences in order to properly get out of runtime suspend. Tested-by: Bryan O'Donoghue # x1e Dell Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 160 ++++++++++++++++++++- drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + 2 files changed, 157 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/platform/qcom/iris/iris_vpu3x.c index 13dab61427b8bd0491b69a9bc5f5144d27d17362..9b7c9a1495ee2f51c60b1142b2ed4680ff798f0a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -4,20 +4,39 @@ */ #include +#include #include "iris_instance.h" #include "iris_vpu_common.h" #include "iris_vpu_register_defines.h" +#define WRAPPER_TZ_BASE_OFFS 0x000C0000 +#define AON_BASE_OFFS 0x000E0000 #define AON_MVP_NOC_RESET 0x0001F000 +#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x54) +#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58) +#define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C) +#define REQ_POWER_DOWN_PREP BIT(0) +#define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60) #define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88) #define CORE_CLK_RUN 0x0 +#define WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG (WRAPPER_TZ_BASE_OFFS + 0x14) +#define CTL_AXI_CLK_HALT BIT(0) +#define CTL_CLK_HALT BIT(1) + +#define WRAPPER_TZ_QNS4PDXFIFO_RESET (WRAPPER_TZ_BASE_OFFS + 0x18) +#define RESET_HIGH BIT(0) + #define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160) #define CORE_BRIDGE_SW_RESET BIT(0) #define CORE_BRIDGE_HW_RESET_DISABLE BIT(1) +#define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168) +#define MSK_SIGNAL_FROM_TENSILICA BIT(0) +#define MSK_CORE_POWER_ON BIT(1) + #define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000) #define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1)) @@ -25,7 +44,16 @@ #define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70) -static bool iris_vpu3_hw_power_collapsed(struct iris_core *core) +#define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS) +#define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4) + +#define AON_WRAPPER_MVP_NOC_CORE_SW_RESET (AON_BASE_OFFS + 0x18) +#define SW_RESET BIT(0) +#define AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL (AON_BASE_OFFS + 0x20) +#define NOC_HALT BIT(0) +#define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28) + +static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core) { u32 value, pwr_status; @@ -40,7 +68,7 @@ static void iris_vpu3_power_off_hardware(struct iris_core *core) u32 reg_val = 0, value, i; int ret; - if (iris_vpu3_hw_power_collapsed(core)) + if (iris_vpu3x_hw_power_collapsed(core)) goto disable_power; dev_err(core->dev, "video hw is power on\n"); @@ -79,7 +107,125 @@ static void iris_vpu3_power_off_hardware(struct iris_core *core) iris_vpu_power_off_hw(core); } -static u64 iris_vpu3_calculate_frequency(struct iris_inst *inst, size_t data_size) +static void iris_vpu33_power_off_hardware(struct iris_core *core) +{ + u32 reg_val = 0, value, i; + int ret; + + if (iris_vpu3x_hw_power_collapsed(core)) + goto disable_power; + + dev_err(core->dev, "video hw is power on\n"); + + value = readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + if (value) + writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + for (i = 0; i < core->iris_platform_data->num_vpp_pipe; i++) { + ret = readl_poll_timeout(core->reg_base + VCODEC_SS_IDLE_STATUSN + 4 * i, + reg_val, reg_val & 0x400000, 2000, 20000); + if (ret) + goto disable_power; + } + + ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS, + reg_val, reg_val & BIT(0), 200, 2000); + if (ret) + goto disable_power; + + /* set MNoC to low power, set PD_NOC_QREQ (bit 0) */ + writel(BIT(0), core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + 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_SYNC_RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_power: + iris_vpu_power_off_hw(core); +} + +static int iris_vpu33_power_off_controller(struct iris_core *core) +{ + u32 xo_rst_tbl_size = core->iris_platform_data->controller_rst_tbl_size; + u32 clk_rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size; + u32 val = 0; + int ret; + + writel(MSK_SIGNAL_FROM_TENSILICA | MSK_CORE_POWER_ON, core->reg_base + CPU_CS_X2RPMH); + + writel(REQ_POWER_DOWN_PREP, core->reg_base + WRAPPER_IRIS_CPU_NOC_LPI_CONTROL); + + ret = readl_poll_timeout(core->reg_base + WRAPPER_IRIS_CPU_NOC_LPI_STATUS, + val, val & BIT(0), 200, 2000); + if (ret) + goto disable_power; + + writel(0x0, core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL); + + ret = readl_poll_timeout(core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS, + val, val == 0, 200, 2000); + if (ret) + goto disable_power; + + writel(CTL_AXI_CLK_HALT | CTL_CLK_HALT, + core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); + writel(RESET_HIGH, core->reg_base + WRAPPER_TZ_QNS4PDXFIFO_RESET); + writel(0x0, core->reg_base + WRAPPER_TZ_QNS4PDXFIFO_RESET); + writel(0x0, core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); + + reset_control_bulk_reset(clk_rst_tbl_size, core->resets); + + /* Disable MVP NoC clock */ + val = readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + val |= NOC_HALT; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + + /* enable MVP NoC reset */ + val = readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + val |= SW_RESET; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + + /* poll AON spare register bit0 to become zero with 50ms timeout */ + ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_SPARE, + val, (val & BIT(0)) == 0, 1000, 50000); + if (ret) + goto disable_power; + + /* enable bit(1) to avoid cvp noc xo reset */ + val = readl(core->reg_base + AON_WRAPPER_SPARE); + val |= BIT(1); + writel(val, core->reg_base + AON_WRAPPER_SPARE); + + reset_control_bulk_assert(xo_rst_tbl_size, core->controller_resets); + + /* De-assert MVP NoC reset */ + val = readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + val &= ~SW_RESET; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + + usleep_range(80, 100); + + reset_control_bulk_deassert(xo_rst_tbl_size, core->controller_resets); + + /* reset AON spare register */ + writel(0, core->reg_base + AON_WRAPPER_SPARE); + + /* Enable MVP NoC clock */ + val = readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + val &= ~NOC_HALT; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + + iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); + +disable_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_POWER_DOMAIN]); + iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + + return 0; +} + +static u64 iris_vpu3x_calculate_frequency(struct iris_inst *inst, size_t data_size) { struct platform_inst_caps *caps = inst->core->iris_platform_data->inst_caps; struct v4l2_format *inp_f = inst->fmt_src; @@ -119,5 +265,11 @@ static u64 iris_vpu3_calculate_frequency(struct iris_inst *inst, size_t data_siz const struct vpu_ops iris_vpu3_ops = { .power_off_hw = iris_vpu3_power_off_hardware, .power_off_controller = iris_vpu_power_off_controller, - .calc_freq = iris_vpu3_calculate_frequency, + .calc_freq = iris_vpu3x_calculate_frequency, +}; + +const struct vpu_ops iris_vpu33_ops = { + .power_off_hw = iris_vpu33_power_off_hardware, + .power_off_controller = iris_vpu33_power_off_controller, + .calc_freq = iris_vpu3x_calculate_frequency, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/media/platform/qcom/iris/iris_vpu_common.h index f8965661c602f990d5a7057565f79df4112d097e..93b7fa27be3bfa1cf6a3e83cc192cdb89d63575f 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -10,6 +10,7 @@ struct iris_core; extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; +extern const struct vpu_ops iris_vpu33_ops; struct vpu_ops { void (*power_off_hw)(struct iris_core *core); From patchwork Thu Apr 10 16:30:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 880723 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 009C92857F3 for ; Thu, 10 Apr 2025 16:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302619; cv=none; b=Ui2As7MuZwBJrCalgDhhI8j+0cPt3nhsA6CPN057R7ZDMVdQQl7wgIlBy8+0EiDxUbqMRziSfmm36YVUMzIDk1HMnUZsadDN1XvjrxPDs3dFSwz02kjlkakGP+mhX+30PyoAzKGZ7s5jaFOvMmmyVOOH+eAqeyfWIBfCYOh4wgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744302619; c=relaxed/simple; bh=QJzi9VtRTRt8770gEHryKmDm1SK4T3JVfWCNXr8L6tY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jn+J8p+NbI7xahjMQFcTOQzCcSM/11MH3avhPWAN9U4knaC5YTRTekQFXaWgg7RfRRi3pKTmYpHBSjNTaiDg/+G552JQhwiX15CkIZYltWvlGI+4Bxc4RbJUywh6NVh2fogq99Ww4YPBMTYTDOqwOX0l8kf2NQm0j9ES3ied7qc= 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=HzyRoamU; arc=none smtp.client-ip=209.85.128.47 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="HzyRoamU" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43cf0d787eeso12018945e9.3 for ; Thu, 10 Apr 2025 09:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744302615; x=1744907415; 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=iMAsgauOE6xhOvqvD7g8R3kEtDo6zcGFGgxPvQiLvBQ=; b=HzyRoamUoF4pRnhQVX2OJw4vOnQsQ8ZQInDmLt49S2kw0hyuef0gunmsInYRtS5Pyy lQ32GaqAxKoCImWZGKQrMZBFCRcc3fgNZz+g6n+Z1+bddxAdGjHbjPbbWY0MRZ77DxKE CeWVdG3MB1SJqtMLwKEWNNTrknEPvorrHDuR6FdmtpY6nMl2VmtGWCVtQAMc37L2TBJV tqF5iNl6QwmBfDUHSnQQZJqK3VsBstb59yDJez1OhAs9G5Puy6UU5NqxXgQv7UrHXk8s NGVnLuMlPYnqhw9TMwyAtqhgVFrDnWOwbs2eaH2NAJyp0QS6HTpgV37Mn5Gb8HlgVwJb kH0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302615; x=1744907415; 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=iMAsgauOE6xhOvqvD7g8R3kEtDo6zcGFGgxPvQiLvBQ=; b=pvd74laI8Yz1UWkKvkEkiI9mdtX70UNA2Lp4ax78OZj20ZrLU7SMuePWY6A8lUBWcL q/+oSinT62v61z5YXymM1HlqZiaFTgTcdBIndeKlpmIpWDAUBuXmSS6d6Me4qIiaRpXB jIRTvdFzcWCfXWnGfFrLtqOtp4VJtgoikA+dgs/2R+Znit5kkjoMVDI2YIDUYl0Mpjn9 znTys/92J7QEI+O62TRNclz2oLno8K+i7TMt5CF5TD6DEfBYWeV0S+CRb9kaBViZIBmv PsqhbdNfBOkzIIpGo+uGTzp59t+wPHC6FEXEGJljrGhkJ4deDWHtkaUAObAQWKPJ3c6U RCxg== X-Forwarded-Encrypted: i=1; AJvYcCVHAFd8wMD/xqBsIN4YmHtYMCsnN5GPPyNjA8z7LsHHXGObAhTV3/0u/mlPyL78bg6CrNB4snb1xc2VJQ==@vger.kernel.org X-Gm-Message-State: AOJu0Yy821+wPLF9aJ8elWsKK79uPiuXU/A0u9VVIm3SYv9Gx+aw/hGt NuqQcbTRfVAhlMawBGT9CmdGTxroV4AjxLeHSUILzFh+OuhjdxjFKanhVxve+abS/1p0IvSNgsM s X-Gm-Gg: ASbGncs7ExdaWBvHISnEKgIJb5mT2VZtrOgLfSzmkCZMQw53ek/zNhbqgCc2nuxMlE0 ZOpEKlG8r/OrlPULVXPmlUOzFHA589geIa84wTDUkbnmFRMOWeihALuCvJ06HPsaE8796y5dbIB RdGIZwdy4oYYIxyFhNFbZ7iGNLm/854Z2SmNWMPai5klVX/wJPY778mDR6OAZFtXWYRo5hQklOf cIgwqQiIojcw8vwzFG9G8Enf3o9+OqlNjNquLskWLbIsqox6cFzgSd5qaGCLShHrjTK24S6O6g+ RENhiWeDF2sZJ0dNJmyyqnCAUtY/4LtKeHBLm5bEkJxuw9onk4wKpdMX+aiP1g== X-Google-Smtp-Source: AGHT+IEOAc3XyyMfCWLt/l+UcTTxDcLQmT60/usgfkMvXf7qiDFVvgWqGTSXyAsH0RuAo9AWx4pOKA== X-Received: by 2002:a05:600c:1c17:b0:43a:b0ac:b10c with SMTP id 5b1f17b1804b1-43f2ff9b959mr26179515e9.26.1744302615023; Thu, 10 Apr 2025 09:30:15 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:3d9:2080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8936129dsm5350663f8f.18.2025.04.10.09.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 09:30:14 -0700 (PDT) From: Neil Armstrong Date: Thu, 10 Apr 2025 18:30:07 +0200 Subject: [PATCH RFC v5 8/8] media: platform: qcom/iris: add sm8650 support Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250410-topic-sm8x50-upstream-iris-catalog-v5-8-44a431574c25@linaro.org> References: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> In-Reply-To: <20250410-topic-sm8x50-upstream-iris-catalog-v5-0-44a431574c25@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5378; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=QJzi9VtRTRt8770gEHryKmDm1SK4T3JVfWCNXr8L6tY=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBn9/IQCBwEt2DAYfpoM+kcPEfnP3gxLTL4dpYuKiy4 4KpXm6+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ/fyEAAKCRB33NvayMhJ0b+VD/ 91zBivzo1HMEBQtOxYgniHjXTpXknul8DWSBUKTyMcJ5MNPNFDEMH8xVRwgp86zO3ePvSNWe7S2m7s B3JhkMFwd8AVeGsF0u+yS3YgK/KHlQ9fw7/P2J8f8Y5eDurr4I7xhbfkbKzjQpAZXsZ1n4ePhes49y Ctn4MP2DubyXopVOrY21sptPx7RoElxvtxbKpvKzfnXJUdyRl3DUkHZqmNAjJKI1sC4BxosdmI4ZBe vuS1pGMUlCHdtfraSWeKm/JHMmZDm5cwcpMkR8fViRSFV/sG3QiOG+QLJ7mUHWZIR/4wKrIKqV90w8 QzeLgqh+ga7acT8w/c5PpaPQ/HGT1hd1XIYkfUHQ8Japkb3Og8A2rLtSNvnOcFYCsCPY4yAakg9qxn aasW4IEFWnhuhybQDr/meHwNg0GOTospiv3JjlTcPyrq4QAoRgjxloOTwJ02h3mR3vjYToCQHGYdev 27FMsqc3YvJNUr5Waw5kxbpEMcrxFRPOPcqi4bOQIn+SpkyjMb4FiJCBkZpn9sHdp1yEdpk3whHz5R WXvOBPA2/svLiKcuvQUyzMU5giUVAqX6cQyhfMLXDYaLYfUGVcgl6Ck7td4+xP/6Yn/64hpFpSVyvD 0jn1Fcoi3HfPvUU7srwTWOLvX13IUiuHZAcaf5X9MbXM6Xk/Ckhx8YXz0Gig== 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.264 decoder capabilities are identical. Tested-by: Bryan O'Donoghue # x1e Dell Signed-off-by: Neil Armstrong --- .../media/platform/qcom/iris/iris_catalog_gen2.c | 1 + .../media/platform/qcom/iris/iris_catalog_sm8650.h | 68 ++++++++++++++++++++++ .../platform/qcom/iris/iris_platform_common.h | 1 + drivers/media/platform/qcom/iris/iris_probe.c | 4 ++ 4 files changed, 74 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_catalog_gen2.c b/drivers/media/platform/qcom/iris/iris_catalog_gen2.c index c3f8ad004cb7f9317859b2594640c7138dbb6534..ad559351f1125d266dedac7eb6e91cda90bbae72 100644 --- a/drivers/media/platform/qcom/iris/iris_catalog_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_catalog_gen2.c @@ -186,3 +186,4 @@ static const u32 sm8550_dec_op_int_buf_tbl[] = { /* platforms catalogs */ #include "iris_catalog_sm8550.h" +#include "iris_catalog_sm8650.h" diff --git a/drivers/media/platform/qcom/iris/iris_catalog_sm8650.h b/drivers/media/platform/qcom/iris/iris_catalog_sm8650.h new file mode 100644 index 0000000000000000000000000000000000000000..be8737dd4f3d9ec20a457d50076be1b4d841787c --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_catalog_sm8650.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef _IRIS_CATALOG_SM8650_H +#define _IRIS_CATALOG_SM8650_H + +#define VIDEO_ARCH_LX 1 + +static const char * const sm8650_clk_reset_table[] = { "bus", "core" }; + +static const char * const sm8650_controller_reset_table[] = { "xo" }; + +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_sm8550_preset_registers, + .icc_tbl = sm8550_icc_table, + .icc_tbl_size = ARRAY_SIZE(sm8550_icc_table), + .clk_rst_tbl = sm8650_clk_reset_table, + .clk_rst_tbl_size = ARRAY_SIZE(sm8650_clk_reset_table), + .controller_rst_tbl = sm8650_controller_reset_table, + .controller_rst_tbl_size = ARRAY_SIZE(sm8650_controller_reset_table), + .bw_tbl_dec = sm8550_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec), + .pmdomain_tbl = sm8550_pmdomain_table, + .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table), + .opp_pd_tbl = sm8550_opp_pd_table, + .opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table), + .clk_tbl = sm8550_clk_table, + .clk_tbl_size = ARRAY_SIZE(sm8550_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_sm8550, + .inst_fw_caps = inst_fw_cap_sm8550, + .inst_fw_caps_size = ARRAY_SIZE(inst_fw_cap_sm8550), + .tz_cp_config_data = &tz_cp_config_sm8550, + .core_arch = VIDEO_ARCH_LX, + .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE, + .ubwc_config = &ubwc_config_sm8550, + .num_vpp_pipe = 4, + .max_session_count = 16, + .max_core_mbpf = ((8192 * 4352) / 256) * 2, + .input_config_params = + sm8550_vdec_input_config_params, + .input_config_params_size = + ARRAY_SIZE(sm8550_vdec_input_config_params), + .output_config_params = + sm8550_vdec_output_config_params, + .output_config_params_size = + ARRAY_SIZE(sm8550_vdec_output_config_params), + .dec_input_prop = sm8550_vdec_subscribe_input_properties, + .dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties), + .dec_output_prop = sm8550_vdec_subscribe_output_properties, + .dec_output_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_output_properties), + + .dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl), +}; + +#endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h index fdd40fd80178c4c66b37e392d07a0a62f492f108..6bc3a7975b04d612f6c89206eae95dac678695fc 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_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c index 4f8bce6e2002bffee4c93dcaaf6e52bf4e40992e..7cd8650fbe9c09598670530103e3d5edf32953e7 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -345,6 +345,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);