Sam Ravnborg | a439fe5 | 2008-07-27 23:00:59 +0200 | [diff] [blame] | 1 | #ifndef ___ASM_SPARC_DMA_MAPPING_H |
| 2 | #define ___ASM_SPARC_DMA_MAPPING_H |
FUJITA Tomonori | d698641 | 2009-05-14 16:23:11 +0000 | [diff] [blame] | 3 | |
| 4 | #include <linux/scatterlist.h> |
| 5 | #include <linux/mm.h> |
FUJITA Tomonori | 02f7a18 | 2009-08-10 11:53:13 +0900 | [diff] [blame] | 6 | #include <linux/dma-debug.h> |
FUJITA Tomonori | b9f69f4 | 2009-05-14 16:23:08 +0000 | [diff] [blame] | 7 | |
David S. Miller | 0d1d909 | 2014-11-26 13:36:41 -0800 | [diff] [blame] | 8 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
| 9 | enum dma_data_direction dir) |
| 10 | { |
| 11 | /* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this |
| 12 | * routine can be a nop. |
| 13 | */ |
| 14 | } |
| 15 | |
Bart Van Assche | 5299709 | 2017-01-20 13:04:01 -0800 | [diff] [blame] | 16 | extern const struct dma_map_ops *dma_ops; |
Bart Van Assche | 5299709 | 2017-01-20 13:04:01 -0800 | [diff] [blame] | 17 | extern const struct dma_map_ops pci32_dma_ops; |
Sam Ravnborg | 87e677c | 2012-05-26 15:56:03 +0200 | [diff] [blame] | 18 | |
FUJITA Tomonori | ee664a9 | 2009-08-10 11:53:16 +0900 | [diff] [blame] | 19 | extern struct bus_type pci_bus_type; |
FUJITA Tomonori | 02f7a18 | 2009-08-10 11:53:13 +0900 | [diff] [blame] | 20 | |
Bart Van Assche | 815dd18 | 2017-01-20 13:04:04 -0800 | [diff] [blame] | 21 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
FUJITA Tomonori | 02f7a18 | 2009-08-10 11:53:13 +0900 | [diff] [blame] | 22 | { |
Andreas Larsson | b84ca92 | 2014-09-08 09:48:52 +0200 | [diff] [blame] | 23 | #ifdef CONFIG_SPARC_LEON |
Sam Ravnborg | 87e677c | 2012-05-26 15:56:03 +0200 | [diff] [blame] | 24 | if (sparc_cpu_model == sparc_leon) |
Christoph Hellwig | c6d333e | 2017-05-22 09:06:26 +0200 | [diff] [blame] | 25 | return &pci32_dma_ops; |
Andreas Larsson | b84ca92 | 2014-09-08 09:48:52 +0200 | [diff] [blame] | 26 | #endif |
| 27 | #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI) |
Bart Van Assche | 815dd18 | 2017-01-20 13:04:04 -0800 | [diff] [blame] | 28 | if (bus == &pci_bus_type) |
FUJITA Tomonori | ee664a9 | 2009-08-10 11:53:16 +0900 | [diff] [blame] | 29 | return &pci32_dma_ops; |
| 30 | #endif |
FUJITA Tomonori | 02f7a18 | 2009-08-10 11:53:13 +0900 | [diff] [blame] | 31 | return dma_ops; |
| 32 | } |
| 33 | |
Sam Ravnborg | a439fe5 | 2008-07-27 23:00:59 +0200 | [diff] [blame] | 34 | #endif |