PDK API Guide for J721E
osal_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2022, Texas Instruments Incorporated
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 distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
48 #ifndef ti_osal_soc_top_include
49 #define ti_osal_soc_top_include
50 
51 #ifdef __cplusplus
52  extern "C" {
53 #endif
54 
55 #if defined (SOC_J721E)
57 #elif defined (SOC_J7200)
58 #include <ti/osal/soc/j7200/osal_soc.h>
59 #elif defined (SOC_J721S2)
60 #include <ti/osal/soc/j721s2/osal_soc.h>
61 #elif defined (SOC_J784S4)
62 #include <ti/osal/soc/j784s4/osal_soc.h>
63 #else
64 /* No known Soc is defined, have below defaults */
65 /* Max number of semaphores for NonOs */
66 #define OSAL_NONOS_MAX_SEMAPHOREP_PER_SOC ((uint32_t) 80U)
67 #define OSAL_NONOS_MAX_HWIP_PER_SOC ((uint32_t) 40U)
68 #define OSAL_NONOS_MAX_TIMERP_PER_SOC ((uint32_t) 20U)
69 
70 /* Max number of various modules for FreeRTOS */
71 #define OSAL_FREERTOS_MAX_SEMAPHOREP_PER_SOC ((uint32_t) 80U)
72 #define OSAL_FREERTOS_MAX_HWIP_PER_SOC ((uint32_t) 40U)
73 #define OSAL_FREERTOS_MAX_TIMERP_PER_SOC ((uint32_t) 20U)
74 #define OSAL_FREERTOS_MAX_TASKP_PER_SOC ((uint32_t) 20U)
75 #define OSAL_FREERTOS_MAX_CLOCKP_PER_SOC ((uint32_t) 20U)
76 #define OSAL_FREERTOS_MAX_MUTEXP_PER_SOC ((uint32_t) 20U)
77 #define OSAL_FREERTOS_MAX_MAILBOXP_PER_SOC ((uint32_t) 20U)
78 #define OSAL_FREERTOS_MAX_QUEUEP_PER_SOC ((uint32_t) 20U)
79 #define OSAL_FREERTOS_MAX_HEAPP_PER_SOC ((uint32_t) 20U)
80 #define OSAL_FREERTOS_MAX_EVENTP_PER_SOC ((uint32_t) 20U)
81 
82 /* Max number of various modules for SafeRTOS */
83 #define OSAL_SAFERTOS_MAX_SEMAPHOREP_PER_SOC ((uint32_t) 80U)
84 #define OSAL_SAFERTOS_MAX_HWIP_PER_SOC ((uint32_t) 40U)
85 #define OSAL_SAFERTOS_MAX_TIMERP_PER_SOC ((uint32_t) 20U)
86 #define OSAL_SAFERTOS_MAX_TASKP_PER_SOC ((uint32_t) 20U)
87 #define OSAL_SAFERTOS_MAX_CLOCKP_PER_SOC ((uint32_t) 20U)
88 #define OSAL_SAFERTOS_MAX_MUTEXP_PER_SOC ((uint32_t) 20U)
89 #define OSAL_SAFERTOS_MAX_MAILBOXP_PER_SOC ((uint32_t) 20U)
90 #define OSAL_SAFERTOS_MAX_EVENTP_PER_SOC ((uint32_t) 20U)
91 #endif
92 
93 /*********************************************************************
94  * @def OSAL_FREERTOS_CONFIGNUM_SEMAPHORE
95  * If the need is more than the defaults, application would need to
96  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
97  * API calls by setting the extended memory block for semaphores
98  *********************************************************************/
99 
100 /* Set the number of SemaphoreP_Handles for FREERTOS */
101 #ifndef OSAL_FREERTOS_CONFIGNUM_SEMAPHORE
102 #define OSAL_FREERTOS_CONFIGNUM_SEMAPHORE (OSAL_FREERTOS_MAX_SEMAPHOREP_PER_SOC)
103 #endif /* OSAL_FREERTOS_CONFIGNUM_SEMAPHORE */
104 
105 /*********************************************************************
106  * @def OSAL_FREERTOS_CONFIGNUM_TASK
107  * If the need is more than the defaults, application would need to
108  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
109  * API calls by setting the extended memory block for tasks
110  *********************************************************************/
111 
112 /* Set the number of SemaphoreP_Handles for FREERTOS */
113 #ifndef OSAL_FREERTOS_CONFIGNUM_TASK
114 #define OSAL_FREERTOS_CONFIGNUM_TASK (OSAL_FREERTOS_MAX_TASKP_PER_SOC)
115 #endif /* OSAL_FREERTOS_CONFIGNUM_TASK */
116 
117 /*********************************************************************
118  * @def OSAL_FREERTOS_CONFIGNUM_CLOCK
119  * If the need is more than the defaults, application would need to
120  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
121  * API calls by setting the extended memory block for clock
122  *********************************************************************/
123 
124 /* Set the number of ClockP_Handles for FREERTOS */
125 #ifndef OSAL_FREERTOS_CONFIGNUM_CLOCK
126 #define OSAL_FREERTOS_CONFIGNUM_CLOCK (OSAL_FREERTOS_MAX_CLOCKP_PER_SOC)
127 #endif /* OSAL_FREERTOS_CONFIGNUM_CLOCK */
128 
129 /*********************************************************************
130  * @def OSAL_FREERTOS_CONFIGNUM_MUTEX
131  * If the need is more than the defaults, application would need to
132  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
133  * API calls by setting the extended memory block for mutex
134  *********************************************************************/
135 
136 /* Set the number of MutexP_Handles for FREERTOS */
137 #ifndef OSAL_FREERTOS_CONFIGNUM_MUTEX
138 #define OSAL_FREERTOS_CONFIGNUM_MUTEX (OSAL_FREERTOS_MAX_MUTEXP_PER_SOC)
139 #endif /* OSAL_FREERTOS_CONFIGNUM_MUTEX */
140 
141 /*********************************************************************
142  * @def OSAL_FREERTOS_CONFIGNUM_MAILBOX
143  * If the need is more than the defaults, application would need to
144  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
145  * API calls by setting the extended memory block for mailbox
146  *********************************************************************/
147 
148 /* Set the number of MailboxP_Handles for FREERTOS */
149 #ifndef OSAL_FREERTOS_CONFIGNUM_MAILBOX
150 #define OSAL_FREERTOS_CONFIGNUM_MAILBOX (OSAL_FREERTOS_MAX_MAILBOXP_PER_SOC)
151 #endif /* OSAL_FREERTOS_CONFIGNUM_MAILBOX */
152 
153 /*********************************************************************
154  * @def OSAL_FREERTOS_CONFIGNUM_QUEUE
155  * If the need is more than the defaults, application would need to
156  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
157  * API calls by setting the extended memory block for queue
158  *********************************************************************/
159 
160 /* Set the number of QueueP_Handles for FREERTOS */
161 #ifndef OSAL_FREERTOS_CONFIGNUM_QUEUE
162 #define OSAL_FREERTOS_CONFIGNUM_QUEUE (OSAL_FREERTOS_MAX_QUEUEP_PER_SOC)
163 #endif /* OSAL_FREERTOS_CONFIGNUM_QUEUE */
164 
165 /*********************************************************************
166  * @def OSAL_FREERTOS_CONFIGNUM_HEAP
167  * If the need is more than the defaults, application would need to
168  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
169  * API calls by setting the extended memory block for heap
170  *********************************************************************/
171 
172 /* Set the number of HeapP_Handles for FREERTOS */
173 #ifndef OSAL_FREERTOS_CONFIGNUM_HEAP
174 #define OSAL_FREERTOS_CONFIGNUM_HEAP (OSAL_FREERTOS_MAX_HEAPP_PER_SOC)
175 #endif /* OSAL_FREERTOS_CONFIGNUM_HEAP */
176 
177 /*********************************************************************
178  * @def OSAL_FREERTOS_CONFIGNUM_EVENT
179  * If the need is more than the defaults, application would need to
180  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
181  * API calls by setting the extended memory block for event
182  *********************************************************************/
183 
184 /* Set the number of EVENTP_Handles for FREERTOS */
185 #ifndef OSAL_FREERTOS_CONFIGNUM_EVENT
186 #define OSAL_FREERTOS_CONFIGNUM_EVENT (OSAL_FREERTOS_MAX_EVENTP_PER_SOC)
187 #endif /* OSAL_FREERTOS_CONFIGNUM_EVENT */
188 
189 /*********************************************************************
190  * @def OSAL_FREERTOS_CONFIGNUM_HWI
191  * If the need is more than the defaults, application would need to
192  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
193  * API calls by setting the extended memory block for HwiP
194  *********************************************************************
195  */
196 /* Set the number of HwiP_Handles */
197 #ifndef OSAL_FREERTOS_CONFIGNUM_HWI
198 #define OSAL_FREERTOS_CONFIGNUM_HWI (OSAL_FREERTOS_MAX_HWIP_PER_SOC)
199 #endif
200 
201 /*********************************************************************
202  * @def OSAL_FREERTOS_CONFIGNUM_TIMER
203  * If the need is more than the defaults, application would need to
204  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
205  * API calls by setting the extended memory block for timer
206  *********************************************************************
207  */
208 /* Set the number of TimerP_Handles for all boards */
209 #ifndef OSAL_FREERTOS_CONFIGNUM_TIMER
210 #define OSAL_FREERTOS_CONFIGNUM_TIMER (OSAL_FREERTOS_MAX_TIMERP_PER_SOC)
211 #endif
212 
213 /*********************************************************************
214  * @def OSAL_SAFERTOS_CONFIGNUM_HWI
215  * If the need is more than the defaults, application would need to
216  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
217  * API calls by setting the extended memory block for HwiP
218  *********************************************************************
219  */
220 /* Set the number of HwiP_Handles */
221 #ifndef OSAL_SAFERTOS_CONFIGNUM_HWI
222 #define OSAL_SAFERTOS_CONFIGNUM_HWI (OSAL_SAFERTOS_MAX_HWIP_PER_SOC)
223 #endif
224 
225 /*********************************************************************
226  * @def OSAL_SAFERTOS_CONFIGNUM_TIMER
227  * If the need is more than the defaults, application would need to
228  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
229  * API calls by setting the extended memory block for timer
230  *********************************************************************
231  */
232 /* Set the number of TimerP_Handles for all boards */
233 #ifndef OSAL_SAFERTOS_CONFIGNUM_TIMER
234 #define OSAL_SAFERTOS_CONFIGNUM_TIMER (OSAL_SAFERTOS_MAX_TIMERP_PER_SOC)
235 #endif
236 
237 /*********************************************************************
238  * @def OSAL_SAFERTOS_CONFIGNUM_CLOCK
239  * If the need is more than the defaults, application would need to
240  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
241  * API calls by setting the extended memory block for clock
242  *********************************************************************/
243 
244 /* Set the number of ClockP_Handles for SAFERTOS */
245 #ifndef OSAL_SAFERTOS_CONFIGNUM_CLOCK
246 #define OSAL_SAFERTOS_CONFIGNUM_CLOCK (OSAL_SAFERTOS_MAX_CLOCKP_PER_SOC)
247 #endif /* OSAL_SAFERTOS_CONFIGNUM_CLOCK */
248 
249 /*********************************************************************
250  * @def OSAL_SAFERTOS_CONFIGNUM_EVENT
251  * If the need is more than the defaults, application would need to
252  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
253  * API calls by setting the extended memory block for event
254  *********************************************************************/
255 
256 /* Set the number of EVENTP_Handles for SAFERTOS */
257 #ifndef OSAL_SAFERTOS_CONFIGNUM_EVENT
258 #define OSAL_SAFERTOS_CONFIGNUM_EVENT (OSAL_SAFERTOS_MAX_EVENTP_PER_SOC)
259 #endif /* OSAL_SAFERTOS_CONFIGNUM_EVENT */
260 
261 /*********************************************************************
262  * @def OSAL_SAFERTOS_CONFIGNUM_MAILBOX
263  * If the need is more than the defaults, application would need to
264  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
265  * API calls by setting the extended memory block for mailbox
266  *********************************************************************/
267 
268 /* Set the number of MailboxP_Handles for SAFERTOS */
269 #ifndef OSAL_SAFERTOS_CONFIGNUM_MAILBOX
270 #define OSAL_SAFERTOS_CONFIGNUM_MAILBOX (OSAL_SAFERTOS_MAX_MAILBOXP_PER_SOC)
271 #endif /* OSAL_SAFERTOS_CONFIGNUM_MAILBOX */
272 
273 /*********************************************************************
274  * @def OSAL_SAFERTOS_CONFIGNUM_MUTEX
275  * If the need is more than the defaults, application would need to
276  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
277  * API calls by setting the extended memory block for mutex
278  *********************************************************************/
279 
280 /* Set the number of MutexP_Handles for SAFERTOS */
281 #ifndef OSAL_SAFERTOS_CONFIGNUM_MUTEX
282 #define OSAL_SAFERTOS_CONFIGNUM_MUTEX (OSAL_SAFERTOS_MAX_MUTEXP_PER_SOC)
283 #endif /* OSAL_SAFERTOS_CONFIGNUM_MUTEX */
284 
285 /*********************************************************************
286  * @def OSAL_SAFERTOS_CONFIGNUM_SEMAPHORE
287  * If the need is more than the defaults, application would need to
288  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
289  * API calls by setting the extended memory block for semaphores
290  *********************************************************************/
291 
292 /* Set the number of SemaphoreP_Handles for SAFERTOS */
293 #ifndef OSAL_SAFERTOS_CONFIGNUM_SEMAPHORE
294 #define OSAL_SAFERTOS_CONFIGNUM_SEMAPHORE (OSAL_SAFERTOS_MAX_SEMAPHOREP_PER_SOC)
295 #endif /* OSAL_SAFERTOS_CONFIGNUM_SEMAPHORE */
296 
297 /*********************************************************************
298  * @def OSAL_SAFERTOS_CONFIGNUM_TASK
299  * If the need is more than the defaults, application would need to
300  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
301  * API calls by setting the extended memory block for task
302  *********************************************************************/
303 
304 /* Set the number of SemaphoreP_Handles for SAFERTOS */
305 #ifndef OSAL_SAFERTOS_CONFIGNUM_TASK
306 #define OSAL_SAFERTOS_CONFIGNUM_TASK (OSAL_SAFERTOS_MAX_TASKP_PER_SOC)
307 #endif /* OSAL_SAFERTOS_CONFIGNUM_TASK */
308 
309 /*********************************************************************
310  * @def OSAL_NONOS_CONFIGNUM_HWI
311  * If the need is more than the defaults, application would need to
312  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
313  * API calls by setting the extended memory block for HwiP
314  *********************************************************************
315  */
316 /* Set the number of HwiP_Handles */
317 #ifndef OSAL_NONOS_CONFIGNUM_HWI
318 #define OSAL_NONOS_CONFIGNUM_HWI (OSAL_NONOS_MAX_HWIP_PER_SOC)
319 #endif
320 
321 /*********************************************************************
322  * @def OSAL_NONOS_CONFIGNUM_TIMER
323  * If the need is more than the defaults, application would need to
324  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
325  * API calls by setting the extended memory block for timer
326  *********************************************************************
327  */
328 /* Set the number of TimerP_Handles for all boards */
329 #ifndef OSAL_NONOS_CONFIGNUM_TIMER
330 #define OSAL_NONOS_CONFIGNUM_TIMER (OSAL_NONOS_MAX_TIMERP_PER_SOC)
331 #endif
332 
333 /*********************************************************************
334  * @def OSAL_NONOS_CONFIGNUM_SEMAPHORE
335  * If the need is more than the defaults, application would need to
336  * suppliment the additional memory for OSAL using @ref Osal_setHwAttrs
337  * API calls by setting the extended memory block for semaphores
338  *********************************************************************/
339 
340 /* Set the number of SemaphoreP_Handles */
341 #ifndef OSAL_NONOS_CONFIGNUM_SEMAPHORE
342 #define OSAL_NONOS_CONFIGNUM_SEMAPHORE (OSAL_NONOS_MAX_SEMAPHOREP_PER_SOC)
343 #endif
344 
345 typedef struct {
346  uint32_t coreId;
347  uint32_t timerId;
349 
350 
351 #ifdef __cplusplus
352 }
353 #endif
354 
355 #endif
356 /* @} */
357 
358 /* Nothing past this point */
uint32_t timerId
Definition: osal_soc.h:347
Definition: osal_soc.h:345
uint32_t coreId
Definition: osal_soc.h:346
SOC specific includes for Osal.