NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
du_mcc.h File Reference

Go to the source code of this file.

Macros

#define DU_MCC_E_OK   0x55U
 Return types for APIs. More...
 
#define DU_MCC_E_DATA_OOR   0xF2U
 Out of range error. More...
 
#define DU_MCC_E_INVALID_IF_ID   0xF3U
 Incorrect Interface ID sent from DU_MCC library to MCU. More...
 
#define DU_MCC_E_INVALID_UPDATE_FW   0xF4U
 Update firmware (UFW) on MCU is not valid. More...
 
#define DU_MCC_E_COND_NOT_MET   0xF5U
 Condition not valid at MCU to perform request operation. More...
 
#define DU_MCC_E_SIZE_ERR   0xF6U
 Incorrect message length sent from DU_MCC library to MCU. More...
 
#define DU_MCC_E_WR_FLASH_LOCK_ERR   0xF7U
 Flash write operation failed at MCU due to flash lock. More...
 
#define DU_MCC_E_WR_FLASH_BUSY_ERR   0xF8U
 Flash write operation failed at MCU as flash is busy. More...
 
#define DU_MCC_E_WR_FLASH_ERR   0xF9U
 Flash write operation generic failure at MCU. More...
 
#define DU_MCC_E_ERASE_FLASH_LOCK_ERR   0xFAU
 Flash erase operation failed at MCU due to flash lock. More...
 
#define DU_MCC_E_ERASE_FLASH_ERR   0xFBU
 Flash erase operation generic failure at MCU. More...
 
#define DU_MCC_E_SEQ_ERR   0xFCU
 Programming sequence error. More...
 
#define DU_MCC_E_CHKSUM_ERR   0xFDU
 CRC computed at MCU doesn't not match with received CRC from DU_MCC library. More...
 
#define DU_MCC_E_INVALID_DATA_ERR   0xFEU
 Invalid data sent from DU_MCC library to MCU. More...
 
#define DU_MCC_E_BLKID_INVALID_ERR   0xFFU
 Incorrect block ID sent from DU_MCC library to MCU. More...
 
#define DU_MCC_E_TIMEOUT   0x0FU
 Response not received by DU_MCC within timeout. More...
 
#define DU_MCC_E_INVALID_PARAMS   0x0EU
 API called with invalid parameter. More...
 
#define DU_MCC_E_NOT_SUPPORTED   0x0DU
 Flashed Aurix FW does not support du mcc interface. More...
 
#define DU_MCC_E_COMM_ERR   0x0CU
 DU_MCC library failed to transmit request to MCU. More...
 
#define DU_MCC_E_INCOMPATIBLE_MCU   0x0BU
 HW step of provided Hex file does not match with flashed Aurix FW. More...
 
#define DU_MCC_E_INCOMPATIBLE_BOARD   0x0AU
 Board type of provided Hex file does not match with flashed Aurix FW. More...
 
#define DU_MCC_E_NOK   0x09U
 Generic failure in du mcc library. More...
 

Typedefs

typedef uint8_t U8
 Data types. More...
 
typedef uint16_t U16
 
typedef uint32_t U32
 
typedef U8 DU_MCC_Ret_Type
 API return type. More...
 

Enumerations

enum  DU_MCC_Tegra_Device_ID {
  DU_MCC_TEGRA_X1,
  DU_MCC_TEGRA_X2,
  DU_MCC_TEGRA_INVALID_ID
}
 Tegra device IDs. More...
 
enum  DU_MCC_BootChain_ID {
  DU_MCC_BootChain_A,
  DU_MCC_BootChain_B,
  DU_MCC_BootChain_C,
  DU_MCC_BootChain_D,
  DU_MCC_BootChain_INVALID_ID
}
 Drive Update Boot Chain IDs. More...
 

Functions

voidDU_MCC_Init (int argc, char *argv[])
 DU_MCC_Init() is the interface to Initialize library instance. More...
 
DU_MCC_Ret_Type DU_MCC_DeInit (void *handle)
 DU_MCC_DeInit() is the interface to DeInitialize library instance. More...
 
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. More...
 
DU_MCC_Ret_Type DU_MCC_SystemReset (void *handle, U8 timeDelay)
 DU_MCC_SystemReset() is the interface to reset Aurix. More...
 
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 default or alternate. More...
 
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 Tegra. More...
 
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 for Tegra. More...
 
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 Tegra. More...
 

Variables

const U32 DU_MCC_version
 Used to verify du and MCC lib are compatible - [Required MCC lib symbol]. More...
 

Macro Definition Documentation

◆ DU_MCC_E_BLKID_INVALID_ERR

#define DU_MCC_E_BLKID_INVALID_ERR   0xFFU

Incorrect block ID sent from DU_MCC library to MCU.

Definition at line 84 of file du_mcc.h.

