[PATCH v2 1/6] capsule: Add Image GUIDs for platforms using capsule updates

Sughosh Ganu sughosh.ganu at linaro.org
Sat Mar 26 10:34:02 CET 2022


hi Heiko,

On Sat, 26 Mar 2022 at 12:36, Heiko Thiery <heiko.thiery at gmail.com> wrote:
>
> Hi
>
> Sughosh Ganu <sughosh.ganu at linaro.org> schrieb am Sa., 26. März 2022, 07:00:
>>
>> Currently, all platforms that enable capsule updates do so using
>> either EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID or
>> EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID. This is based on the Firmware
>> Management Protocol(FMP) instance used on the platform. However, this
>> means that all platforms that enable a particular FMP instance have
>> the same GUID value for all the updatable images, either the FIT image
>> GUID or the raw image GUID, and that an image for some platform can be
>> updated on any other platform which uses the same FMP instance. Another
>> issue with this implementation is that the ESRT table shows the same
>> GUID value for all images on the platform and also across platforms,
>> which is not in compliance with the UEFI specification.
>>
>> Fix this by defining image GUID values and firmware names for
>> individual images per platform. The GetImageInfo FMP hook would then
>> populate these values in the image descriptor array.
>>
>> Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
>> ---
>>
>> Changes since V1:
>> * Make changes for the xilinx boards as suggested by Michal Simek.
>> * Add a GUID for the sandbox FIT image
>>
>>  .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c       | 19 ++++++++++++++
>>  .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c   | 18 +++++++++++++
>>  board/emulation/qemu-arm/qemu-arm.c           | 20 +++++++++++++++
>>  board/kontron/pitx_imx8m/pitx_imx8m.c         | 15 ++++++++++-
>>  board/kontron/sl-mx8mm/sl-mx8mm.c             | 14 +++++++++++
>>  board/kontron/sl28/sl28.c                     | 14 +++++++++++
>>  board/sandbox/sandbox.c                       | 25 +++++++++++++++++++
>>  board/socionext/developerbox/developerbox.c   | 23 +++++++++++++++++
>>  board/xilinx/common/board.c                   | 18 +++++++++++++
>>  include/configs/imx8mm-cl-iot-gate.h          | 10 ++++++++
>>  include/configs/imx8mp_rsb3720.h              | 10 ++++++++
>>  include/configs/kontron-sl-mx8mm.h            |  6 +++++
>>  include/configs/kontron_pitx_imx8m.h          |  6 +++++
>>  include/configs/kontron_sl28.h                |  6 +++++
>>  include/configs/qemu-arm.h                    | 10 ++++++++
>>  include/configs/sandbox.h                     | 14 +++++++++++
>>  include/configs/synquacer.h                   | 14 +++++++++++
>>  include/configs/xilinx_versal.h               | 10 ++++++++
>>  include/configs/xilinx_zynqmp.h               | 10 ++++++++
>>  include/configs/zynq-common.h                 | 10 ++++++++
>>  include/efi_loader.h                          | 15 +++++++++++
>>  21 files changed, 286 insertions(+), 1 deletion(-)
>>
>> diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
>> index 16566092bd..6b534660fe 100644
>> --- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
>> +++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
>> @@ -6,6 +6,8 @@
>>
>>  #include <common.h>
>>  #include <dwc3-uboot.h>
>> +#include <efi.h>
>> +#include <efi_loader.h>
>>  #include <errno.h>
>>  #include <miiphy.h>
>>  #include <netdev.h>
>> @@ -21,6 +23,7 @@
>>  #include <asm/arch/clock.h>
>>  #include <asm/mach-imx/dma.h>
>>  #include <linux/delay.h>
>> +#include <linux/kernel.h>
>>  #include <power/pmic.h>
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>> @@ -44,6 +47,22 @@ static void setup_gpmi_nand(void)
>>  }
>>  #endif
>>
>> +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
>> +struct efi_fw_images fw_images[] = {
>> +       {
>> +#if defined(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)
>> +               .image_type_id = IMX8MP_RSB3720A1_4G_FIT_IMAGE_GUID,
>> +#elif defined(CONFIG_TARGET_IMX8MP_RSB3720A1_6G)
>> +               .image_type_id = IMX8MP_RSB3720A1_6G_FIT_IMAGE_GUID,
>> +#endif
>> +               .fw_name = u"IMX8MP-RSB3720-FIT"
>> +       },
>> +};
>> +
>> +u8 num_image_type_guids = ARRAY_SIZE(fw_images);
>> +#endif /* EFI_HAVE_CAPSULE_SUPPORT */
>> +
>> +
>>  int board_early_init_f(void)
>>  {
>>         struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
>> diff --git a/board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c b/board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c
>> index 7e2d88f449..ec73d75db3 100644
>> --- a/board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c
>> +++ b/board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c
>> @@ -5,6 +5,8 @@
>>   */
>>
>>  #include <common.h>
>> +#include <efi.h>
>> +#include <efi_loader.h>
>>  #include <env.h>
>>  #include <extension_board.h>
>>  #include <hang.h>
>> @@ -21,11 +23,27 @@
>>  #include <asm/mach-imx/gpio.h>
>>  #include <asm/mach-imx/mxc_i2c.h>
>>  #include <asm/sections.h>
>> +#include <linux/kernel.h>
>>
>>  #include "ddr/ddr.h"
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
>> +struct efi_fw_images fw_images[] = {
>> +       {
>> +#if defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE)
>> +               .image_type_id = IMX8MM_CL_IOT_GATE_FIT_IMAGE_GUID,
>> +#elif defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE)
>> +               .image_type_id = IMX8MM_CL_IOT_GATE_OPTEE_FIT_IMAGE_GUID,
>> +#endif
>> +               .fw_name = u"IMX8MM-CL-IOT-GATE-FIT",
>> +       },
>> +};
>> +
>> +u8 num_image_type_guids = ARRAY_SIZE(fw_images);
>> +#endif /* EFI_HAVE_CAPSULE_SUPPORT */
>> +
>>  int board_phys_sdram_size(phys_size_t *size)
>>  {
>>         struct lpddr4_tcm_desc *lpddr4_tcm_desc =
>> diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
>> index 16d5a97167..99872ce0b8 100644
>> --- a/board/emulation/qemu-arm/qemu-arm.c
>> +++ b/board/emulation/qemu-arm/qemu-arm.c
>> @@ -6,15 +6,35 @@
>>  #include <common.h>
>>  #include <cpu_func.h>
>>  #include <dm.h>
>> +#include <efi.h>
>> +#include <efi_loader.h>
>> +#include <efi_loader.h>
>
>
> The include is here two times.

Oops. Will fix it in the next version. Thanks.

-sughosh

>
>>  #include <fdtdec.h>
>>  #include <init.h>
>>  #include <log.h>
>>  #include <virtio_types.h>
>>  #include <virtio.h>
>>
>> +#include <linux/kernel.h>
>
>
> [Snip]


More information about the U-Boot mailing list