xref: /openbmc/linux/arch/sparc/include/asm/dma-mapping.h (revision 7f2e85840871f199057e65232ebde846192ed989)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ___ASM_SPARC_DMA_MAPPING_H
3 #define ___ASM_SPARC_DMA_MAPPING_H
4 
5 #include <linux/scatterlist.h>
6 #include <linux/mm.h>
7 #include <linux/dma-debug.h>
8 
9 extern const struct dma_map_ops *dma_ops;
10 extern const struct dma_map_ops pci32_dma_ops;
11 
12 extern struct bus_type pci_bus_type;
13 
14 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
15 {
16 #ifdef CONFIG_SPARC_LEON
17 	if (sparc_cpu_model == sparc_leon)
18 		return &pci32_dma_ops;
19 #endif
20 #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
21 	if (bus == &pci_bus_type)
22 		return &pci32_dma_ops;
23 #endif
24 	return dma_ops;
25 }
26 
27 #endif
28