[RFC PATCH 1/4] efidebug: capsule: Add a command to update capsule on disk
Heinrich Schuchardt
xypron.glpk at gmx.de
Mon Mar 23 12:50:06 CET 2020
On 3/23/20 8:11 AM, Sughosh Ganu wrote:
> Add a efidebug subcommand to initiate a firmware update using the efi
> firmware management protocol(fmp) set_image routine.
>
> The firmware update can be initiated through
>
> 'efidebug capsule disk-update'
>
> This would locate the efi capsule file on the efi system partition,
> and call the platform's set_image fmp routine to initiate the firmware
> update.
Hello Sughosh,
why do we need this command? Shouldn't a simple reset do the job?
See chapter 8.5.5 "Delivery of Capsules via file on Mass Storage device"
of UEFI spec 2.8.
What might be of interest is a command to start a capsule from a memory
location. This would allow to load capsules from other locations than
directory \EFI\UpdateCapsule.
Best regards
Heinrich
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> ---
> cmd/efidebug.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> index 4a7661d0ac..fd8366dc90 100644
> --- a/cmd/efidebug.c
> +++ b/cmd/efidebug.c
> @@ -77,6 +77,16 @@ static int do_efi_capsule_update(cmd_tbl_t *cmdtp, int flag,
> return CMD_RET_SUCCESS;
> }
>
> +static int do_efi_capsule_on_disk_update(cmd_tbl_t *cmdtp, int flag,
> + int argc, char * const argv[])
> +{
> + efi_status_t ret;
> +
> + ret = efi_launch_capsules();
> +
> + return ret == EFI_SUCCESS ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
> +}
> +
> /**
> * do_efi_capsule_show() - show capsule information
> *
> @@ -205,6 +215,8 @@ static cmd_tbl_t cmd_efidebug_capsule_sub[] = {
> "", ""),
> U_BOOT_CMD_MKENT(show, CONFIG_SYS_MAXARGS, 1, do_efi_capsule_show,
> "", ""),
> + U_BOOT_CMD_MKENT(disk-update, 0, 0, do_efi_capsule_on_disk_update,
> + "", ""),
> U_BOOT_CMD_MKENT(result, CONFIG_SYS_MAXARGS, 1, do_efi_capsule_res,
> "", ""),
> };
> @@ -1387,6 +1399,8 @@ static char efidebug_help_text[] =
> #ifdef CONFIG_EFI_CAPSULE_UPDATE
> "efidebug capsule update [-v] <capsule address>\n"
> " - process a capsule\n"
> + "efidebug capsule disk-update\n"
> + " - update a capsule from disk\n"
> "efidebug capsule show <capsule address>\n"
> " - show capsule information\n"
> "efidebug capsule result [<capsule result var>]\n"
>
More information about the U-Boot
mailing list