1 /*
2  * Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.
3  * Copyright (c) 2020-2022, Xilinx, Inc. All rights reserved.
4  * Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef PM_IPI_H
10 #define PM_IPI_H
11 
12 #include <stddef.h>
13 
14 #include <plat_ipi.h>
15 #include "pm_common.h"
16 
17 #define IPI_BLOCKING		1
18 #define IPI_NON_BLOCKING	0
19 
20 void pm_ipi_init(const struct pm_proc *proc);
21 
22 enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
23 			       uint32_t payload[PAYLOAD_ARG_CNT]);
24 enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
25 					    uint32_t payload[PAYLOAD_ARG_CNT]);
26 enum pm_ret_status pm_ipi_send_sync(const struct pm_proc *proc,
27 				    uint32_t payload[PAYLOAD_ARG_CNT],
28 				    uint32_t *value, size_t count);
29 enum pm_ret_status pm_ipi_buff_read_callb(uint32_t *value, size_t count);
30 void pm_ipi_irq_enable(const struct pm_proc *proc);
31 void pm_ipi_irq_clear(const struct pm_proc *proc);
32 uint32_t pm_ipi_irq_status(const struct pm_proc *proc);
33 #if IPI_CRC_CHECK
34 uint32_t calculate_crc(uint32_t payload[PAYLOAD_ARG_CNT], uint32_t buffersize);
35 #endif
36 
37 #endif /* PM_IPI_H */
38