summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-06-15 14:08:36 +0300
committerPaul Burton <paul.burton@mips.com>2018-06-24 19:26:03 +0300
commitf6d302e33d68ddbaf99c774ed994599243462b24 (patch)
tree62aba80f4998764b95b5cf7d521bf44b6f9ba96f /arch/mips/include/asm/dma-mapping.h
parente799de3efb9d6e0df5740eed901b89a6e533eaef (diff)
downloadlinux-f6d302e33d68ddbaf99c774ed994599243462b24.tar.xz
MIPS: consolidate the swiotlb implementations
Octeon and Loongson share exactly the same code, move it into a common implementation, and use that implementation directly from get_arch_dma_ops. Also provide the expected dma-direct.h helpers directly instead of delegating to platform dma-coherence.h headers. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19534/ Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de> Cc: Huacai Chen <chenhc@lemote.com> Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org
Diffstat (limited to 'arch/mips/include/asm/dma-mapping.h')
-rw-r--r--arch/mips/include/asm/dma-mapping.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index 886e75a383f2..ebcce3e22297 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -11,10 +11,15 @@
#endif
extern const struct dma_map_ops *mips_dma_map_ops;
+extern const struct dma_map_ops mips_swiotlb_ops;
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
+#ifdef CONFIG_SWIOTLB
+ return &mips_swiotlb_ops;
+#else
return mips_dma_map_ops;
+#endif
}
#define arch_setup_dma_ops arch_setup_dma_ops