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 <sughosh.ganu@linaro.org>
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 5d9a945..28ad6ef 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -7,6 +7,8 @@
 #include <cpu_func.h>
 #include <cros_ec.h>
 #include <dm.h>
+#include <efi.h>
+#include <efi_loader.h>
 #include <env_internal.h>
 #include <init.h>
 #include <led.h>
@@ -14,6 +16,7 @@
 #include <asm/global_data.h>
 #include <asm/test.h>
 #include <asm/u-boot-sandbox.h>
+#include <linux/kernel.h>
 #include <malloc.h>
 
 #include <extension_board.h>
@@ -25,6 +28,37 @@
  */
 gd_t *gd;
 
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+#if defined(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)
+	{
+		.image_type_id = SANDBOX_UBOOT_IMAGE_GUID,
+		.fw_name = u"SANDBOX-UBOOT",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = SANDBOX_UBOOT_ENV_IMAGE_GUID,
+		.fw_name = u"SANDBOX-UBOOT-ENV",
+		.image_index = 2,
+	},
+#elif defined(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)
+	{
+		.image_type_id = SANDBOX_FIT_IMAGE_GUID,
+		.fw_name = u"SANDBOX-FIT",
+		.image_index = 1,
+	},
+#endif
+};
+
+struct efi_capsule_update_info update_info = {
+	.dfu_string = "sf 0:0=u-boot-bin raw 0x100000 0x50000;"
+		"u-boot-env raw 0x150000 0x200000",
+	.images = fw_images,
+};
+
+u8 num_image_type_guids = ARRAY_SIZE(fw_images);
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
 /*
  * Add a simple GPIO device (don't use with of-platdata as it interferes with