PDK API Guide for J721E
V1/ipc_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
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_V1_H_
48 #define IPC_SOC_V1_H_
49 
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
60 #if defined (SOC_J7200)
61 #define IPC_VRING_BUFFER_SIZE (0x800000U)
62 #else
63 #define IPC_VRING_BUFFER_SIZE (0x1C00000U)
64 #endif
65 
66 /*
67  * For VLAB toolbox 0.14.5.snapshot2 onward,
68  * this must be defined for C66x interrupt to work
69  * properly.
70  */
71 #define SUPPORT_C66X_BIT0
72 
74 #define IPC_MPU1_0 (0U)
75 #define IPC_MCU1_0 (1U)
76 #define IPC_MCU1_1 (2U)
77 #define IPC_MCU2_0 (3U)
78 #define IPC_MCU2_1 (4U)
79 #if defined (SOC_J721E)
80 #define IPC_MCU3_0 (5U)
81 #define IPC_MCU3_1 (6U)
82 #define IPC_C66X_1 (7U)
83 #define IPC_C66X_2 (8U)
84 #define IPC_C7X_1 (9U)
85 #define IPC_MPU1_1 (10U)
86 #define IPC_MAX_PROCS (11U)
87 #elif defined (SOC_J7200)
88 #define IPC_MPU1_1 (5U)
89 #define IPC_MAX_PROCS (6U)
90 #endif
91 
92 #define IPC_MAILBOX_CLUSTER_CNT (12U)
93 #define IPC_MAILBOX_USER_CNT (4U)
94 #define MAIN_NAVSS_MAILBOX_INPUTINTR_MAX (440U)
95 #define MAIN_NAVSS_MAILBOX_OUTPUTINTR_MAX (512U)
96 
97 /* Refer to J7ES interrupt mapping table and BoardCfg Resource allocation */
98 /* Note: In case of IPC_SUPPORT_SCICLIENT this is not actually used, since
99  * the range is returned from the BoardCfg */
100 #ifndef QNX_OS
101 #define NAVSS512_MPU1_0_INPUT_MAILBOX_OFFSET (182U)
102 #define NAVSS512_MPU1_0_INPUT_MAILBOX_VIM_OFFSET (726U)
103 #else
104 #define NAVSS512_MPU1_0_INPUT_MAILBOX_OFFSET (112U)
105 #define NAVSS512_MPU1_0_INPUT_MAILBOX_VIM_OFFSET (496U)
106 #endif
107 #define NAVSS512_MCU1R5F0_INPUT_MAILBOX_OFFSET (400U)
108 #define NAVSS512_MCU1R5F0_INPUT_MAILBOX_VIM_OFFSET (376U)
109 #define NAVSS512_MCU1R5F1_INPUT_MAILBOX_OFFSET (404U)
110 #define NAVSS512_MCU1R5F1_INPUT_MAILBOX_VIM_OFFSET (380U)
111 #define NAVSS512_MCU2R5F0_INPUT_MAILBOX_OFFSET (216U)
112 #define NAVSS512_MCU2R5F0_INPUT_MAILBOX_VIM_OFFSET (248U)
113 #define NAVSS512_MCU2R5F1_INPUT_MAILBOX_OFFSET (248U)
114 #define NAVSS512_MCU2R5F1_INPUT_MAILBOX_VIM_OFFSET (248U)
115 #define NAVSS512_MCU3R5F0_INPUT_MAILBOX_OFFSET (280U)
116 #define NAVSS512_MCU3R5F0_INPUT_MAILBOX_VIM_OFFSET (248U)
117 #define NAVSS512_MCU3R5F1_INPUT_MAILBOX_OFFSET (312U)
118 #define NAVSS512_MCU3R5F1_INPUT_MAILBOX_VIM_OFFSET (248U)
119 #define NAVSS512_C66X1_INPUT_MAILBOX_OFFSET (344U)
120 #define NAVSS512_C66X1_INPUT_MAILBOX_VIM_OFFSET (97U) /* C66x_intrRouter_0 */
121 #define NAVSS512_C66X2_INPUT_MAILBOX_OFFSET (376U)
122 #define NAVSS512_C66X2_INPUT_MAILBOX_VIM_OFFSET (97U) /* C66x_intrRouter_1 */
123 #define NAVSS512_C7X1_INPUT_MAILBOX_OFFSET (188U)
124 #define NAVSS512_C7X1_INPUT_MAILBOX_VIM_OFFSET (732U)
125 
126 #define IPC_MCU_NAVSS0_INTR0_CFG_BASE (CSL_NAVSS_MAIN_INTR_ROUTER_CFG_REGS_0_BASE)
127 
128 /* Could not find the RAT address in CSL */
129 #define IPC_C66X_RAT_BASE (0x07ff0030U)
130 
131 /* Virtual Address used for C66x to access j7_c66_interrupt_router */
132 #define IPC_C66X_INTR_VA_BASE (0x18000000U)
133 
134 /* Sclient does not configure RAT, so it must
135  * be done C66x core
136  * RAT configuration for C66x_1 and C66x_2 */
137 #define IPC_C66X_1_INTR_PA_BASE (CSL_C66SS0_INTROUTER0_INTR_ROUTER_CFG_BASE)
138 #define IPC_C66X_2_INTR_PA_BASE (CSL_C66SS1_INTROUTER0_INTR_ROUTER_CFG_BASE)
139 #define C66X1_MBINTR_INPUT_BASE (74U)
140 #define C66X1_MBINTR_OFFSET (84U)
141 #define C66X1_MBINTR_OUTPUT_BASE (96U)
142 #define C66X2_MBINTR_INPUT_BASE (74U)
143 #define C66X2_MBINTR_OUTPUT_BASE (96U)
144 #define C66X2_MBINTR_OFFSET (84U)
145 
146 /* For C7x, DMSC does not configure or map CLEC router
147  * it must be done by C7x software.
148  */
149 #define C7X_CLEC_BASE_ADDR (CSL_COMPUTE_CLUSTER0_CLEC_REGS_BASE)
150 
151 /* CLEC Offset = 992:- soc_events_in #32 is connected to CLEC event #1024 */
152 #define C7X_CLEC_OFFSET (1024U - 32U)
153 
154 /* User selected IRQ number */
155 /* Start of C7x events associated to CLEC that IPC Driver will manage */
156 /* Events 0 - 15 : left for other drivers, Timer Interrupts etc.
157  * Events 16 - 47 : For routing DRU Local Events from CLEC (done by Vision Apps/TIDL)
158  * Events 48 - 58 : managed by UDMA for routing various UDMA events to C7x
159  * Events 59 - 63 : managed by IPC for routing various Mailbox events to C7x */
160 #define IPC_C7X_MBINTR_OFFSET (59U)
161 
162 /* ========================================================================== */
163 /* Include Files */
164 /* ========================================================================== */
165 
166 /* None */
167 
168 
169 /* ========================================================================== */
170 /* Macros & Typedefs */
171 /* ========================================================================== */
172 
173 
174 
175 /* @} */
176 
177 /* ========================================================================== */
178 /* Structure Declarations */
179 /* ========================================================================== */
180 /* None */
181 
182 /* ========================================================================== */
183 /* Function Declarations */
184 /* ========================================================================== */
185 
186 #if defined(BUILD_C66X)
187 void Ipc_configC66xIntrRouter(uint32_t input);
188 #endif
189 
190 #if defined(BUILD_C7X)
191 uint32_t Ipc_configClecRouter(uint32_t coreEvent, uint32_t coreEventBase);
192 #endif
193 
194 #ifdef IPC_SUPPORT_SCICLIENT
195 int32_t Ipc_sciclientIrqRelease(uint16_t remoteId, uint32_t clusterId,
196  uint32_t userId, uint32_t intNumber);
197 int32_t Ipc_sciclientIrqSet(uint16_t remoteId, uint32_t clusterId,
198  uint32_t userId, uint32_t intNumber);
199 int32_t Ipc_getIntNumRange(uint32_t coreIndex, uint16_t *rangeStartP,
200  uint16_t *rangeNumP);
201 #endif
202 
203 /* ========================================================================== */
204 /* Static Function Definitions */
205 /* ========================================================================== */
206 
207 /* None */
208 
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 #endif /* #ifndef IPC_SOC_V1_H_ */
214 
215 /* @} */
configurations for ipc module.