u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"huang lin" <hl@rock-chips.com>,
	"Jeffy Chen" <jeffy.chen@rock-chips.com>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"Tom Rini" <trini@konsulko.com>,
	"Philippe Reynes" <philippe.reynes@softathome.com>,
	"Ivan Mikhaylov" <ivan.mikhaylov@siemens.com>,
	"Alexandru Gagniuc" <mr.nuke.me@gmail.com>,
	"Bin Meng" <bmeng.cn@gmail.com>, "Heiko Schocher" <hs@denx.de>,
	"Heiko Thiery" <heiko.thiery@gmail.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Marek Behún" <marek.behun@nic.cz>, "Marek Vasut" <marex@denx.de>,
	"Pali Rohár" <pali@kernel.org>,
	"Ricardo Salveti" <ricardo@foundries.io>,
	"Stefan Roese" <sr@denx.de>
Subject: Re: [PATCH 03/24] spl: x86: Correct the binman symbols for SPL
Date: Wed, 23 Feb 2022 15:58:53 -0700	[thread overview]
Message-ID: <CAPnjgZ0YAys_n6CMAJC57x1JAXsT=Pi+HJXmRO0qkQaziH+6KA@mail.gmail.com> (raw)
In-Reply-To: <4f285518-51a9-e1f1-ef77-c014dc81679a@gmail.com>

Hi Alper,

On Tue, 15 Feb 2022 at 04:52, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>
> On 08/02/2022 21:49, Simon Glass wrote:
> > These symbols are incorrect, meaning that binman cannot find the
> > associated entry. This leads to errors like:
> >
> > binman: Section '/binman/simple-bin': Symbol '_binman_spl_prop_size'
> >    in entry '/binman/simple-bin/u-boot-spl/u-boot-spl-nodtb':
> >    Entry 'spl' not found in list (mkimage,u-boot-spl-nodtb,
> >    u-boot-spl-bss-pad,u-boot-spl-dtb,u-boot-spl,u-boot-img,main-section)
>
> I can't help but feel like this is a bug with entry expansion where the
> name of the expanded node is ignored (and replaced by its type?) when it
> comes to the symbols.

The problem is that there is only really one value for a symbol. E.g.
U-Boot has an image-pos and it doesn't matter what you call it; it is
the same value.

So does it make sense to disallow different names for the same thing?
See testSymbol() which actually creates two SPLs and checks that both
are updated. That is the opposite to what you are talking about, of
course, since it is the properties of the 'u-boot' entry which are
used to write into the SPL entries.

If we move to using the name instead, we could have two different
copies of U-Boot in the image and each SPL could refer to a different
one. At present this is done by puting the pairs into their own
section.

I think this needs more discussion....what do you think?

Regards,
Simon


