Wendy Liang | 3aebacf | 2017-09-13 11:02:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | /* ZynqMP IPI management enums and defines */ |
| 8 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 9 | #ifndef ZYNQMP_IPI_H |
| 10 | #define ZYNQMP_IPI_H |
Wendy Liang | 3aebacf | 2017-09-13 11:02:42 -0700 | [diff] [blame] | 11 | |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | /********************************************************************* |
| 15 | * IPI agent IDs macros |
| 16 | ********************************************************************/ |
| 17 | #define IPI_ID_APU 0U |
| 18 | #define IPI_ID_RPU0 1U |
| 19 | #define IPI_ID_RPU1 2U |
| 20 | #define IPI_ID_PMU0 3U |
| 21 | #define IPI_ID_PMU1 4U |
| 22 | #define IPI_ID_PMU2 5U |
| 23 | #define IPI_ID_PMU3 6U |
| 24 | #define IPI_ID_PL0 7U |
| 25 | #define IPI_ID_PL1 8U |
| 26 | #define IPI_ID_PL2 9U |
| 27 | #define IPI_ID_PL3 10U |
| 28 | |
| 29 | /********************************************************************* |
| 30 | * IPI mailbox status macros |
| 31 | ********************************************************************/ |
| 32 | #define IPI_MB_STATUS_IDLE 0 |
| 33 | #define IPI_MB_STATUS_SEND_PENDING 1 |
| 34 | #define IPI_MB_STATUS_RECV_PENDING 2 |
| 35 | |
| 36 | /********************************************************************* |
| 37 | * IPI mailbox call is secure or not macros |
| 38 | ********************************************************************/ |
| 39 | #define IPI_MB_CALL_NOTSECURE 0 |
| 40 | #define IPI_MB_CALL_SECURE 1 |
| 41 | |
| 42 | /********************************************************************* |
| 43 | * IPI APIs declarations |
| 44 | ********************************************************************/ |
| 45 | |
| 46 | /* Validate IPI mailbox access */ |
| 47 | int ipi_mb_validate(uint32_t local, uint32_t remote, unsigned int is_secure); |
| 48 | |
| 49 | /* Open the IPI mailbox */ |
| 50 | void ipi_mb_open(uint32_t local, uint32_t remote); |
| 51 | |
| 52 | /* Release the IPI mailbox */ |
| 53 | void ipi_mb_release(uint32_t local, uint32_t remote); |
| 54 | |
| 55 | /* Enquire IPI mailbox status */ |
| 56 | int ipi_mb_enquire_status(uint32_t local, uint32_t remote); |
| 57 | |
| 58 | /* Trigger notification on the IPI mailbox */ |
| 59 | void ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking); |
| 60 | |
| 61 | /* Ack IPI mailbox notification */ |
| 62 | void ipi_mb_ack(uint32_t local, uint32_t remote); |
| 63 | |
| 64 | /* Disable IPI mailbox notification interrupt */ |
| 65 | void ipi_mb_disable_irq(uint32_t local, uint32_t remote); |
| 66 | |
| 67 | /* Enable IPI mailbox notification interrupt */ |
| 68 | void ipi_mb_enable_irq(uint32_t local, uint32_t remote); |
| 69 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 70 | #endif /* ZYNQMP_IPI_H */ |