U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH 1/2] bloblist: Introduce BLOBLIST_PRIOR_STAGE options
Date: Thu, 12 Dec 2024 18:34:44 +0200	[thread overview]
Message-ID: <Z1sQpA6eTeh9lbys@hera> (raw)
In-Reply-To: <20241212151142.1562825-1-trini@konsulko.com>

Hi Tom,

On Thu, Dec 12, 2024 at 09:11:41AM -0600, Tom Rini wrote:
> Introduce an option to control if we expect that a prior stage has
> created a bloblist already and thus it is safe to scan the address. We
> need to have this be configurable because we do not (and cannot) know if
> the address at CONFIG_BLOBLIST_ADDR is in regular DRAM or some special
> on-chip memory and so it may or may not be safe to read from this
> address this early.

Yes this patch makes instead of making the OF_SEPARATE implicitly take
priority

>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  common/Kconfig | 32 ++++++++++++++++++++++++++++++++
>  lib/fdtdec.c   | 11 +++--------
>  2 files changed, 35 insertions(+), 8 deletions(-)
>
> diff --git a/common/Kconfig b/common/Kconfig
> index e8d89bf6eb9d..e8febad0f212 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1077,6 +1077,14 @@ config BLOBLIST_SIZE
>  	  is set up in the first part of U-Boot to run (TPL, SPL or U-Boot
>  	  proper), and this sane bloblist is used for subsequent phases.
>
> +config BLOBLIST_PRIOR_STAGE
> +	bool "Bloblist was created in a stage prior to U-Boot"
> +	default y
> +	depends on BLOBLIST_FIXED
> +	help
> +	  Select this if the bloblist at CONFIG_BLOBLIST_ADDR was created
> +	  before U-Boot is started.
> +
>  config BLOBLIST_SIZE_RELOC
>  	hex "Size of bloblist after relocation"
>  	default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
> @@ -1117,6 +1125,14 @@ config SPL_BLOBLIST_ALLOC
>
>  endchoice
>
> +config SPL_BLOBLIST_PRIOR_STAGE
> +	bool "Bloblist was created in a stage prior to SPL"
> +	default y
> +	depends on SPL_BLOBLIST_FIXED
> +	help
> +	  Select this if the bloblist at CONFIG_BLOBLIST_ADDR was created before
> +	  U-Boot SPL is started.
> +
>  endif # SPL_BLOBLIST
>
>  if TPL_BLOBLIST
> @@ -1146,6 +1162,14 @@ config TPL_BLOBLIST_ALLOC
>
>  endchoice
>
> +config TPL_BLOBLIST_PRIOR_STAGE
> +	bool "Bloblist was created in a stage prior to TPL"
> +	default y
> +	depends on TPL_BLOBLIST_FIXED
> +	help
> +	  Select this if the bloblist at CONFIG_BLOBLIST_ADDR was created before
> +	  U-Boot TPL is started.
> +
>  endif # TPL_BLOBLIST
>
>  if VPL_BLOBLIST
> @@ -1175,6 +1199,14 @@ config VPL_BLOBLIST_ALLOC
>
>  endchoice
>
> +config VPL_BLOBLIST_PRIOR_STAGE
> +	bool "Bloblist was created in a stage prior to VPL"
> +	default y
> +	depends on VPL_BLOBLIST_FIXED
> +	help
> +	  Select this if the bloblist at CONFIG_BLOBLIST_ADDR was created before
> +	  U-Boot VPL is started.
> +
>  endif # VPL_BLOBLIST
>
>  endmenu
> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> index b06559880296..29bddab4150c 100644
> --- a/lib/fdtdec.c
> +++ b/lib/fdtdec.c
> @@ -1669,15 +1669,10 @@ int fdtdec_setup(void)
>  	int ret = -ENOENT;
>
>  	/*
> -	 * If allowing a bloblist, check that first. There was discussion about
> -	 * adding an OF_BLOBLIST Kconfig, but this was rejected.
> -	 *
> -	 * The necessary test is whether the previous phase passed a bloblist,
> -	 * not whether this phase creates one.
> +	 * Only scan for a bloblist and then if that bloblist contains a device
> +	 * tree if we have been configured to expect one.
>  	 */
> -	if (CONFIG_IS_ENABLED(BLOBLIST) &&
> -	    (xpl_prev_phase() != PHASE_TPL ||
> -	     !IS_ENABLED(CONFIG_TPL_BLOBLIST))) {
> +	if (CONFIG_IS_ENABLED(BLOBLIST_PRIOR_STAGE)) {

Without wider context I am not sure but if that check can fold in
bloblist_maybe_init() and return -X if the config isn't enabled, it's going
to be easier to read

Thanks
/Ilias
>  		ret = bloblist_maybe_init();
>  		if (!ret) {
>  			gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
> --
> 2.43.0
>

  parent reply	other threads:[~2024-12-12 16:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 15:11 [PATCH 1/2] bloblist: Introduce BLOBLIST_PRIOR_STAGE options Tom Rini
2024-12-12 15:11 ` [PATCH 2/2] bloblist: Disable CONFIG_SPL_BLOBLIST_PRIOR_STAGE on some platforms Tom Rini
2024-12-12 16:31   ` Ilias Apalodimas
2024-12-12 16:34 ` Ilias Apalodimas [this message]
2024-12-12 17:02   ` [PATCH 1/2] bloblist: Introduce BLOBLIST_PRIOR_STAGE options Tom Rini
2024-12-12 17:08     ` Ilias Apalodimas
2024-12-12 17:27       ` Tom Rini
2024-12-12 17:28         ` Ilias Apalodimas
2024-12-13  3:38           ` Simon Glass
2024-12-13 14:03             ` Tom Rini
2024-12-13 14:15               ` Simon Glass
2024-12-13 14:28                 ` Tom Rini
2024-12-13 14:32 ` Simon Glass
2024-12-13 17:07   ` Tom Rini
2024-12-16  0:25     ` Simon Glass
2024-12-17  4:00       ` Tom Rini
2024-12-17 19:45         ` Simon Glass
2024-12-17 20:15           ` Tom Rini
2024-12-17 23:42             ` Simon Glass
2024-12-18  0:18               ` Tom Rini
2024-12-18  1:46                 ` Simon Glass

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=Z1sQpA6eTeh9lbys@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.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