1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (C) Foundries Ltd. 2021
4  * Author: Jorge Ramirez <jorge@foundries.io>
5  */
6 
7 #ifndef __DRIVERS_ZYNQMP_CSUDMA_H_
8 #define __DRIVERS_ZYNQMP_CSUDMA_H_
9 
10 #include <drivers/zynqmp_csu.h>
11 #include <tee_api_types.h>
12 #include <types_ext.h>
13 
14 #define ZYNQMP_CSUDMA_ALIGN			64
15 #define __aligned_csudma			__aligned(ZYNQMP_CSUDMA_ALIGN)
16 
17 #define ZYNQMP_CSUDMA_MIN_SIZE			16
18 #define ZYNQMP_CSUDMA_DONE			BIT(0)
19 
20 enum zynqmp_csudma_channel {
21 	ZYNQMP_CSUDMA_SRC_CHANNEL = 0,
22 	ZYNQMP_CSUDMA_DST_CHANNEL
23 };
24 
25 TEE_Result zynqmp_csudma_transfer(enum zynqmp_csudma_channel channel,
26 				  void *address, size_t len, uint8_t notify);
27 TEE_Result zynqmp_csudma_sync(enum zynqmp_csudma_channel channel);
28 TEE_Result zynqmp_csudma_prepare(void);
29 void zynqmp_csudma_unprepare(void);
30 
31 #endif
32