aboutsummaryrefslogtreecommitdiff
path: root/board/xilinx
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/xilinx
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/xilinx')
-rw-r--r--board/xilinx/common/board.c28
-rw-r--r--board/xilinx/zynq/board.c3
-rw-r--r--board/xilinx/zynqmp/zynqmp.c3
3 files changed, 32 insertions, 2 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 0769189dcf2..5be3090c318 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -5,6 +5,8 @@
*/
#include <common.h>
+#include <efi.h>
+#include <efi_loader.h>
#include <env.h>
#include <log.h>
#include <asm/global_data.h>
@@ -20,9 +22,35 @@
#include <generated/dt.h>
#include <soc.h>
#include <linux/ctype.h>
+#include <linux/kernel.h>
#include "fru.h"
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+#if defined(XILINX_BOOT_IMAGE_GUID)
+ {
+ .image_type_id = XILINX_BOOT_IMAGE_GUID,
+ .fw_name = u"XILINX-BOOT",
+ .image_index = 1,
+ },
+#endif
+#if defined(XILINX_UBOOT_IMAGE_GUID)
+ {
+ .image_type_id = XILINX_UBOOT_IMAGE_GUID,
+ .fw_name = u"XILINX-UBOOT",
+ .image_index = 2,
+ },
+#endif
+};
+
+struct efi_capsule_update_info update_info = {
+ .images = fw_images,
+};
+
+u8 num_image_type_guids = ARRAY_SIZE(fw_images);
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
{
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 26ef0488358..63aff0474be 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -168,7 +168,8 @@ void set_dfu_alt_info(char *interface, char *devstr)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
- if (env_get("dfu_alt_info"))
+ if (!CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) &&
+ env_get("dfu_alt_info"))
return;
memset(buf, 0, sizeof(buf));
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index e7e8e91d2cf..41ecc9559c4 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -889,7 +889,8 @@ void set_dfu_alt_info(char *interface, char *devstr)
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
- if (env_get("dfu_alt_info"))
+ if (!CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) &&
+ env_get("dfu_alt_info"))
return;
memset(buf, 0, sizeof(buf));