Hi Simon, On Fri, 28 Mar 2025 at 07:34, Simon Glass <s...@chromium.org> wrote: > > Hi Raymond, > > On Thu, 27 Mar 2025 at 17:13, Raymond Mao <raymond....@linaro.org> wrote: > > > > When a bloblist is valid and contains fdt, it explicitly means > > a previous boot stage is passing transfer list compliant with > > Firmware Handoff specification, thus the fdt from bloblist should > > not be overridden with the ones from board or env variables. > > Why is that? The board can choose to override it, if it wishes, but in > general, if gd->fdt_blob is already set up, it should return -EEXIST > from board_fdt_blob_setup(). > First, if a board is running in a "stand-alone" mode, there should not be a transfer list passed from the previous boot stage. Secondly, overriding the transfer list with the env variables does not make sense, since booti, bootm and bootefi are actually using the env variables to get the fdt when launching to the kernel. We need to do the opposite way - override the env variable with the one pointing to the bloblist fdt (See my patch [2/2]), then all boot commands can work with the transfer list.
Regards, Raymond > > > > Fixes: 70fe23859437 ("fdt: Allow the devicetree to come from a bloblist") > > Signed-off-by: Raymond Mao <raymond....@linaro.org> > > --- > > lib/fdtdec.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/lib/fdtdec.c b/lib/fdtdec.c > > index f09c9926a7a..c38738b48c7 100644 > > --- a/lib/fdtdec.c > > +++ b/lib/fdtdec.c > > @@ -1708,7 +1708,7 @@ int fdtdec_setup(void) > > gd->fdt_src = FDTSRC_BLOBLIST; > > log_debug("Devicetree is in bloblist at > > %p\n", > > gd->fdt_blob); > > - ret = 0; > > + goto setup_fdt; > > } else { > > log_debug("No FDT found in bloblist\n"); > > ret = -ENOENT; > > @@ -1752,6 +1752,7 @@ int fdtdec_setup(void) > > } > > } > > > > +setup_fdt: > > if (CONFIG_IS_ENABLED(MULTI_DTB_FIT)) > > setup_multi_dtb_fit(); > > > > -- > > 2.25.1 > > > > Regards, > Simon