Update and Redundancy

NVIDIA® Jetson™ Linux supports Bootloader update and redundancy on all Jetson platforms.

The Bootloader update process performs a safe Bootloader update and ensures that a workable Bootloader partition remains available during an update. It accomplishes this using A/B update, a feature that maintains two sets of Bootloader partitions, Slot A and Slot B, each of which is a complete set of the partitions that contain boot images.

Bootloader redundancy is enabled by default.

A/B Slot Layout

The principle of shadow copying enables multiple placeholders. All of the placeholders but one hold backup copies. Each backup copy is a candidate to boot from. However, based on runtime decisions, the correct copy of the binary is loaded to continue with the boot process. These two shadow copies are commonly referred to as Slot A and Slot B. This two-slot implementation is as follows:

../../_images/SlotImplementationLayout.svg

The diagram above shows the slot implementation in conceptual form.

A/B System Update

Partition Selection

A/B system updates use two sets of partitions (slots). Each slot has several attributes:

  • The slot that the running system booted from is called the current slot. The other slot is called the unused slot. The system exchanges the roles of the current and unused slot in the course of an update, or when the software fails repeatedly during or immediately after a boot.

  • The slot that the system will use the next time it boots is called the active slot. In “steady state” device the bootable slot is also the active slot. When the system is being updated it may be different.

  • A slot’s status attribute indicates whether the slot contains a system from which the device should be able to boot. When the system is running the current slot is bootable; the unused slot may have an older, identical, or newer version of the system, and may or may not be bootable.

The bootable slot is the slot whose status attribute is normal.

If a bootable slot fails to boot, Bootloader sets its status attribute as unbootable and switches the roles of the current and unused slots. The formerly unused, now current, slot typically contains boot software that is one update old (if the device was just updated with nonfunctional software) or current (if the former current slot has suffered data corruption).

Bootloader Implementation

The A/B system uses the Scratch Register to store the slot status. It is used between the cpu-bootloader and early stage Bootloader. The early stage Bootloader runs the state machine to select the boot slot. It handles the update failure cases as follows:

../../_images/UpdateFailure.svg

Here is the process flow:

  • For NVIDIA® Jetson AGX Orin™, NVIDIA® Jetson Orin™ NX, and NVIDIA® Jetson Orin™ Nano: BootRom uses the BR-BCT to find the current slot for cold boot, and it uses the Scratch Register to find the current slot for warm boot. It marks the current slot status as invalid and caches the current slot number, 0 (slot A) or 1 (slot B), with the status flag in scratch register 109. This slot number will be used by MB1, MB2, UEFI, or later stage loaders. When control reaches cpu-bootloader, it restores the status flag to valid and saves to the scratch register 109.

  • For NVIDIA® Jetson AGX Xavier™ and NVIDIA® Jetson Xavier™ NX: BootRom uses the BR-BCT to find the current slot for cold boot, and it uses the Scratch Register to find the current slot for warm boot. It caches the current slot number, 0 (slot A) or 1 (slot B) in scratch register 99, and MB1 reads the current slot number from the scratch register 99. It marks the current slot status as invalid and caches the current slot number with the status flag in scratch register 15. The cached slot number will be used by MB2, UEFI, or later stage loaders. When control reaches cpu-bootloader, it restores the status flag to valid and saves the updated state to scratch register 15.

If BootRom does not find a current slot, the device enters NVIDIA recovery mode.

Note

The Cpu-bootloader automatically updates the slot number in BR-BCT when the following conditions are met:

  • The slot number in BR-BCT does not match the current slot number in the scratch register.

  • The UEFI variable AutoUpdateBrBct is set to 1, and this value is configured by L4TConfiguration.dts in UEFI source.

Bootloader Scratch Register

This section provides information about the Scratch register definition.

For NVIDIA® Jetson AGX Orin™, NVIDIA® Jetson Orin™ NX, and NVIDIA® Jetson Orin™ Nano

Scratch register 109 layout

Bits

Contents

31-6

Reserved

5-4

Current slot number

3-0

Boot slot status flag

