11611ef2bSJolly Shah /* 21611ef2bSJolly Shah * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. 31611ef2bSJolly Shah * 41611ef2bSJolly Shah * SPDX-License-Identifier: BSD-3-Clause 51611ef2bSJolly Shah */ 61611ef2bSJolly Shah 71611ef2bSJolly Shah /* ZynqMP IPI management enums and defines */ 81611ef2bSJolly Shah 91611ef2bSJolly Shah #ifndef PLAT_IPI_H 101611ef2bSJolly Shah #define PLAT_IPI_H 111611ef2bSJolly Shah 121611ef2bSJolly Shah #include <stdint.h> 13*b8e39f49SJolly Shah #include <ipi.h> 141611ef2bSJolly Shah 151611ef2bSJolly Shah /********************************************************************* 161611ef2bSJolly Shah * IPI agent IDs macros 171611ef2bSJolly Shah ********************************************************************/ 181611ef2bSJolly Shah #define IPI_ID_APU 0U 191611ef2bSJolly Shah #define IPI_ID_RPU0 1U 201611ef2bSJolly Shah #define IPI_ID_RPU1 2U 211611ef2bSJolly Shah #define IPI_ID_PMU0 3U 221611ef2bSJolly Shah #define IPI_ID_PMU1 4U 231611ef2bSJolly Shah #define IPI_ID_PMU2 5U 241611ef2bSJolly Shah #define IPI_ID_PMU3 6U 251611ef2bSJolly Shah #define IPI_ID_PL0 7U 261611ef2bSJolly Shah #define IPI_ID_PL1 8U 271611ef2bSJolly Shah #define IPI_ID_PL2 9U 281611ef2bSJolly Shah #define IPI_ID_PL3 10U 291611ef2bSJolly Shah 301611ef2bSJolly Shah /********************************************************************* 311611ef2bSJolly Shah * IPI mailbox status macros 321611ef2bSJolly Shah ********************************************************************/ 331611ef2bSJolly Shah #define IPI_MB_STATUS_IDLE 0 341611ef2bSJolly Shah #define IPI_MB_STATUS_SEND_PENDING 1 351611ef2bSJolly Shah #define IPI_MB_STATUS_RECV_PENDING 2 361611ef2bSJolly Shah 371611ef2bSJolly Shah /********************************************************************* 381611ef2bSJolly Shah * IPI mailbox call is secure or not macros 391611ef2bSJolly Shah ********************************************************************/ 401611ef2bSJolly Shah #define IPI_MB_CALL_NOTSECURE 0 411611ef2bSJolly Shah #define IPI_MB_CALL_SECURE 1 421611ef2bSJolly Shah 431611ef2bSJolly Shah /********************************************************************* 441611ef2bSJolly Shah * IPI APIs declarations 451611ef2bSJolly Shah ********************************************************************/ 46*b8e39f49SJolly Shah /* Configure IPI table for zynqmp */ 47*b8e39f49SJolly Shah void zynqmp_ipi_config_table_init(void); 48*b8e39f49SJolly Shah 49*b8e39f49SJolly Shah /* Initialize IPI configuration table */ 50*b8e39f49SJolly Shah void ipi_config_table_init(const struct ipi_config *ipi_table, 51*b8e39f49SJolly Shah uint32_t total_ipi); 521611ef2bSJolly Shah 531611ef2bSJolly Shah /* Validate IPI mailbox access */ 541611ef2bSJolly Shah int ipi_mb_validate(uint32_t local, uint32_t remote, unsigned int is_secure); 551611ef2bSJolly Shah 561611ef2bSJolly Shah /* Open the IPI mailbox */ 571611ef2bSJolly Shah void ipi_mb_open(uint32_t local, uint32_t remote); 581611ef2bSJolly Shah 591611ef2bSJolly Shah /* Release the IPI mailbox */ 601611ef2bSJolly Shah void ipi_mb_release(uint32_t local, uint32_t remote); 611611ef2bSJolly Shah 621611ef2bSJolly Shah /* Enquire IPI mailbox status */ 631611ef2bSJolly Shah int ipi_mb_enquire_status(uint32_t local, uint32_t remote); 641611ef2bSJolly Shah 651611ef2bSJolly Shah /* Trigger notification on the IPI mailbox */ 661611ef2bSJolly Shah void ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking); 671611ef2bSJolly Shah 681611ef2bSJolly Shah /* Ack IPI mailbox notification */ 691611ef2bSJolly Shah void ipi_mb_ack(uint32_t local, uint32_t remote); 701611ef2bSJolly Shah 711611ef2bSJolly Shah /* Disable IPI mailbox notification interrupt */ 721611ef2bSJolly Shah void ipi_mb_disable_irq(uint32_t local, uint32_t remote); 731611ef2bSJolly Shah 741611ef2bSJolly Shah /* Enable IPI mailbox notification interrupt */ 751611ef2bSJolly Shah void ipi_mb_enable_irq(uint32_t local, uint32_t remote); 761611ef2bSJolly Shah 771611ef2bSJolly Shah #endif /* PLAT_IPI_H */ 78