blob: 52dfc4766ef70670354a6988ceb316f7f9987e8a [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Venkatesh Yadav Abbarapu35a8be92019-04-04 14:23:32 +05302 * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
Rajan Vaja566b2f92022-08-31 12:54:38 +02003 * Copyright (c) 2020-2022, Xilinx, Inc. All rights reserved.
4 * Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved.
Soren Brinkmann76fcae32016-03-06 20:16:27 -08005 *
dp-armfa3cf0b2017-05-03 09:38:09 +01006 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-03-06 20:16:27 -08007 */
8
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00009#ifndef PM_IPI_H
10#define PM_IPI_H
Soren Brinkmann76fcae32016-03-06 20:16:27 -080011
Jolly Shah259afe52019-01-09 12:37:57 -080012#include <plat_ipi.h>
Rajan Vaja566b2f92022-08-31 12:54:38 +020013#include <stddef.h>
Soren Brinkmann76fcae32016-03-06 20:16:27 -080014#include "pm_common.h"
15
Jolly Shah259afe52019-01-09 12:37:57 -080016#define IPI_BLOCKING 1
17#define IPI_NON_BLOCKING 0
18
HariBabu Gattemaa811712022-10-07 00:07:49 -070019void pm_ipi_init(const struct pm_proc *proc);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080020
21enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
22 uint32_t payload[PAYLOAD_ARG_CNT]);
Tejas Patelaf4b10e2018-02-09 02:42:59 -080023enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
24 uint32_t payload[PAYLOAD_ARG_CNT]);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080025enum pm_ret_status pm_ipi_send_sync(const struct pm_proc *proc,
26 uint32_t payload[PAYLOAD_ARG_CNT],
Venkatesh Yadav Abbarapue7c45382022-05-19 14:49:49 +053027 uint32_t *value, size_t count);
28void pm_ipi_buff_read_callb(uint32_t *value, size_t count);
Wendy Liang328105c2017-10-03 23:21:11 -070029void pm_ipi_irq_enable(const struct pm_proc *proc);
30void pm_ipi_irq_clear(const struct pm_proc *proc);
Jolly Shah259afe52019-01-09 12:37:57 -080031uint32_t pm_ipi_irq_status(const struct pm_proc *proc);
Venkatesh Yadav Abbarapubfa2a2a2021-02-19 01:40:14 -070032#if IPI_CRC_CHECK
Venkatesh Yadav Abbarapu35a8be92019-04-04 14:23:32 +053033uint32_t calculate_crc(uint32_t payload[PAYLOAD_ARG_CNT], uint32_t buffersize);
34#endif
Soren Brinkmann76fcae32016-03-06 20:16:27 -080035
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000036#endif /* PM_IPI_H */