Where:

  • The current slot number is 0 for slot A and 1 for slot B.

  • The boot slot status flag uses bits to indicate the following slot statuses:

    • 0: valid

    • 1: invalid

    For example, 0001b means slot A is invalid.

For NVIDIA® Jetson AGX Xavier™ and NVIDIA® Jetson Xavier™ NX

Scratch register 15 layout

Bits

Contents

31-27

Reserved

26

Update BR-BCT flag

25-22

Boot slot status flag

21-19

Maximum number of slots

18-16

Current slot number

15-0

Magic pattern 0x4EF1

Where:

  • The current slot number is 0 for slot A and 1 for slot B.

  • Maximum number of slots: the maximum number of bootloader slots. For the current system it is two, slot A and slot B.

  • The boot slot status flag uses bits to indicate the following slot statuses:

    • 0: valid

    • 1: invalid

    For example, 0001b means slot A is invalid.

  • The boot slot status flag uses bits to notify the cpu-bootloader to update the BR-BCT:

    • 0: not update

    • 1: update

Partition Settings

For NVIDIA® Jetson AGX Orin™, NVIDIA® Jetson Orin™ NX, and NVIDIA® Jetson Orin™ Nano

The A/B partitions must use the following naming convention:

  • A_mb1

  • B_mb1

  • A_mb2

  • B_mb2

  • A_cpu-bootloader

  • B_cpu-bootloader

  • etc

The name of the partition that is being loaded is derived as follows:

partition_name = "<slot_value>"_<base_name>
slot value = "A" for slot 0
slot value = "B" for slot 1

For NVIDIA® Jetson AGX Xavier™ and NVIDIA® Jetson Xavier™ NX

The A/B partitions must use the following naming convention:

  • mb1

  • mb1_b

  • mb2

  • mb2_b

  • cpu-bootloader

  • cpu-bootloader_b

  • etc

The name of the partition that is being loaded is derived as follows:

partition_name = <base_name>"<slot_value>"
slot value = "" for slot 0
slot value = "_b" for slot 1

The empty suffix for Slot A ensures backward compatibility with legacy partition loading mechanisms that are unaware of A/B slots.

Bootloader Version in QSPI Flash

The bootloader version is stored in the A_VER and B_VER partition, which is in the QSPI flash. UEFI gets the version from the partition and stores in the ESRT table, and this table is published in the sysfs when you boot to the kernel. To read the bootloader version, run one of the following commands in the kernel:

  • Read the fw_version of the ESRT table:

    $ sudo cat /sys/firmware/efi/esrt/entries/entry0/fw_version
    

The output value is a decimal number, so you need to convert it to a hexadecimal number in the 0xAABBCC form where 0xAA is the release branch, 0xBB is the major version, and 0xCC is the minor version. For example, the release 35.5.0:

2295040 = 0x230500 => [0x23].[0x05].[0x00] => 35.5.0
  • Read the firmware version by using the fwupdate utility:

    $ sudo fwupdate -l
    

The output includes the version that has the same format as the fw_version. For example, the release 35.5.0:

$ sudo fwupdate -l
...
system-firmware type, {bf0d4599-20d4-414e-b2c5-3595b1cda402} version 2295040 can be updated to any version above 2295039

2295040 = 0x230500 => [0x23].[0x05].[0x00] => 35.5.0

Update Bootloader

The bootloader is updated by UEFI Capsule update. Refer to Manually Trigger the Capsule Update for more information.

Bootloader Tools

NVIDIA provides tools for ease of use in the Bootloader update process.

Boot Control

nvbootctrl is intended to be used for debugging, so it can be used to dump the slot information. You can also use it to set the active slot, which forces the boot slot to change for the next boot.

To display the command usage, run the following command with no parameters:

$ sudo nvbootctrl

For more information, refer to Manually Modifying Boot Slots.

Bootloader Update Payload Generator

The Bootloader Update Payload (BUP) is the payload that is packed into the Capsule payload. The BUP is generated by the build_l4t_bup.sh host tool, which is kept with flash.sh in the Linux for Jetson Board Support Package (BSP).

This section describes procedures for generating a multi-spec BUP or a single-spec BUP.