◆ DU_MCC_E_CHKSUM_ERR

#define DU_MCC_E_CHKSUM_ERR   0xFDU

CRC computed at MCU doesn't not match with received CRC from DU_MCC library.

Definition at line 76 of file du_mcc.h.

◆ DU_MCC_E_COMM_ERR

#define DU_MCC_E_COMM_ERR   0x0CU

DU_MCC library failed to transmit request to MCU.

Definition at line 100 of file du_mcc.h.

◆ DU_MCC_E_COND_NOT_MET

#define DU_MCC_E_COND_NOT_MET   0xF5U

Condition not valid at MCU to perform request operation.

Definition at line 43 of file du_mcc.h.

◆ DU_MCC_E_DATA_OOR

#define DU_MCC_E_DATA_OOR   0xF2U

Out of range error.

Response data validation failed at MCU.

Definition at line 31 of file du_mcc.h.

◆ DU_MCC_E_ERASE_FLASH_ERR

#define DU_MCC_E_ERASE_FLASH_ERR   0xFBU

Flash erase operation generic failure at MCU.

Definition at line 67 of file du_mcc.h.

◆ DU_MCC_E_ERASE_FLASH_LOCK_ERR

#define DU_MCC_E_ERASE_FLASH_LOCK_ERR   0xFAU

Flash erase operation failed at MCU due to flash lock.

Definition at line 63 of file du_mcc.h.

◆ DU_MCC_E_INCOMPATIBLE_BOARD

#define DU_MCC_E_INCOMPATIBLE_BOARD   0x0AU

Board type of provided Hex file does not match with flashed Aurix FW.

Definition at line 108 of file du_mcc.h.

◆ DU_MCC_E_INCOMPATIBLE_MCU

#define DU_MCC_E_INCOMPATIBLE_MCU   0x0BU

HW step of provided Hex file does not match with flashed Aurix FW.

Definition at line 104 of file du_mcc.h.

◆ DU_MCC_E_INVALID_DATA_ERR

#define DU_MCC_E_INVALID_DATA_ERR   0xFEU

Invalid data sent from DU_MCC library to MCU.

Definition at line 80 of file du_mcc.h.

◆ DU_MCC_E_INVALID_IF_ID

#define DU_MCC_E_INVALID_IF_ID   0xF3U

Incorrect Interface ID sent from DU_MCC library to MCU.

Definition at line 35 of file du_mcc.h.

◆ DU_MCC_E_INVALID_PARAMS

#define DU_MCC_E_INVALID_PARAMS   0x0EU

API called with invalid parameter.

Definition at line 92 of file du_mcc.h.

◆ DU_MCC_E_INVALID_UPDATE_FW

#define DU_MCC_E_INVALID_UPDATE_FW   0xF4U

Update firmware (UFW) on MCU is not valid.

Definition at line 39 of file du_mcc.h.

◆ DU_MCC_E_NOK

#define DU_MCC_E_NOK   0x09U

Generic failure in du mcc library.

Definition at line 112 of file du_mcc.h.

◆ DU_MCC_E_NOT_SUPPORTED

#define DU_MCC_E_NOT_SUPPORTED   0x0DU

Flashed Aurix FW does not support du mcc interface.

Definition at line 96 of file du_mcc.h.

◆ DU_MCC_E_OK

#define DU_MCC_E_OK   0x55U

Return types for APIs.

Success. The requested operation is successfully completed.

Definition at line 27 of file du_mcc.h.

◆ DU_MCC_E_SEQ_ERR

#define DU_MCC_E_SEQ_ERR   0xFCU

Programming sequence error.

Definition at line 71 of file du_mcc.h.

◆ DU_MCC_E_SIZE_ERR

#define DU_MCC_E_SIZE_ERR   0xF6U

Incorrect message length sent from DU_MCC library to MCU.

Definition at line 47 of file du_mcc.h.

◆ DU_MCC_E_TIMEOUT

#define DU_MCC_E_TIMEOUT   0x0FU

Response not received by DU_MCC within timeout.

Definition at line 88 of file du_mcc.h.

◆ DU_MCC_E_WR_FLASH_BUSY_ERR

#define DU_MCC_E_WR_FLASH_BUSY_ERR   0xF8U

Flash write operation failed at MCU as flash is busy.

Definition at line 55 of file du_mcc.h.

◆ DU_MCC_E_WR_FLASH_ERR

#define DU_MCC_E_WR_FLASH_ERR   0xF9U

Flash write operation generic failure at MCU.

Definition at line 59 of file du_mcc.h.

◆ DU_MCC_E_WR_FLASH_LOCK_ERR

#define DU_MCC_E_WR_FLASH_LOCK_ERR   0xF7U

Flash write operation failed at MCU due to flash lock.

Definition at line 51 of file du_mcc.h.

