NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bootkernel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2018, 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 
12 
13 #ifndef INCLUDED_BOOTKERNEL_H
14 #define INCLUDED_BOOTKERNEL_H
15 
32 #include <nvcommon.h>
33 #ifdef QB_BL_BUILD
34 #include <bug.h>
35 #endif
36 
37 #define KERNEL_CMDLINE_SIZE (2 * KB)
38 
39 #define IMAGE_MAGIC "BOOT_IMAGE!"
40 #define IMAGE_MAGIC_SIZE 12
41 #define CMDLINE_BUF_SIZE 40
42 
43 #define NATIVE_BOOT 1
44 #define VIRTUALIZED_BOOT 2
45 
46 typedef enum {
54  BootImageType_Force = 0x7FFFFFFF,
56 
57 typedef enum {
60  BootImage_Force = 0x7FFFFFFF,
62 
63 typedef enum {
68 
69 typedef enum {
78  BootImageLoading_Force = 0x7FFFFFFF,
80 
81 typedef enum {
85 } BootGuidType;
86 
87 #define RECOVERY_KERNEL_BIT (1 << 31)
88 #define UPDATE_KERNEL_BIT (1 << 29)
89 
111 NvError
113  const NvS8 *pKernelPartName,
114  const NvS8 *pRamdiskPartName,
115  const NvS8 *pDtbPartName);
116 
137 NvError
139  const NvS8 *pKernName,
140  const NvS8 *pRamdiskName,
141  const NvS8 *pDtbPartName,
142  NvUPtr *pBootAddrVirt,
143  NvUPtr *pRamDiskAddrVirt,
144  NvUPtr **pDtAddrVirt,
145  NvU32 *pKernelUnCompressSize,
146  NvU32 *pRamdiskUncompressSize);
147 
157 void KernelCmdLine(NvU32 RatchetFuseBurnStatus);
158 
159 #ifdef CONFIG_HYPERVISOR_SUPPORT
160 
166 NvError QbStoreGuestCmdLine(void);
167 
168 #ifdef CONFIG_SUPPORT_BOOTDATA
169 
176 NvError AddBootDataToSysInfo(void);
177 
178 #endif
179 #endif
180 
184 void KernelDT(void);
185 
190 void AppendBoardDT(void);
191 
192 #ifdef CONFIG_SUPPORT_BOOTDATA
193 
199 void AddBootDataToDT(void);
200 #endif
201 
209 
218 
227 NvError QbGetSerialNum(NvU8 **pSerialNum, NvU32 *DataSize);
228 
236 NvBool QbIsHypervisorBoot(void);
237 
245 NvBool QbIsAndroidBoot(void);
246 
259 static inline void AdjustPointers(NvS32 *pRemains, NvS8 **pPtr, NvS32 len)
260 {
261  if (!pRemains || !pPtr || (*pRemains <= len))
262  {
263 #ifdef QB_BL_BUILD
264  BUG();
265 #else
266  return;
267 #endif
268  }
269  *pRemains -= len;
270  *pPtr += len;
271 }
272 
283 NvError QbQueryMemInfo(NvU8 **pData, NvU32 *pDataSize, NvU64 ReserveMemSize);
284 
295 void QbPerformHandOff(
296  NvUPtr *pKernelRegs,
297  NvU32 NumKernelRegs,
298  NvUPtr KernelStartAddr);
299 
303 #endif //INCLUDED_BOOTKERNEL_H
void KernelCmdLine(NvU32 RatchetFuseBurnStatus)
Prepares the kernel command line to be passed to the kernel.
BootImageLoading
Definition: bootkernel.h:69
void QbPerformHandOff(NvUPtr *pKernelRegs, NvU32 NumKernelRegs, NvUPtr KernelStartAddr)
Performs any necessary operations before kernel handoff.
NvBool QbIsHypervisorBoot(void)
Determines whether hypervisor is to be booted.
void AppendBoardDT(void)
Appends the board-specific DT support.
NvError QbLoadBootImages(const NvS8 *pKernName, const NvS8 *pRamdiskName, const NvS8 *pDtbPartName, NvUPtr *pBootAddrVirt, NvUPtr *pRamDiskAddrVirt, NvUPtr **pDtAddrVirt, NvU32 *pKernelUnCompressSize, NvU32 *pRamdiskUncompressSize)
Internal function invoked by QbLoadAndBootKernel to load the images from storage in case of cold boot...
void KernelDT(void)
Updates the device tree with architecture-specific and board-specific changes.
NvError QbBoardLoadAndBootKernel(void)
Adds board-specific boot policy.
BootImage_Compression
Definition: bootkernel.h:57
NvError
The NvError enumeration contains ALL return / error codes.
Definition: nverror.h:36
static void AdjustPointers(NvS32 *pRemains, NvS8 **pPtr, NvS32 len)
Adjusts pointers in a buffer to process appending new string to the buffer.
Definition: bootkernel.h:259
BootImageType s_g_BootImageType
NvBool QbIsAndroidBoot(void)
Determines whether android is to be booted.
NVIDIA Quickboot Interface: Debugging
BootImageType
Definition: bootkernel.h:46
BootImageStreamValidation
Definition: bootkernel.h:63
BootGuidType
Definition: bootkernel.h:81
NvError QbGetSerialNum(NvU8 **pSerialNum, NvU32 *DataSize)
Gets the serial number of the board.
#define BUG()
Definition: bug.h:34
NvError QbDefaultLoadAndBootKernel(void)
Adds a default boot policy.
NvError QbQueryMemInfo(NvU8 **pData, NvU32 *pDataSize, NvU64 ReserveMemSize)
Queries memory info to be passed to kernel.
NvError QbLoadAndBootKernel(const NvS8 *pKernelPartName, const NvS8 *pRamdiskPartName, const NvS8 *pDtbPartName)
(Top-level function) Loads the kernel image from a specific partition.