NVIDIA L4T Embedded Linux Boot Process for Jetson Nano

 

Jetson Nano Bootloader functionalities:

  • The primary function of the NVIDIA® Jetson Nano™ boot software is to initialize the SoC (System on a Chip), including:
  • Initializing MC/EMC/CPU
  • Setting up security parameters
  • Loading different firmware
  • Maintaining Chain of Trust
  • Setting memory carveouts for different firmware
  • Flashing the device
  • Booting to the operating system Additionally, the Jetson Nano boot software also performs other operations defined by product requirements, including but not limited to:
  • Initialization of HDMI™/DSI
  • Displaying the boot logo

jetson_nano_boot_sequence

  • BPMP???
    • BPMP is NVIDIA Tegra Boot and Power Management Processor
    • The BPMP is a specific processor in Tegra chip, which is designed for booting process handling and offloading the power management, clock management, and reset control tasks from the CPU.
    • The BPMP firmware driver, which can create the interprocessor communication (IPC) between the CPU and BPMP.

Bootloader Components

0. BootROM

  • Jetson Nano BootROM (BR) is hard-wired in the SoC.
  • It initializes the Boot Media and loads bootloaders and firmware from the Boot Media.
  • Boot Configuration Table (BCT)
    • Multiple copies of the BootROM Boot Configuration Table (BCT) may be stored at the start of the Boot-Media.
    • The BCT contains configuration parameters used by the BootROM for hardware initialization.
    • Bootloader info in BCT:
      • Size
      • Entry point
      • Load address
      • Hash

    bootrom-boot-flow

1. TegraBoot

  • TegraBoot (NVTBoot) is the first boot software component loaded by BootROM in SysRAM (Internal RAM), and runs on BPMP.
  • 2 Types:
    • One used for cold boot (~hard boot:restart the board)
    • One for recovery boot/flashing
  • Responsibilities:
    • Loading and initializing firmware (FW) components such as TOS
      • TOS contains the trusted OS binary.
    • Creating carveouts
      • carveouts: It’s share memory for the coprocess.
    • Completing CPU initialization
    • Loading the next stage bootloader
    • Supporting flashing
    • Supporting RCM boot
      • Recovery mode: used during flasing the board
    • Reading PMIC reset reason
      • PMIC: Power Management IC
    • Loading the bootloader device tree and passing the device tree load address to CBoot
    • Stops execution when the CCPLEX is booted
      • CCPLEX: main CPU Complex, CCPLEX typically runs the system’s primary software stack.

2. TegrBoot CPU

  • Add rollback prevention.
  • Using bootloader DTB(~device tree binary), perform EMC(~Electromagnetic Compatibility) training and update kernel DTB with training results.
  • Pass control to CBoot.

3. CBoot

  • Primary CPU bootloader used on mobile platforms in the cold boot path.
  • features:
  • BootLoader and kernel use separate device trees stored in separate partitions.

  • Responsibilities:
    • Parsing the CPU-BL parameters and initializing the bootloader device tree
    • Chaining to U-Boot to boot the kernel
    • Supporting the update mechanism
    • Unhalts the BPMP so that the BPMP-FW can start running

4. U-Boot

  • default OS bootloader for NVIDIA® Jetson™ L4T Driver Package.

Partitions

  • L4T supports formatting mass storage media(~SD cards, USB) into multiple partitions for storing data, such as the device OS image, Bootloader image, device firmware, and Bootloader splash screens.

Partition Configuration file

  • Located at <top>/Linux_for_Tegra/bootloader/t210ref/cfg/ for Jetson Nano devices
  • NVIDIA Jetson Nano (SKU 0000): flash_l4t_t210_max-spi_sd_p3448.xml
  • NVIDIA Jetson Nano (SKU 0002): flash_l4t_t210_emmc_p3448.xml
  • During the flashing procedure, flash.sh reads in the partition configuration file, translates keywords into values specified in <device>.conf or in option parameters and saves the data in bootloader/flash.xml.
  • Then __*bootloader/tegraflash.py*__ reads in bootloader/flash.xml and performs actual flashing as specified by bootloader/flash.xml.

