capsule: board: Add information needed for capsule updates
[platform/kernel/u-boot.git] / board / compulab / imx8mm-cl-iot-gate / imx8mm-cl-iot-gate.c
index 27200f7..e6021a4 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 #include <common.h>
+#include <efi.h>
+#include <efi_loader.h>
 #include <env.h>
 #include <extension_board.h>
 #include <hang.h>
 #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_image fw_images[] = {
+#if defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE)
+       {
+               .image_type_id = IMX8MM_CL_IOT_GATE_FIT_IMAGE_GUID,
+               .fw_name = u"IMX8MM-CL-IOT-GATE-FIT",
+               .image_index = 1,
+       },
+#elif defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE)
+       {
+               .image_type_id = IMX8MM_CL_IOT_GATE_OPTEE_FIT_IMAGE_GUID,
+               .fw_name = u"IMX8MM-CL-IOT-GATE-FIT",
+               .image_index = 1,
+       },
+#endif
+};
+
+struct efi_capsule_update_info update_info = {
+       .dfu_string = "mmc 2=flash-bin raw 0x42 0x1D00 mmcpart 1",
+       .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)
 {
        struct lpddr4_tcm_desc *lpddr4_tcm_desc =