A multi-spec BUP includes firmware binaries and BCT images for each supported Jetson device. When you run the updater, it uses the appropriate binary of each type for the device you are updating.

A single-spec BUP includes firmware binaries and BCT images for just one type of device. It is appropriate if you are updating just one type of Jetson device.

The multi-spec procedure stores a BUP at each of these locations for the respective group of processors. The single-spec procedure stores a BUP at just one location for the appropriate type of processor.

Manually Modifying Boot Slots

NVIDIA provides the nvbootctrl tool for testing and development purposes. However, you may wish to switch boot slots manually from user space.

To manually modify the boot slots

  1. Run the following command to switch to superuser mode:

    $ sudo su
    
  2. Run the following command:

    # nvbootctrl <command>
    

    Where <command> is one of the values in the following table:

Command

Description

get-number-slots

Prints the number of slots.

get-current-slot

Prints the currently running slot.

dump-slots-info

Prints information about the slots.

set-active-boot-slot <slot>

At the next boot, loads and executes <slot>.

verify

Verifies the bootloader and the rootfs boot.

set-SR-BR <slot>

On next warm reset, loads and executes <slot>. (only the T194 bootloader).

is-rootfs-ab-enabled

Rootfs only, return:
  • 0: Rootfs A/B is disabled.

  • 1: Rootfs A/B is enabled and current rootfs slot is A.

  • 2: Rootfs A/B is enabled and current rootfs slot is B.

Note

  • <slot> is the zero-based slot number.

  • The default setting for both slot 0 and slot 1 is “bootable”.

To show the current boot slot

  • Run the following command:

    # nvbootctrl get-current-slot
    

The command displays a single digit, 0 (slot A) or 1 (slot B).

To show the slot status

  • Run the following command:

    # nvbootctrl dump-slots-info
    

    The command displays the status of both slots:

    Current version: 35.2.0
    Capsule update status: 0
    Current bootloader slot: A
    Active bootloader slot: A
    num_slots: 2
    slot: 0,             status: normal
    slot: 1,             status: normal
    

Sample Boot Log

The boot slot is selected by BootRom, and MB1 and MB2 use the slot number. The message displayed from MB1 is available from an MB1 debug build that has messages enabled. Messages from MB2 are always available.

For NVIDIA® Jetson AGX Orin™, NVIDIA® Jetson Orin™ NX, and NVIDIA® Jetson Orin™ Nano

The following sample log shows that slot 1 (slot B) is selected as the boot slot:

[0000.063] I> MB1 (version: 0.23.0.0-t234-54845784-92215740)
[0000.068] I> t234-A01-0-Silicon (0x12347) Prod
[0000.073] I> Boot-mode : Coldboot
[0000.076] I> Emulation:
[0000.078] I> Entry timestamp: 0x00000000
[0000.082] I> last_boot_error: 0x0
[0000.085] I> BR-BCT: preprod_dev_sign: 0
[0000.089] I> rst_source: 0xb, rst_level: 0x1
[0000.093] I> Task: CRC check (0x5001cf71)
[0000.097] I> Skip CRC check as records_integrity fuse is not burned
 . . .
 . . .
[0000.265] I> Loading MEM-BCT to SysRAM
[0000.269] I> Scratch RSV109: 0x00000013    active chain: 1
[0000.274] I> Slot: 1
[0000.276] I> Binary[0] block-0 (partition size: 0x40000)
[0000.281] I>  get_binary_info: Binary name: MEM-BCT-0
 . . .
 . . .
I> MB2 (version: 0.0.0.0-t234-54845784-7aee5a6b)
I> t234-A01-0-Silicon (0x12347)
I> Boot-mode : Coldboot
I> Emulation:
I> Entry timestamp: 0x001f2b6f
I> Regular heap: [base:0x40040000, size:0x10000]
 . . .
 . . .
I> Successfully register APE FW load task with MB2 loader
I> Skipping FSI FW load
I> Successfully register XUSB FW load task with MB2 loader
I> Scratch RSV109: 0x00000013    active chain: 1
I> Partition name: B_spe-fw
I> Size of partition: 589824
I> Binary@ device:3/0 block-118016 (partition size: 0x90000), name: B_spe-fw
 . . .
 . . .

