blob: 8be1003e6baf86fe4e55411f5af7b57ef8fc3450 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Andy Shevchenkob7026b02017-07-06 14:41:51 +03002/*
3 * (C) Copyright 2007
4 * Stelian Pop <stelian@popies.net>
5 * Lead Tech Design <www.leadtechdesign.com>
Andy Shevchenkob7026b02017-07-06 14:41:51 +03006 */
7#ifndef __ASM_X86_DMA_MAPPING_H
8#define __ASM_X86_DMA_MAPPING_H
9
Vignesh Raghavendrac0a5a812020-01-16 14:23:45 +053010#include <common.h>
11#include <asm/cache.h>
12#include <cpu_func.h>
Masahiro Yamadab27af392017-08-26 00:50:17 +090013#include <linux/dma-direction.h>
Masahiro Yamadac22c0db2020-02-14 16:40:17 +090014#include <linux/types.h>
Vignesh Raghavendrac0a5a812020-01-16 14:23:45 +053015#include <malloc.h>
Andy Shevchenkob7026b02017-07-06 14:41:51 +030016
Andy Shevchenkob7026b02017-07-06 14:41:51 +030017static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
18{
19 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
20 return (void *)*handle;
21}
22
23static inline void dma_free_coherent(void *addr)
24{
25 free(addr);
26}
27
Andy Shevchenkob7026b02017-07-06 14:41:51 +030028#endif /* __ASM_X86_DMA_MAPPING_H */