summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-08-27 16:15:59 +0100
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:14:42 -0700
commitcc1a363f31974369ff48c69eae4a5f609fd9d235 (patch)
tree2ada189f5ae1040537091c72ee6df3544a3046ee /include
parent452eb9f1aa8bb5d421a659c3393aa6a8cfd758fd (diff)
iommu: add new iommu_ops callback for adding an OF device
This patch adds a new function to the iommu_ops structure to allow an OF device to be added to a specific IOMMU instance using the recently merged generic devicetree binding for IOMMUs. The callback (of_xlate) takes a struct device representing the master and an of_phandle_args representing the IOMMU and the correspondong IDs for the new master. Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Joerg Roedel <jroedel@suse.de> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iommu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a151cdec9cdd..9b3509dddb16 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -21,6 +21,7 @@
#include <linux/errno.h>
#include <linux/err.h>
+#include <linux/of.h>
#include <linux/types.h>
#include <trace/events/iommu.h>
@@ -124,6 +125,7 @@ extern struct dentry *iommu_debugfs_top;
* @remove_device: remove device from iommu grouping
* @domain_get_attr: Query domain attributes
* @domain_set_attr: Change domain attributes
+ * @of_xlate: add OF master IDs to iommu grouping
* @pgsize_bitmap: bitmap of supported page sizes
* @trigger_fault: trigger a fault on the device attached to an iommu domain
* @reg_read: read an IOMMU register
@@ -169,6 +171,10 @@ struct iommu_ops {
void (*reg_write)(struct iommu_domain *domain, unsigned long val,
unsigned long offset);
+#ifdef CONFIG_OF_IOMMU
+ int (*of_xlate)(struct device *dev, struct of_phandle_args *args);
+#endif
+
unsigned long pgsize_bitmap;
void *priv;
};