U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Simon Glass <sjg@chromium.org>
Cc: Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	Tom Rini <trini@konsulko.com>,
	Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
	Oliver Gaskell <Oliver.Gaskell@analog.com>,
	Nathan Barrett-Morrison <nathan.morrison@timesys.com>,
	Greg Malysa <greg.malysa@timesys.com>,
	Trevor Woerner <twoerner@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	Marek Vasut <marex@denx.de>, Paul Kocialkowski <contact@paulk.fr>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Lukas Funke <lukas.funke@weidmueller.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] spl: riscv: Disable SPL_BINMAN_UBOOT_SYMBOLS by default
Date: Tue, 8 Apr 2025 16:21:19 +0000	[thread overview]
Message-ID: <Z_VM_5f5-m9SHX51@pie> (raw)
In-Reply-To: <CAFLszTjmabVKuHF8Ym1OENiiBZrSTd2vVjWvHcQkb552qAuhwg@mail.gmail.com>

On Mon, Apr 07, 2025 at 10:50:07PM +1200, Simon Glass wrote:
> Hi Yao,
> 
> On Mon, 7 Apr 2025 at 15:38, Yao Zi <ziyao@disroot.org> wrote:
> >
> > The default binman configuration of RISC-V wraps proper U-Boot into a
> > FIT image instead of shipping a plain image, thus there's no
> > "u_boot_any" entry by default. Let's disable the option to prevent
> > binman from looking for a plain proper U-Boot image, failing the build
> > with message like
> >
> >   Section '/binman/spl-img': Symbol '_binman_u_boot_any_prop_size'
> >      in entry '/binman/spl-img/mkimage/u-boot-spl/u-boot-spl-nodtb':
> >        Entry 'u-boot-any' not found in list (u-boot-spl-nodtb,
> >        u-boot-spl-dtb,u-boot-spl,mkimage,spl-img)
> 
> Do you know where the symbol is being referenced? This sounds like a bug to me.
> 
> It is likely to be spl_get_image_pos(), perhaps called from
> spl_set_header_raw_uboot().

The symbol is referenced in common/spl/spl.c:54,

	#if CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)
	/* See spl.h for information about this */
	#if defined(CONFIG_SPL_BUILD)
	binman_sym_declare(ulong, u_boot_any, image_pos);
	binman_sym_declare(ulong, u_boot_any, size);
	#endif

> If you are using FIT that function should not be called.

The place where binman_sym() is used isn't where an entry in .binman_sym
section is introduced. Instead, binman_sym_declare() actually defines
the entry.

So whether spl_get_image_pos() is invoked doesn't affect the failure,
since in both cases binman_sym_declare() puts an entry into .binman_sym,
confusing binman.

imho SPL_BINMAN_UBOOT_SYMBOLS should depend on !SPL_LOAD_FIT in an ideal
world, but I'm not sure the impact on current codebase thus limited the
change to RISC-V only.

Best regards,
Yao Zi

> >
> > Signed-off-by: Yao Zi <ziyao@disroot.org>
> > ---
> >  common/spl/Kconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index 7d6780936d1..356ddab38de 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -214,6 +214,8 @@ config SPL_BINMAN_UBOOT_SYMBOLS
> >         bool "Declare binman symbols for U-Boot phases in SPL"
> >         depends on SPL_BINMAN_SYMBOLS
> >         default n if ARCH_IMX8M || ARCH_IMX8ULP || ARCH_IMX9
> > +       # A FIT image is created with default binman configuration of RISC-V
> > +       default n if RISCV
> >         default y
> >         help
> >           This enables use of symbols in SPL which refer to U-Boot phases,
> > --
> > 2.49.0
> >
> 
> Regards,
> Simon

  reply	other threads:[~2025-04-08 16:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  3:37 [PATCH 0/2] Fix binman_sym functionality on RISC-V port Yao Zi
2025-04-07  3:37 ` [PATCH 1/2] spl: riscv: Disable SPL_BINMAN_UBOOT_SYMBOLS by default Yao Zi
2025-04-07 10:50   ` Simon Glass
2025-04-08 16:21     ` Yao Zi [this message]
2025-04-07 11:22   ` Jonas Karlman
2025-04-09  4:27     ` Yao Zi
2025-04-07  3:37 ` [PATCH 2/2] riscv: Provide __image_copy_{start_end} symbols in linkerscript Yao Zi
2025-04-07 10:49   ` Simon Glass
2025-04-07 11:10   ` Jonas Karlman
2025-04-08  9:32     ` Yao Zi
2025-04-09 13:22       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_VM_5f5-m9SHX51@pie \
    --to=ziyao@disroot.org \
    --cc=Oliver.Gaskell@analog.com \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=contact@paulk.fr \
    --cc=greg.malysa@timesys.com \
    --cc=jerome.forissier@linaro.org \
    --cc=lukas.funke@weidmueller.com \
    --cc=marex@denx.de \
    --cc=nathan.morrison@timesys.com \
    --cc=peng.fan@nxp.com \
    --cc=rick@andestech.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=twoerner@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox