1c73a90e5STejas Patel /* 2bfd06265SMichal Simek * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. 3bfd06265SMichal Simek * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 4c73a90e5STejas Patel * 5c73a90e5STejas Patel * SPDX-License-Identifier: BSD-3-Clause 6c73a90e5STejas Patel */ 7c73a90e5STejas Patel 8c73a90e5STejas Patel /* Versal IPI management enums and defines */ 9c73a90e5STejas Patel 10c73a90e5STejas Patel #ifndef PLAT_IPI_H 11c73a90e5STejas Patel #define PLAT_IPI_H 12c73a90e5STejas Patel 13c73a90e5STejas Patel #include <stdint.h> 14c73a90e5STejas Patel 15*01a326abSPrasad Kummari #include <ipi.h> 16*01a326abSPrasad Kummari 17c73a90e5STejas Patel /********************************************************************* 18c73a90e5STejas Patel * IPI agent IDs macros 19c73a90e5STejas Patel ********************************************************************/ 20c73a90e5STejas Patel #define IPI_ID_PMC 1U 21c73a90e5STejas Patel #define IPI_ID_APU 2U 22c73a90e5STejas Patel #define IPI_ID_RPU0 3U 23c73a90e5STejas Patel #define IPI_ID_RPU1 4U 24c73a90e5STejas Patel #define IPI_ID_3 5U 25c73a90e5STejas Patel #define IPI_ID_4 6U 26c73a90e5STejas Patel #define IPI_ID_5 7U 27c73a90e5STejas Patel 28c73a90e5STejas Patel /********************************************************************* 29c73a90e5STejas Patel * IPI message buffers 30c73a90e5STejas Patel ********************************************************************/ 31c73a90e5STejas Patel #define IPI_BUFFER_BASEADDR 0xFF3F0000U 32c73a90e5STejas Patel 33068b0bc6SMichal Simek #define IPI_LOCAL_ID IPI_ID_APU 34068b0bc6SMichal Simek #define IPI_REMOTE_ID IPI_ID_PMC 35068b0bc6SMichal Simek 3669a5bee4SMichal Simek #define IPI_BUFFER_LOCAL_BASE (IPI_BUFFER_BASEADDR + (IPI_LOCAL_ID * 0x200U)) 3769a5bee4SMichal Simek #define IPI_BUFFER_REMOTE_BASE (IPI_BUFFER_BASEADDR + (IPI_REMOTE_ID * 0x200U)) 38c73a90e5STejas Patel 3969a5bee4SMichal Simek #define IPI_BUFFER_TARGET_LOCAL_OFFSET (IPI_LOCAL_ID * 0x40U) 4069a5bee4SMichal Simek #define IPI_BUFFER_TARGET_REMOTE_OFFSET (IPI_REMOTE_ID * 0x40U) 41c73a90e5STejas Patel 42c73a90e5STejas Patel #define IPI_BUFFER_MAX_WORDS 8 43c73a90e5STejas Patel 44c73a90e5STejas Patel #define IPI_BUFFER_REQ_OFFSET 0x0U 45c73a90e5STejas Patel #define IPI_BUFFER_RESP_OFFSET 0x20U 46c73a90e5STejas Patel 47c73a90e5STejas Patel /********************************************************************* 48c73a90e5STejas Patel * Platform specific IPI API declarations 49c73a90e5STejas Patel ********************************************************************/ 50c73a90e5STejas Patel 51c73a90e5STejas Patel /* Configure IPI table for versal */ 52c73a90e5STejas Patel void versal_ipi_config_table_init(void); 53c73a90e5STejas Patel 54b2258ce3SMichal Simek /* IPI registers and bitfields */ 55b2258ce3SMichal Simek #define PMC_REG_BASE U(0xFF320000) 56b2258ce3SMichal Simek #define PMC_IPI_TRIG_BIT (1U << 1U) 57b2258ce3SMichal Simek #define IPI0_REG_BASE U(0xFF330000) 58b2258ce3SMichal Simek #define IPI0_TRIG_BIT (1U << 2U) 59b2258ce3SMichal Simek #define IPI1_REG_BASE U(0xFF340000) 60b2258ce3SMichal Simek #define IPI1_TRIG_BIT (1U << 3U) 61b2258ce3SMichal Simek #define IPI2_REG_BASE U(0xFF350000) 62b2258ce3SMichal Simek #define IPI2_TRIG_BIT (1U << 4U) 63b2258ce3SMichal Simek #define IPI3_REG_BASE U(0xFF360000) 64b2258ce3SMichal Simek #define IPI3_TRIG_BIT (1U << 5U) 65b2258ce3SMichal Simek #define IPI4_REG_BASE U(0xFF370000) 66b2258ce3SMichal Simek #define IPI4_TRIG_BIT (1U << 5U) 67b2258ce3SMichal Simek #define IPI5_REG_BASE U(0xFF380000) 68b2258ce3SMichal Simek #define IPI5_TRIG_BIT (1U << 6U) 69b2258ce3SMichal Simek 70c73a90e5STejas Patel #endif /* PLAT_IPI_H */ 71