NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Generic Partition Header

Detailed Description

Declares the APIs and data structures required for accessing information about guest bootloader and related info.

Data Structures

struct  NvGPHObjectSignatureRec
 
struct  NvGPHBLInfoRec
 Stores information needed to locate and verify a boot loader. More...
 
struct  NvGPHRec
 Generic Partition Header. More...
 

Macros

#define CMAC_AES_HASH_LENGTH   4
 
#define NVGPH_MAX_COPIES   64
 
#define NVGPH_COPIES_OFFSET   2048
 
#define MAX_BOOTLOADERS   2
 
#define GPH_CUSTOMER_DATA_SIZE   424
 

Typedefs

typedef struct
NvGPHObjectSignatureRec 
NvGPHObjectSignature
 
typedef struct NvGPHBLInfoRec NvGuestBLInfo
 Stores information needed to locate and verify a boot loader. More...
 
typedef struct NvGPHRec NvGPH
 Generic Partition Header. More...
 

Enumerations

enum  NvGPH_ValidationEnum {
  NvGPH_Validation_AES_CMAC = 1,
  NvGPH_EncryptionAndValidation_AES_CMAC,
  NvGPH_Validation_RSA,
  NvGPH_Validation_SHA256,
  NvGPH_Force = 0xFFFFFFFF
}
 Specifies the type of Validataion to be used. More...
 
enum  NvGPHDataType {
  NvGPHDataType_ValidationType,
  NvGPHDataType_Signature,
  NvGPHDataType_NumValidBL,
  NvGPHDataType_BLInfo,
  NvGPHDataType_PTStart,
  NvGPHDataType_CustData
}
 Data elements of the NvGPH which can be queried and set via the NvGPH set/get API. More...
 

Functions

NvError NvGphInit (QbDriver DeviceId, NvU32 DevInstance, NvU64 Offset, NvU32 PartId)
 Initializes GPH. More...
 
void NvGphDeinit (void)
 Deinitializes GPH. More...
 
NvError NvGPHGetDataSize (NvGPHDataType DataType, NvU32 *Size, NvU32 *NumInstances)
 Gets data size of GPH element. More...
 
NvError NvGPHGetData (NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data)
 Gets the contents of the GPH element. More...
 
NvError NvGPHSetData (NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data)
 Sets the contents of the GPH element. More...
 
NvError NvGphWriteGphApp (NvS8 *FileName, NvU32 Size)
 Writes the GPH to a file. More...
 
void NvPrintGPH (void)
 Prints GPH information to console. More...
 

Macro Definition Documentation

#define CMAC_AES_HASH_LENGTH   4

Definition at line 34 of file nvgph.h.

#define GPH_CUSTOMER_DATA_SIZE   424

Definition at line 53 of file nvgph.h.

#define MAX_BOOTLOADERS   2

Definition at line 52 of file nvgph.h.

#define NVGPH_COPIES_OFFSET   2048

Definition at line 36 of file nvgph.h.

#define NVGPH_MAX_COPIES   64

Definition at line 35 of file nvgph.h.

Typedef Documentation

typedef struct NvGPHRec NvGPH

Generic Partition Header.

This stores information about guest bootloaders, Guest Partition table offset and Customer Data.

typedef struct NvGPHBLInfoRec NvGuestBLInfo

Stores information needed to locate and verify a boot loader.

There is one NvGuestBLInfo structure for each copy of a BL stored on the device.

Enumeration Type Documentation

Specifies the type of Validataion to be used.

Enumerator
NvGPH_Validation_AES_CMAC 
NvGPH_EncryptionAndValidation_AES_CMAC 
NvGPH_Validation_RSA 
NvGPH_Validation_SHA256 
NvGPH_Force 

Definition at line 83 of file nvgph.h.

Data elements of the NvGPH which can be queried and set via the NvGPH set/get API.

Enumerator
NvGPHDataType_ValidationType 

Valdation/Encryption type for the GPH and BL.

NvGPHDataType_Signature 

Signature of GPH.

NvGPHDataType_NumValidBL 

Valid BLs in the structure.

NvGPHDataType_BLInfo 

Bootloader information.

NvGPHDataType_PTStart 

PartitionTable Start location.

NvGPHDataType_CustData 

Customer data.

Definition at line 133 of file nvgph.h.

Function Documentation

void NvGphDeinit ( void  )

Deinitializes GPH.

Free allocated memory for GPH and set the pointer to NULL.

NvError NvGPHGetData ( NvGPHDataType  DataType,
NvU32  Size,
NvU32  Instance,
void *  Data 
)

Gets the contents of the GPH element.

Parameters
DataTypetype of data to obtain from GPH.
SizeSize of the datatype.
InstanceNeeded Instance of the datatype.
DataAddress of the location where needed element of GPH should be copied.
Return values
NvSuccessGetting the contents is successful.
NvError_BadParameterQueried Size/Instance is not valid for the data type.
NvError NvGPHGetDataSize ( NvGPHDataType  DataType,
NvU32 *  Size,
NvU32 *  NumInstances 
)

Gets data size of GPH element.

Parameters
DataTypetype of data to obtain from GPH.
SizePointer to NvU32 to be populated with size of the datatype.
NumInstancesPointer to NvU32 to be populated with instances of the datatype.
Return values
NvSuccessQuerying the size is successful.
NvError_BadParameterQueried Datatype not valid.
NvError NvGphInit ( QbDriver  DeviceId,
NvU32  DevInstance,
NvU64  Offset,
NvU32  PartId 
)

Initializes GPH.

Parameters
DeviceIdDevice ID of the device on which the BR BCT resides.
DevInstanceDevice instance of the device on which the BR BCT resides.
OffsetOffset of the partition to read the GPH.
PartIdpartition id of the guest container partition.
Return values
NvSuccessGPH initializtion successful.
NvError_InvalidStateHash mismatch.
NvError_InsufficientMemoryNot enough memory to allocate handle.
NvError NvGPHSetData ( NvGPHDataType  DataType,
NvU32  Size,
NvU32  Instance,
void *  Data 
)

Sets the contents of the GPH element.

Parameters
DataTypetype of data to be modified in GPH.
SizeSize of the datatype.
InstanceNeeded Instance of the datatype.
DataAddress of the location from where new contents are to be copied to the GPH element.
Return values
NvSuccessSetting the contents is successful.
NvError_BadParameterQueried Size/Instance is not valid for the data type.
NvError_NotSupportModifying GPH is not allowed.
NvError NvGphWriteGphApp ( NvS8 *  FileName,
NvU32  Size 
)

Writes the GPH to a file.

Parameters
FileNameLocation for the file to be created.
SizeSize to be copied to the file.
Return values
NvSuccessWriting GPH to the file is successful.
NvError_BadParameterBad file path or invalid size specified for the data type.
NvError_NotSupportedWriting GPH to a file is not supported.
void NvPrintGPH ( void  )

Prints GPH information to console.

To print the GPH information properly, NvGphInit call should be made before this function.