blob: 976abd61a8ea7ba6c749bfc1a44d4eebb2d5c7e7 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Michal Simek2a47faa2023-04-14 08:43:51 +02002 * 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
Rajan Vaja566b2f92022-08-31 12:54:38 +020012#include <stddef.h>
Prasad Kummari536e1102023-06-22 10:50:02 +053013
14#include <plat_ipi.h>
Soren Brinkmann76fcae32016-03-06 20:16:27 -080015#include "pm_common.h"
16
Jolly Shah259afe52019-01-09 12:37:57 -080017#define IPI_BLOCKING 1
18#define IPI_NON_BLOCKING 0
19
HariBabu Gattemaa811712022-10-07 00:07:49 -070020void pm_ipi_init(const struct pm_proc *proc);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080021
22enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
23 uint32_t payload[PAYLOAD_ARG_CNT]);
Tejas Patelaf4b10e2018-02-09 02:42:59 -080024enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
25 uint32_t payload[PAYLOAD_ARG_CNT]);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080026enum pm_ret_status pm_ipi_send_sync(const struct pm_proc *proc,
27 uint32_t payload[PAYLOAD_ARG_CNT],
Venkatesh Yadav Abbarapue7c45382022-05-19 14:49:49 +053028 uint32_t *value, size_t count);
Naman Trivedi Manojbhaibeec83f2023-03-07 12:41:12 +053029enum pm_ret_status pm_ipi_buff_read_callb(uint32_t *value, size_t count);
Wendy Liang328105c2017-10-03 23:21:11 -070030void pm_ipi_irq_enable(const struct pm_proc *proc);
31void pm_ipi_irq_clear(const struct pm_proc *proc);
Jolly Shah259afe52019-01-09 12:37:57 -080032uint32_t pm_ipi_irq_status(const struct pm_proc *proc);
Venkatesh Yadav Abbarapubfa2a2a2021-02-19 01:40:14 -070033#if IPI_CRC_CHECK
Venkatesh Yadav Abbarapu35a8be92019-04-04 14:23:32 +053034uint32_t calculate_crc(uint32_t payload[PAYLOAD_ARG_CNT], uint32_t buffersize);
35#endif
Soren Brinkmann76fcae32016-03-06 20:16:27 -080036
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000037#endif /* PM_IPI_H */