1 #ifndef ___ASM_SPARC_DMA_MAPPING_H
2 #define ___ASM_SPARC_DMA_MAPPING_H
3 
4 #include <linux/scatterlist.h>
5 #include <linux/mm.h>
6 #include <linux/dma-debug.h>
7 
8 #define HAVE_ARCH_DMA_SUPPORTED 1
9 int dma_supported(struct device *dev, u64 mask);
10 
11 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
12 				  enum dma_data_direction dir)
13 {
14 	/* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this
15 	 * routine can be a nop.
16 	 */
17 }
18 
19 extern const struct dma_map_ops *dma_ops;
20 extern const struct dma_map_ops pci32_dma_ops;
21 
22 extern struct bus_type pci_bus_type;
23 
24 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
25 {
26 #ifdef CONFIG_SPARC_LEON
27 	if (sparc_cpu_model == sparc_leon)
28 		return &pci32_dma_ops;
29 #endif
30 #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
31 	if (bus == &pci_bus_type)
32 		return &pci32_dma_ops;
33 #endif
34 	return dma_ops;
35 }
36 
37 #endif
38