[PATCH 1/7] lib/fdtdec.c: Disallow overriding the fdt address with mandatory passage
Tom Rini
trini at konsulko.com
Wed Jul 8 19:00:55 CEST 2026
On Wed, Jul 08, 2026 at 10:32:04AM -0600, Tom Rini wrote:
> On Wed, Jul 08, 2026 at 12:26:04PM -0400, Raymond Mao wrote:
> > Hi Tom,
> >
> > On Tue, Jul 7, 2026 at 9:30 PM Tom Rini <trini at konsulko.com> wrote:
> > >
> > > When we have CONFIG_BLOBLIST_PASSAGE_MANDATORY don't allow the device
> > > tree address to be overridden. The device tree we're given is the one
> > > that must be used.
> > >
> >
> > The commit message does not explicitly mention this is only for
> > OF_BOARD. So I think we need to add
> > "!IS_ENABLED(CONFIG_BLOBLIST_PASSAGE_MANDATORY)" to the next check as
> > well:
> >
> > /* Allow the early environment to override the fdt address */
> > - if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
> > + if (!IS_ENABLED(CONFIG_XPL_BUILD) &&
> > + !IS_ENABLED(CONFIG_BLOBLIST_PASSAGE_MANDATORY)) {
> > ulong addr;
> >
> > Or, state in the commit message that it is for OF_BOARD only.
> >
> > Regards,
> > Raymond
> >
> >
> > > Signed-off-by: Tom Rini <trini at konsulko.com>
> > > ---
> > > Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> > > Cc: Raymond Mao <raymondmaoca at gmail.com>
> > > ---
> > > lib/fdtdec.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> > > index b91e067106dd..ecb22a58b964 100644
> > > --- a/lib/fdtdec.c
> > > +++ b/lib/fdtdec.c
> > > @@ -1856,7 +1856,8 @@ int fdtdec_setup(void)
> > > }
> > >
> > > /* Allow the board to override the fdt address. */
> > > - if (IS_ENABLED(CONFIG_OF_BOARD)) {
> > > + if (IS_ENABLED(CONFIG_OF_BOARD) &&
> > > + !IS_ENABLED(CONFIG_BLOBLIST_PASSAGE_MANDATORY)) {
> > > void *blob;
> > >
> > > blob = (void *)gd->fdt_blob;
>
> I might have to jump back to what the code looked like in January or so,
> to figure this out again. We never set OF_BOARD and
> BLOBLIST_PASSAGE_MANDATORY so this change here never matters. It might
> have been because I was doing this on top of the (now merged) rework of
> bloblist_init and bloblist_maybe_init. I'll look harder at this and post
> a v2, thanks!
I see now why I did this, and because vexpress64_fvp_bloblist fails to
build because it does enable OF_BOARD. So, there's two distinct problems
here. One of which is that CONFIG_BLOBLIST_PASSAGE_MANDATORY can be,
well, not mandatory in a few cases, and that's not intentional. With
that fixed, we can then do what the rest of this series does, and fix
OF_OMIT_DTB behavior. And then patch #2 that cleans up vexpress64 is
also standalone.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260708/2ac8fed7/attachment-0001.sig>
More information about the U-Boot
mailing list