summaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-09-13 05:54:14 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-16 04:34:15 -0400
commit57f98d2f61e191ef9d06863c9ce3f8621f3671ef (patch)
treefd6d52282bcada86b0893b9972eaa5b8a5f219e1 /include/linux/device.h
parentb996444cf35e736621855e73f9d0762bd49f41f2 (diff)
iommu: Introduce iommu_fwspec
Introduce a common structure to hold the per-device firmware data that most IOMMU drivers need to keep track of. This enables us to configure much of that data from common firmware code, and consolidate a lot of the equivalent implementations, device look-up tables, etc. which are currently strewn across IOMMU drivers. This will also be enable us to address the outstanding "multiple IOMMUs on the platform bus" problem by tweaking IOMMU API calls to prefer dev->fwspec->ops before falling back to dev->bus->iommu_ops, and thus gracefully handle those troublesome systems which we currently cannot. As the first user, hook up the OF IOMMU configuration mechanism. The driver-defined nature of DT cells means that we still need the drivers to translate and add the IDs themselves, but future users such as the much less free-form ACPI IORT will be much simpler and self-contained. CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 38f02814d53a..bc41e87a969b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -41,6 +41,7 @@ struct device_node;
41struct fwnode_handle; 41struct fwnode_handle;
42struct iommu_ops; 42struct iommu_ops;
43struct iommu_group; 43struct iommu_group;
44struct iommu_fwspec;
44 45
45struct bus_attribute { 46struct bus_attribute {
46 struct attribute attr; 47 struct attribute attr;
@@ -765,6 +766,7 @@ struct device_dma_parameters {
765 * gone away. This should be set by the allocator of the 766 * gone away. This should be set by the allocator of the
766 * device (i.e. the bus driver that discovered the device). 767 * device (i.e. the bus driver that discovered the device).
767 * @iommu_group: IOMMU group the device belongs to. 768 * @iommu_group: IOMMU group the device belongs to.
769 * @iommu_fwspec: IOMMU-specific properties supplied by firmware.
768 * 770 *
769 * @offline_disabled: If set, the device is permanently online. 771 * @offline_disabled: If set, the device is permanently online.
770 * @offline: Set after successful invocation of bus type's .offline(). 772 * @offline: Set after successful invocation of bus type's .offline().
@@ -849,6 +851,7 @@ struct device {
849 851
850 void (*release)(struct device *dev); 852 void (*release)(struct device *dev);
851 struct iommu_group *iommu_group; 853 struct iommu_group *iommu_group;
854 struct iommu_fwspec *iommu_fwspec;
852 855
853 bool offline_disabled:1; 856 bool offline_disabled:1;
854 bool offline:1; 857 bool offline:1;