Files
Linux_Drivers/u-boot-2021.10/arch/riscv/include/asm/dma-mapping.h
sam.xiang f8fc109960 [uboot] create uboot from github:
repo: https://github.com/u-boot/u-boot
	commit: d80bb749fab53da72c4a0e09b8c2d2aaa3103c91

Change-Id: Ie6434426e1ec15bc08bb1832798e371f3fd5fb29
2023-03-10 20:30:57 +08:00

31 lines
652 B
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (c) 2018 Western Digital Corporation or its affiliates.
*
* Authors:
* Anup Patel <anup.patel@wdc.com>
*/
#ifndef __ASM_RISCV_DMA_MAPPING_H
#define __ASM_RISCV_DMA_MAPPING_H
#include <common.h>
#include <linux/types.h>
#include <asm/cache.h>
#include <cpu_func.h>
#include <linux/dma-direction.h>
#include <malloc.h>
static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
{
*handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
return (void *)*handle;
}
static inline void dma_free_coherent(void *addr)
{
free(addr);
}
#endif /* __ASM_RISCV_DMA_MAPPING_H */