2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2008-01-31 21:15:53 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2007
|
2011-10-31 23:00:39 +00:00
|
|
|
* Stelian Pop <stelian@popies.net>
|
2008-01-31 21:15:53 +00:00
|
|
|
* Lead Tech Design <www.leadtechdesign.com>
|
|
|
|
*/
|
|
|
|
#ifndef __ASM_ARM_DMA_MAPPING_H
|
|
|
|
#define __ASM_ARM_DMA_MAPPING_H
|
|
|
|
|
2020-01-16 08:53:45 +00:00
|
|
|
#include <asm/cache.h>
|
|
|
|
#include <cpu_func.h>
|
2017-08-25 15:50:17 +00:00
|
|
|
#include <linux/dma-direction.h>
|
2020-05-10 17:39:55 +00:00
|
|
|
#include <linux/kernel.h>
|
2020-02-14 07:40:17 +00:00
|
|
|
#include <linux/types.h>
|
2020-01-16 08:53:45 +00:00
|
|
|
#include <malloc.h>
|
2015-02-23 13:09:56 +00:00
|
|
|
|
2015-02-23 13:09:49 +00:00
|
|
|
static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
|
2008-01-31 21:15:53 +00:00
|
|
|
{
|
2019-01-04 09:24:14 +00:00
|
|
|
*handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
|
2008-01-31 21:15:53 +00:00
|
|
|
return (void *)*handle;
|
|
|
|
}
|
|
|
|
|
2015-02-23 13:09:56 +00:00
|
|
|
static inline void dma_free_coherent(void *addr)
|
|
|
|
{
|
|
|
|
free(addr);
|
|
|
|
}
|
|
|
|
|
2008-01-31 21:15:53 +00:00
|
|
|
#endif /* __ASM_ARM_DMA_MAPPING_H */
|