public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: u-boot@lists.denx.de, trini@konsulko.com, sjg@chromium.org,
	ilias.apalodimas@linaro.org
Subject: Re: [PATCH v2 03/12] cmd: bootefi: carve out EFI boot manager interface
Date: Tue, 21 Nov 2023 04:38:12 +0100	[thread overview]
Message-ID: <fffc514b-a986-482c-a468-6d52598a046e@gmx.de> (raw)
In-Reply-To: <20231121012950.156539-4-takahiro.akashi@linaro.org>

On 11/21/23 02:29, AKASHI Takahiro wrote:
> Carve EFI boot manager related code out of do_bootefi_image() in order
> to move boot manager specific code into library directory in the later
> commit.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>   cmd/bootefi.c | 43 ++++++++++++++++++++++++-------------------
>   1 file changed, 24 insertions(+), 19 deletions(-)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index e9e5ab67a1f5..87910c42333a 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -413,28 +413,40 @@ out:
>   }
>
>   /**
> - * do_efibootmgr() - execute EFI boot manager
> + * efi_bootmgr_run() - execute EFI boot manager
> + * fdt:	Flat device tree
> + *
> + * Invoke EFI boot manager and execute a binary depending on
> + * boot options. If @fdt is not NULL, it will be passed to
> + * the executed binary.

How about the fallback to the control device-tree?
How about booting with ACPI?

Best regards

Heinrich

>    *
>    * Return:	status code
>    */
> -static int do_efibootmgr(void)
> +static efi_status_t efi_bootmgr_run(void *fdt)
>   {
>   	efi_handle_t handle;
> -	efi_status_t ret;
>   	void *load_options;
> +	efi_status_t ret;
>
> -	ret = efi_bootmgr_load(&handle, &load_options);
> +	/* Initialize EFI drivers */
> +	ret = efi_init_obj_list();
>   	if (ret != EFI_SUCCESS) {
> -		log_notice("EFI boot manager: Cannot load any image\n");
> +		log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n",
> +			ret & ~EFI_ERROR_MASK);
>   		return CMD_RET_FAILURE;
>   	}
>
> -	ret = do_bootefi_exec(handle, load_options);
> -
> +	ret = efi_install_fdt(fdt);
>   	if (ret != EFI_SUCCESS)
> -		return CMD_RET_FAILURE;
> +		return ret;
>
> -	return CMD_RET_SUCCESS;
> +	ret = efi_bootmgr_load(&handle, &load_options);
> +	if (ret != EFI_SUCCESS) {
> +		log_notice("EFI boot manager: Cannot load any image\n");
> +		return ret;
> +	}
> +
> +	return do_bootefi_exec(handle, load_options);
>   }
>
>   /**
> @@ -624,21 +636,14 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
>
>   	if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) &&
>   	    !strcmp(argv[1], "bootmgr")) {
> -		/* Initialize EFI drivers */
> -		ret = efi_init_obj_list();
> -		if (ret != EFI_SUCCESS) {
> -			log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n",
> -				ret & ~EFI_ERROR_MASK);
> -			return CMD_RET_FAILURE;
> -		}
> +		ret = efi_bootmgr_run(fdt);
>
> -		ret = efi_install_fdt(fdt);
>   		if (ret == EFI_INVALID_PARAMETER)
>   			return CMD_RET_USAGE;
> -		else if (ret != EFI_SUCCESS)
> +		else if (ret)
>   			return CMD_RET_FAILURE;
>
> -		return do_efibootmgr();
> +		return CMD_RET_SUCCESS;
>   	}
>
>   	if (IS_ENABLED(CONFIG_CMD_BOOTEFI_SELFTEST) &&


  reply	other threads:[~2023-11-21  3:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  1:29 [PATCH v2 00/12] cmd: bootefi: refactor the code for bootmgr AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 01/12] cmd: bootefi: unfold do_bootefi_image() AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 02/12] cmd: bootefi: re-organize do_bootefi() AKASHI Takahiro
2023-11-21  3:31   ` Heinrich Schuchardt
2023-11-21  4:53     ` AKASHI Takahiro
2023-12-05  8:54       ` Ilias Apalodimas
2023-12-05  9:24         ` AKASHI Takahiro
2023-12-08  6:33           ` Ilias Apalodimas
2023-12-08  7:49             ` AKASHI Takahiro
2023-12-17 12:00   ` Heinrich Schuchardt
2023-12-17 12:03     ` Heinrich Schuchardt
2023-11-21  1:29 ` [PATCH v2 03/12] cmd: bootefi: carve out EFI boot manager interface AKASHI Takahiro
2023-11-21  3:38   ` Heinrich Schuchardt [this message]
2023-11-21  5:00     ` AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 04/12] cmd: bootefi: carve out binary execution interface AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 05/12] cmd: bootefi: localize global device paths for efi_selftest AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 06/12] cmd: bootefi: move library interfaces under lib/efi_loader AKASHI Takahiro
2023-12-17 10:49   ` Heinrich Schuchardt
2023-12-17 11:51   ` Heinrich Schuchardt
2023-11-21  1:29 ` [PATCH v2 07/12] cmd: efidebug: ease efi configuration dependency AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 08/12] bootmeth: use efi_loader interfaces instead of bootefi command AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 09/12] efi_loader: split unrelated code from efi_bootmgr.c AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 10/12] efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 11/12] net: tftp: remove explicit efi configuration dependency AKASHI Takahiro
2023-11-21  1:29 ` [PATCH v2 12/12] fs: " AKASHI Takahiro
2023-12-04  1:58 ` [PATCH v2 00/12] cmd: bootefi: refactor the code for bootmgr AKASHI Takahiro
2023-12-04  6:16   ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fffc514b-a986-482c-a468-6d52598a046e@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox