mbox series

[v3,0/4] FMP versioning support

Message ID 20230320055448.12439-1-masahisa.kojima@linaro.org
Headers show
Series FMP versioning support | expand

Message

Masahisa Kojima March 20, 2023, 5:54 a.m. UTC
Firmware version management is not implemented in the current
FMP implementation. This series aims to add the versioning support
in FMP.
Python based test will follow later.

EDK2 reference implementation utilizes the FMP Payload Header
inserted right before the capsule payload. With this series,
U-Boot also follows the EDK2 implementation.

Currently, there is no way to know the current running firmware
version through the EFI interface. FMP->GetImageInfo() returns
always 0 for the version number. So a user can not know that
expected firmware is running after the capsule update.

With this series applied, version number can be specified
in the capsule file generation with mkeficapsule tool, then
user can know the running firmware version through
FMP->GetImageInfo() and ESRT.

Note that this series does not mandate the FMP Payload Header,
compatible with boards that are already using the existing
U-Boot FMP implementation.
If no FMP Payload Header is found in the capsule file, fw_version,
lowest supported version, last attempt version and last attempt
status is set to 0 and this is the same behavior as existing FMP
implementation.

Changes in v3:
- exclude CONFIG_FWU_MULTI_BANK_UPDATE case

Masahisa Kojima (4):
  efi_loader: store firmware version into FmpState variable
  efi_loader: versioning support in GetImageInfo
  efi_loader: check lowest supported version in capsule update
  mkeficapsule: add FMP Payload Header

 doc/mkeficapsule.1            |  16 ++
 lib/efi_loader/efi_firmware.c | 302 +++++++++++++++++++++++++++++++---
 tools/eficapsule.h            |  32 ++++
 tools/mkeficapsule.c          |  51 +++++-
 4 files changed, 369 insertions(+), 32 deletions(-)