aboutsummaryrefslogtreecommitdiff
path: root/include/iommu.h
diff options
context:
space:
mode:
authorCaleb Connolly2023-12-11 18:41:41 +0000
committerTom Rini2023-12-21 11:59:49 -0500
commit76c53dad6b5dc94e4c43069882b2708853c284c0 (patch)
treef9ef0304d6bd59d54ca9b49c735c269cfe6d8b7c /include/iommu.h
parente96ecbe71925f31ee43d353ceabe5b2c53df512f (diff)
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 <caleb.connolly@linaro.org>
Diffstat (limited to 'include/iommu.h')
-rw-r--r--include/iommu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/iommu.h b/include/iommu.h
index cf9719c5e91..b8ba0b8e707 100644
--- a/include/iommu.h
+++ b/include/iommu.h
@@ -5,6 +5,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
*
* @dev: device for which to map DMA memory