[PATCH v6] fdt: Allow the devicetree to come from a bloblist

Tom Rini trini at konsulko.com
Thu Dec 28 22:24:29 CET 2023


On Thu, Dec 28, 2023 at 07:47:25PM +0000, Simon Glass wrote:

> Standard passage provides for a bloblist to be passed from one firmware
> phase to the next. That can be used to pass the devicetree along as well.
> Add an option to support this.
> 
> Tests for this will be added as part of the Universal Payload work.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
[snip]
> diff --git a/dts/Kconfig b/dts/Kconfig
> index 00c0aeff893..ae451b9caf7 100644
> --- a/dts/Kconfig
> +++ b/dts/Kconfig
> @@ -105,6 +105,19 @@ config OF_EMBED
>  
>  endchoice
>  
> +config OF_BLOBLIST
> +	bool "Provided by a bloblist at runtime"
> +	depends on BLOBLIST && OF_SEPARATE

This is now even more confusing, frankly. The help for OF_SEPARATE says:
If this option is enabled, the device tree will be built and placed as a
separate u-boot.dtb file alongside the U-Boot image.

So why would you enable that to then have a device tree passed via
bloblist instead?

We should probably start by fixing all of this confusing naming / logic
and then correct things such that:
- OF_EMBED wins if set. This is the override-has-been-set we-must-use-it
  switch. First choice, not last choice. If binman needs tweaks so that
  it will still generate images for platforms in this case, that needs
  to happen.
- If we have a bloblist, we scan the bloblist for DT and if found, use
  it.
- If it looks like we've been booted as a fake Linux kernel, and we can
  start with just aarch64 and let riscv come in as a follow up, so
  what's documented within
  https://www.kernel.org/doc/html/latest/arch/arm64/booting.html#call-the-kernel-image
  then we use that device tree.
  - This _may_ just end up having to be "Does x0 (or similar) point to a
    valid DT?" as I don't know how correct everything using this method
    today is too what the spec above lists.
- If we have a dtb appended to use by what we call today OF_SEPARATE but
  should really stop calling it that we use that.

At that point, we can probably have zero "totally board specific kludge
for device tree location", and kill off OF_HAS_PRIOR_STAGE too (since
that's really just bloblist or fake-linux-kernel). We'll also be able to
support migration from fake-linux-kernel to bloblist

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231228/b8a1cdb4/attachment.sig>


More information about the U-Boot mailing list