NVIDIA DRIVE OS Linux API Reference

5.1.0.2 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 
33 #include <nvcommon.h>
34 #include <bug.h>
35 
36 #define KERNEL_CMDLINE_SIZE (2 * KB)
37 
38 #define IMAGE_MAGIC "BOOT_IMAGE!"
39 #define IMAGE_MAGIC_SIZE 12
40 #define CMDLINE_BUF_SIZE 40
41 
42 #define NATIVE_BOOT 1
43 #define VIRTUALIZED_BOOT 2
44 
45 typedef enum {
53  BootImageType_Force = 0x7FFFFFFF,
55 
56 typedef enum {
59  BootImage_Force = 0x7FFFFFFF,
61 
62 typedef enum {
67 
68 typedef enum {
77  BootImageLoading_Force = 0x7FFFFFFF,
79 
80 typedef enum {
84 } BootGuidType;
85 
86 #define RECOVERY_KERNEL_BIT (1 << 31)
87 #define UPDATE_KERNEL_BIT (1 << 29)
88 
110 NvError
112  const NvS8 *pKernelPartName,
113  const NvS8 *pRamdiskPartName,
114  const NvS8 *pDtbPartName);
115 
136 NvError
138  const NvS8 *pKernName,
139  const NvS8 *pRamdiskName,
140  const NvS8 *pDtbPartName,
141  NvUPtr *pBootAddrVirt,
142  NvUPtr *pRamDiskAddrVirt,
143  NvUPtr **pDtAddrVirt,
144  NvU32 *pKernelUnCompressSize,
145  NvU32 *pRamdiskUncompressSize);
146 
156 void KernelCmdLine(NvU32 RatchetFuseBurnStatus);
157 
158 #ifdef CONFIG_HYPERVISOR_SUPPORT
159 
165 NvError QbStoreGuestCmdLine(void);
166 
167 #ifdef CONFIG_SUPPORT_BOOTDATA
168 
175 NvError AddBootDataToSysInfo(void);
176 
177 #endif
178 #endif
179 
183 void KernelDT(void);
184 
189 void AppendBoardDT(void);
190 
191 #ifdef CONFIG_SUPPORT_BOOTDATA
192 
198 void AddBootDataToDT(void);
199 #endif
200 
207 NvError QbDefaultLoadAndBootKernel(void);
208 
216 NvError QbBoardLoadAndBootKernel(void);
217 
226 NvError QbGetSerialNum(NvU8 **pSerialNum, NvU32 *DataSize);
227 
235 NvBool QbIsHypervisorBoot(void);
236 
244 NvBool QbIsAndroidBoot(void);
245 
258 static inline void AdjustPointers(NvS32 *pRemains, NvS8 **pPtr, NvS32 len)
259 {
260  if (!pRemains || !pPtr || (*pRemains <= len))
261  BUG();
262 
263  *pRemains -= len;
264  *pPtr += len;
265 }
266 
277 NvError QbQueryMemInfo(NvU8 **pData, NvU32 *pDataSize, NvU64 ReserveMemSize);
278 
289 void QbPerformHandOff(
290  NvUPtr *pKernelRegs,
291  NvU32 NumKernelRegs,
292  NvUPtr KernelStartAddr);
293 
297 #endif //INCLUDED_BOOTKERNEL_H
void KernelCmdLine(NvU32 RatchetFuseBurnStatus)
Prepares the kernel command line to be passed to the kernel.
BootImageLoading
Definition: bootkernel.h:68
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:56
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:258
BootImageType s_g_BootImageType
NvBool QbIsAndroidBoot(void)
Determines whether android is to be booted.
NVIDIA Quickboot Interface: Debugging
BootImageType
Definition: bootkernel.h:45
BootImageStreamValidation
Definition: bootkernel.h:62
BootGuidType
Definition: bootkernel.h:80
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.