[PATCH 2/4] fdt: Introduce OF_BLOBLIST
Simon Glass
sjg at chromium.org
Thu Apr 3 19:57:38 CEST 2025
Hi Raymond,
On Fri, 4 Apr 2025 at 04:34, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Hi Simon,
>
> On Fri, 28 Mar 2025 at 11:44, Simon Glass <sjg at chromium.org> wrote:
> >
> > Add an option which indicates that the devicetree comes from the
> > bloblist.
> >
> > After discussions with Tom, it seems we are comfortable with introducing
> > this option, ensuring of course that the transfer list is properly
> > supported.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > doc/develop/devicetree/control.rst | 3 ++
> > dts/Kconfig | 8 ++++
> > lib/fdtdec.c | 66 ++++++++++++------------------
> > 3 files changed, 38 insertions(+), 39 deletions(-)
> >
> > diff --git a/doc/develop/devicetree/control.rst b/doc/develop/devicetree/control.rst
> > index 0233945f8b6..d80f4d420a9 100644
> > --- a/doc/develop/devicetree/control.rst
> > +++ b/doc/develop/devicetree/control.rst
> > @@ -137,6 +137,9 @@ If `OF_BOARD` is selected by Kconfig, a board-specific routine will provide the
> > devicetree at runtime, for example if an earlier bootloader stage creates
> > it and passes it to U-Boot.
> >
> > +If `OF_BLOBLIST` is defined, the devicetree comes from a bloblist passed
> > +from a previous stage.
> > +
> > If `BLOBLIST` is selected by Kconfig, the devicetree may come from a bloblist
> > passed from a previous stage, if present.
> >
> > diff --git a/dts/Kconfig b/dts/Kconfig
> > index 6a5141b56e9..04359a4d7b2 100644
> > --- a/dts/Kconfig
> > +++ b/dts/Kconfig
> > @@ -167,6 +167,14 @@ config OF_INITIAL_DTB_READONLY
> > If initial DTB for DT control is read-only (e.g. points to
> > memory-mapped flash memory), then set this option.
> >
> > +config OF_BLOBLIST
> > + bool "DTB is provided by a bloblist"
> > + help
> > + Select this to read the devicetree from the bloblist. This allows
> > + using a bloblist to transfer the devicetree between U-Boot phases.
> > + The devicetree is stored in the bloblist by an earlier phase so that
> > + U-Boot can read it.
> > +
> > config OF_BOARD
> > bool "Provided by the board (e.g a previous loader) at runtime"
> > default y if SANDBOX || OF_HAS_PRIOR_STAGE
> > diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> > index f09c9926a7a..833f8aca3ce 100644
> > --- a/lib/fdtdec.c
> > +++ b/lib/fdtdec.c
> > @@ -1689,55 +1689,43 @@ void fdtdec_setup_embed(void)
> >
> > int fdtdec_setup(void)
>
> I think a better idea is to use BLOBLIST_PASSAGE_MANDATORY, see below
> pseudo code:
>
> ```
> if (IS_ENABLED(CONFIG_OF_BOARD)) {
> /* get fdt from board */
> }
>
> /* allow fdtcontroladdr to override it */
>
> if (CONFIG_IS_ENABLED(BLOBLIST) && ... ) {
> /* try to find fdt from bloblist */
>
> if (CONFIG_IS_ENABLED(BLOBLIST_PASSAGE_MANDATORY) {
> if (no_fdt_in_bloblist)
> return ERROR;
>
> /* override fdt with the one from bloblist */
> }
> }
> ```
See my other email on this. With OF_BLOBLIST we actually don't need
BLOBLIST_PASSAGE_MANDATORY so we can drop it.
Regards,
Simon
More information about the U-Boot
mailing list