diff options
author | Will Deacon <will.deacon@arm.com> | 2014-08-27 12:52:44 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2014-12-01 11:51:35 -0500 |
commit | 4bb25789ed28228a52c030bf28edb2fcdb214be8 (patch) | |
tree | aafa892add12a5acb47c69696de5dd7c95e0251e /arch/arm/include/asm/dma-mapping.h | |
parent | af4dda732ea044517f8beed4a38c852ea97e7690 (diff) |
arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops
This patch plumbs the existing ARM IOMMU DMA infrastructure (which isn't
actually called outside of a few drivers) into arch_setup_dma_ops, so
that we can use IOMMUs for DMA transfers in a more generic fashion.
Since this significantly complicates the arch_setup_dma_ops function,
it is moved out of line into dma-mapping.c. If CONFIG_ARM_DMA_USE_IOMMU
is not set, the iommu parameter is ignored and the normal ops are used
instead.
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/include/asm/dma-mapping.h')
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index f3c0d953f6a2..9410b7e548fc 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -121,14 +121,12 @@ static inline unsigned long dma_max_pfn(struct device *dev) | |||
121 | } | 121 | } |
122 | #define dma_max_pfn(dev) dma_max_pfn(dev) | 122 | #define dma_max_pfn(dev) dma_max_pfn(dev) |
123 | 123 | ||
124 | static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, | ||
125 | u64 size, struct iommu_ops *iommu, | ||
126 | bool coherent) | ||
127 | { | ||
128 | if (coherent) | ||
129 | set_dma_ops(dev, &arm_coherent_dma_ops); | ||
130 | } | ||
131 | #define arch_setup_dma_ops arch_setup_dma_ops | 124 | #define arch_setup_dma_ops arch_setup_dma_ops |
125 | extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, | ||
126 | struct iommu_ops *iommu, bool coherent); | ||
127 | |||
128 | #define arch_teardown_dma_ops arch_teardown_dma_ops | ||
129 | extern void arch_teardown_dma_ops(struct device *dev); | ||
132 | 130 | ||
133 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | 131 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
134 | { | 132 | { |