AM263x MCU+ SDK  08.03.00
sipc_notify.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef SIPC_NOTIFY_H_
34 #define SIPC_NOTIFY_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <stdint.h>
41 #include <kernel/dpl/SystemP.h>
42 #include <drivers/secure_ipc_notify/soc/sipc_notify_soc.h>
43 
74 typedef void (*SIPC_FxnCallback)(uint8_t remoteSecCoreId, uint8_t localClientId, uint8_t remoteClientId ,uint8_t *msgValue, void *args);
75 
76 
84 typedef struct SIPC_Params_ {
85 
86  uint32_t numCores;
89  uint32_t coreIdList[MAX_SEC_CORES_WITH_HSM];
94  uint32_t ipcQueue_length ;
98  uintptr_t tx_SipcQueues[MAX_SEC_CORES_WITH_HSM];
100  uintptr_t rx_SipcQueues[MAX_SEC_CORES_WITH_HSM];
102  /* The size of SecureMaster_CoreId array is 2 so the coreId value written on INDEX = 0 will represent the
103  * Secure Master 1's CORE ID and so on */
104  uint32_t secHostCoreId[MAX_SEC_CORES_WITH_HSM - 1];
105  /* This field is for soc extension if user wants to configure different interrupt for SIPC communication*/
106  /* for am263x it is fixed to zero */
108 
109 } SIPC_Params;
110 
114 typedef enum SIPC_fifoFlags_
115 {
118 
120 
127 
136 int32_t SIPC_init(SIPC_Params *params);
137 
144 void SIPC_deInit();
145 
169 int32_t SIPC_sendMsg(uint8_t remoteSecCoreId, uint8_t remoteClientId, uint8_t localClientId ,uint8_t* msgValue, SIPC_fifoFlags waitForFifoNotFull);
170 
181 int32_t SIPC_registerClient(uint8_t localClientId, SIPC_FxnCallback msgCallback, void *args);
182 
183 
192 int32_t SIPC_unregisterClient(uint16_t localClientId);
193 
200 
207 
215 uint32_t SIPC_isCoreEnabled(uint32_t coreId);
216 
217 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* IPC_NOTIFY_H_ */
225 
SIPC_unregisterClient
int32_t SIPC_unregisterClient(uint16_t localClientId)
Un-register a previously registered callback.
SIPC_Params
Parameters used by SIPC_init.
Definition: sipc_notify.h:84
SIPC_getSelfSecMasterId
uint32_t SIPC_getSelfSecMasterId()
Return current core sec master ID.
SystemP.h
SIPC_Params::numCores
uint32_t numCores
Definition: sipc_notify.h:86
SIPC_Params::interruptConfig_Num
uint8_t interruptConfig_Num
Definition: sipc_notify.h:107
SIPC_Params_init
void SIPC_Params_init(SIPC_Params *params)
Set default value to SIPC_Params.
WAIT_IF_FIFO_FULL
@ WAIT_IF_FIFO_FULL
Definition: sipc_notify.h:117
ABORT_ON_FIFO_FULL
@ ABORT_ON_FIFO_FULL
Definition: sipc_notify.h:116
SIPC_init
int32_t SIPC_init(SIPC_Params *params)
Initialize Secure IPC notify module.
SIPC_registerClient
int32_t SIPC_registerClient(uint8_t localClientId, SIPC_FxnCallback msgCallback, void *args)
Register a callback to handle messages received from a specific remote core and for a specific local ...
SIPC_FxnCallback
void(* SIPC_FxnCallback)(uint8_t remoteSecCoreId, uint8_t localClientId, uint8_t remoteClientId, uint8_t *msgValue, void *args)
User callback that is invoked when a message is received from a reote core for a given client ID.
Definition: sipc_notify.h:74
SIPC_Params::ipcQueue_eleSize_inBytes
uint32_t ipcQueue_eleSize_inBytes
Definition: sipc_notify.h:95
SIPC_getSelfCoreId
uint32_t SIPC_getSelfCoreId()
Return current core ID.
MAX_SEC_CORES_WITH_HSM
@ MAX_SEC_CORES_WITH_HSM
Definition: sipc_notify_cfg.h:128
SIPC_deInit
void SIPC_deInit()
De-initialize secure IPC Notify module.
SIPC_sendMsg
int32_t SIPC_sendMsg(uint8_t remoteSecCoreId, uint8_t remoteClientId, uint8_t localClientId, uint8_t *msgValue, SIPC_fifoFlags waitForFifoNotFull)
Send message to a specific remote core and specific client ID on that remote core.
SIPC_Params::ipcQueue_length
uint32_t ipcQueue_length
Definition: sipc_notify.h:94
SIPC_Params::ipcQueue_totalSize_inBytes
uint32_t ipcQueue_totalSize_inBytes
Definition: sipc_notify.h:96
SIPC_isCoreEnabled
uint32_t SIPC_isCoreEnabled(uint32_t coreId)
Check if a core is enabled for SIPC.
SIPC_fifoFlags
SIPC_fifoFlags
flags to pass with the SIPC_sendMsg Api which indicates the flow of execution when the write FIFO is ...
Definition: sipc_notify.h:115