NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvgph.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 
11 
28 #ifndef INCLUDED_NVGPH_H
29 #define INCLUDED_NVGPH_H
30 
31 #include <nvcommon.h>
32 #include <crypto_data.h>
33 
34 #define CMAC_AES_HASH_LENGTH 4
35 #define NVGPH_MAX_COPIES 64
36 #define NVGPH_COPIES_OFFSET 2048
37 
38 
40 {
41  union {
44 
46  NvU8 SHA256[SHA256_DIGEST_SIZE];
47  } SignType;
49  NvU8 Reserved[48];
51 
52 #define MAX_BOOTLOADERS 2
53 #define GPH_CUSTOMER_DATA_SIZE 424
54 
60 typedef struct NvGPHBLInfoRec
61 {
66  NvU32 Version;
67 
69  NvU32 Start;
70 
73  NvU32 LoadAddress;
74 
76  NvU32 EntryPoint;
77 
79 
83 typedef enum
84 {
89  NvGPH_Force = 0xFFFFFFFF,
91 
99 typedef struct NvGPHRec
100 {
103 
105  NvU32 Unused[3];
106 
109 
112 
115 
119 
122 
125 
126 } NvGPH;
127 
133 typedef enum
134 {
147 } NvGPHDataType;
148 
149 #ifdef QB_BL_BUILD
150 
157 NvError NvGphInit(void);
158 #else
159 
171 NvError
172 NvGphInit(
173  QbDriver DeviceId,
174  NvU32 DevInstance,
175  NvU64 Offset,
176  NvU32 PartId);
177 #endif
178 
179 
184 void NvGphDeinit(void);
185 
199  NvGPHDataType DataType,
200  NvU32 *Size,
201  NvU32 *NumInstances);
202 
218  NvGPHDataType DataType,
219  NvU32 Size,
220  NvU32 Instance,
221  void *Data);
222 
239  NvGPHDataType DataType,
240  NvU32 Size,
241  NvU32 Instance,
242  void *Data);
243 
256 NvError
258  NvS8 *FileName, NvU32 Size);
259 
267 void
268 NvPrintGPH(void);
270 #endif /* #ifndef INCLUDED_NVGPH_H */
Valid BLs in the structure.
Definition: nvgph.h:140
QbDriver
Defines Quickboot device driver types.
Definition: device_id.h:34
PartitionTable Start location.
Definition: nvgph.h:144
NvError NvGphInit(QbDriver DeviceId, NvU32 DevInstance, NvU64 Offset, NvU32 PartId)
Initializes GPH.
NvGPH_ValidationEnum ValidationType
Specifies AES_CMAC for validation.
Definition: nvgph.h:102
void NvPrintGPH(void)
Prints GPH information to console.
NvU32 Unused[3]
To make start of Sign-section align to 16 byte.
Definition: nvgph.h:105
NvU32 Version
Specifies a version number for the BL.
Definition: nvgph.h:66
NvGPH_ValidationEnum
Specifies the type of Validataion to be used.
Definition: nvgph.h:83
NvGPHObjectSignature Signature
Specifies the AES-CMAC MAC for the rest of the GPH structure.
Definition: nvgph.h:111
NvError
The NvError enumeration contains ALL return / error codes.
Definition: nverror.h:36
Generic Partition Header.
Definition: nvgph.h:99
union NvGPHObjectSignatureRec::@12 SignType
Stores information needed to locate and verify a boot loader.
Definition: nvgph.h:60
NvU32 PartitionTableStart
Specifies Guest Partition Table Start.
Definition: nvgph.h:121
#define MAX_BOOTLOADERS
Definition: nvgph.h:52
NvError NvGPHGetData(NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data)
Gets the contents of the GPH element.
NvU8 Reserved[48]
Reserved for future use.
Definition: nvgph.h:49
struct NvGPHBLInfoRec NvGuestBLInfo
Stores information needed to locate and verify a boot loader.
NvError NvGPHSetData(NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data)
Sets the contents of the GPH element.
NvGPHDataType
Data elements of the NvGPH which can be queried and set via the NvGPH set/get API.
Definition: nvgph.h:133
NvU32 Start
Specifies the start offset from start of the Guest partition.
Definition: nvgph.h:69
struct NvGPHRec NvGPH
Generic Partition Header.
Signature of GPH.
Definition: nvgph.h:138
struct NvGPHObjectSignatureRec NvGPHObjectSignature
NvU8 SHA256[SHA256_DIGEST_SIZE]
Specifies the SHA256 signature for the rest of the BCT structure.
Definition: nvgph.h:46
NvError NvGphWriteGphApp(NvS8 *FileName, NvU32 Size)
Writes the GPH to a file.
#define GPH_CUSTOMER_DATA_SIZE
Definition: nvgph.h:53
NvU32 BootLoadersUsed
Specifies the number of BLs described in the BootLoader table.
Definition: nvgph.h:114
NvGuestBLInfo BootLoader[MAX_BOOTLOADERS]
Specifies the information needed to locate and validate each BL.
Definition: nvgph.h:118
NvU32 LoadAddress
Specifies the starting address of the memory region into which the BL will be loaded.
Definition: nvgph.h:73
#define CMAC_AES_HASH_LENGTH
Definition: nvgph.h:34
NvU32 EntryPoint
Specifies the entry point address in the loaded BL image.
Definition: nvgph.h:76
NvU32 Hash[CMAC_AES_HASH_LENGTH]
Specifies the AES-CMAC signature for the rest of the BCT structure.
Definition: nvgph.h:43
NvGPHObjectSignature UnUsed1
Unused field kept for backword compatibility.
Definition: nvgph.h:108
Valdation/Encryption type for the GPH and BL.
Definition: nvgph.h:136
NvError NvGPHGetDataSize(NvGPHDataType DataType, NvU32 *Size, NvU32 *NumInstances)
Gets data size of GPH element.
void NvGphDeinit(void)
Deinitializes GPH.
Bootloader information.
Definition: nvgph.h:142
Customer data.
Definition: nvgph.h:146
NvU8 CustomerData[GPH_CUSTOMER_DATA_SIZE]
Customer Data.
Definition: nvgph.h:124