2008-01-31 21:15:53 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2007
|
2011-11-01 00:00:39 +01:00
|
|
|
* Stelian Pop <stelian@popies.net>
|
2008-01-31 21:15:53 +00:00
|
|
|
* Lead Tech Design <www.leadtechdesign.com>
|
|
|
|
*
|
2013-07-08 09:37:19 +02:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2008-01-31 21:15:53 +00:00
|
|
|
*/
|
|
|
|
#ifndef __ASM_ARM_DMA_MAPPING_H
|
|
|
|
#define __ASM_ARM_DMA_MAPPING_H
|
|
|
|
|
2015-02-23 18:39:56 +05:30
|
|
|
#define dma_mapping_error(x, y) 0
|
|
|
|
|
2008-01-31 21:15:53 +00:00
|
|
|
enum dma_data_direction {
|
|
|
|
DMA_BIDIRECTIONAL = 0,
|
|
|
|
DMA_TO_DEVICE = 1,
|
|
|
|
DMA_FROM_DEVICE = 2,
|
|
|
|
};
|
|
|
|
|
2015-02-23 18:39:49 +05:30
|
|
|
static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
|
2008-01-31 21:15:53 +00:00
|
|
|
{
|
2013-07-29 13:51:43 +08:00
|
|
|
*handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
|
2008-01-31 21:15:53 +00:00
|
|
|
return (void *)*handle;
|
|
|
|
}
|
|
|
|
|
2015-02-23 18:39:56 +05:30
|
|
|
static inline void dma_free_coherent(void *addr)
|
|
|
|
{
|
|
|
|
free(addr);
|
|
|
|
}
|
|
|
|
|
2008-01-31 21:15:53 +00:00
|
|
|
static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
|
|
|
|
enum dma_data_direction dir)
|
|
|
|
{
|
|
|
|
return (unsigned long)vaddr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dma_unmap_single(volatile void *vaddr, size_t len,
|
|
|
|
unsigned long paddr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ASM_ARM_DMA_MAPPING_H */
|