diff options
| author | Mitchel Humpherys <mitchelh@codeaurora.org> | 2015-07-06 15:24:22 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:13:23 -0700 |
| commit | 49e92b140d8118ec925da065069b96c17fa21f5c (patch) | |
| tree | 4363e1d0c862260dd47f7c9d82c1aeceae1ced42 /include/linux | |
| parent | ec9843794985992fc4a32bd640567717d0227dc2 (diff) | |
iommu: Add iommu_iova_to_phys_hard
Some IOMMU hardware implementations provide hardware translation
operations that can be useful during debugging and development. Add a
function for this purpose along with an associated op in the iommu_ops
structure so that drivers can implement it.
Change-Id: I54ad5df526cdce05f8e04206a4f01253b3976b48
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iommu.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a83c1eb59920..2e5b071d82d0 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -110,6 +110,7 @@ enum iommu_attr { * @map_sg: map a scatter-gather list of physically contiguous memory chunks * to an iommu domain * @iova_to_phys: translate iova to physical address + * @iova_to_phys_hard: translate iova to physical address using IOMMU hardware * @add_device: add device to iommu grouping * @remove_device: remove device from iommu grouping * @domain_get_attr: Query domain attributes @@ -129,6 +130,8 @@ struct iommu_ops { size_t (*map_sg)(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg, unsigned int nents, int prot); phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova); + phys_addr_t (*iova_to_phys_hard)(struct iommu_domain *domain, + dma_addr_t iova); int (*add_device)(struct device *dev); void (*remove_device)(struct device *dev); int (*device_group)(struct device *dev, unsigned int *groupid); @@ -178,6 +181,8 @@ extern size_t default_iommu_map_sg(struct iommu_domain *domain, unsigned long io struct scatterlist *sg,unsigned int nents, int prot); extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova); +extern phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain, + dma_addr_t iova); extern void iommu_set_fault_handler(struct iommu_domain *domain, iommu_fault_handler_t handler, void *token); @@ -358,6 +363,12 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad return 0; } +static inline phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain, + dma_addr_t iova) +{ + return 0; +} + static inline void iommu_set_fault_handler(struct iommu_domain *domain, iommu_fault_handler_t handler, void *token) { |
