blob: fc5b8f634d546dcc26503169a648d31127a95bb6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stelian Pop7d42a222008-01-31 21:15:53 +00002/*
3 * (C) Copyright 2007
Stelian Pop5ee0c7f2011-11-01 00:00:39 +01004 * Stelian Pop <stelian@popies.net>
Stelian Pop7d42a222008-01-31 21:15:53 +00005 * Lead Tech Design <www.leadtechdesign.com>
Stelian Pop7d42a222008-01-31 21:15:53 +00006 */
7#ifndef __ASM_ARM_DMA_MAPPING_H
8#define __ASM_ARM_DMA_MAPPING_H
9
Masahiro Yamadaef205ea2017-08-26 00:50:17 +090010#include <linux/dma-direction.h>
Kishon Vijay Abraham Icec6d1c2015-02-23 18:39:56 +053011
Masahiro Yamadaef205ea2017-08-26 00:50:17 +090012#define dma_mapping_error(x, y) 0
Stelian Pop7d42a222008-01-31 21:15:53 +000013
Kishon Vijay Abraham I14841502015-02-23 18:39:49 +053014static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
Stelian Pop7d42a222008-01-31 21:15:53 +000015{
Ye Li054f7792019-01-04 09:24:14 +000016 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
Stelian Pop7d42a222008-01-31 21:15:53 +000017 return (void *)*handle;
18}
19
Kishon Vijay Abraham Icec6d1c2015-02-23 18:39:56 +053020static inline void dma_free_coherent(void *addr)
21{
22 free(addr);
23}
24
Stelian Pop7d42a222008-01-31 21:15:53 +000025static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
26 enum dma_data_direction dir)
27{
28 return (unsigned long)vaddr;
29}
30
31static inline void dma_unmap_single(volatile void *vaddr, size_t len,
32 unsigned long paddr)
33{
34}
35
36#endif /* __ASM_ARM_DMA_MAPPING_H */