capsule: FMP: Populate the image descriptor array from platform data
authorSughosh Ganu <sughosh.ganu@linaro.org>
Fri, 15 Apr 2022 05:59:35 +0000 (11:29 +0530)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 15 Apr 2022 08:43:18 +0000 (10:43 +0200)
commit1ea06bc929ad1ce3350e2184ad81872c87d9fad4
tree5b7379f429bc6b78fe411a1d2e34193f059d1221
parent741ef867288bb294039e34ab2287ffe981b05b86
capsule: FMP: Populate the image descriptor array from platform data

Currently, the image descriptor array that has been passed to the
GetImageInfo function of the Firmware Management Protocol(FMP) gets
populated through the data stored with the dfu framework. The
dfu data is not restricted to contain information only of the images
updatable through the capsule update mechanism, but it also contains
information on other images. The image descriptor array is also parsed
by the ESRT generation code, and thus the ESRT table contains entries
for other images that are not being handled by the FMP for the capsule
updates. Fix this by populating the image descriptor array from the
structure initialised in the board file.

The other issue fixed is assignment of a separate GUID for all images
in the image descriptor array. The UEFI specification mandates that
all entries in the ESRT table should have a unique GUID value as part
of the FwClass member of the EFI_SYSTEM_RESOURCE_ENTRY. Currently, all
images are assigned a single GUID value, either an FIT GUID or a raw
image GUID. This is fixed by obtaining the GUID values from the
efi_fw_images array defined per platform.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
lib/efi_loader/efi_firmware.c