NVIDIA DRIVE OS Linux API Reference5.1.0.2 Release |
Declares the APIs and data structures required for kernel booting.
Macros | |
#define | KERNEL_CMDLINE_SIZE (2 * KB) |
#define | IMAGE_MAGIC "BOOT_IMAGE!" |
#define | IMAGE_MAGIC_SIZE 12 |
#define | CMDLINE_BUF_SIZE 40 |
#define | NATIVE_BOOT 1 |
#define | VIRTUALIZED_BOOT 2 |
#define | RECOVERY_KERNEL_BIT (1 << 31) |
#define | UPDATE_KERNEL_BIT (1 << 29) |
Enumerations | |
enum | BootImageType { BootImageType_Linux = 1, BootImageType_Qnx = 2, BootImageType_Android = 3, BootImageType_Integrity = 4, BootImageType_Mods = 5, BootImageType_Ramdisk = 6, BootImageType_Hypervisor = 7, BootImageType_Force = 0x7FFFFFFF } |
enum | BootImage_Compression { BootImage_CompressionNone = 0, BootImage_CompressionLz4 = 3, BootImage_Force = 0x7FFFFFFF } |
enum | BootImageStreamValidation { BootImageStreamValidation_No = 0, BootImageStreamValidation_Yes = 1, BootImageStreamValidation_Force = 0x7FFFFFFF } |
enum | BootImageLoading { BootImageLoading_NoCompression_NoStreamValidation, BootImageLoading_NoCompression_StreamValidation, BootImageLoading_CompressionLz4_NoStreamValidation, BootImageLoading_CompressionLz4_StreamValidation, BootImageLoading_Force = 0x7FFFFFFF } |
enum | BootGuidType { BootGuidType_Windows = 0, BootGuidType_Linux, BootGuidType_Qnx } |
Functions | |
NvError | QbLoadAndBootKernel (const NvS8 *pKernelPartName, const NvS8 *pRamdiskPartName, const NvS8 *pDtbPartName) |
(Top-level function) Loads the kernel image from a specific partition. More... | |
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 and from RAM in case of RCM boot. More... | |
void | KernelCmdLine (NvU32 RatchetFuseBurnStatus) |
Prepares the kernel command line to be passed to the kernel. More... | |
void | KernelDT (void) |
Updates the device tree with architecture-specific and board-specific changes. More... | |
void | AppendBoardDT (void) |
Appends the board-specific DT support. More... | |
NvError | QbDefaultLoadAndBootKernel (void) |
Adds a default boot policy. More... | |
NvError | QbBoardLoadAndBootKernel (void) |
Adds board-specific boot policy. More... | |
NvError | QbGetSerialNum (NvU8 **pSerialNum, NvU32 *DataSize) |
Gets the serial number of the board. More... | |
NvBool | QbIsHypervisorBoot (void) |
Determines whether hypervisor is to be booted. More... | |
NvBool | QbIsAndroidBoot (void) |
Determines whether android is to be booted. More... | |
static void | AdjustPointers (NvS32 *pRemains, NvS8 **pPtr, NvS32 len) |
Adjusts pointers in a buffer to process appending new string to the buffer. More... | |
NvError | QbQueryMemInfo (NvU8 **pData, NvU32 *pDataSize, NvU64 ReserveMemSize) |
Queries memory info to be passed to kernel. More... | |
void | QbPerformHandOff (NvUPtr *pKernelRegs, NvU32 NumKernelRegs, NvUPtr KernelStartAddr) |
Performs any necessary operations before kernel handoff. More... | |
#define CMDLINE_BUF_SIZE 40 |
Definition at line 40 of file bootkernel.h.
#define IMAGE_MAGIC "BOOT_IMAGE!" |
Definition at line 38 of file bootkernel.h.
#define IMAGE_MAGIC_SIZE 12 |
Definition at line 39 of file bootkernel.h.
#define KERNEL_CMDLINE_SIZE (2 * KB) |
Definition at line 36 of file bootkernel.h.
#define NATIVE_BOOT 1 |
Definition at line 42 of file bootkernel.h.
#define RECOVERY_KERNEL_BIT (1 << 31) |
Definition at line 86 of file bootkernel.h.
#define UPDATE_KERNEL_BIT (1 << 29) |
Definition at line 87 of file bootkernel.h.
#define VIRTUALIZED_BOOT 2 |
Definition at line 43 of file bootkernel.h.
enum BootGuidType |
Enumerator | |
---|---|
BootGuidType_Windows | |
BootGuidType_Linux | |
BootGuidType_Qnx |
Definition at line 80 of file bootkernel.h.
Enumerator | |
---|---|
BootImage_CompressionNone | |
BootImage_CompressionLz4 | |
BootImage_Force |
Definition at line 56 of file bootkernel.h.
enum BootImageLoading |
Definition at line 68 of file bootkernel.h.
Enumerator | |
---|---|
BootImageStreamValidation_No | |
BootImageStreamValidation_Yes | |
BootImageStreamValidation_Force |
Definition at line 62 of file bootkernel.h.
enum BootImageType |
Enumerator | |
---|---|
BootImageType_Linux | |
BootImageType_Qnx | |
BootImageType_Android | |
BootImageType_Integrity | |
BootImageType_Mods | |
BootImageType_Ramdisk | |
BootImageType_Hypervisor | |
BootImageType_Force |
Definition at line 45 of file bootkernel.h.
|
inlinestatic |
Adjusts pointers in a buffer to process appending new string to the buffer.
It updates pointer of the string by incrementing by length of string so that it points to next location of buffer where new string can be appended. It also decrements available size by length of the current string.
[out] | pRemains | Pointer to remaining size of the buffer. |
[out] | pPtr | Buffer pointer where current string has been appended. |
[in] | len | Length of the string being appended. |
Definition at line 258 of file bootkernel.h.
References BUG.
void AppendBoardDT | ( | void | ) |
Appends the board-specific DT support.
void KernelCmdLine | ( | NvU32 | RatchetFuseBurnStatus | ) |
Prepares the kernel command line to be passed to the kernel.
It first prepares the default kernel command line and then appends the command line that is passed by the user through mkbootimg
. Finally, it is added as an ATAG.
RatchetFuseBurnStatus | provide the status of burning field ratchet fuse. |
void KernelDT | ( | void | ) |
Updates the device tree with architecture-specific and board-specific changes.
NvError QbBoardLoadAndBootKernel | ( | void | ) |
Adds board-specific boot policy.
NvError QbDefaultLoadAndBootKernel | ( | void | ) |
Adds a default boot policy.
NvError_ | in case of boot failures and does not return otherwise. |
NvError QbGetSerialNum | ( | NvU8 ** | pSerialNum, |
NvU32 * | DataSize | ||
) |
Gets the serial number of the board.
[out] | pSerialNum | A pointer to a buffer with the serial number. |
[out] | DataSize | Size A pointer to a field that holds the size of the buffer created by the board file. |
NvBool QbIsAndroidBoot | ( | void | ) |
Determines whether android is to be booted.
This check is based on Kernel Cmdline.
NvBool QbIsHypervisorBoot | ( | void | ) |
Determines whether hypervisor is to be booted.
This check is based on the Kernel command line.
NvError QbLoadAndBootKernel | ( | const NvS8 * | pKernelPartName, |
const NvS8 * | pRamdiskPartName, | ||
const NvS8 * | pDtbPartName | ||
) |
(Top-level function) Loads the kernel image from a specific partition.
If the kernel image is stored in a compressed format, it performs streaming decompression of the kernel image in parallel with reading from flash.
If the primary kernel image (application mode kernel) is corrupted, this function automatically loads the secondary image (maintenance mode kernel) from recovery partition and boots it.
It then sets up the ATAGS/DT parameters and other environment variables needed for running the OS kernel. Finally, this function flushes/invalidates and then disables the L1/L2 caches and the MMU before transferring control to the OS kernel.
pKernelPartName | Kernel partition name. |
pRamdiskPartName | Ramdisk partition name. |
pDtbPartName | DTB partition name. |
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 and from RAM in case of RCM boot.
pKernName | Kernel partition name. |
pRamdiskName | Ramdisk partition name. |
pDtbPartName | DTB partition name. |
pBootAddrVirt | Virtual address set by function where kernel is loaded. |
pRamDiskAddrVirt | Virtual address set by function where Ramdisk (if any) is loaded. |
pDtAddrVirt | Virtual address set by function where DTB (if any) is loaded. |
pKernelUnCompressSize | Size of the kernel image. If compressed, the function uncompresses the kernel. |
pRamdiskUncompressSize | Size of the ramdisk image. If compressed, the function uncompresses the kernel. |
void QbPerformHandOff | ( | NvUPtr * | pKernelRegs, |
NvU32 | NumKernelRegs, | ||
NvUPtr | KernelStartAddr | ||
) |
Performs any necessary operations before kernel handoff.
pKernelRegs | A pointer to an array containing the values of the registers. |
NumKernelRegs | The number of a register. |
KernelStartAddr | The address to which the function must jump after performing its other operations. |
NvError QbQueryMemInfo | ( | NvU8 ** | pData, |
NvU32 * | pDataSize, | ||
NvU64 | ReserveMemSize | ||
) |
Queries memory info to be passed to kernel.
[out] | pData | A pointer to a buffer that contains the base and size of each bank. |
[out] | pDataSize | A pointer to the buffer size. |
[in] | ReserveMemSize | Amount of memory to be reserved from the primary partition. |