For NVIDIA® Jetson AGX Xavier™ and NVIDIA® Jetson Xavier™ NX

The following sample log shows that slot 1 (slot B) is selected as the boot slot:

[0000.053] W> RATCHET: MB1 binary ratchet value 4 is larger than ratchet level 1 from HW fuses.
[0000.061] I> MB1 (prd-version: 2.3.0.0-t194-41334769-0a17edc1)
[0000.067] I> Boot-mode: Coldboot
[0000.070] I> Platform: Silicon
[0000.073] I> Chip revision : A02
[0000.076] I> Bootrom patch version : 7 (correctly patched)
[0000.081] I> ATE fuse revision : 0x200
[0000.084] I> Ram repair fuse : 0x0
[0000.087] I> Ram Code : 0x0
[0000.090] I> rst_source: 0xb, rst_level: 0x1
[0000.095] I> Boot-device: SDMMC (instance: 3)
[0000.111] I> sdmmc DDR50 mode
[0000.115] I> Boot chain mechanism: A/B
[0000.118] I> Current Boot-Chain Slot: 1
[0000.122] I> BR-BCT Boot-Chain: 0, status: 0. update flag: 1
[0000.129] W> PROD_CONFIG: device prod data is empty in MB1 BCT.
[0000.134] I> Temperature = 39500
[0000.137] W> Skipping boost for clk: BPMP_CPU_NIC
[0000.142] W> Skipping boost for clk: BPMP_APB
[0000.146] W> Skipping boost for clk: AXI_CBB
[0000.150] W> Skipping boost for clk: AON_CPU_NIC
[0000.154] W> Skipping boost for clk: CAN1
[0000.158] W> Skipping boost for clk: CAN2
[0000.162] I> Boot-device: SDMMC (instance: 3)
[0000.173] I> Sdmmc: HS400 mode enabled
[0000.177] I> Non-ECC region[0]: Start:0x80000000, End:0x100000000
[0000.184] W>  Thermal config not found in BCT
[0000.192] W>  MEMIO rail config not found in BCT
[0000.210] I> sdmmc bdev is already initialized
[0000.255] W>  Platform config not found in BCT
[0000.289] I> MB1 done

main enter
SPE VERSION #: R01.00.18 Created: Jan 29 2021 @ 14:18:27
HW Function test
Start Scheduler.
in late init

[0000.298] I> Welcome to MB2(TBoot-BPMP) (version: default.t194-mobile-23fd5458)
[0000.299] I> DMA Heap @ [0x526fa000 - 0x52ffa000]
[0000.299] I> Default Heap @ [0xd486400 - 0xd48a400]
[0000.300] E> DEVICE_PROD: Invalid value data = 70020000, size = 0.
[0000.306] W> device prod register failed
[0000.310] I> gpio framework initialized
[0000.313] I> tegrabl_gpio_driver_register: register 'nvidia,tegra194-gpio' driver
[0000.321] I> tegrabl_gpio_driver_register: register 'nvidia,tegra194-gpio-aon' driver
[0000.328] I> No valid sdcard_params in mb1_bct
[0000.333] I> Boot_device: SDMMC_BOOT instance: 3
[0000.337] I> sdmmc-3 params source = boot args
[0000.346] I> sdmmc-3 params source = boot args
[0000.347] I> sdmmc bdev is already initialized
[0000.380] I> Found 20 partitions in SDMMC_BOOT (instance 3)
[0000.395] I> Found 42 partitions in SDMMC_USER (instance 3)
[0000.396] I> Active Boot chain : 1
[0000.454] I> Relocating BR-BCT
[0000.455]  > DEVICE_PROD: device prod is not initialized.
 . . .
 . . .

Generating the Bootloader Update Payload (BUP)

A Bootloader Update Payload (BUP) is used to implement Bootloader update. It contains firmware binaries of each type needed to update a Jetson device.

