diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2013-05-21 17:35:19 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-05-29 10:17:22 +0800 |
commit | bfe3606cc02559087e85365f7528589e8b43bae9 (patch) | |
tree | c75723936a23df71a228decbf52a314f98619a0b /arch/arm64/include/asm/dma-mapping.h | |
parent | 40520991c46c3355ce59a7590f88138142cf3466 (diff) |
arm64: Implement coherent DMA API based on swiotlbv3.14/topic/arm64-cma
This patch adds support for DMA API cache maintenance on SoCs without
hardware device cache coherency.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 7363590d2c4691593fd280f94b3deaeb5e83dbbd)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'arch/arm64/include/asm/dma-mapping.h')
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index fd0c0c0e447a..3a4572ec3273 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h @@ -30,6 +30,8 @@ #define DMA_ERROR_CODE (~(dma_addr_t)0) extern struct dma_map_ops *dma_ops; +extern struct dma_map_ops coherent_swiotlb_dma_ops; +extern struct dma_map_ops noncoherent_swiotlb_dma_ops; static inline struct dma_map_ops *__generic_dma_ops(struct device *dev) { @@ -47,6 +49,11 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) return __generic_dma_ops(dev); } +static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) +{ + dev->archdata.dma_ops = ops; +} + #include <asm-generic/dma-mapping-common.h> static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |