mbox series

[RFC,0/3] FMP versioning support

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

Message

Masahisa Kojima Feb. 22, 2023, 10:40 a.m. UTC
This series aims to add the versioning support
in FMP protocol implementation.

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

Note that this series is RFC and only tested with RAW image
with single image index.

[TODO]
- test with FIT image, authenticated capsule, multiple image index.
- enhance U-Boot mkeficapsule tool to insert FMP Payload Header

Masahisa Kojima (3):
  efi_loader: store firmware version into FmpState variable
  efi_loader: versioning support in GetImageInfo
  efi_loader: check lowest supported version in capsule update

 lib/efi_loader/efi_firmware.c | 269 ++++++++++++++++++++++++++++++----
 1 file changed, 242 insertions(+), 27 deletions(-)

Comments

Heinrich Schuchardt Feb. 23, 2023, 5:53 a.m. UTC | #1
Am 22. Februar 2023 11:40:33 MEZ schrieb Masahisa Kojima <masahisa.kojima@linaro.org>:
>This series aims to add the versioning support
>in FMP protocol implementation.
>
>EDK2 reference implementation utilizes the FMP Payload Header
>inserted right before the capsule payload. With this series,
>U-Boot also follows the EDK2 implementation.
>
>Note that this series is RFC and only tested with RAW image
>with single image index.

Hello Masahisa,

Could you please describe if this change will be compatible with boards that are already using the existing U-Boot FMP implementation.

Further please describe the benefit of the change.

Best regards

Heinrich


>
>[TODO]
>- test with FIT image, authenticated capsule, multiple image index.
>- enhance U-Boot mkeficapsule tool to insert FMP Payload Header
>
>Masahisa Kojima (3):
>  efi_loader: store firmware version into FmpState variable
>  efi_loader: versioning support in GetImageInfo
>  efi_loader: check lowest supported version in capsule update
>
> lib/efi_loader/efi_firmware.c | 269 ++++++++++++++++++++++++++++++----
> 1 file changed, 242 insertions(+), 27 deletions(-)
>
Masahisa Kojima Feb. 23, 2023, 11:28 p.m. UTC | #2
Hi Heinrich,

On Thu, 23 Feb 2023 at 14:53, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
>
>
> Am 22. Februar 2023 11:40:33 MEZ schrieb Masahisa Kojima <masahisa.kojima@linaro.org>:
> >This series aims to add the versioning support
> >in FMP protocol implementation.
> >
> >EDK2 reference implementation utilizes the FMP Payload Header
> >inserted right before the capsule payload. With this series,
> >U-Boot also follows the EDK2 implementation.
> >
> >Note that this series is RFC and only tested with RAW image
> >with single image index.
>
> Hello Masahisa,
>
> Could you please describe if this change will be compatible with boards that are already using the existing U-Boot FMP implementation.

Yes, this change is compatible with boards using the existing U-Boot
FMP implementation.
This change utilizes the FMP Payload Header inserted right before the
capsule payload by EDK2
capsule generation script.
This change does not mandate the FMP Payload Header.
If no FMP Payload Header is found in the capsule file, fw_version,
lowest supported
version, last attempt version and last attempt status is 0 and this is
the same behavior as existing FMP
implementation.

>
> Further please describe the benefit of the change.

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

# CapsuleApp.efi -P

############
# FMP DATA #
############
FMP (0) ImageInfo:
  DescriptorVersion  - 0x4
  DescriptorCount    - 0x1
  DescriptorSize     - 0x78
  PackageVersion     - 0xFFFFFFFF
  PackageVersionName - "<null string>"
  ImageDescriptor (0)
    ImageIndex                  - 0x1
    ImageTypeId                 - 00000000-66E9-8808-BA84-9347A90833E0
    ImageId                     - 0x1
    ImageIdName                 - "DEVELOPERBOX-FIP"
    Version                     - 0x0
    VersionName                 - "<null string>"
    Size                        - 0x0
        <--snip-->

After this series is applied, "Version" will have the number specified
in the capsule file generation.

I will add these explanations in the relevant commit message and cover letter.

Regards,
Masahisa Kojima



>
> Best regards
>
> Heinrich
>
>
> >
> >[TODO]
> >- test with FIT image, authenticated capsule, multiple image index.
> >- enhance U-Boot mkeficapsule tool to insert FMP Payload Header
> >
> >Masahisa Kojima (3):
> >  efi_loader: store firmware version into FmpState variable
> >  efi_loader: versioning support in GetImageInfo
> >  efi_loader: check lowest supported version in capsule update
> >
> > lib/efi_loader/efi_firmware.c | 269 ++++++++++++++++++++++++++++++----
> > 1 file changed, 242 insertions(+), 27 deletions(-)
> >