2008-07-18 11:55:51 +07:00
|
|
|
#ifndef ___ASM_SPARC_DMA_MAPPING_H
|
|
|
|
#define ___ASM_SPARC_DMA_MAPPING_H
|
2009-05-14 23:23:11 +07:00
|
|
|
|
|
|
|
#include <linux/scatterlist.h>
|
|
|
|
#include <linux/mm.h>
|
2009-08-10 09:53:13 +07:00
|
|
|
#include <linux/dma-debug.h>
|
2009-05-14 23:23:08 +07:00
|
|
|
|
|
|
|
#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
|
|
|
|
|
2015-09-10 05:39:49 +07:00
|
|
|
#define HAVE_ARCH_DMA_SUPPORTED 1
|
2014-05-17 04:25:50 +07:00
|
|
|
int dma_supported(struct device *dev, u64 mask);
|
2009-05-14 23:23:08 +07:00
|
|
|
|
2014-11-27 04:36:41 +07:00
|
|
|
static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
|
|
|
|
enum dma_data_direction dir)
|
|
|
|
{
|
|
|
|
/* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this
|
|
|
|
* routine can be a nop.
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2017-01-21 04:04:01 +07:00
|
|
|
extern const struct dma_map_ops *dma_ops;
|
|
|
|
extern const struct dma_map_ops *leon_dma_ops;
|
|
|
|
extern const struct dma_map_ops pci32_dma_ops;
|
2012-05-26 20:56:03 +07:00
|
|
|
|
2009-08-10 09:53:16 +07:00
|
|
|
extern struct bus_type pci_bus_type;
|
2009-05-14 23:23:11 +07:00
|
|
|
|
2017-01-21 04:04:04 +07:00
|
|
|
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
|
2009-05-14 23:23:11 +07:00
|
|
|
{
|
2014-09-08 14:48:52 +07:00
|
|
|
#ifdef CONFIG_SPARC_LEON
|
2012-05-26 20:56:03 +07:00
|
|
|
if (sparc_cpu_model == sparc_leon)
|
|
|
|
return leon_dma_ops;
|
2014-09-08 14:48:52 +07:00
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
|
2017-01-21 04:04:04 +07:00
|
|
|
if (bus == &pci_bus_type)
|
2009-08-10 09:53:16 +07:00
|
|
|
return &pci32_dma_ops;
|
|
|
|
#endif
|
2009-08-10 09:53:13 +07:00
|
|
|
return dma_ops;
|
2009-05-14 23:23:11 +07:00
|
|
|
}
|
|
|
|
|
2008-07-18 11:55:51 +07:00
|
|
|
#endif
|