NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
du_mcc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022, NVIDIA Corporation. All Rights Reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property and
5  * proprietary rights in and to this software and related documentation. Any
6  * use, reproduction, disclosure or distribution of this software and related
7  * documentation without an express license agreement from NVIDIA Corporation
8  * is strictly prohibited.
9  */
10 #ifndef __DU_MCC_H__
11 #define __DU_MCC_H__
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
19 
20 /*==================[macros]==================================================*/
21 
27 #define DU_MCC_E_OK 0x55U
28 
31 #define DU_MCC_E_DATA_OOR 0xF2U
32 
35 #define DU_MCC_E_INVALID_IF_ID 0xF3U
36 
39 #define DU_MCC_E_INVALID_UPDATE_FW 0xF4U
40 
43 #define DU_MCC_E_COND_NOT_MET 0xF5U
44 
47 #define DU_MCC_E_SIZE_ERR 0xF6U
48 
51 #define DU_MCC_E_WR_FLASH_LOCK_ERR 0xF7U
52 
55 #define DU_MCC_E_WR_FLASH_BUSY_ERR 0xF8U
56 
59 #define DU_MCC_E_WR_FLASH_ERR 0xF9U
60 
63 #define DU_MCC_E_ERASE_FLASH_LOCK_ERR 0xFAU
64 
67 #define DU_MCC_E_ERASE_FLASH_ERR 0xFBU
68 
71 #define DU_MCC_E_SEQ_ERR 0xFCU
72 
76 #define DU_MCC_E_CHKSUM_ERR 0xFDU
77 
80 #define DU_MCC_E_INVALID_DATA_ERR 0xFEU
81 
84 #define DU_MCC_E_BLKID_INVALID_ERR 0xFFU
85 
88 #define DU_MCC_E_TIMEOUT 0x0FU
89 
92 #define DU_MCC_E_INVALID_PARAMS 0x0EU
93 
96 #define DU_MCC_E_NOT_SUPPORTED 0x0DU
97 
100 #define DU_MCC_E_COMM_ERR 0x0CU
101 
104 #define DU_MCC_E_INCOMPATIBLE_MCU 0x0BU
105 
108 #define DU_MCC_E_INCOMPATIBLE_BOARD 0x0AU
109 
112 #define DU_MCC_E_NOK 0x09U
113 
114 
117 typedef uint8_t U8;
118 typedef uint16_t U16;
119 typedef uint32_t U32;
120 
121 
123 extern const U32 DU_MCC_version;
124 
128 
131 typedef enum {
136 
139 typedef enum {
146 
147 //==================================================================================================
148 // The following section defines the DU MCC library interface. The DU will then call DU_MCC_Init()
149 // and then good to call all other APIs to start communicating with the MCU
150 //
151 // ...Sample code flow from DU...
152 // [DU]
153 // /* check the du_mcc_version */
154 // ASSERT(DU_MCC_LIB_VERSION == DU_MCC_version)
155 //
156 // /* Initialize the MCC lib */
157 // void* libHandle = DU_MCC_Init(0, NULL);
158 //
159 // /* Start communicating with MCU and process requests */
160 // DU_MCC_SetDefaultBootChain(libHandle, ...);
161 //
162 // /* De init */
163 // DU_MCC_DeInit(libHandle);
164 //==================================================================================================
165 
188 void* DU_MCC_Init(int argc, char *argv[]);
189 
214 
243  void* handle,
244  DU_MCC_Tegra_Device_ID Tegra_id,
245  U8 timeout);
246 
275  void* handle,
276  U8 timeDelay);
277 
278 
279 /**********************************************************************/
280 /* Interface APIs for GPIO based Boot-chain selection for Tegra x1/x2 */
281 /**********************************************************************/
282 
317  void* handle,
318  DU_MCC_Tegra_Device_ID Tegra_id,
319  DU_MCC_BootChain_ID Boot_id);
320 
321 
357  void* handle,
358  DU_MCC_Tegra_Device_ID Tegra_id,
359  DU_MCC_BootChain_ID Boot_id);
360 
361 /**********************************************************************/
362 /* Interface APIs for getting Boot-chain information for Tegra x1/x2 */
363 /**********************************************************************/
364 
397  void* handle,
398  DU_MCC_Tegra_Device_ID Tegra_id,
399  U8 *DefaultBootChain);
400 
432  void* handle,
433  DU_MCC_Tegra_Device_ID Tegra_id,
434  U8 *ActiveBootChain);
435 
436 #ifdef __cplusplus
437 }
438 #endif
439 
440 #endif // __DU_MCC_H__
DU_MCC_TEGRA_INVALID_ID
@ DU_MCC_TEGRA_INVALID_ID
Definition: du_mcc.h:134
DU_MCC_GetActiveBootChain
DU_MCC_Ret_Type DU_MCC_GetActiveBootChain(void *handle, DU_MCC_Tegra_Device_ID Tegra_id, U8 *ActiveBootChain)
DU_MCC_GetActive_BootChain() is the interface to request MCU to get active boot chain selection for T...
DU_MCC_Init
void * DU_MCC_Init(int argc, char *argv[])
DU_MCC_Init() is the interface to Initialize library instance.
DU_MCC_BootChain_INVALID_ID
@ DU_MCC_BootChain_INVALID_ID
Definition: du_mcc.h:144
U32
unsigned int U32
Definition: nvavtp.h:51
U16
uint16_t U16
Definition: du_mcc.h:118
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:124
DU_MCC_BootChain_B
@ DU_MCC_BootChain_B
Definition: du_mcc.h:141
DU_MCC_Ret_Type
U8 DU_MCC_Ret_Type
API return type.
Definition: du_mcc.h:127
DU_MCC_TegraReboot
DU_MCC_Ret_Type DU_MCC_TegraReboot(void *handle, DU_MCC_Tegra_Device_ID Tegra_id, U8 timeout)
DU_MCC_TegraReboot() is the interface for requesting reboot of Tegra.
DU_MCC_GetDefaultBootChain
DU_MCC_Ret_Type DU_MCC_GetDefaultBootChain(void *handle, DU_MCC_Tegra_Device_ID Tegra_id, U8 *DefaultBootChain)
DU_MCC_GetDefault_BootChain() is the interface to request MCU to get default boot chain configuration...
U32
uint32_t U32
Definition: du_mcc.h:119
DU_MCC_BootChain_A
@ DU_MCC_BootChain_A
Definition: du_mcc.h:140
DU_MCC_version
const U32 DU_MCC_version
Used to verify du and MCC lib are compatible - [Required MCC lib symbol].
DU_MCC_BootChain_ID
DU_MCC_BootChain_ID
Drive Update Boot Chain IDs.
Definition: du_mcc.h:139
DU_MCC_TEGRA_X2
@ DU_MCC_TEGRA_X2
Definition: du_mcc.h:133
DU_MCC_SetDefaultBootChain
DU_MCC_Ret_Type DU_MCC_SetDefaultBootChain(void *handle, DU_MCC_Tegra_Device_ID Tegra_id, DU_MCC_BootChain_ID Boot_id)
DU_MCC_SetDefault_BootChain() is the interface to request MCU to set the default BootChain of the Teg...
U8
uint8_t U8
Data types.
Definition: du_mcc.h:117
DU_MCC_SystemReset
DU_MCC_Ret_Type DU_MCC_SystemReset(void *handle, U8 timeDelay)
DU_MCC_SystemReset() is the interface to reset Aurix.
DU_MCC_DeInit
DU_MCC_Ret_Type DU_MCC_DeInit(void *handle)
DU_MCC_DeInit() is the interface to DeInitialize library instance.
DU_MCC_BootChain_C
@ DU_MCC_BootChain_C
Definition: du_mcc.h:142
DU_MCC_TEGRA_X1
@ DU_MCC_TEGRA_X1
Definition: du_mcc.h:132
DU_MCC_BootChain_D
@ DU_MCC_BootChain_D
Definition: du_mcc.h:143
U8
unsigned char U8
Definition: nvavtp.h:49
DU_MCC_Tegra_Device_ID
DU_MCC_Tegra_Device_ID
Tegra device IDs.
Definition: du_mcc.h:131
DU_MCC_SetNextBootChain
DU_MCC_Ret_Type DU_MCC_SetNextBootChain(void *handle, DU_MCC_Tegra_Device_ID Tegra_id, DU_MCC_BootChain_ID Boot_id)
DU_MCC_SetNext_BootChain() is the interface to request MCU to switch the BootChain of Tegra to defaul...