MCUSW
Cdd_Ipc.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) 2019 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 : DES_CDD_IPC_002, DES_CDD_IPC_003, DES_CDD_IPC_004, DES_CDD_IPC_018,
104  *
105  */
106 /*
107  * Requirements : MCAL-964, MCAL-3699, MCAL-3697, MCAL-981
108  */
109 
110 #ifndef CDD_IPC_H_
111 #define CDD_IPC_H_
112 
113 
114 /* ========================================================================== */
115 /* Include Files */
116 /* ========================================================================== */
117 #include "Std_Types.h"
118 #include "Cdd_IpcCfg.h"
119 
120 
121 
122 #ifdef __cplusplus
123 extern "C"
124 {
125 #endif
126 
127 /* ========================================================================== */
128 /* Macros & Typedefs */
129 /* ========================================================================== */
130 
139 #define CDD_IPC_SW_MAJOR_VERSION (1U)
140 
141 #define CDD_IPC_SW_MINOR_VERSION (2U)
142 
143 #define CDD_IPC_SW_PATCH_VERSION (1U)
144 /* @} */
145 
153 #define CDD_IPC_AR_RELEASE_MAJOR_VERSION (4U)
154 
155 #define CDD_IPC_AR_RELEASE_MINOR_VERSION (3U)
156 
157 #define CDD_IPC_AR_RELEASE_REVISION_VERSION (1U)
158 /* @} */
159 
166 /*
167  * Design : DES_CDD_IPC_019
168  */
169 /*
170  * Requirements : MCAL-3720, MCAL-3721, MCAL-3722, MCAL-3723, MCAL-3727,
171  * MCAL-3729, MCAL-3734, MCAL-3740, MCAL-3756
172  */
174 #define CDD_IPC_MODULE_ID ((uint16) 255U)
175 
176 #define CDD_IPC_VENDOR_ID ((uint16) 44U)
177 
178 #define CDD_IPC_INSTANCE_ID ((uint8) 0U)
179 
180 /* @} */
181 
182 
188 /*
189  * Design : DES_CDD_IPC_027, DES_CDD_IPC_028, DES_CDD_IPC_029, DES_CDD_IPC_030,
190  * DES_CDD_IPC_031, DES_CDD_IPC_032, DES_CDD_IPC_033, DES_CDD_IPC_039
191  */
192 /*
193  * Requirements : MCAL-3708, MCAL-3688, MCAL-3717 MCAL-3724, MCAL-3730,
194  * MCAL-3739, MCAL-3736, MCAL-4068
195  */
196 
198 #define CDD_IPC_SID_GETVERSIONINFO (0x01U)
199 
200 #define CDD_IPC_SID_INIT (0x02U)
201 
202 #define CDD_IPC_SID_SEND (0x03U)
203 
204 #define CDD_IPC_SID_RECEIVE (0x04U)
205 
206 #define CDD_IPC_SID_ANNOUNCE (0x05U)
207 
208 #define CDD_IPC_SID_INTERNAL_ISR_ID (0x06U)
209 
210 #define CDD_IPC_SID_REG_READBACK (0x07U)
211 
212 #define CDD_IPC_SID_DEINIT (0x08U)
213 
214 #define CDD_IPC_SID_CTRL_RECEIVE (0x09U)
215 
216 #define CDD_IPC_SID_IS_INIT_DONE (0x0AU)
217 
218 #define CDD_IPC_SID_GET_MAX_MSG_SIZE (0x0BU)
219 
220 /* @} */
221 
226 /*
227  * Design : DES_CDD_IPC_019
228  */
229 /*
230  * Requirements : MCAL-3720, MCAL-3721, MCAL-3722, MCAL-3723, MCAL-3727,
231  * MCAL-3729, MCAL-3734, MCAL-3740, MCAL-3756
232  */
234 #define CDD_IPC_E_OK (0x00U)
235 
236 #define CDD_IPC_E_INIT_FAILED (0x01U)
237 
238 #define CDD_IPC_E_UNINIT (0x02U)
239 
240 #define CDD_IPC_E_PARAM_POINTER (0x03U)
241 
242 #define CDD_IPC_E_ALREADY_INITIALIZED (0x04U)
243 
244 #define CDD_IPC_E_INVALID_CONFIG (0x05U)
245 
246 #define CDD_IPC_E_SEND (0x06U)
247 
248 #define CDD_IPC_E_RECEIVE_RETRY (0x07U)
249 
250 #define CDD_IPC_E_NOT_SUPPORTED (0x08U)
251 
252 /* @} */
253 
256 #define CDD_IPC_CORE_ID_MAX (11U)
257 
260 #define CDD_IPC_MAX_MSG_LEN (512U)
261 
264 #define CDD_IPC_MAX_CTRL_MSG_LEN (32U)
265 
271 #define CDD_IPC_MAX_RETRY_NOTIFY (2U)
272 
273 /* ========================================================================== */
274 /* Structures and Enums */
275 /* ========================================================================== */
287 /*
288  * Design : DES_CDD_IPC_006, DES_CDD_IPC_022
289  */
290 /*
291  * Requirements : MCAL-3668, MCAL-3669, MCAL-3670, MCAL-3671
292  */
293 typedef struct Cdd_IpcMpType_s
294 {
295  uint32 ownProcID;
297  uint32 numProcs;
299  uint32 remoteProcID[CDD_IPC_CORE_ID_MAX];
301  uint32 reserved;
304 } Cdd_IpcMpType;
305 /* @} */
306 
313 /*
314  * Design : DES_CDD_IPC_006, DES_CDD_IPC_008, DES_CDD_IPC_023
315  */
316 /*
317  * Requirements : MCAL-3672, MCAL-3673, MCAL-3674, MCAL-3675, MCAL-3676
318  */
319 typedef struct Cdd_IpcVertIoType_s
320 {
327  uint32 reserved;
331 /* @} */
332 
337 /*
338  * Design : DES_CDD_IPC_006, DES_CDD_IPC_024
339  */
340 /*
341  * Requirements : MCAL-3677, MCAL-3678, MCAL-3679, MCAL-3680, MCAL-3681,
342  * MCAL-3682, MCAL-3755
343  */
344 typedef struct Cdd_IpcChannelType_s
345 {
346  uint32 id;
348  uint32 localEp;
350  uint32 remoteEp;
352  uint32 remoteProcId;
354  uint32 numMsgQueued;
356  uint32 maxMsgSize;
358  uint32 reserved;
362 /* @} */
363 
368 /*
369  * Design : DES_CDD_IPC_025,
370  */
371 /*
372  * Requirements : MCAL-3702, MCAL-3705
373  */
374 typedef struct Cdd_IpcConfigType_s
375 {
380  uint32 channelCount;
382  P2CONST(Cdd_IpcChannelType, AUTOMATIC, CDD_IPC_CONST) pChCfg;
385  uint32 reserved;
388 
389 /* @} */
390 
395 /*
396  * Design :
397  */
398 /*
399  * Requirements :
400  */
401 typedef struct
402 {
403  uint32 numRegisters;
405  uint32 regValues[CDD_IPC_CORE_ID_MAX];
407  uint32 reserved;
410 
411 /* @} */
412 
417 typedef struct Cdd_IpcChannelBufType_s
418 {
419  uint8 *pBuf;
421  uint32 bufSize;
424 
425 /* @} */
426 /* ========================================================================== */
427 /* Function Declarations */
428 /* ========================================================================== */
429 
447 #if (STD_ON == CDD_IPC_VERSION_INFO_API)
448 FUNC(void, CDD_IPC_CODE) Cdd_IpcGetVersionInfo(
449  P2VAR(Std_VersionInfoType, AUTOMATIC,
450  CDD_APP_DATA) VersionInfoPtr);
451 #endif
452 
469 FUNC(void, CDD_IPC_CODE) Cdd_IpcInit(void);
470 
488 #if (STD_ON == CDD_IPC_DEINIT_API)
489 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcDeinit(void);
490 #endif
491 
517 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcSendMsg(
518  VAR(uint32, AUTOMATIC) chId,
519  P2CONST(void, AUTOMATIC, CDD_APP_DATA) pBuf,
520  VAR(uint32, AUTOMATIC) bufLen);
549 FUNC(Std_ReturnType, CDD_IPC_CODE)Cdd_IpcReceiveMsg(
550  VAR(uint32, AUTOMATIC) chId,
551  P2VAR(void, AUTOMATIC, CDD_APP_DATA) pBuf,
552  P2VAR(uint32, AUTOMATIC, CDD_APP_DATA) bufLen);
553 
577 #if (STD_ON == CDD_IPC_ANNOUNCE_API)
578 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcAnnounce(
579  P2CONST(char, AUTOMATIC, CDD_APP_DATA) pBuf,
580  VAR(uint32, AUTOMATIC) chId);
581 #endif /* CDD_IPC_ANNOUNCE_API */
582 
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 
642 #if (STD_ON == CDD_IPC_REGISTER_READBACK_API)
643 FUNC(Std_ReturnType, CDD_IPC_CODE) Cdd_IpcRegisterReadBack(
644  P2VAR(Cdd_IpcRegRbValues, AUTOMATIC, CDD_APP_DATA) pRegArgs);
645 #endif
646 
664 #if (STD_ON == CDD_IPC_IS_INIT_DONE_API)
665 FUNC(boolean, CDD_IPC_CODE) Cdd_IpcIsInitDone(void);
666 #endif
667 
685 #if (STD_ON == CDD_IPC_GET_MAX_MSG_SIZE_API)
686 FUNC(uint32, CDD_IPC_CODE) Cdd_IpcGetMaxMsgSize(VAR(uint32, AUTOMATIC) chId);
687 #endif
688 
689 #ifdef __cplusplus
690 }
691 #endif
692 
693 #endif /* #ifndef CDD_IPC_H_ */
694 
695 /* @} */
uint32 reserved
Definition: Cdd_Ipc.h:407
void Cdd_IpcGetVersionInfo(Std_VersionInfoType *VersionInfoPtr)
Service for getting CDD version.
void Cdd_IpcInit(void)
Service for CDD Initialization.
uint32 vertIoRingSize
Definition: Cdd_Ipc.h:323
Definition: Cdd_Ipc.h:401
void * vertIoRingAddr
Definition: Cdd_Ipc.h:321
Std_ReturnType Cdd_IpcReceiveCtrlMsg(uint32 *pRemoteProcId, uint32 *pRemoteEndPt, void *pBuf, uint32 *bufLen)
Service for reception of N bytes of control message from remote cores.
This file contains generated pre compile configurations for CDD IPC MCAL driver.
uint32 reserved
Definition: Cdd_Ipc.h:327
#define CDD_IPC_CORE_ID_MAX
IPC maximum possible core ID.
Definition: Cdd_Ipc.h:256
uint32 remoteEp
Definition: Cdd_Ipc.h:350
const Cdd_IpcChannelType * pChCfg
Definition: Cdd_Ipc.h:382
uint32 ownProcID
Definition: Cdd_Ipc.h:295
uint32 reserved
Definition: Cdd_Ipc.h:301
uint32 Cdd_IpcGetMaxMsgSize(VAR(uint32,) chId)
Service for checking if IPC module is initialized.
Defines logical communication channel between cores.
Definition: Cdd_Ipc.h:344
uint32 numRegisters
Definition: Cdd_Ipc.h:403
Cdd_IpcVertIoType vertIoCfg
Definition: Cdd_Ipc.h:378
Channel RP Msg buffer type Used to hold the received buffer, before apps can pick it up...
Definition: Cdd_Ipc.h:417
uint32 bufSize
Definition: Cdd_Ipc.h:421
boolean Cdd_IpcIsInitDone(void)
Service for checking if IPC module is initialized.
uint32 numMsgQueued
Definition: Cdd_Ipc.h:354
Std_ReturnType Cdd_IpcSendMsg(VAR(uint32,) chId, const void *pBuf, VAR(uint32,) bufLen)
Service for sending an message to remote cores.
Cdd_IpcMpType coreIds
Definition: Cdd_Ipc.h:376
uint32 channelCount
Definition: Cdd_Ipc.h:380
Defines Shared Memories for VRING and VRING OBJECT VRING is the shared memory between cores and VRING...
Definition: Cdd_Ipc.h:319
uint32 reserved
Definition: Cdd_Ipc.h:385
CDD IPC Configuration type.
Definition: Cdd_Ipc.h:374
Defines processor identifiers Core on which MCAL/AUTOSAR is hosted and other cores with which IPC is ...
Definition: Cdd_Ipc.h:293
uint32 remoteProcId
Definition: Cdd_Ipc.h:352
Std_ReturnType Cdd_IpcAnnounce(const char *pBuf, VAR(uint32,) chId)
Service for broadcasting capabilities of this core to all other cores.
uint32 maxMsgSize
Definition: Cdd_Ipc.h:356
Std_ReturnType Cdd_IpcReceiveMsg(VAR(uint32,) chId, void *pBuf, uint32 *bufLen)
Service for reception of N bytes of data from remote cores.
uint32 id
Definition: Cdd_Ipc.h:346
uint32 localEp
Definition: Cdd_Ipc.h:348
uint8 * pBuf
Definition: Cdd_Ipc.h:419
uint32 numProcs
Definition: Cdd_Ipc.h:297
Std_ReturnType Cdd_IpcDeinit(void)
Service for deinitializing CDD.
uint32 vertIoObjSize
Definition: Cdd_Ipc.h:325
uint32 reserved
Definition: Cdd_Ipc.h:358
Std_ReturnType Cdd_IpcRegisterReadBack(Cdd_IpcRegRbValues *pRegArgs)
Service for reading the configuration registers of the MCAL modules.