From 741ef867288bb294039e34ab2287ffe981b05b86 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Fri, 15 Apr 2022 11:29:34 +0530 Subject: capsule: board: Add information needed for capsule updates Add a structure which defines the information that is needed for executing capsule updates on a platform. Some information in the structure like the dfu string is used for making the update process more robust while some information like the per platform image GUIDs is used for fixing issues. Initialise this structure in the board file, and use the information for the capsule updates. Signed-off-by: Sughosh Ganu --- board/kontron/pitx_imx8m/pitx_imx8m.c | 21 ++++++++++++++++++++- board/kontron/sl-mx8mm/sl-mx8mm.c | 20 ++++++++++++++++++++ board/kontron/sl28/sl28.c | 21 +++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) (limited to 'board/kontron') diff --git a/board/kontron/pitx_imx8m/pitx_imx8m.c b/board/kontron/pitx_imx8m/pitx_imx8m.c index d655fe099b..d974af8da1 100644 --- a/board/kontron/pitx_imx8m/pitx_imx8m.c +++ b/board/kontron/pitx_imx8m/pitx_imx8m.c @@ -2,6 +2,8 @@ #include "pitx_misc.h" #include +#include +#include #include #include #include @@ -12,7 +14,7 @@ #include #include #include - +#include DECLARE_GLOBAL_DATA_PTR; @@ -30,6 +32,23 @@ static iomux_v3_cfg_t const uart_pads[] = { IMX8MQ_PAD_ECSPI1_MISO__UART3_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), }; +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = KONTRON_PITX_IMX8M_FIT_IMAGE_GUID, + .fw_name = u"KONTRON-PITX-IMX8M-UBOOT", + .image_index = 1, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "mmc 0=flash-bin raw 0x42 0x1000 mmcpart 1", + .images = fw_images, +}; + +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/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index 48376cb826..fea9327837 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -6,12 +6,32 @@ #include #include #include +#include +#include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = KONTRON_SL_MX8MM_FIT_IMAGE_GUID, + .fw_name = u"KONTROL-SL-MX8MM-UBOOT", + .image_index = 1, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=flash-bin raw 0x400 0x1f0000", + .images = fw_images, +}; + +u8 num_image_type_guids = ARRAY_SIZE(fw_images); +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_phys_sdram_size(phys_size_t *size) { u32 ddr_size = readl(M4_BOOTROM_BASE_ADDR); diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c index 17bb457736..32e9694b77 100644 --- a/board/kontron/sl28/sl28.c +++ b/board/kontron/sl28/sl28.c @@ -3,11 +3,14 @@ #include #include #include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -23,6 +26,24 @@ DECLARE_GLOBAL_DATA_PTR; +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[] = { + { + .image_type_id = KONTRON_SL28_FIT_IMAGE_GUID, + .fw_name = u"KONTRON-SL28-FIT", + .image_index = 1, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=u-boot-bin raw 0x210000 0x1d0000;" + "u-boot-env raw 0x3e0000 0x20000", + .images = fw_images, +}; + +u8 num_image_type_guids = ARRAY_SIZE(fw_images); +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_early_init_f(void) { fsl_lsch3_early_init_f(); -- cgit v1.2.3