This section describes the procedure for generating a single-spec BUP, which contains just one binary of each type and can be used to update just one Jetson device configuration.

There is also a procedure for generating a multi-spec BUP, which includes multiple firmware binaries and BCT images of each type, and can be used to update any supported type of Jetson device. When you run the updater, it uses the appropriate binary of each type for the device you are updating. Refer to Generating a multi-spec BUP for more information.

Before you generate BUPs, set the ToT_BSP environment variable to point to the complete path name of the BSPs for the current release (the Linux_for_Tegra/ directory) in which flash.sh is stored.

Generating a Single-Spec BUP

  • To create a BUP image that will be stored in a file for a carrier board that is not connected to the host system:

    • For a Jetson AGX Orin carrier board with the indicated value of FAB, BOARDID, FUSELEVEL and BOARDSKU:

      $ cd ${ToT_BSP}
      $ sudo FAB=000 BOARDID=3701 FUSELEVEL=fuselevel_production BOARDSKU=0000 ./build_l4t_bup.sh jetson-agx-orin-devkit mmcblk0p1
      
    • For a Jetson Orin NX carrier board with the indicated value of FAB, BOARDID, FUSELEVEL and BOARDSKU:

      $ cd ${ToT_BSP}
      $ sudo FAB=000 BOARDID=3767 FUSELEVEL=fuselevel_production BOARDSKU=0000 ./build_l4t_bup.sh jetson-orin-nano-devkit mmcblk0p1
      
    • For a Jetson Xavier NX carrier board with the indicated values of FAB, BOARDID, FUSELEVEL and BOARDSKU:

      $ cd ${ToT_BSP}
      $ sudo FAB=100 BOARDID=3668 FUSELEVEL=fuselevel_production BOARDSKU=0001 ./build_l4t_bup.sh jetson-xavier-nx-devkit-emmc mmcblk0p1
      
    • For a Jetson AGX Xavier carrier board with the indicated values of FAB, BOARDID, FUSELEVEL, BOARDSKU and BOARDREV:

      $ cd ${ToT_BSP}
      $ sudo FAB=400 BOARDID=2888 FUSELEVEL=fuselevel_production BOARDSKU=0001 BOARDREV=H.0 ./build_l4t_bup.sh jetson-agx-xavier-devkit mmcblk0p1
      
  • To create a BUP image for a board that is connected to the host system:

    1. Place the target board into Force Recovery Mode.

    2. Run the following commands:

      $ cd ${ToT_BSP}
      $ sudo ./build_l4t_bup.sh <device> mmcblk0p1
      

    Where <device> is:

    • For the Jetson AGX Orin: jetson-agx-orin-devkit

    • For the Jetson Orin NX series and the Orin Nano series: jetson-orin-nano-devkit

    • For the Jetson Xavier NX series: jetson-xavier-nx-devkit-emmc

    • For the Jetson AGX Xavier series: jetson-agx-xavier-devkit

  • To create the PKC signed BUP image for a carrier board connected to the host system:

    1. Place the target board into Force Recovery Mode.

    2. Run the following commands:

      $ cd ${ToT_BSP}
      $ sudo ./build_l4t_bup.sh -u <pkc_key_file> -v <sbk_key_file> <device> mmcblk0p1
      

      Where:

      • <pkc_key_file> is the RSA private key file for your board. It must be in the ${ToT_BSP}/bootloader directory, or you must specify its absolute pathname.

      • <sbk_key_file> is the Secure Boot Key (SBK) key file for your board. It must be in the ${ToT_BSP}/bootloader directory, or you must specify its absolute pathname. This option must used with PKC key and currently support only Jetson Xavier NX series and Jetson AGX Xavier.

      • <device> is:

        • For the Jetson AGX Orin series: jetson-agx-orin-devkit

        • For the Jetson Orin NX series and the Orin Nano series: jetson-orin-nano-devkit

        • For the Jetson Xavier NX series: jetson-xavier-nx-devkit-emmc

        • For the Jetson AGX Xavier series: jetson-agx-xavier-devkit

Generating a Specified Partition BUP

Note

