[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V3 6/8] iommu: Add of_xlate callback



From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

According to the generic IOMMU DT bindings [1] the context of
required properties for IOMMU device/master node (#iommu-cells, iommus)
depends on many factors and is really driver depended thing.

We need some way to provide the driver with DT IOMMU specifier which
describes the IOMMU master interfaces of that device (device IDs, etc)
to let it decide how to interpret them. For that reason we can borrow
Linux's "of_xlate" callback.

All IOMMU drivers which support generic IOMMU DT bindings should use
this callback.

Subsequent patches will use of that support.

[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/iommu/iommu.txt

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/include/xen/iommu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 48f8748..79b86ac 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -240,6 +240,16 @@ struct iommu_ops {
     int __must_check (*iotlb_flush_all)(struct domain *d);
     int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
     void (*dump_p2m_table)(struct domain *d);
+
+#ifdef CONFIG_HAS_DEVICE_TREE
+    /*
+     * All IOMMU drivers which support generic IOMMU DT bindings should use
+     * this callback. This is a way for the framework to provide the driver
+     * with DT IOMMU specifier which describes the IOMMU master interfaces of
+     * that device (device IDs, etc).
+     */
+    int (*of_xlate)(device_t *dev, struct dt_phandle_args *args);
+#endif
 };
 
 #include <asm/iommu.h>
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.