blob: 3d930c90eceb3fb8f99ee756dcb47f235f39bc34 [file] [log] [blame]
Anup Patel928452a2019-02-25 08:14:17 +00001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (c) 2018 Western Digital Corporation or its affiliates.
4 *
5 * Authors:
6 * Anup Patel <anup.patel@wdc.com>
7 */
8
9#ifndef __ASM_RISCV_DMA_MAPPING_H
10#define __ASM_RISCV_DMA_MAPPING_H
11
12#include <linux/dma-direction.h>
13
14#define dma_mapping_error(x, y) 0
15
16static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
17{
18 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
19 return (void *)*handle;
20}
21
22static inline void dma_free_coherent(void *addr)
23{
24 free(addr);
25}
26
27static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
28 enum dma_data_direction dir)
29{
30 return (unsigned long)vaddr;
31}
32
33static inline void dma_unmap_single(volatile void *vaddr, size_t len,
34 unsigned long paddr)
35{
36}
37
38#endif /* __ASM_RISCV_DMA_MAPPING_H */