Typedef Documentation

◆ DU_MCC_Ret_Type

API return type.

Definition at line 127 of file du_mcc.h.

◆ U16

typedef uint16_t U16

Definition at line 118 of file du_mcc.h.

◆ U32

typedef uint32_t U32

Definition at line 119 of file du_mcc.h.

◆ U8

typedef uint8_t U8

Data types.

Definition at line 117 of file du_mcc.h.

Enumeration Type Documentation

◆ DU_MCC_BootChain_ID

Drive Update Boot Chain IDs.

Enumerator
DU_MCC_BootChain_A 
DU_MCC_BootChain_B 
DU_MCC_BootChain_C 
DU_MCC_BootChain_D 
DU_MCC_BootChain_INVALID_ID 

Definition at line 139 of file du_mcc.h.

◆ DU_MCC_Tegra_Device_ID

Tegra device IDs.

Enumerator
DU_MCC_TEGRA_X1 
DU_MCC_TEGRA_X2 
DU_MCC_TEGRA_INVALID_ID 

Definition at line 131 of file du_mcc.h.

Function Documentation

◆ DU_MCC_DeInit()

DU_MCC_Ret_Type DU_MCC_DeInit ( void handle)

DU_MCC_DeInit() is the interface to DeInitialize library instance.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Returns
: DU_MCC_Ret_Type : success/failure in DeInit
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: No
    • De-Init: Yes

◆ 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 Tegra.

This function requests MCU to get active boot chain selection for Tegra. MCU gets the boot chain selected while booting the Tegra.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Tegra_idId of Tegra x1 or x2 for which the active BootChain selection is requested.
ActiveBootChain(out): out param to store obtained active BootChain configuration. = 0x0 for BootChain_A, 0x1 for BootChain_B
Returns
: DU_MCC_Ret_Type : success/failure in getting active BootChain selection.
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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 for Tegra.

This function requests MCU to get default boot chain configuration for Tegra. MCU gets the boot chain status by reading default boot chain configuration in persistent memory for supplied Tegra Id.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Tegra_idId of Tegra x1 or x2 for which the Default BootChain configuration is requested.
DefaultBootChain(out): out param to store obtained default BootChain configuration. = 0x0 for BootChain_A, 0x1 for BootChain_B
Returns
: DU_MCC_Ret_Type : success/failure in getting default BootChain configuration.
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ DU_MCC_Init()

void* DU_MCC_Init ( int  argc,
char *  argv[] 
)

DU_MCC_Init() is the interface to Initialize library instance.

Parameters
argcNo of args
argv: arguments
Returns
: void* : NULL if there is any error in Initializing, pointer to internal handle would be returned in case of successful initialization


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ 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 Tegra.

This function requests MCU to set the default BootChain selection status in persistent memory to the supplied Boot_id values.

This function will change status in persistent memory only, does not set the GPIO line accordingly.

MCU will evaluate boot chain configuration from persistent memory to set the GPIO line during every boot-up of Tegra.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Tegra_id: Id of Tegra x1 or x2
Boot_id: Id of default BootChain to be set
Returns
: DU_MCC_Ret_Type : success/failure in set default BootChain
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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 default or alternate.

(only for the next immediate reboot of Xavier).

This function requests MCU to switch the BootChain of Tegra to default or alternate boot-chain, by changing the state of the GPIO line. This will not change the default BootChain in persistent memory. This shall be followed by a MCU_TegraReboot request, to boot the Tegra in the selected BootChain.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Tegra_id: Id of Tegra x1 or x2 for which the BootChain switching is requested
DU_MCC_BootChain_ID: A|B|C|D
Returns
: DU_MCC_Ret_Type : success/failure in set BootChain for next reboot
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ DU_MCC_SystemReset()

DU_MCC_Ret_Type DU_MCC_SystemReset ( void handle,
U8  timeDelay 
)

DU_MCC_SystemReset() is the interface to reset Aurix.

This function requests MCU FW to reset the Aurix controller. This will result in reset of all the Tegras and the peripherals on the board

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
timeDelay: Timeout value in Seconds, MCU shall wait before issuing Tegra reset.
Returns
: DU_MCC_Ret_Type : success/failure in Aurix reset / complete board reset
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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.

This function requests MCU to Reboot Tegra. An option is provided to hold Tegra in reset state.

Parameters
handleHandle obtained from DU_MCC_Init() should be passed
Tegra_idTegra ID for Tegra x1 or x2
timeout: Timeout value in Seconds, MCU shall wait before performing Tegra reset.
Returns
: DU_MCC_Ret_Type : success/failure in Tegra Reboot
Precondition
DU_MCC_Init should already be called


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

Variable Documentation

◆ DU_MCC_version

const U32 DU_MCC_version

Used to verify du and MCC lib are compatible - [Required MCC lib symbol].