aboutsummaryrefslogtreecommitdiff
path: root/board/sandbox/sandbox.c
diff options
context:
space:
mode:
authorSughosh Ganu2022-04-15 11:29:34 +0530
committerHeinrich Schuchardt2022-04-15 10:43:18 +0200
commit741ef867288bb294039e34ab2287ffe981b05b86 (patch)
tree283cab5cd74fea8b86672de3dc3fdb674117dd17 /board/sandbox/sandbox.c
parent42a2d90cf51acea56bf19006ed5688c93c099ff0 (diff)
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>
Diffstat (limited to 'board/sandbox/sandbox.c')
-rw-r--r--board/sandbox/sandbox.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 5d9a945d64c..28ad6efd136 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