UEFI support for one partition image update is disabled in the default UEFI build. To enable this feature, complete the instructions in Single Image Capsule Update. To rebuild UEFI, refer to Building UEFI for NVIDIA Jetson.

To create a specified partition BUP image for a carrier board connected to the host system:

  1. Place the target board into Force Recovery Mode.

  2. Run the following commands:

    $ cd ${ToT_BSP}
    $ sudo ./build_l4t_bup.sh --single-image-bup <partition_name> <device> mmcblk0p1
    

Where:

  • <partition_name> is the partition name specified in flash.cfg.

  • <device> is:

    • For the Jetson AGX Orin series: jetson-agx-orin-devkit

    • For the Jetson Orin NX series and the Orin Nano series: jetson-orin-nano-devkit

    • For the Jetson Xavier NX series: jetson-xavier-nx-devkit-emmc

    • For the Jetson AGX Xavier series: jetson-agx-xavier-devkit

Note

The generated BUP payload name is <partition_name>_only_payload.

Here is an example to generate a partition BUP image of xusb-fw for Jetson Xavier NX:

$ cd ${ToT_BSP}
$ sudo ./build_l4t_bup.sh --single-image-bup xusb-fw jetson-xavier-nx-devkit mmcblk0p1

Generating a Multi-Spec BUP

  • Run the following commands:

    $ cd ${ToT_BSP}
    $ sudo ./l4t_generate_soc_bup.sh [-u <pkc_key_file>] [ -v <sbk_key_file> ] [-b <board>] [-p <option>] [-f <boardspec file>] [-e <boardspec entry>] [-d] <target_soc>
    

    Where:

    • <pkc_key_file> is the RSA private key file for your Jetson carrier board. If it is a relative pathname, it is interpreted relative to the ${ToT_BSP}/bootloader/ directory.

    • <sbk_key_file> is the SBK key file for your board. It must be in the ${ToT_BSP}/bootloader directory, or you must specify its absolute pathname. This option must used with PKC key, and currently only supports t19x.

    • <board> specifies one particular board for corresponding target_soc.

    • <options> is a string of command line options to be passed to flash.sh to generate the BUP. If the string contains whitespace characters, it must be enclosed in quotes.

    • <boardspec file> specifies a user-provided board spec file.

    • <boardspec entry> specifies a board spec entry in a user provided board spec file, such as “jetson_xavier_nx_devkit_emmc_ota_emmc_r32_7_spec” in “ota_board_specs.conf”.

    • -d causes the script to run in debug mode, which keeps all boot firmware blob images in bootloader/signed and bootloader/multi-signed.

    • <target_soc> is:

      • For the Jetson AGX Orin series, the Orin NX series, and the Orin Nano series: t23x

      • For the Jetson Xavier NX series and the AGX Xavier series: t19x

Location of Generated BUP Files

Both procedures store the generated BUP(s) in the director(ies):

  • For the Jetson AGX Orin series, the Orin NX series, and the Orin Nano series: ${ToT_BSP}/bootloader/payloads_t23x

  • For the Jetson Xavier NX series and the Jetson AGX Xavier series: ${ToT_BSP}/bootloader/payloads_t19x

To Customize the BUP

Currently, the UEFI Capsule update supports an optional update for a pre-defined list of partitions, and this optional update is completed by packing or unpacking these images into the UEFI Capsule.

  • For t19x, users can change the SKIP field settings between “0” and “1” for an image in the t19x_bl_table in the bootloader/l4t_bup_gen.func file, which is in the ${ToT_BSP}/Linux_for_Tegra/ directory.

  • For t23x, users can change the SKIP field settings between “0” and “1” for an image in the t23x_bl_table in the bootloader/l4t_bup_gen.func file, which is in the ${ToT_BSP}/Linux_for_Tegra/ directory.

This way, the corresponding image will be packed (or unpacked) into BUP and then into the UEFI Capsule. For example, Add the xusb-fw into BUP for t19x:

'xusb-fw         0            0              0                0'

Unpack the xusb-fw to BUP:

'xusb-fw         0            0              0                1'

