Upgrading the Bootloader

Capsule Updates provide a secure and standardized method for firmware upgrades, originally defined by the UEFI specification and now supported in U-Boot. This mechanism allows PHYTEC K3-based System-on-Modules to perform bootloader self-upgrades in a flexible and reliable way, regardless of the flash storage type.

EFI Capsule Update support has been implemented for all PHYTEC K3-based SoMs. These boards support multiple types of flash devices:

  • eMMC

  • OSPI NOR

  • uSD card

The update mechanism works across all supported storage configurations, enabling consistent upgrade procedures regardless of the boot medium.

Our BSP builds include pre-generated capsule binaries for each firmware component - tiboot3-capsule.bin, tispl-capsule.bin, and uboot-capsule.bin - that are ready for use with the EFI capsule update mechanism. These binaries follow the UEFI capsule format and can be directly loaded and applied, without requiring additional preparation or conversion by the user. This simplifies the upgrade process and ensures compatibility with the capsule update infrastructure in U-Boot.

Retrieving the Board GUID

Each board dynamically generates a unique firmware identifier (GUID) for capsule update targeting. To inspect the currently registered firmware resources and their GUIDs, use the following command in U-Boot:

sh-uboot:~# efidebug capsule esrt

========================================
ESRT: fw_resource_count=3
ESRT: fw_resource_count_max=3
ESRT: fw_resource_version=1
[entry 0]==============================
ESRT: fw_class=C7D64D6D-10B2-54BC-A3BF-06A9DC3653D9
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
[entry 1]==============================
ESRT: fw_class=09841C3F-F177-5D57-B1F6-754D92879205
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
[entry 2]==============================
ESRT: fw_class=D11A9016-515E-503A-8872-3FF65384D0C4
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
========================================

Each fw_class represents a firmware component (e.g., tiboot3, tispl, uboot) that can be updated using a corresponding capsule binary.

Performing an Update

Ensure the capsule binaries (tiboot3-capsule.bin, tispl-capsule.bin, uboot-capsule.bin) are available on a uSD card (mmc 1:1). Then run the following commands on the target board:

sh-uboot:~# load mmc 1:1 $loadaddr tiboot3-capsule.bin
sh-uboot:~# efidebug capsule update $loadaddr

sh-uboot:~# load mmc 1:1 $loadaddr tispl-capsule.bin
sh-uboot:~# efidebug capsule update $loadaddr

sh-uboot:~# load mmc 1:1 $loadaddr uboot-capsule.bin
sh-uboot:~# efidebug capsule update $loadaddr

These commands:

  • Load each capsule file into memory at the address defined by $loadaddr

  • Trigger the EFI capsule update process via efidebug capsule update

Important Notes

  • Boot Device Targeting: Updates are applied to the flash device from which the board is currently running. For eMMC, this means the first boot partition.

  • Supported Boot Media: Capsule updates are supported on boards booting from eMMC, OSPI NOR, or uSD card.

  • Multiple Firmware Components: Each component has a unique GUID, managed through the EFI System Resource Table (ESRT).