From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86471395AFD for ; Wed, 3 Jun 2026 14:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496428; cv=none; b=mXgxK29IqB4KjWGwoKl2RPV70CttIDtWELvIIB5H8gP2P3ikrW1ceGssqbof/KUIEJDYhsYdg/KA4Nl5RYyuwnX/Ebv0/LBi/+Fv0SIge2uATeD2k39XRjYjuP8P9BGQHjkkbFnbkBq0UE2jhh58aGuR5ni3IUBkZvfS64jao5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496428; c=relaxed/simple; bh=0F6NYH2vBOPGXFbInvg3unabFPXg6JrkTEoOs8NbdW8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lKSNFeCWZhcoUErHzgJvybVmv168gJ+JVst3fYk/tpCcrn6MXKy0NmKURN+VJl1GiZGQzxNjIg3RLE3JB9XTdz/MRH13qemaTdKbWhi2iHGC594xB7soJdaNOSUJNrMFuwDGAHPxErG7jo9CW0NZYElF74l2XAF/V4ui9J4paJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lkK6l5Zd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IaSKz28H; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lkK6l5Zd"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IaSKz28H" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 653Ckl651740590 for ; Wed, 3 Jun 2026 14:20:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kMD0vi07CEccdmp8qLavRITVcgt4Oz8v3SLZupcLXoA=; b=lkK6l5ZdrcjKz7W3 z5DJ1oBqp14j55ForPBtXses8rXUFPXz03cv3BbIXiTSRzJcsy8PFZli+3nqghaY nbyLdjxAnOR8GBnR8ESvosZQZb/gwdOva5hBoV6mZSwv0XlM7BV2XrmAY4blWY1F mJE+a5dN+oWZVHofW+mwxFKMTDM7cJNmyKso1nH9wL70quhD6SpNydbl15PR5kfN 6mamsxIMCRGqSf7vXCgk0ObSh7afbp6X6VKEqI5Iuox4dHjkrNC0akc8IJFVMG9X WenqWl2JjtTW4UTAYym/N2Gn9NecZ7YfSCI5qeAsAMvINJUxAMzLGclQ7mYVRCOm 5nKaHA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ejdq7t7n0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 03 Jun 2026 14:20:24 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2bfdd99f6b7so76029565ad.0 for ; Wed, 03 Jun 2026 07:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780496424; x=1781101224; 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=kMD0vi07CEccdmp8qLavRITVcgt4Oz8v3SLZupcLXoA=; b=IaSKz28H4+Y+YjApxp5UMWZ735Qu1Eo4KDHeFX/6FK0UCVRVWeMXEsHl9DiYIUCQg4 4n3e0LDppONIxQ6F9KNLRKGBqNmy9pTUSTkXZtphq8H25zJDMmt2gU9XV/8JxN2U0s66 OpTATj43QfXB2glzSef5B9KJXRaTvR+Md9MrOdwGx1ddOiuWyWPKke3um/ReFtaSmoRK ZKpaH7TH0G7SIsA/bwmV07Jbvv0zVXFEpp1B/L+CTBafN49whz6hQ0bwxZ7L46FNImx/ SINgNFRUGbZl0Yxm+4ikBP/vzDjvTB/4x0MydnEIU4HI+gW6puXe6r0tGbofiax4yJXq Sbww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496424; x=1781101224; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kMD0vi07CEccdmp8qLavRITVcgt4Oz8v3SLZupcLXoA=; b=ey8Fe8LSbESdYsvhI8oZzP11sLfti3b0/DNTPFL9fue9UoNsMenLnsHpTL88iEj5CR uW5SUzt62Sy02n1QvhQIWvfUO7TDEwyxAsz20HBsy3gPXHtRk8GpVWsRTafD6VGpyNlQ HokZJ29dDk3u4nXQzjNdKBEtRbEPEDGznngio+TIOwsnoGD3HQzcEtSpIRLM/kZS/H7c P1+LAxCU+mZOCRhVjESqQNTlyFXvkcCx2JvxJBEJJrbute8hjjbB3OPSZNzislnLeHef SBCO4R2sAj9gN+h0wd8wBJ03wcppHSQ9Zr45FnKjEEAQrK9bX6qQFowE4Uk99enl/Kf7 j4XA== X-Gm-Message-State: AOJu0YymAvSnk/za6NliOVgD9pIWEHR425FxXmT8ZHtzM1C16/Tn/REp sR9QdHaXeYHy2MUyLQEfKq6FO34O/d0N/MnttHFZ9GiQXGJ7mak5uG60DBgXN6TMj4Qd9HQbUMz AoAL9qi1Cx1JQ/JQhBXYJzmMeJ+LRkDH0XsmisMZidjmomC7Ts5JAijmqJRUdKewUNL0= X-Gm-Gg: Acq92OF49zVRXYhyGnk2YcbPxmdQo9Fe9VOlxQzFwG3Cb+3vvQdvvVCh5395sjbOgB3 SGDyyCztYwsrma40ls6fbDmd+bZq3E0tJBlNvpjRZhBOAyZMC4o0JCUGlPYZnMCHM8/c4Q8gEJ4 o0X+qTQuSoUGV82AGBjwGpheFT8tAgyIpbUxqDO2QfuND9KbqdQrWlqVShrlHEYY5bn1e/5oNCR /pCI2J4CSj2igiOEyvyPF30XfitWIf19U1KsD//x+nOtb52yIBXeZpm6nONY2yEWHZPl8/Ia1zt XLhOt4Cx5N47kqVDSPN0+mccj272YsCN/5QtZ2zboaXHTVx453AowVA7/XEIB5Gjp9TXcjOJUeF qokdpZSNC7mbqcIrWKVmOSnl2Nkt63SXYFNEpuahxi7yi/e7cLXiZiSyU+X385CGWWw== X-Received: by 2002:a17:902:f787:b0:2c0:bb2d:a314 with SMTP id d9443c01a7336-2c1640ab375mr42523355ad.28.1780496424085; Wed, 03 Jun 2026 07:20:24 -0700 (PDT) X-Received: by 2002:a17:902:f787:b0:2c0:bb2d:a314 with SMTP id d9443c01a7336-2c1640ab375mr42522565ad.28.1780496423356; Wed, 03 Jun 2026 07:20:23 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f6d37esm41514955ad.9.2026.06.03.07.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:20:23 -0700 (PDT) From: Vishnu Reddy Date: Wed, 03 Jun 2026 19:48:39 +0530 Subject: [PATCH v7 01/12] media: iris: Add iris vpu bus support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260603-glymur-v7-1-afaa55d11fe0@oss.qualcomm.com> References: <20260603-glymur-v7-0-afaa55d11fe0@oss.qualcomm.com> In-Reply-To: <20260603-glymur-v7-0-afaa55d11fe0@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1780496410; l=5398; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=lgs97ZMLfMsrUuRVQ2JpjplW6O7nx8Egm5QQ2cPQxEY=; b=UhBVV+0OiyAWuPE/lzW4Rta3udej9PFLi+yMOhT5AFGAvH2GsPTojUKXK7U0r61ZUAhraimM3 /dFowAfO0cCBNr4M3NWexEKON1jnYZvh+BAE48lyN2wP086fG9jLVZs X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAzMDEzNyBTYWx0ZWRfX3GZuxoolfiMv IZU179o7ak95rnewySeNXdWz+bK1P3YC/PIdF/WcQeIPmBBIjbGzzGx7pQRbaXQv4uFzkmKv4li XZzSeGdzK8oAFhaNWpEr+sZ7rusrElVHV5WGuZVpelh4uoJJdPQoU7csYPOmj3Gc+WiEsR2NyOW Aq+46vlbfK4urcnpA/SCukCN3guhlvq69coSuw7qJov+37YABWvHt1o+wzCLj8TnROIzjcwXpkg LCyE1wLNt+43yLuc2mIh+a1c1xEHZAsX4Aj2UYJs8lEhpJv3p/IID8NA0l/aPl5ihUWDneL+uhZ XnmMagPtkQqJ6zfDf/m3dJzyfNowcyL9XRSmvHvPCPlXa09B0vjuV9jX2Ne+PmBINli8htTLLpF s9ey8p+9IibSV78gEhnhNEJeVCSBXES/5JRhx10OK5GlruIrYr7sPMc6bhVInH4sBhc4PsrfieF 9ltTgTeT7hj/yab8C/Q== X-Proofpoint-ORIG-GUID: yjca-V6f7Dz6xAKiCkDtOmeNhi_o4htV X-Proofpoint-GUID: yjca-V6f7Dz6xAKiCkDtOmeNhi_o4htV X-Authority-Analysis: v=2.4 cv=ccniaHDM c=1 sm=1 tr=0 ts=6a203828 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=6cGehGV22KE80QuxIsQA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-03_05,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606030137 From: Vikash Garodia On glymur platform, firmware loading needs a separate IOMMU mapping with its own stream ID. This stream ID is defined in the device tree with the associated firmware function ID in the iommu-map property. To create this mapping, a separate child device is needed so the firmware memory can be isolated in its own IOMMU context. Introduce a new bus called iris-vpu-bus. This creates a dynamic device, and its dma_configure() callback calls of_dma_configure_id() with the function ID provided by the client to map the corresponding stream ID. This sets up a dedicated IOMMU context for the child device. Reviewed-by: Vishnu Reddy Signed-off-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- MAINTAINERS | 1 + drivers/media/platform/qcom/iris/Kconfig | 4 ++ drivers/media/platform/qcom/iris/Makefile | 1 + drivers/media/platform/qcom/iris/iris_vpu_bus.c | 61 +++++++++++++++++++++++++ include/linux/iris_vpu_bus.h | 25 ++++++++++ 5 files changed, 92 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c9f2780b2d31..508a1150ffad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22230,6 +22230,7 @@ L: linux-arm-msm@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/qcom,*-iris.yaml F: drivers/media/platform/qcom/iris/ +F: include/linux/iris_vpu_bus.h QUALCOMM NAND CONTROLLER DRIVER M: Manivannan Sadhasivam diff --git a/drivers/media/platform/qcom/iris/Kconfig b/drivers/media/platform/qcom/iris/Kconfig index af78a1775937..76c9fcd253df 100644 --- a/drivers/media/platform/qcom/iris/Kconfig +++ b/drivers/media/platform/qcom/iris/Kconfig @@ -1,3 +1,6 @@ +config QCOM_IRIS_VPU_BUS + bool + config VIDEO_QCOM_IRIS tristate "Qualcomm iris V4L2 decoder driver" depends on VIDEO_DEV @@ -5,6 +8,7 @@ config VIDEO_QCOM_IRIS select V4L2_MEM2MEM_DEV select QCOM_MDT_LOADER select QCOM_SCM + select QCOM_IRIS_VPU_BUS select QCOM_UBWC_CONFIG select VIDEOBUF2_DMA_CONTIG help diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile index 48e415cbc439..6deadd531c8e 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -30,3 +30,4 @@ qcom-iris-objs += iris_buffer.o \ iris_vpu_common.o \ obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o +obj-$(CONFIG_QCOM_IRIS_VPU_BUS) += iris_vpu_bus.o diff --git a/drivers/media/platform/qcom/iris/iris_vpu_bus.c b/drivers/media/platform/qcom/iris/iris_vpu_bus.c new file mode 100644 index 000000000000..e3327b227332 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_vpu_bus.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include +#include +#include +#include + +static int iris_vpu_bus_dma_configure(struct device *dev) +{ + const u32 *iommu_fid = (const u32 *)dev_get_platdata(dev); + + return of_dma_configure_id(dev, dev->parent->of_node, true, iommu_fid); +} + +const struct bus_type iris_vpu_bus_type = { + .name = "iris-vpu-bus", + .dma_configure = iris_vpu_bus_dma_configure, +}; +EXPORT_SYMBOL_GPL(iris_vpu_bus_type); + +static void iris_vpu_bus_release_device(struct device *dev) +{ + kfree(dev); +} + +struct device *iris_vpu_bus_create_device(struct device *parent_device, const char *name, + u64 dma_mask, const u32 *iommu_fid) +{ + struct device *dev; + int ret; + + dev = kzalloc_obj(*dev); + if (!dev) + return ERR_PTR(-ENOMEM); + + dev->release = iris_vpu_bus_release_device; + dev->bus = &iris_vpu_bus_type; + dev->parent = parent_device; + dev->coherent_dma_mask = dma_mask; + dev->dma_mask = &dev->coherent_dma_mask; + dev->platform_data = (void *)iommu_fid; + dev_set_name(dev, "%s", name); + + ret = device_register(dev); + if (ret) { + put_device(dev); + return ERR_PTR(ret); + } + + return dev; +} +EXPORT_SYMBOL_GPL(iris_vpu_bus_create_device); + +static int __init iris_vpu_bus_init(void) +{ + return bus_register(&iris_vpu_bus_type); +} +postcore_initcall(iris_vpu_bus_init); diff --git a/include/linux/iris_vpu_bus.h b/include/linux/iris_vpu_bus.h new file mode 100644 index 000000000000..62af9ee7e288 --- /dev/null +++ b/include/linux/iris_vpu_bus.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef _LINUX_IRIS_VPU_BUS_H +#define _LINUX_IRIS_VPU_BUS_H + +#include + +#ifdef CONFIG_QCOM_IRIS_VPU_BUS +extern const struct bus_type iris_vpu_bus_type; + +struct device *iris_vpu_bus_create_device(struct device *parent_device, const char *name, + u64 dma_mask, const u32 *iommu_fid); +#else +static inline struct device *iris_vpu_bus_create_device(struct device *parent_device, + const char *name, u64 dma_mask, + const u32 *iommu_fid) +{ + return ERR_PTR(-ENODEV); +} +#endif + +#endif /* _LINUX_IRIS_VPU_BUS_H */ -- 2.34.1