From 76c53dad6b5dc94e4c43069882b2708853c284c0 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 11 Dec 2023 18:41:41 +0000 Subject: iommu: add a connect op Add an optional iommu callback to be invoked before a device probes. This can be used to configure the IOMMU in preparation for the device (e.g. by allocating a context bank) Signed-off-by: Caleb Connolly --- include/iommu.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/iommu.h') diff --git a/include/iommu.h b/include/iommu.h index cf9719c5e91..b8ba0b8e707 100644 --- a/include/iommu.h +++ b/include/iommu.h @@ -4,6 +4,15 @@ struct udevice; struct iommu_ops { + /** + * init() - Connect a device to it's IOMMU, called before probe() + * The iommu device can be fetched through dev->iommu + * + * @iommu_dev: IOMMU device + * @dev: Device to connect + * @return 0 if OK, -errno on error + */ + int (*connect)(struct udevice *dev); /** * map() - map DMA memory * -- cgit v1.2.3