Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / include / asm / dma-mapping.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2007
4  * Stelian Pop <stelian@popies.net>
5  * Lead Tech Design <www.leadtechdesign.com>
6  */
7 #ifndef __ASM_ARM_DMA_MAPPING_H
8 #define __ASM_ARM_DMA_MAPPING_H
9
10 #include <asm/cache.h>
11 #include <cpu_func.h>
12 #include <linux/dma-direction.h>
13 #include <linux/kernel.h>
14 #include <linux/types.h>
15 #include <malloc.h>
16
17 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
18 {
19         *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
20         return (void *)*handle;
21 }
22
23 static inline void dma_free_coherent(void *addr)
24 {
25         free(addr);
26 }
27
28 #endif /* __ASM_ARM_DMA_MAPPING_H */