blob: a5821f54e5670a185ea541013ec7e2359089db5b [file] [log] [blame]
Stelian Popfa506a92008-01-31 21:15:53 +00001/*
2 * (C) Copyright 2007
Stelian Popc9e798d2011-11-01 00:00:39 +01003 * Stelian Pop <stelian@popies.net>
Stelian Popfa506a92008-01-31 21:15:53 +00004 * Lead Tech Design <www.leadtechdesign.com>
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Stelian Popfa506a92008-01-31 21:15:53 +00007 */
8#ifndef __ASM_ARM_DMA_MAPPING_H
9#define __ASM_ARM_DMA_MAPPING_H
10
Kishon Vijay Abraham I2f066932015-02-23 18:39:56 +053011#define dma_mapping_error(x, y) 0
12
Stelian Popfa506a92008-01-31 21:15:53 +000013enum dma_data_direction {
14 DMA_BIDIRECTIONAL = 0,
15 DMA_TO_DEVICE = 1,
16 DMA_FROM_DEVICE = 2,
17};
18
Kishon Vijay Abraham Iaecbf872015-02-23 18:39:49 +053019static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
Stelian Popfa506a92008-01-31 21:15:53 +000020{
Kuo-Jung Su771f74c2013-07-29 13:51:43 +080021 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
Stelian Popfa506a92008-01-31 21:15:53 +000022 return (void *)*handle;
23}
24
Kishon Vijay Abraham I2f066932015-02-23 18:39:56 +053025static inline void dma_free_coherent(void *addr)
26{
27 free(addr);
28}
29
Stelian Popfa506a92008-01-31 21:15:53 +000030static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
31 enum dma_data_direction dir)
32{
33 return (unsigned long)vaddr;
34}
35
36static inline void dma_unmap_single(volatile void *vaddr, size_t len,
37 unsigned long paddr)
38{
39}
40
41#endif /* __ASM_ARM_DMA_MAPPING_H */