[PATCH 5/9] fdt: Correct condition for bloblist existing

Simon Glass sjg at chromium.org
Mon Jun 10 17:54:02 CEST 2024


Hi Ilias,

On Tue, 4 Jun 2024 at 23:33, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Hi Simon,
>
> On Wed, 5 Jun 2024 at 06:26, Simon Glass <sjg at chromium.org> wrote:
> >
> > On some boards, the bloblist is created in SPL once SDRAM is ready. It
> > cannot be accessed until that point, so is not available early in SPL.
> >
> > Add a condition to avoid a hang in this case.
> >
> > This fixes a hang in chromebook_coral
> >
> > Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist")
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> >  lib/fdtdec.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> > index b2c59ab3818..b141244e3b9 100644
> > --- a/lib/fdtdec.c
> > +++ b/lib/fdtdec.c
> > @@ -1669,8 +1669,16 @@ int fdtdec_setup(void)
> >  {
> >         int ret = -ENOENT;
> >
> > -       /* If allowing a bloblist, check that first */
> > -       if (CONFIG_IS_ENABLED(BLOBLIST)) {
> > +       /*
> > +        * If allowing a bloblist, check that first. This would be better
> > +        * handled with an OF_BLOBLIST Kconfig, but that caused far too much
> > +        * argument, so add a hack here, used e.g. by chromebook_coral
> > +        * The necessary test is whether the previous stage passed a bloblist,
> > +        * not whether this one creates one.
> > +        */
> > +       if (CONFIG_IS_ENABLED(OF_BLOBLIST) &&
> > +           (spl_prev_phase() != PHASE_TPL ||
> > +            !IS_ENABLED(CONFIG_TPL_BLOBLIST))) {
>
> The same condition exists in common/bloblist.c.
> Carve out a function --e.g
>
> bool can can_enable_bloblist(void)
>      return ....
>
> instead of open coding that

Unfortunately it looks like the conditions are different, with the one
you mention being:

if (spl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST))
from_addr = false;

(is that the one you mean?)

So I don't think I can combine them into a helper function.

Regards,
Simon


More information about the U-Boot mailing list