aboutsummaryrefslogtreecommitdiff
path: root/board/xilinx
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2022-04-15 11:29:34 +0530
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-04-15 10:43:18 +0200
commit741ef867288bb294039e34ab2287ffe981b05b86 (patch)
tree283cab5cd74fea8b86672de3dc3fdb674117dd17 /board/xilinx
parent42a2d90cf51acea56bf19006ed5688c93c099ff0 (diff)
downloadu-boot-741ef867288bb294039e34ab2287ffe981b05b86.zip
u-boot-741ef867288bb294039e34ab2287ffe981b05b86.tar.gz
u-boot-741ef867288bb294039e34ab2287ffe981b05b86.tar.bz2
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 0769189..5be3090 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 26ef048..63aff04 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 e7e8e91..41ecc95 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));