PSDK QNX API Guide
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 #define IPC_MCU_NAVSS0_INTR0_CFG_BASE (CSL_NAVSS_MAIN_INTR_ROUTER_CFG_REGS_0_BASE)
98 
99 /* Could not find the RAT address in CSL */
100 #define IPC_C66X_RAT_BASE (0x07ff0030U)
101 
102 /* Virtual Address used for C66x to access j7_c66_interrupt_router */
103 #define IPC_C66X_INTR_VA_BASE (0x18000000U)
104 
105 /* Sclient does not configure RAT, so it must
106  * be done C66x core
107  * RAT configuration for C66x_1 and C66x_2 */
108 #define IPC_C66X_1_INTR_PA_BASE (CSL_C66SS0_INTROUTER0_INTR_ROUTER_CFG_BASE)
109 #define IPC_C66X_2_INTR_PA_BASE (CSL_C66SS1_INTROUTER0_INTR_ROUTER_CFG_BASE)
110 #define C66X1_MBINTR_INPUT_BASE (74U)
111 #define C66X1_MBINTR_OFFSET (84U)
112 #define C66X1_MBINTR_OUTPUT_BASE (96U)
113 #define C66X2_MBINTR_INPUT_BASE (74U)
114 #define C66X2_MBINTR_OUTPUT_BASE (96U)
115 #define C66X2_MBINTR_OFFSET (84U)
116 
117 /* For C7x, DMSC does not configure or map CLEC router
118  * it must be done by C7x software.
119  */
120 #define C7X_CLEC_BASE_ADDR (CSL_COMPUTE_CLUSTER0_CLEC_REGS_BASE)
121 
122 /* CLEC Offset = 992:- soc_events_in #32 is connected to CLEC event #1024 */
123 #define C7X_CLEC_OFFSET (1024U - 32U)
124 
125 /* User selected IRQ number */
126 /* Start of C7x events associated to CLEC that IPC Driver will manage */
127 /* Events 0 - 15 : left for other drivers, Timer Interrupts etc.
128  * Events 16 - 47 : For routing DRU Local Events from CLEC (done by Vision Apps/TIDL)
129  * Events 48 - 58 : managed by UDMA for routing various UDMA events to C7x
130  * Events 59 - 63 : managed by IPC for routing various Mailbox events to C7x */
131 #define IPC_C7X_MBINTR_OFFSET (59U)
132 
133 /* ========================================================================== */
134 /* Include Files */
135 /* ========================================================================== */
136 
137 /* None */
138 
139 
140 /* ========================================================================== */
141 /* Macros & Typedefs */
142 /* ========================================================================== */
143 
144 
145 
146 /* @} */
147 
148 /* ========================================================================== */
149 /* Structure Declarations */
150 /* ========================================================================== */
151 /* None */
152 
153 /* ========================================================================== */
154 /* Function Declarations */
155 /* ========================================================================== */
156 
157 #if defined(BUILD_C66X)
158 void Ipc_configC66xIntrRouter(uint32_t input);
159 #endif
160 
161 #if defined(BUILD_C7X)
162 uint32_t Ipc_configClecRouter(uint32_t coreEvent, uint32_t coreEventBase);
163 #endif
164 
165 int32_t Ipc_sciclientIrqRelease(uint16_t remoteId, uint32_t clusterId,
166  uint32_t userId, uint32_t intNumber);
167 int32_t Ipc_sciclientIrqSet(uint16_t remoteId, uint32_t clusterId,
168  uint32_t userId, uint32_t intNumber);
169 int32_t Ipc_getIntNumRange(uint32_t coreIndex, uint16_t *rangeStartP,
170  uint16_t *rangeNumP);
171 
172 /* ========================================================================== */
173 /* Static Function Definitions */
174 /* ========================================================================== */
175 
176 /* None */
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif /* #ifndef IPC_SOC_V1_H_ */
183 
184 /* @} */
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.