PSDK QNX API Guide
ipc_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2022
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
47 #ifndef IPC_SOC_V4_H_
48 #define IPC_SOC_V4_H_
49 
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
59 #define IPC_VRING_BUFFER_SIZE (0x3000000U)
60 
62 #define IPC_MPU1_0 (0U)
63 #define IPC_MCU1_0 (1U)
64 #define IPC_MCU1_1 (2U)
65 #define IPC_MCU2_0 (3U)
66 #define IPC_MCU2_1 (4U)
67 #define IPC_MCU3_0 (5U)
68 #define IPC_MCU3_1 (6U)
69 #define IPC_MCU4_0 (7U)
70 #define IPC_MCU4_1 (8U)
71 #define IPC_C7X_1 (9U)
72 #define IPC_C7X_2 (10U)
73 #define IPC_C7X_3 (11U)
74 #if defined (SOC_J784S4)
75 #define IPC_C7X_4 (12U)
76 #define IPC_MPU1_1 (13U)
77 #define IPC_MAX_PROCS (14U)
78 #elif defined (SOC_J742S2)
79 #define IPC_MPU1_1 (12U)
80 #define IPC_MAX_PROCS (13U)
81 #endif
82 
83 #define IPC_MAILBOX_CLUSTER_CNT (18U)
84 #define IPC_MAILBOX_USER_CNT (4U)
85 #define MAIN_NAVSS_MAILBOX_INPUTINTR_MAX (440U)
86 #define MAIN_NAVSS_MAILBOX_OUTPUTINTR_MAX (512U)
87 
88 #define IPC_MCU_NAVSS0_INTR0_CFG_BASE (CSL_NAVSS0_INTR0_INTR_ROUTER_CFG_BASE)
89 
90 /* For C7x, DMSC does not configure or map CLEC router
91  * it must be done by C7x software.
92  */
93 #define C7X_CLEC_BASE_ADDR (CSL_COMPUTE_CLUSTER0_CLEC_REGS_BASE)
94 
95 /* CLEC Offset = 992:- soc_events_in #32 is connected to CLEC event #1024 */
96 /* CLEC is shared b/w all C7x cores and the offset can be common.
97  * ClecEvent # will be different for a particular C7x since the
98  * range is returned from BoardCfg based on core specific allocation */
99 #define C7X_CLEC_OFFSET (1024U - 32U)
100 
101 /* User selected IRQ number */
102 /* Start of C7x events associated to CLEC that IPC Driver will manage */
103 /* Events 0 - 15 : left for other drivers, Timer Interrupts etc.
104  * Events 16 - 47 : For routing DRU Local Events from CLEC (done by Vision Apps/TIDL)
105  * Events 48 - 58 : managed by UDMA for routing various UDMA events to C7x
106  * Events 59 - 63 : managed by IPC for routing various Mailbox events to C7x */
107 /* Even though same CLEC is shared b/w two C7x cores, CLEC can broadcast the
108  * event to any C7x core and CPU IRQ is core specific.
109  * Hence same Mailbox Interrupt offset can be used for both C7x cores. */
110 #define IPC_C7X_MBINTR_OFFSET (59U)
111 
112 /* ========================================================================== */
113 /* Include Files */
114 /* ========================================================================== */
115 
116 /* None */
117 
118 
119 /* ========================================================================== */
120 /* Macros & Typedefs */
121 /* ========================================================================== */
122 
123 
124 
125 /* @} */
126 
127 /* ========================================================================== */
128 /* Structure Declarations */
129 /* ========================================================================== */
130 /* None */
131 
132 /* ========================================================================== */
133 /* Function Declarations */
134 /* ========================================================================== */
135 
136 #if defined(BUILD_C7X)
137 uint32_t Ipc_configClecRouter(uint32_t coreEvent, uint32_t coreEventBase);
138 #endif
139 
140 int32_t Ipc_sciclientIrqRelease(uint16_t remoteId, uint32_t clusterId,
141  uint32_t userId, uint32_t intNumber);
142 int32_t Ipc_sciclientIrqSet(uint16_t remoteId, uint32_t clusterId,
143  uint32_t userId, uint32_t intNumber);
144 int32_t Ipc_getIntNumRange(uint32_t coreIndex, uint16_t *rangeStartP,
145  uint16_t *rangeNumP);
146 
147 /* ========================================================================== */
148 /* Static Function Definitions */
149 /* ========================================================================== */
150 
151 /* None */
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* #ifndef IPC_SOC_V4_H_ */
158 
159 /* @} */
int32_t Ipc_sciclientIrqSet(uint16_t remoteId, uint32_t clusterId, uint32_t userId, uint32_t intNumber)
int32_t Ipc_sciclientIrqRelease(uint16_t remoteId, uint32_t clusterId, uint32_t userId, uint32_t intNumber)
int32_t Ipc_getIntNumRange(uint32_t coreIndex, uint16_t *rangeStartP, uint16_t *rangeNumP)
configurations for ipc module.