Skip to content

Commit 0db2e5d

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu: Implement common IOMMU ops for DMA mapping
Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Since associating an IOVA allocator with an IOMMU domain is a fairly common need, rather than introduce yet another private structure just to do this for ourselves, extend the top-level struct iommu_domain with the notion. A simple opaque cookie allows reuse by other IOMMU API users with their various different incompatible allocator types. Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 25cb62b commit 0db2e5d

File tree

5 files changed

+618
-0
lines changed

5 files changed

+618
-0
lines changed

drivers/iommu/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ config OF_IOMMU
4949
def_bool y
5050
depends on OF && IOMMU_API
5151

52+
# IOMMU-agnostic DMA-mapping layer
53+
config IOMMU_DMA
54+
bool
55+
depends on NEED_SG_DMA_LENGTH
56+
select IOMMU_API
57+
select IOMMU_IOVA
58+
5259
config FSL_PAMU
5360
bool "Freescale IOMMU support"
5461
depends on PPC32

drivers/iommu/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
obj-$(CONFIG_IOMMU_API) += iommu.o
22
obj-$(CONFIG_IOMMU_API) += iommu-traces.o
33
obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o
4+
obj-$(CONFIG_IOMMU_DMA) += dma-iommu.o
45
obj-$(CONFIG_IOMMU_IO_PGTABLE) += io-pgtable.o
56
obj-$(CONFIG_IOMMU_IO_PGTABLE_LPAE) += io-pgtable-arm.o
67
obj-$(CONFIG_IOMMU_IOVA) += iova.o

0 commit comments

Comments
 (0)