mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 12:54:37 +00:00
board: remove capsule update support in set_dfu_alt_info()
Now that capsule update sets the dfu_alt_info environment variable
explicitly, there is no need to support it in the set_dfu_alt_info()
function. Decouple SET_DFU_ALT_INFO from EFI_CAPSULE_FIRMWARE_FIT and
EFI_CAPSULE_FIRMWARE_RAW. For many boards, this was the only use of
set_dfu_alt_info() so remove the function entirely.
Fixes: a9e6f01a94
("efi: Define set_dfu_alt_info() for boards with UEFI capsule update enabled")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> # for board/libre-computer/*
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de> # for
This commit is contained in:
parent
546152624f
commit
6f7fb8d29f
17 changed files with 15 additions and 104 deletions
|
@ -45,14 +45,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -41,14 +41,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -31,8 +31,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
{
|
{
|
||||||
if (interface && strcmp(interface, "ram") == 0)
|
if (interface && strcmp(interface, "ram") == 0)
|
||||||
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
||||||
else if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
{
|
{
|
||||||
if (interface && strcmp(interface, "ram") == 0)
|
if (interface && strcmp(interface, "ram") == 0)
|
||||||
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
||||||
else if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
{
|
{
|
||||||
if (interface && strcmp(interface, "ram") == 0)
|
if (interface && strcmp(interface, "ram") == 0)
|
||||||
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000");
|
||||||
else if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -82,14 +82,6 @@ static void configure_capsule_updates(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_ENV_IS_IN_FAT) || IS_ENABLED(CONFIG_ENV_IS_IN_MMC)
|
#if IS_ENABLED(CONFIG_ENV_IS_IN_FAT) || IS_ENABLED(CONFIG_ENV_IS_IN_MMC)
|
||||||
int mmc_get_env_dev(void)
|
int mmc_get_env_dev(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,14 +41,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -74,14 +74,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -54,14 +54,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -65,14 +65,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -40,14 +40,6 @@ struct efi_capsule_update_info update_info = {
|
||||||
.images = fw_images,
|
.images = fw_images,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,4 +18,7 @@ bool board_detection(void);
|
||||||
char *soc_name_decode(void);
|
char *soc_name_decode(void);
|
||||||
|
|
||||||
bool soc_detection(void);
|
bool soc_detection(void);
|
||||||
|
|
||||||
|
void configure_capsule_updates(void);
|
||||||
|
|
||||||
#endif /* BOARD_XILINX_COMMON_BOARD_H */
|
#endif /* BOARD_XILINX_COMMON_BOARD_H */
|
||||||
|
|
|
@ -281,6 +281,9 @@ int board_late_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
||||||
|
configure_capsule_updates();
|
||||||
|
|
||||||
if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
|
if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
|
||||||
debug("Saved variables - Skipping\n");
|
debug("Saved variables - Skipping\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -357,8 +360,6 @@ enum env_location env_get_location(enum env_operation op, int prio)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
|
|
||||||
#define DFU_ALT_BUF_LEN SZ_1K
|
#define DFU_ALT_BUF_LEN SZ_1K
|
||||||
|
|
||||||
static void mtd_found_part(u32 *base, u32 *size)
|
static void mtd_found_part(u32 *base, u32 *size)
|
||||||
|
@ -386,7 +387,7 @@ static void mtd_found_part(u32 *base, u32 *size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
void configure_capsule_updates(void)
|
||||||
{
|
{
|
||||||
int bootseq = 0, len = 0;
|
int bootseq = 0, len = 0;
|
||||||
u32 multiboot = versal_multi_boot();
|
u32 multiboot = versal_multi_boot();
|
||||||
|
@ -394,9 +395,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
|
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
||||||
|
|
||||||
if (env_get("dfu_alt_info"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
multiboot = env_get_hex("multiboot", multiboot);
|
multiboot = env_get_hex("multiboot", multiboot);
|
||||||
|
@ -437,9 +435,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
env_set("dfu_alt_info", buf);
|
|
||||||
puts("DFU alt info setting: done\n");
|
|
||||||
update_info.dfu_string = strdup(buf);
|
update_info.dfu_string = strdup(buf);
|
||||||
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -53,6 +53,9 @@ int board_late_init(void)
|
||||||
char *new_targets;
|
char *new_targets;
|
||||||
char *env_targets;
|
char *env_targets;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
||||||
|
configure_capsule_updates();
|
||||||
|
|
||||||
if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
|
if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
|
||||||
debug("Saved variables - Skipping\n");
|
debug("Saved variables - Skipping\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -166,17 +169,12 @@ enum env_location env_get_location(enum env_operation op, int prio)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
|
|
||||||
#define DFU_ALT_BUF_LEN SZ_1K
|
#define DFU_ALT_BUF_LEN SZ_1K
|
||||||
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
void configure_capsule_updates(void)
|
||||||
{
|
{
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
||||||
|
|
||||||
if (env_get("dfu_alt_info"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
|
switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
|
||||||
|
@ -200,9 +198,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
env_set("dfu_alt_info", buf);
|
|
||||||
puts("DFU alt info setting: done\n");
|
|
||||||
update_info.dfu_string = strdup(buf);
|
update_info.dfu_string = strdup(buf);
|
||||||
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -527,6 +527,9 @@ int board_late_init(void)
|
||||||
usb_ether_init();
|
usb_ether_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
|
||||||
|
configure_capsule_updates();
|
||||||
|
|
||||||
multiboot = multi_boot();
|
multiboot = multi_boot();
|
||||||
if (multiboot >= 0)
|
if (multiboot >= 0)
|
||||||
env_set_hex("multiboot", multiboot);
|
env_set_hex("multiboot", multiboot);
|
||||||
|
@ -632,8 +635,6 @@ enum env_location env_get_location(enum env_operation op, int prio)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SET_DFU_ALT_INFO)
|
|
||||||
|
|
||||||
#define DFU_ALT_BUF_LEN SZ_1K
|
#define DFU_ALT_BUF_LEN SZ_1K
|
||||||
|
|
||||||
static void mtd_found_part(u32 *base, u32 *size)
|
static void mtd_found_part(u32 *base, u32 *size)
|
||||||
|
@ -661,15 +662,12 @@ static void mtd_found_part(u32 *base, u32 *size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_dfu_alt_info(char *interface, char *devstr)
|
void configure_capsule_updates(void)
|
||||||
{
|
{
|
||||||
int multiboot, bootseq = 0, len = 0;
|
int multiboot, bootseq = 0, len = 0;
|
||||||
|
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
||||||
|
|
||||||
if (env_get("dfu_alt_info"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
multiboot = multi_boot();
|
multiboot = multi_boot();
|
||||||
|
@ -733,12 +731,9 @@ void set_dfu_alt_info(char *interface, char *devstr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
env_set("dfu_alt_info", buf);
|
|
||||||
puts("DFU alt info setting: done\n");
|
|
||||||
update_info.dfu_string = strdup(buf);
|
update_info.dfu_string = strdup(buf);
|
||||||
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
debug("Capsule DFU: %s\n", update_info.dfu_string);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_SPL_SPI_LOAD)
|
#if defined(CONFIG_SPL_SPI_LOAD)
|
||||||
unsigned int spl_spi_get_uboot_offs(struct spi_flash *flash)
|
unsigned int spl_spi_get_uboot_offs(struct spi_flash *flash)
|
||||||
|
|
|
@ -305,7 +305,6 @@ config EFI_CAPSULE_FIRMWARE_FIT
|
||||||
depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT
|
depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT
|
||||||
select UPDATE_FIT
|
select UPDATE_FIT
|
||||||
select DFU
|
select DFU
|
||||||
select SET_DFU_ALT_INFO
|
|
||||||
select EFI_CAPSULE_FIRMWARE
|
select EFI_CAPSULE_FIRMWARE
|
||||||
help
|
help
|
||||||
Select this option if you want to enable firmware management protocol
|
Select this option if you want to enable firmware management protocol
|
||||||
|
@ -317,7 +316,6 @@ config EFI_CAPSULE_FIRMWARE_RAW
|
||||||
depends on SANDBOX || (!SANDBOX && !EFI_CAPSULE_FIRMWARE_FIT)
|
depends on SANDBOX || (!SANDBOX && !EFI_CAPSULE_FIRMWARE_FIT)
|
||||||
select DFU_WRITE_ALT
|
select DFU_WRITE_ALT
|
||||||
select DFU
|
select DFU
|
||||||
select SET_DFU_ALT_INFO
|
|
||||||
select EFI_CAPSULE_FIRMWARE
|
select EFI_CAPSULE_FIRMWARE
|
||||||
help
|
help
|
||||||
Select this option if you want to enable firmware management protocol
|
Select this option if you want to enable firmware management protocol
|
||||||
|
|
|
@ -56,11 +56,6 @@ struct fmp_state {
|
||||||
u32 last_attempt_status; /* not used */
|
u32 last_attempt_status; /* not used */
|
||||||
};
|
};
|
||||||
|
|
||||||
__weak void set_dfu_alt_info(char *interface, char *devstr)
|
|
||||||
{
|
|
||||||
env_set("dfu_alt_info", update_info.dfu_string);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* efi_firmware_get_image_type_id - get image_type_id
|
* efi_firmware_get_image_type_id - get image_type_id
|
||||||
* @image_index: image index
|
* @image_index: image index
|
||||||
|
|
Loading…
Add table
Reference in a new issue