>
> >
> > Fix it.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  arch/x86/dts/u-boot.dtsi | 2 +-
> >  common/spl/spl.c         | 8 ++++----
> >  include/spl.h            | 4 ++--
> >  3 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi
> > index ca84d18ad9..24e692f988 100644
> > --- a/arch/x86/dts/u-boot.dtsi
> > +++ b/arch/x86/dts/u-boot.dtsi
> > @@ -37,7 +37,7 @@
> >       u-boot-tpl-dtb {
> >       };
> >  #endif
> > -     spl {
> > +     u-boot-spl {
> >               type = "u-boot-spl";
>
> I guess the type can be removed now that it's the same as the node name.
>
> >               offset = <CONFIG_X86_OFFSET_SPL>;
> >       };
> > diff --git a/common/spl/spl.c b/common/spl/spl.c
> > index 884102bdea..444907432c 100644
> > --- a/common/spl/spl.c
> > +++ b/common/spl/spl.c
> > @@ -54,8 +54,8 @@ binman_sym_declare(ulong, u_boot_any, image_pos);
> >  binman_sym_declare(ulong, u_boot_any, size);
> >
> >  #ifdef CONFIG_TPL
> > -binman_sym_declare(ulong, spl, image_pos);
> > -binman_sym_declare(ulong, spl, size);
> > +binman_sym_declare(ulong, u_boot_spl, image_pos);
> > +binman_sym_declare(ulong, u_boot_spl, size);
> >  #endif
> >
> >  /* Define board data structure */
> > @@ -143,14 +143,14 @@ void spl_fixup_fdt(void *fdt_blob)
> >  ulong spl_get_image_pos(void)
> >  {
> >       return spl_phase() == PHASE_TPL ?
> > -             binman_sym(ulong, spl, image_pos) :
> > +             binman_sym(ulong, u_boot_spl, image_pos) :
> >               binman_sym(ulong, u_boot_any, image_pos);
> >  }
> >
> >  ulong spl_get_image_size(void)
> >  {
> >       return spl_phase() == PHASE_TPL ?
> > -             binman_sym(ulong, spl, size) :
> > +             binman_sym(ulong, u_boot_spl, size) :
> >               binman_sym(ulong, u_boot_any, size);
> >  }
> >
> > diff --git a/include/spl.h b/include/spl.h
> > index bb92bc6ec6..8ceb3c0f09 100644
> > --- a/include/spl.h
> > +++ b/include/spl.h
> > @@ -269,8 +269,8 @@ struct spl_load_info {
> >   */
> >  binman_sym_extern(ulong, u_boot_any, image_pos);
> >  binman_sym_extern(ulong, u_boot_any, size);
> > -binman_sym_extern(ulong, spl, image_pos);
> > -binman_sym_extern(ulong, spl, size);
> > +binman_sym_extern(ulong, u_boot_spl, image_pos);
> > +binman_sym_extern(ulong, u_boot_spl, size);
> >
> >  /**
> >   * spl_get_image_pos() - get the image position of the next phase

  reply	other threads:[~2022-02-23 23:01 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 18:49 [PATCH 00/24] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
2022-02-08 18:49 ` [PATCH 01/24] moveconfig: Show the config name rather than the defconfig Simon Glass
2022-02-15 11:40   ` Alper Nebi Yasak
2022-02-23  2:35   ` Simon Glass
2022-02-23  2:43     ` Simon Glass
2022-02-08 18:49 ` [PATCH 02/24] moveconfig: Allow regex matches when finding combinations Simon Glass
2022-02-15 11:41   ` Alper Nebi Yasak
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 03/24] spl: x86: Correct the binman symbols for SPL Simon Glass
2022-02-15 11:42   ` Alper Nebi Yasak
2022-02-23 22:58     ` Simon Glass [this message]
2022-03-03 21:06       ` Alper Nebi Yasak
2022-03-06  3:07         ` Simon Glass
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 04/24] spl: Allow disabling binman symbols in SPL Simon Glass
2022-02-15 11:42   ` Alper Nebi Yasak
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 05/24] rockchip: evb-rk3288: Drop raw-image support Simon Glass
2022-02-08 18:49 ` [PATCH 06/24] dtoc: Support adding a string list to a device tree Simon Glass
2022-02-15 11:43   ` Alper Nebi Yasak
2022-02-23 22:58     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak
2022-03-06  3:07         ` Simon Glass
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 07/24] dtoc: Support deleting a node Simon Glass
2022-02-08 18:49 ` [PATCH 08/24] dtoc: Allow deleting nodes and adding them in the same sync Simon Glass
2022-02-08 18:49 ` [PATCH 09/24] dtoc: Support reading a list of arguments Simon Glass
2022-02-15 11:43   ` Alper Nebi Yasak
2022-02-23 22:58     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 10/24] binman: Update docs to indicate mkimage is supported Simon Glass
2022-02-08 18:49 ` [PATCH 11/24] elf: Add a way to read segment information from an ELF file Simon Glass
2022-02-15 11:44   ` Alper Nebi Yasak
2022-02-23 22:58     ` Simon Glass
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 12/24] WIP: binman: Add support for OP-TEE Simon Glass
2022-02-08 18:49 ` [PATCH 13/24] binman: Add to the TODO Simon Glass
2022-02-08 18:49 ` [PATCH 14/24] binman: Support a list of strings with the mkimage etype Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23 22:59     ` Simon Glass
2022-02-23  2:34   ` Simon Glass
2022-02-08 18:49 ` [PATCH 15/24] binman: Add a ELF test file with disjoint text sections Simon Glass
2022-02-08 18:50 ` [PATCH 16/24] binman: Move entry-data collection into a Entry method Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23  2:34   ` Simon Glass
2022-02-08 18:50 ` [PATCH 17/24] binman: fit: Refactor to reduce function size Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23 22:59     ` Simon Glass
2022-02-23  2:34   ` Simon Glass
2022-02-08 18:50 ` [PATCH 18/24] binman: Tidy up the docs a little with fit Simon Glass
2022-02-08 18:50 ` [PATCH 19/24] binman: Allow different operations in FIT generator nodes Simon Glass
2022-02-08 18:50 ` [PATCH 20/24] binman: Support splitting an ELF file into multiple nodes Simon Glass
2022-02-15 11:46   ` Alper Nebi Yasak
2022-02-23 22:59     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak
2022-03-06  3:07         ` Simon Glass
2022-02-08 18:50 ` [PATCH 21/24] rockchip: Include binman script in 64-bit boards Simon Glass
2022-02-08 18:50 ` [PATCH 22/24] rockchip: Support building the all output files in binman Simon Glass
2022-02-10 15:03   ` Peter Geis
2022-02-10 18:57     ` Simon Glass
2022-02-10 19:32       ` Peter Geis
2022-02-14  1:28         ` Peter Geis
2022-02-15 11:48   ` Alper Nebi Yasak
2022-02-08 18:50 ` [PATCH 23/24] rockchip: Convert all boards to use binman Simon Glass
2022-02-08 18:50 ` [PATCH 24/24] rockchip: Drop the FIT generator script Simon Glass
2022-02-11 15:22 ` [PATCH 00/24] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Alper Nebi Yasak
2022-02-23  2:34 ` [PATCH 19/24] binman: Allow different operations in FIT generator nodes Simon Glass
2022-02-23  2:35 ` [PATCH 10/24] binman: Update docs to indicate mkimage is supported 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='CAPnjgZ0YAys_n6CMAJC57x1JAXsT=Pi+HJXmRO0qkQaziH+6KA@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=alpernebiyasak@gmail.com \
    --cc=bmeng.cn@gmail.com \
    --cc=heiko.thiery@gmail.com \
    --cc=hl@rock-chips.com \
    --cc=hs@denx.de \
    --cc=ivan.mikhaylov@siemens.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=kever.yang@rock-chips.com \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=mr.nuke.me@gmail.com \
    --cc=pali@kernel.org \
    --cc=philippe.reynes@softathome.com \
    --cc=ricardo@foundries.io \
    --cc=sr@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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;
as well as URLs for NNTP newsgroup(s).