summaryrefslogtreecommitdiffstats
path: root/arch/kvx/include/asm/dma.h
blob: a7ecf279a982bf7f7f5b8fd087502dcf9e5ad441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0-only */
/* SPDX-FileCopyrightText: 2021 Yann Sionneau <ysionneau@kalray.eu>, Kalray Inc. */

#ifndef __ASM_DMA_H
#define __ASM_DMA_H

#include <common.h>

#define KVX_DDR_32BIT_RAM_WINDOW_BA	(0x80000000ULL)
#define KVX_DDR_64BIT_RAM_WINDOW_BA	(0x100000000ULL)
#define MAX_32BIT_ADDR			(0xffffffffULL)

#define dma_alloc dma_alloc
static inline void *dma_alloc(size_t size)
{
	return xmemalign(64, ALIGN(size, 64));
}

static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
{
	BUILD_BUG_ON_MSG(1, "dma_alloc_coherent not supported: "
			"MMU support is required to map uncached pages");
	return NULL;
}

static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle,
				     size_t size)
{
	free(mem);
}

#endif /* __ASM_DMA_H */