PDK API Guide for J721E
ipc_types.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 
40 #ifndef IPC_TYPES_H_
41 #define IPC_TYPES_H_
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /* ========================================================================== */
48 /* Include Files */
49 /* ========================================================================== */
50 
51 /* ========================================================================== */
52 /* Macros & Typedefs */
53 /* ========================================================================== */
54 
64 #define IPC_SOK (CSL_PASS)
65 
68 #define IPC_EFAIL (CSL_EFAIL)
69 
72 #define IPC_EBADARGS (CSL_EBADARGS)
73 
76 #define IPC_EINVALID_PARAMS (CSL_EINVALID_PARAMS)
77 
81 #define IPC_ETIMEOUT (CSL_ETIMEOUT)
82 
84 #define IPC_EALLOC (CSL_EALLOC)
85 
87 #define IPC_EUNSUPPORTED (CSL_EUNSUPPORTED_CMD)
88 
90 #define IPC_E_UNBLOCKED (-50)
91 
93 #define IPC_INTR_INVALID (0xFFFF0000U)
94 
98 #define IPC_RPMESSAGE_TIMEOUT_FOREVER ~(0)
99 
103 #define RPMESSAGE_ANY (0xFFFFFFFFU)
104 
108 #define RPMESSAGE_ALL (0xFFFFFFFFU)
109 
113 typedef struct Ipc_MbConfig_s
114 {
115  uint32_t priority;
116  uint32_t eventId;
117  uint32_t inputIntrNum;
118  uint32_t outputIntrNum;
119  uint32_t eventIdBase;
120 }Ipc_MbConfig;
121 
130 typedef void (*Ipc_OsalHIsrFxn)(uintptr_t arg0, uintptr_t arg1);
131 
135 typedef struct Ipc_OsalHIsrHandle_s
136 {
137  uintptr_t arg0;
139  uintptr_t arg1;
146 
150 typedef void (* Ipc_OsalHIsrGateHandle);
151 
162 typedef uint32_t (*Ipc_VirtToPhyFxn)(const void *virtAddr);
163 
174 typedef void *(*Ipc_PhyToVirtFxn)(uint32_t phyAddr);
175 
183 typedef void (*Ipc_PrintFxn)(const char *str);
184 
190 typedef uintptr_t (*Ipc_OsalDisableAllIntrFxn)(void);
191 
197 typedef void (*Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie);
198 
207 
216 
225 
235  int32_t key);
236 
242 typedef void * (*Ipc_OsalMutexCreateFxn)(void);
243 
249 typedef void (*Ipc_OsalMutexDeleteFxn)(void *mutexHandle);
250 
256 typedef int32_t (*Ipc_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout);
257 
263 typedef void (*Ipc_OsalMutexUnlockFxn)(void *mutexHandle);
264 
272 typedef int32_t (*Ipc_OsalHIsrCreateFxn)(Ipc_OsalHIsrHandle *handle,
273  Ipc_OsalHIsrFxn fxn, void *arg);
274 
282 typedef void (*Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle);
283 
291 typedef int32_t (*Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle);
292 
298 typedef void (*Ipc_OsalIsrFxn)(uintptr_t arg);
299 
309 typedef void *(*Ipc_OsalRegisterIntrFxn)(Ipc_MbConfig *cfg,
310  Ipc_OsalIsrFxn isrFxn,
311  uintptr_t arg);
312 
318 typedef void (*Ipc_OsalUnRegisterIntrFxn)(void *hwiHandle);
319 
326 typedef void (*Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId);
327 
331 typedef struct Ipc_OsalPrms_s
332 {
368 } Ipc_OsalPrms;
369 
370 #ifdef __cplusplus
371 }
372 #endif
373 
374 #endif /* #ifndef IPC_TYPES_H_ */
void *(* Ipc_OsalRegisterIntrFxn)(Ipc_MbConfig *cfg, Ipc_OsalIsrFxn isrFxn, uintptr_t arg)
IPC OSAL ISR register function prototype.
Definition: ipc_types.h:309
Mailbox interrupt router configuration.
Definition: ipc_types.h:113
Ipc_OsalHIsrPostFxn postHIsr
Definition: ipc_types.h:342
Ipc_OsalHIsrDeleteFxn deleteHIsr
Definition: ipc_types.h:340
uint32_t eventIdBase
Definition: ipc_types.h:119
void(* Ipc_OsalDeleteHIsrMutexFxn)(Ipc_OsalHIsrGateHandle *handle)
IPC OSAL delete high level interrupt lock.
Definition: ipc_types.h:215
uint32_t priority
Definition: ipc_types.h:115
int32_t(* Ipc_OsalHIsrCreateFxn)(Ipc_OsalHIsrHandle *handle, Ipc_OsalHIsrFxn fxn, void *arg)
IPC OSAL create high level interrupt handler.
Definition: ipc_types.h:272
Ipc_OsalEnterHIsrMutexFxn lockHIsrGate
Definition: ipc_types.h:349
uint32_t(* Ipc_VirtToPhyFxn)(const void *virtAddr)
IPC Virtual to Physical address translation callback function.
Definition: ipc_types.h:162
int32_t(* Ipc_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout)
IPC OSAL mutex lock function prototype.
Definition: ipc_types.h:256
uint32_t eventId
Definition: ipc_types.h:116
Ipc_OsalRegisterIntrFxn registerIntr
Definition: ipc_types.h:364
Ipc_OsalCreateHIsrMutexFxn createHIsrGate
Definition: ipc_types.h:345
Ipc_OsalHIsrFxn hIsrFxn
Definition: ipc_types.h:141
void(* Ipc_OsalHIsrFxn)(uintptr_t arg0, uintptr_t arg1)
IPC OSAL High Level ISR type.
Definition: ipc_types.h:130
uintptr_t(* Ipc_OsalDisableAllIntrFxn)(void)
IPC OSAL interrupt disable function prototype.
Definition: ipc_types.h:190
Ipc_OsalMutexCreateFxn createMutex
Definition: ipc_types.h:355
void(* Ipc_OsalMutexDeleteFxn)(void *mutexHandle)
IPC OSAL mutex delete function prototype.
Definition: ipc_types.h:249
Second level ISR (HISR), used to complete ISR functions.
Definition: ipc_types.h:135
void * Ipc_OsalHIsrGateHandle
High Level ISR handle.
Definition: ipc_types.h:150
void(* Ipc_OsalUnRegisterIntrFxn)(void *hwiHandle)
IPC OSAL ISR unregister function prototype.
Definition: ipc_types.h:318
uintptr_t arg1
Definition: ipc_types.h:139
Ipc_OsalDisableAllIntrFxn disableAllIntr
Definition: ipc_types.h:333
void(* Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL delete high level interrupt handler.
Definition: ipc_types.h:282
Ipc_OsalDeleteHIsrMutexFxn deleteHIsrGate
Definition: ipc_types.h:347
void(* Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId)
IPC New message notification.
Definition: ipc_types.h:326
Ipc_OsalExitHIsrMutexFxn unLockHIsrGate
Definition: ipc_types.h:351
void *(* Ipc_OsalMutexCreateFxn)(void)
IPC OSAL mutex create function prototype to protect critical section.
Definition: ipc_types.h:242
int32_t(* Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL Lock High level ISR's.
Definition: ipc_types.h:291
Ipc_OsalRestoreAllIntrFxn restoreAllIntr
Definition: ipc_types.h:335
void(* Ipc_OsalExitHIsrMutexFxn)(Ipc_OsalHIsrGateHandle handle, int32_t key)
IPC OSAL Un Lock High level ISR's.
Definition: ipc_types.h:234
void(* Ipc_OsalMutexUnlockFxn)(void *mutexHandle)
IPC OSAL mutex lock function prototype.
Definition: ipc_types.h:263
Ipc_OsalMutexLockFxn lockMutex
Definition: ipc_types.h:359
Ipc_OsalHIsrGateHandle(* Ipc_OsalCreateHIsrMutexFxn)(void)
IPC OSAL create high level interrupt lock.
Definition: ipc_types.h:206
Ipc_OsalHIsrCreateFxn createHIsr
Definition: ipc_types.h:338
void * hLosHisrHandle
Definition: ipc_types.h:143
int32_t(* Ipc_OsalEnterHIsrMutexFxn)(Ipc_OsalHIsrGateHandle handle)
IPC OSAL Lock High level ISR's.
Definition: ipc_types.h:224
uintptr_t arg0
Definition: ipc_types.h:137
void(* Ipc_PrintFxn)(const char *str)
IPC info/debug print function prototype.
Definition: ipc_types.h:183
Ipc_OsalMutexUnlockFxn unlockMutex
Definition: ipc_types.h:361
uint32_t inputIntrNum
Definition: ipc_types.h:117
char str[32]
Definition: tisci_core.h:442
Ipc_OsalMutexDeleteFxn deleteMutex
Definition: ipc_types.h:357
IPC driver OSAL function pointers.
Definition: ipc_types.h:331
void(* Ipc_OsalIsrFxn)(uintptr_t arg)
IPC OSAL ISR callback function prototype.
Definition: ipc_types.h:298
void(* Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie)
IPC OSAL interrupt restore function prototype.
Definition: ipc_types.h:197
Ipc_OsalUnRegisterIntrFxn unRegisterIntr
Definition: ipc_types.h:366
uint32_t outputIntrNum
Definition: ipc_types.h:118