The list of images that support optional update:

  • For t19x:

    • eks

    • sce-fw

    • xusb-fw

  • For t23x:

    • eks

    • fsi-fw

    • tsec-fw

    • xusb-fw

Note

Update the EKB image for the eks partition only when user keys are added or removed.

Generating the Capsule Update Payload

Starting with release 35.2, a Capsule update payload is used to implement the Bootloader update. This section provides information about how to generate a multi-spec Capsule payload, which contains multiple firmware binaries and BCT images of each type. The payload can be used to update any supported Jetson device. When you start the update, UEFI uses the appropriate binary of each type for the device you are updating.

Before you generate Capsule update payloads, set the ToT_BSP environment variable to point to the complete path name of the BSPs for the current release (the Linux_for_Tegra/ directory) in which flash.sh is stored.

Generating a Multi-Spec Capsule Payload

  • To generate a multi-spec BUP, refer to Generating a Multi-Spec BUP for more information.

  • Run the following commands to generate multi-spec Capsule payload:

    $ cd ${ToT_BSP}
    $ ./generate_capsule/l4t_generate_soc_capsule.sh [-o <output file> [-i <input file>] [ --signer-private-cert <signer private cert> ] [ --other-public-cert <other public cert> ] [ --trusted-public-cert <trusted public cert> ] <target_soc>
    

    Where:

    • <output file> is the path and file name of the output Capsule image.

    • <input file> is the path and file name of the input BUP payload.

    • <signer private cert> specifies the OpenSSL signer private certificate filename. (By default, the public TestCert.pem is used.)

    • <other public cert> specifies OpenSSL other public certificate filename. (By default, the public TestSub.pub.pem is used.)

    • <trusted public cert> specifies OpenSSL trusted public certificate filename. (By default, the public TestRoot.pub.pem by default.)

    • <target_soc> is:

      • For the Jetson AGX Orin series, the Orin NX series, and the Orin Nano series: t23x

      • For the Jetson Xavier NX series and the AGX Xavier series: t19x

Here are the examples to generate multi-spec Capsule payloads for t23x:

  • Generate a multi-spec, Capsule payload for the AGX Orin series:

    $ cd ${ToT_BSP}
    
    # For AGX Orin:
    $ sudo ./l4t_generate_soc_bup.sh -e t23x_agx_bl_spec t23x
    
    # For AGX Orin Industrial:
    $ sudo ./l4t_generate_soc_bup.sh -e t23x_agx_ind_bl_spec t23x
    
    $ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/bl_only_payload -o ./TEGRA_BL.Cap t234
    
  • Generate a multi-spec, Capsule payload for the Orin NX series and the Orin Nano series:

    $ cd ${ToT_BSP}
    $ sudo ./l4t_generate_soc_bup.sh -e t23x_3767_bl_spec t23x
    $ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/bl_only_payload -o ./TEGRA_BL.Cap t234
    
  • Generate a multi-spec, Capsule payload for the Xavier NX series and the AGX Xavier series:

    $ cd ${ToT_BSP}
    $ sudo ./l4t_generate_soc_bup.sh t19x
    $ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t19x/bl_only_payload -o ./TEGRA_BL.Cap t194
    

Manually Trigger the Capsule Update

The UEFI updates the non-current slot Bootloader when a Capsule update is triggered. The device boots from the updated non-current slot after the Capsule update has finished.

  1. Copy the generated multi-spec Capsule payload to the EFI/UpdateCapsule directory in the esp partition of the active boot media. Refer to Generating a Multi-Spec Capsule Payload for more information.

  • For device booted from eMMC, copy the payload to the esp partition on eMMC.

  • For device booted from NVMe, copy the payload to the esp partition on NVMe.

  1. Set the bit2 of the OsIndications UEFI variable.

  • For devices with QSPI flash:

    $ cd /sys/firmware/efi/efivars/
    $ printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
    $ sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync
    
  • For devices without QSPI flash, mount the esp partition of eMMC to set the variable:

    $ sudo mkdir -p /opt/nvidia/esp
    $ esp_uuid=$(lsblk -o name,partlabel,uuid | grep "mmcblk0" | awk '{ if($2 == "esp") print $3 }')
    $ sudo mount UUID=$esp_uuid /opt/nvidia/esp
    
    $ cd /opt/nvidia/esp/EFI/NVDA/Variables
    $ printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
    $ sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync
    
  1. Reboot the Jetson device. UEFI will use the Capsule payload to update the non-current slot Bootloader.

  2. To check the Capsule update status, run the nvbootctrl command:

    $ sudo nvbootctrl dump-slots-info
    

The output value of Capsule update status can be following:

0 - No Capsule update
1 - Capsule update successfully
2 - Capsule install successfully but boot new firmware failed
3 - Capsule install failed

Manually Sync Bootloader A/B Slots with the Capsule Update

Bootloader A/B slots can be synced by applying the Capsule update on a non-current slot.

If the UEFI Capsule was previously successfully updated, the current slot boots up with the image from the Capsule. To update the non-current slot through Capsule Update, users must complete the steps below.

If the UEFI Capsule was not previously successfully updated, to ensure that slots A and B are updated with the same image, users must complete the following steps twice. For example, if the current slot is A, when you complete the following steps the first time, slot B is updated. After the devices boot up from slot B, when users complete the steps again, slot A will be updated with the Capsule. The device will now boot up from slot A.

  1. Copy the Capsule payload that was used in step 1 in Manually Trigger the Capsule Update to the EFI/UpdateCapsule directory in the esp partition of the active boot media.

  2. Set the bit2 of the OsIndications UEFI variable.

  3. Reboot the Jetson device. UEFI uses the Capsule payload to update the non-current slot Bootloader.

  4. To check the Capsule update status and current slot, run the nvbootctrl command. The Capsule update status is success.

Manually Triggering the Single Partition Image Capsule Update

  1. Generate a specified partition BUP image. Refer to Generating a specified partition BUP for more information.

  2. Generate a Capsule payload by the specified partition BUP image. Refer to Generating a Multi-Spec Capsule Payload for more information.

    Here is an example to generate a Capsule payload of A_xusb-fw for t23x:

    $ cd ${ToT_BSP}
    $ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/A_xusb-fw_only_payload -o ./TEGRA_BL.Cap t234
    
  3. Customize the UEFI to enable the single image Capsule update. Refer to the Single Image Capsule Update for more information.

  4. Copy the generated Capsule payload in step 2 to the EFI/UpdateCapsule directory in the esp partition of the active boot media. Refer to the step 1 in Manually Triggering the Capsule Update for more information.

  5. Trigger the single partition image Capsule update. Refer to the Single Image Capsule Update for more information.

    Users need to set the FmpCapsuleSinglePartitionChain and OsIndications variables.

    • Set FmpCapsuleSinglePartitionChain with the desired boot chain to be updated (0: slot A, 1: slot B).

    • Set the bit2 of the OsIndications. Refer to the step 2 in Manually Triggering the Capsule Update for more information.

    Here is an example to trigger A_xusb-fw single image Capsule update to slot B on t23x, current slot is A. Refer to Manually Modifying Boot Slots for the command that shows current slot:

    $ cd /sys/firmware/efi/efivars/
    $ printf "\x07\x00\x00\x00\x01" > /tmp/var_tmp.bin
    # In case to update chain A, the setting is:
    # $ printf "\x07\x00\x00\x00\x00" > /tmp/var_tmp.bin
    $ sudo dd if=/tmp/var_tmp.bin of=FmpCapsuleSinglePartitionChain-781e084c-a330-417c-b678-38e696380cb9 bs=5;sync
    
    $ printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
    $ sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync
    
  6. Reboot the Jetson device. UEFI will use the single image Capsule payload to update the specified partition.

  7. To verify the single partition image Capsule update status, check the value of the /sys/firmware/efi/esrt/entries/entry0/last_attempt_status file after system boots up. 0 means that the verification was successful. For other values, check the error code:

    $ sudo cat /sys/firmware/efi/esrt/entries/entry0/last_attempt_status
    

Note

When single partition image Capsule update is complete, the Capsule update status in the output of nvbootctrl command is not reliable.