MCUSW
Cdd_Ipc.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) 2024 Texas Instruments Incorporated
4 *
5 * All rights reserved not granted herein.
6 *
7 * Limited License.
8 *
9 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10 * license under copyrights and patents it now or hereafter owns or controls to make,
11 * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12 * terms herein. With respect to the foregoing patent license, such license is granted
13 * solely to the extent that any such patent is necessary to Utilize the software alone.
14 * The patent license shall not apply to any combinations which include this software,
15 * other than combinations with devices manufactured by or for TI ("TI Devices").
16 * No hardware patent is licensed hereunder.
17 *
18 * Redistributions must preserve existing copyright notices and reproduce this license
19 * (including the above copyright notice and the disclaimer and (if applicable) source
20 * code license limitations below) in the documentation and/or other materials provided
21 * with the distribution
22 *
23 * Redistribution and use in binary form, without modification, are permitted provided
24 * that the following conditions are met:
25 *
26 * * No reverse engineering, decompilation, or disassembly of this software is
27 * permitted with respect to any software provided in binary form.
28 *
29 * * any redistribution and use are licensed by TI for use only with TI Devices.
30 *
31 * * Nothing shall obligate TI to provide you with source code for the software
32 * licensed and provided to you in object code.
33 *
34 * If software source code is provided to you, modification and redistribution of the
35 * source code are permitted provided that the following conditions are met:
36 *
37 * * any redistribution and use of the source code, including any resulting derivative
38 * works, are licensed by TI for use only with TI Devices.
39 *
40 * * any redistribution and use of any object code compiled from the source code
41 * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42 *
43 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44 *
45 * may be used to endorse or promote products derived from this software without
46 * specific prior written permission.
47 *
48 * DISCLAIMER.
49 *
50 * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53 * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59 * OF THE POSSIBILITY OF SUCH DAMAGE.
60 *
61 */
62 
97 /*
98  * Below are the global requirements which are met by this IPC CDD
99  * driver
100  */
101 
102 /*
103  * Design: MCAL-3699,MCAL-3697
104  */
105 
106 #ifndef CDD_IPC_H_
107 #define CDD_IPC_H_
108 
109 
110 /* ========================================================================== */
111 /* Include Files */
112 /* ========================================================================== */
113 #include "Std_Types.h"
114 #include "Cdd_IpcCfg.h"
115 
116 
117 
118 #ifdef __cplusplus
119 extern "C"
120 {
121 #endif
122 
123 /* ========================================================================== */
124 /* Macros & Typedefs */
125 /* ========================================================================== */
126 
135 #define CDD_IPC_SW_MAJOR_VERSION (11U)
137 #define CDD_IPC_SW_MINOR_VERSION (2U)
139 #define CDD_IPC_SW_PATCH_VERSION (0U)
140 /* @} */
141 
149 #define CDD_IPC_AR_RELEASE_MAJOR_VERSION (4U)
151 #define CDD_IPC_AR_RELEASE_MINOR_VERSION (3U)
153 #define CDD_IPC_AR_RELEASE_REVISION_VERSION (1U)
154 /* @} */
155 
162 /*
163  * Design: MCAL-7226,MCAL-7225,MCAL-7205,MCAL-7177,MCAL-7193,MCAL-7176,MCAL-7155,MCAL-7179,MCAL-7160
164  */
166 #define CDD_IPC_MODULE_ID ((uint16) 255U)
168 #define CDD_IPC_VENDOR_ID ((uint16) 44U)
170 #define CDD_IPC_INSTANCE_ID ((uint8) 0U)
171 
172 /* @} */
173 
174 
180 /*
181  * Design: MCAL-7153,MCAL-7196,MCAL-7168,MCAL-7151,MCAL-7241,MCAL-7206,MCAL-3736,MCAL-7167
182  */
183 
185 #define CDD_IPC_SID_GETVERSIONINFO (0x01U)
187 #define CDD_IPC_SID_INIT (0x02U)
189 #define CDD_IPC_SID_SEND (0x03U)
191 #define CDD_IPC_SID_RECEIVE (0x04U)
193 #define CDD_IPC_SID_ANNOUNCE (0x05U)
195 #define CDD_IPC_SID_INTERNAL_ISR_ID (0x06U)
197 #define CDD_IPC_SID_REG_READBACK (0x07U)
199 #define CDD_IPC_SID_DEINIT (0x08U)
201 #define CDD_IPC_SID_CTRL_RECEIVE (0x09U)
203 #define CDD_IPC_SID_IS_INIT_DONE (0x0AU)
205 #define CDD_IPC_SID_GET_MAX_MSG_SIZE (0x0BU)
207 #define CDD_IPC_SID_MAILBOX_STATE (0x0CU)
208 
209 /* @} */
210 
215 /*
216  * Design: MCAL-7226,MCAL-7225,MCAL-7205,MCAL-7177,MCAL-7193,MCAL-7176,MCAL-7155,MCAL-7179,MCAL-7160
217  */
219 #define CDD_IPC_E_OK (0x00U)
221 #define CDD_IPC_E_INIT_FAILED (0x01U)
223 #define CDD_IPC_E_UNINIT (0x02U)
225 #define CDD_IPC_E_PARAM_POINTER (0x03U)
227 #define CDD_IPC_E_ALREADY_INITIALIZED (0x04U)
229 #define CDD_IPC_E_INVALID_CONFIG (0x05U)
231 #define CDD_IPC_E_SEND (0x06U)
233 #define CDD_IPC_E_RECEIVE_RETRY (0x07U)
235 #define CDD_IPC_E_NOT_SUPPORTED (0x08U)
237 #define CDD_IPC_E_CALLBACK_NULL (0x09U)
238 
239 /* @} */
240 
243 #define CDD_IPC_MAX_MSG_LEN (496U)
244 
247 #define CDD_IPC_MAX_CTRL_MSG_LEN (32U)
248 
254 #define CDD_IPC_MAX_RETRY_NOTIFY (2U)
255 
256 #define Cdd_IPC_MPU10_BUFFER_SIZE (256)
257 
258 typedef void (*Cdd_Ipc_NewMessage)(void);
259 /*Function pointer for a new message from remote core at a specific channel*/
260 
261 /* ========================================================================== */
262 /* Structures and Enums */
263 /* ========================================================================== */
275 /*
276  * Design: MCAL-7210,MCAL-7204,MCAL-7223,MCAL-7161
277  */
278 typedef struct Cdd_IpcMpType_s
279 {
280  uint32 ownProcID;
282  uint32 numProcs;
284  uint32 remoteProcID[CDD_IPC_CORE_USED];
286  uint32 reserved;
289 } Cdd_IpcMpType;
290 /* @} */
291 
298 /*
299  * Design: MCAL-7194,MCAL-7180,MCAL-7152,MCAL-7197,MCAL-7199
300  */
301 typedef struct Cdd_IpcVertIoType_s
302 {
309  uint32 reserved;
313 /* @} */
314 
319 /*
320  * Design: MCAL-7218,MCAL-7243,MCAL-7192,MCAL-7245,MCAL-7182,MCAL-7231,MCAL-7216
321  */
322 typedef struct Cdd_IpcChannelType_s
323 {
324  uint32 id;
326  uint32 localEp;
328  uint32 remoteEp;
330  uint32 remoteProcId;
332  uint32 numMsgQueued;
334  uint32 maxMsgSize;
338  uint32 reserved;
342 /* @} */
343 
348 /*
349  * Design: MCAL-7233,MCAL-7229
350  */
351 typedef struct Cdd_IpcConfigType_s
352 {
357  uint32 channelCount;
359  P2CONST(Cdd_IpcChannelType, AUTOMATIC, CDD_IPC_CONST) pChCfg;
362  uint32 reserved;
365 
366 /* @} */
367 
373 typedef struct
374 {
375  uint32 numRegisters;
377  uint32 regValues[CDD_IPC_CORE_ID_MAX];
379  uint32 cddipcRev;
381  uint32 cddipcsyscfg;
383  uint32 cddipceoi;
385  uint32 cddipcmsg;
389  uint32 cddipcmsgsts;
393  uint32 cddipcclrsts;
395  uint32 cddipcenbclr;
397  uint32 cddipcenbset;
399  uint32 reserved;
402 
403 /* @} */
404 
409 typedef struct Cdd_IpcChannelBufType_s
410 {
411  uint8 *pBuf;
413  uint32 bufSize;
416 
417 
418 /* @} */
419 /* ========================================================================== */
420 /* Function Declarations */
421 /* ========================================================================== */
422 
441 #if (STD_ON == CDD_IPC_VERSION_INFO_API)
442 FUNC(void, CDD_IPC_CODE) Cdd_IpcGetVersionInfo(
443  P2VAR(Std_VersionInfoType, AUTOMATIC,
444  CDD_APP_DATA) VersionInfoPtr);
445 #endif
446 
464 FUNC(void, CDD_IPC_CODE) Cdd_IpcInit(void);
465 
484 #if (STD_ON == CDD_IPC_DEINIT_API)
485 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcDeinit(void);
486 #endif
487 
514 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcSendMsg(
515  VAR(uint32, AUTOMATIC) chId,
516  P2CONST(void, AUTOMATIC, CDD_APP_DATA) pBuf,
517  VAR(uint32, AUTOMATIC) bufLen);
547 FUNC(Std_ReturnType, CDD_IPC_CODE)Cdd_IpcReceiveMsg(
548  VAR(uint32, AUTOMATIC) chId,
549  P2VAR(void, AUTOMATIC, CDD_APP_DATA) pBuf,
550  P2VAR(uint32, AUTOMATIC, CDD_APP_DATA) bufLen);
551 
576 #if (STD_ON == CDD_IPC_ANNOUNCE_API)
577 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcAnnounce(
578  P2CONST(UCHAR, AUTOMATIC, CDD_APP_DATA) pBuf,
579  VAR(uint32, AUTOMATIC) chId);
580 #endif /* CDD_IPC_ANNOUNCE_API */
581 
615 #if (STD_ON == CDD_IPC_ANNOUNCE_API)
616 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcReceiveCtrlMsg (
617  P2VAR (uint32, AUTOMATIC, CDD_APP_DATA) pRemoteProcId,
618  P2VAR (uint32, AUTOMATIC, CDD_APP_DATA) pRemoteEndPt,
619  P2VAR (void, AUTOMATIC, CDD_APP_DATA) pBuf,
620  P2VAR (uint32, AUTOMATIC, CDD_APP_DATA) bufLen);
621 #endif /* CDD_IPC_ANNOUNCE_API */
622 
643 #if (STD_ON == CDD_IPC_REGISTER_READBACK_API)
644 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcRegisterReadBack(uint32 remoteProcId,
645  P2VAR(Cdd_IpcRegRbValues, AUTOMATIC, CDD_APP_DATA) pRegArgs);
646 #endif
647 
666 #if (STD_ON == CDD_IPC_IS_INIT_DONE_API)
667 FUNC(boolean, CDD_IPC_CODE) Cdd_IpcIsInitDone(void);
668 #endif
669 
688 #if (STD_ON == CDD_IPC_GET_MAX_MSG_SIZE_API)
689 FUNC(uint32, CDD_IPC_CODE) Cdd_IpcGetMaxMsgSize(VAR(uint32, AUTOMATIC) chId);
690 #endif
691 
710 #if (STD_ON == CDD_IPC_SAFETY_DIAGNOSTIC_API)
711 FUNC(uint32, CDD_IPC_CODE) Cdd_IpcGetMailboxStatus(VAR(uint32, AUTOMATIC) remoteProcId);
712 #endif
713 
714 
716 /*
717  * Design: MCAL-30320
718  */
719 FUNC(int32_t, CDD_IPC_CODE) Cdd_Ipc_Send_Ack(uint32 selfId, uint32 remoteProcId, uint32 val,uint32 timeoutCnt);
720 
721 /* Return gracefull request status to the application*/
722 /*
723  * Design: MCAL-30317,MCAL-30318
724  */
725  FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcgbShutdownRequest(void);
726 
727 
738 /*
739  * Design: MCAL-30319
740  */
741 FUNC(void,CDD_IPC_CODE) Cdd_Ipc_mailboxDisableMsg(uint16 selfId, uint16 remoteProcId);
742 
743 #ifdef __cplusplus
744 }
745 #endif
746 
747 #endif /* #ifndef CDD_IPC_H_ */
748 
749 /* @} */
This file contains generated pre compile configurations for CDD IPC MCAL driver.
uint32 reserved
Definition: Cdd_Ipc.h:309
uint32 maxMsgSize
Definition: Cdd_Ipc.h:334
uint32 cddipcclrsts
Definition: Cdd_Ipc.h:393
uint32 cddipcenbclr
Definition: Cdd_Ipc.h:395
uint32 reserved
Definition: Cdd_Ipc.h:399
uint32 cddipcmsgsts
Definition: Cdd_Ipc.h:389
uint32 cddipcenbset
Definition: Cdd_Ipc.h:397
uint32 reserved
Definition: Cdd_Ipc.h:286
uint32 remoteProcId
Definition: Cdd_Ipc.h:330
uint32 reserved
Definition: Cdd_Ipc.h:338
uint32 cddipcRev
Definition: Cdd_Ipc.h:379
void * vertIoRingAddr
Definition: Cdd_Ipc.h:303
uint32 numProcs
Definition: Cdd_Ipc.h:282
uint32 vertIoObjSize
Definition: Cdd_Ipc.h:307
uint32 cddipcirqrawsts
Definition: Cdd_Ipc.h:391
uint32 cddipcfifosts
Definition: Cdd_Ipc.h:387
uint32 reserved
Definition: Cdd_Ipc.h:362
uint32 bufSize
Definition: Cdd_Ipc.h:413
uint32 remoteEp
Definition: Cdd_Ipc.h:328
uint32 numMsgQueued
Definition: Cdd_Ipc.h:332
uint32 cddipceoi
Definition: Cdd_Ipc.h:383
uint32 numRegisters
Definition: Cdd_Ipc.h:375
uint32 cddipcmsg
Definition: Cdd_Ipc.h:385
uint8 * pBuf
Definition: Cdd_Ipc.h:411
Cdd_Ipc_NewMessage NewMessageNotify
Definition: Cdd_Ipc.h:336
uint32 cddipcsyscfg
Definition: Cdd_Ipc.h:381
const Cdd_IpcChannelType * pChCfg
Definition: Cdd_Ipc.h:359
Cdd_IpcMpType coreIds
Definition: Cdd_Ipc.h:353
uint32 localEp
Definition: Cdd_Ipc.h:326
uint32 vertIoRingSize
Definition: Cdd_Ipc.h:305
uint32 channelCount
Definition: Cdd_Ipc.h:357
uint32 id
Definition: Cdd_Ipc.h:324
uint32 ownProcID
Definition: Cdd_Ipc.h:280
Cdd_IpcVertIoType vertIoCfg
Definition: Cdd_Ipc.h:355
VAR(uint8, ETH_VAR_NO_INIT_128) Eth_Ctrl_0_Egress_BufferMem_0[24576U]
boolean Cdd_IpcIsInitDone(void)
Service for checking if IPC module is initialized.
void(* Cdd_Ipc_NewMessage)(void)
Definition: Cdd_Ipc.h:258
Std_ReturnType Cdd_IpcReceiveCtrlMsg(uint32 *pRemoteProcId, uint32 *pRemoteEndPt, void *pBuf, uint32 *bufLen)
Service for reception of N bytes of control message from remote cores.
Std_ReturnType Cdd_IpcReceiveMsg(VAR(uint32,) chId, void *pBuf, uint32 *bufLen)
Service for reception of N bytes of data from remote cores.
void Cdd_IpcGetVersionInfo(Std_VersionInfoType *VersionInfoPtr)
Service for getting CDD version.
int32_t Cdd_Ipc_Send_Ack(uint32 selfId, uint32 remoteProcId, uint32 val, uint32 timeoutCnt)
uint32 Cdd_IpcGetMailboxStatus(VAR(uint32,) remoteProcId)
Service to get Mailbox state is FULL or not.
void Cdd_IpcInit(void)
Service for CDD Initialization.
Std_ReturnType Cdd_IpcSendMsg(VAR(uint32,) chId, const void *pBuf, VAR(uint32,) bufLen)
Service for sending an message to remote cores.
uint32 Cdd_IpcGetMaxMsgSize(VAR(uint32,) chId)
Service for checking if IPC module is initialized.
Std_ReturnType Cdd_IpcDeinit(void)
Service for deinitializing CDD.
Std_ReturnType Cdd_IpcAnnounce(const UCHAR *pBuf, VAR(uint32,) chId)
Service for broadcasting capabilities of this core to all other cores.
Std_ReturnType Cdd_IpcRegisterReadBack(uint32 remoteProcId, Cdd_IpcRegRbValues *pRegArgs)
Service for reading the configuration registers of the MCAL modules.
void Cdd_Ipc_mailboxDisableMsg(uint16 selfId, uint16 remoteProcId)
Dummy API to call mailbox API Ipc_mailboxDisableNewMsgInt from Application : API Mailbox Disable new ...
Std_ReturnType Cdd_IpcgbShutdownRequest(void)
#define CDD_IPC_CORE_USED
Definition: Cdd_IpcCfg.h:357
#define CDD_IPC_CORE_ID_MAX
IPC maximum possible core ID.
Definition: Cdd_IpcCfg.h:355
Channel RP Msg buffer type Used to hold the received buffer, before apps can pick it up.
Definition: Cdd_Ipc.h:410
Defines logical communication channel between cores.
Definition: Cdd_Ipc.h:323
CDD IPC Configuration type.
Definition: Cdd_Ipc.h:352
Defines processor identifiers Core on which MCAL/AUTOSAR is hosted and other cores with which IPC is ...
Definition: Cdd_Ipc.h:279
Definition: Cdd_Ipc.h:374
Defines Shared Memories for VRING and VRING OBJECT VRING is the shared memory between cores and VRING...
Definition: Cdd_Ipc.h:302