On Sat, Jan 28, 2023 at 06:27:15PM -0700, Simon Glass wrote:
> For EFI, the distro boot scripts search in three different directories
> for the .dtb file. The SOC-based filename fallback is supported only for
> 32-bit ARM.
> 
> Adjust the code to mirror this behaviour.
> 
> Also some boards can use a prior-stage FDT if one is not found in the
> normal way. Support this and show a warning in that case.
> 
> Signed-off-by: Simon Glass <s...@chromium.org>
> Suggested-by: Mark Kettenis <kette...@openbsd.org>
> ---
> 
> Changes in v2:
> - Allow use of the prior-stage FDT if nothing else is found
> - Warn about using a prior-stage FDT
> 
>  boot/bootflow.c     |  3 ++
>  boot/bootmeth_efi.c | 70 +++++++++++++++++++++++++++++++++++++++------
>  include/bootflow.h  | 14 +++++++++
>  3 files changed, 78 insertions(+), 9 deletions(-)
> 
> diff --git a/boot/bootflow.c b/boot/bootflow.c
> index 4999018e36e..5ee12eb2bab 100644
> --- a/boot/bootflow.c
> +++ b/boot/bootflow.c
> @@ -463,6 +463,9 @@ int bootflow_run_boot(struct bootflow_iter *iter, struct 
> bootflow *bflow)
>  
>       printf("** Booting bootflow '%s' with %s\n", bflow->name,
>              bflow->method->name);
> +     if (IS_ENABLED(CONFIG_OF_HAS_PRIOR_STAGE) &&
> +         (bflow->flags & BOOTFLOWF_USE_PRIOR_FDT))
> +             printf("** Warning: Using prior-stage device tree\n");

It should not be a warning. It should just be a statement. It's not an
inherent failure or problem, but it is something the user should be
aware of as it may be unexpected. Or simply because they should be just
as aware here as when it's loaded from $file at $location. A huge
general stumbling block when working on custom / new hardware is "did
the device tree I want really get used?" so being clear where the one
being used is from is important.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to