Partition Table Overview

Bootloader Update

  • NVIDIA® Jetson™ Nano platform use the Debian package facility to update Bootloader.
  • Dual Boot Strategy
    • Ensures that a usable Bootloader partition exists at all times during an update.

Bootloader Components Validation & Partition Layout

  • Boot Configuration Table (BCT) is stored in a partition named BCT.
  • The NVIDIA flashing utility tegraflash.py writes up to 64 instances of the BCT.

    Bootloader Validation:

  • BootROM validates the BCT through an integrated checksum or RSA signature.
  • If the calculated checksum or signature does not match the value in the BCT located at the beginning of the partition, the BootROM attempts to validate the next instances of the BCT.
  • When BootROM finds a valid set of checksums or signatures, it transfers control to the specified instance of TegraBoot.
  • TegraBoot computes and validates the checksums for the first BFS and the first KFS and the signatures the individual files. When the checksums and signatures have been validated, TegraBoot loads the appropriate boot files,
    • BFS: a set of all of the files in a group of partitions that are concerned with booting.
      • The TegraBoot CPU binary
      • DTB files used by Bootloader
    • KFS: a set of all of the files in a group of partitions that are concerned with loading the kernel.
      • DTB files used by the kernel
      • Warmboot binary
      • Trusted OS image
  • After validation, TegraBoot transfers control to the boot loader, e.g. CBoot.
  • The CBoot loader validates and loads the next-level software component, such as the Linux kernel or U‑Boot.
  • If TegraBoot fails to validate the first BFS andKFS, it overwrites itself and resets the board so that the BootROM can validate and load the next set of TegraBoot, BFS, and KFS.

Partition Layout:

1. Boot Partition:

  • BCT, which contains redundant instances of the Boot Configuration Table. This must be the first partition on the boot device.
  • NVC contains TegraBoot. This must be the second boot partition.
  • The following boot partitions, PT through BPF, are part of the BFS.
  • PT contains layout information for each BFS, and indicates the beginning of each one. It is the first partition in the BFS.
  • TBC contains the TegraBoot CPU-side binary.
  • RP1 contains TegraBoot DTBs.
  • EBT contains CBoot.
  • WB0 contains the warm boot binary.
  • BPF contains BPMP microcode
  • NVC‑1 contains a copy of NVC.
  • PT‑1 through BPF‑1 are copy partitions for the primaries NVC through BPF, making up a copy of the BFS, denoted BFS‑1.
  • PAD is an empty partition which ensures the VER and VER_b are at the very end of the boot partition.
  • VER_b contains additional version information for redundancy and version checking.
  • VER contains version information.

2. GP1 contains the sdmmc_user device’s primary GPT. All partitions defined after this one are configured in the Linux kernel, and are accessible by standard partition tools such as gdisk and parted.

3. User Partition:

  • The following partitions constitute the kernel-file-set (KFS), and have redundant copy partitions:
  • DTB contains kernel DTBs.
  • TOS contains the trusted OS binary.
  • EKS is optional, and is reserved for future use.
  • LNX contains either the Linux kernel or U-Boot, depending on your choice of DFLT_KERNEL_IMAGE in the configuration file.
  • DTB‑1 through EKS‑1 constitute a copy of the primary KFS, denoted KFS‑1.

Bootloader Update Payload (BUP)

  • multi-spec BUP:
    • A multi-spec BUP includes multiple firmware binaries and BCT images of each type.
    • When you run the updater, it uses the appropriate binary of each type for the device you are updating.
  • single-spec BUP:
    • A single-spec BUP contains just one binary of each type, and can be used to update just one Jetson device configuration.

Detailed Steps for:

References: