[PATCH v2 21/30] xpl: Rename u_boot_first_phase to xpl_is_first_phase()

Simon Glass sjg at chromium.org
Sun Sep 29 13:47:41 CEST 2024


Hi Jonas,

On Sat, 28 Sept 2024 at 16:23, Jonas Karlman <jonas at kwiboo.se> wrote:
>
> Hi Simon,
>
> On 2024-09-28 22:00, Simon Glass wrote:
> > This is a better name for this function, so update it.
> >
> > Tidy up the function comment to mention VPL. Use SPL_BUILD in the SPL
> > check, for clarity.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > (no changes since v1)
> >
> >  arch/arm/mach-omap2/am33xx/board.c |  2 +-
> >  common/bloblist.c                  |  4 ++--
> >  common/spl/spl.c                   |  4 ++--
> >  include/spl.h                      | 16 +++++++++-------
> >  4 files changed, 14 insertions(+), 12 deletions(-)
> >
>
> [snip]
>
> > --- a/include/spl.h
> > +++ b/include/spl.h
> > @@ -34,24 +34,26 @@ struct spl_boot_device;
> >  enum boot_device;
> >
> >  /*
> > - * u_boot_first_phase() - check if this is the first U-Boot phase
> > + * xpl_is_first_phase() - check if this is the first U-Boot phase
> >   *
> > - * U-Boot has up to three phases: TPL, SPL and U-Boot proper. Depending on the
> > - * build flags we can determine whether the current build is for the first
> > + * U-Boot has up to four phases: TPL, VPL, SPL and U-Boot proper. Depending on
> > + * the build flags we can determine whether the current build is for the first
> >   * phase of U-Boot or not. If there is no SPL, then this is U-Boot proper. If
> >   * there is SPL but no TPL, the the first phase is SPL. If there is TPL, then
> > - * it is the first phase.
> > + * it is the first phase, etc.
> >   *
> > - * @returns true if this is the first phase of U-Boot
> > + * Note that VPL can never be the first phase. If it exists, it is loaded from
> > + * TPL
> >   *
> > + * Return: true if this is the first phase of U-Boot
> >   */
> > -static inline bool u_boot_first_phase(void)
> > +static inline bool xpl_is_first_phase(void)
> >  {
> >       if (IS_ENABLED(CONFIG_TPL)) {
> >               if (IS_ENABLED(CONFIG_TPL_BUILD))
> >                       return true;
> >       } else if (IS_ENABLED(CONFIG_SPL)) {
> > -             if (IS_ENABLED(CONFIG_XPL_BUILD))
> > +             if (IS_ENABLED(CONFIG_SPL_BUILD))
>
> Here is another instance where it made no sense to replace SPL with XPL
> to just later restore it back to SPL.

Thanks for taking the time to look through this!

The rename to XPL happens in 'global: Rename SPL_ to XPL_' which is an
earlier patch. That patch renames absolutely everything. If I leave
this particular one as SPL_BUILD, then there will still be occurrences
of SPL_BUILD in U-Boot. So when I later rebase this series I won't
know whether I missed something or not.

I can certainly drop the s/XPL/SPL/ change in this patch though, if
that is suitable?

Regards,
Simon


More information about the U-Boot mailing list