public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Marek Vasut <marex@denx.de>
Subject: Re: [Binman] Question regarding SPL symbol offsets generation
Date: Fri, 9 Aug 2024 11:51:58 +0200	[thread overview]
Message-ID: <20240809115158.537051d5@wsk> (raw)
In-Reply-To: <CAFLszThwMEoiXTQnogYd19j82vAeqFao=c2ZnWuUr-BiAPcadQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4596 bytes --]

Hi Simon,

> Hi Lukasz,
> 
> On Thu, 8 Aug 2024 at 03:06, Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Dear Community
> >
> > I'd like to ask about one issue with generation of symbol offsets in
> > binman [1].
> >
> > In my case the CONFIG_FSPI_CONF_HEADER is defined.
> >
> > Problem is with generated symbols [2] to point into
> > ddr-1d-imem-fw/ddr-1d-dmem-fw/ddr-2d-imem-fw/ddr-2d-dmem-fw.
> >
> > It looks like only symbols have extra offset of 0x1000 (the same as
> > the first section introduces) - binaries for training memory are
> > placed without this extra offset.
> >
> > On the other hand - before this change:
> > SHA1: 37e50627efacd8dae18b564e9d8886a033e181bc
> >
> > The u-boot-spl-ddr.bin was a separate binman "entry" (i.e. not
> > section)
> > - so e.g. ddr-1d-dmem-fw {} had proper offsets (as this binary was
> > also mangled into spl.bin with mkimage invocation).
> >
> >
> > Now the question - how to properly fix this issue?
> >
> > I've tried to add pad-before = <0x1000>; to ddr-1d-imem-fw property
> > hoping to "move" this binary itself by 0x1000. However with it the
> > symbol of ddr-1d-dmem-fw is moved up as well.
> >
> > Another option was to try alignment 'align-size' set to 0x1000 -
> > effect is the same as described above.
> >
> > In the documentation [3] - I've found that I could use
> > "ProcessEntryContents()" for tweaking, but this seems to be not
> > eligible (as all imx8mX boards, which are going to boot from fspi)
> > are affected.
> >
> > Maybe falling-back to 'multiple-images' [4] and generate the
> > u-boot-spl-ddr.bin in that way is a proper solution?
> >
> >
> > Last but not least - this problem is not present when one boots from
> > SD/eMMC as in this case the "fspi_conf_block" property is not
> > present and everything starts with 0x0 offset.
> >
> > Thanks in advance for your help.  
> 
> BTW we are waiting for tests for this etype...when those are in place
> it should provide a way to test the behaviour.
> 
> I see that Entry_nxp_imx8mimage.SetImagePos() adjusts the image-pos.
> Is that the symbol you are writing? Are you saying that the image_pos
> symbol that is written is incorrect?
> 

Yes, it is up by +0x1000 when compared to the real place where binaries
(like ddr_1d_imem_fw) are placed.

> Or are you using u-boot-spl-mkimage.signed.bin (i.e. without the 4KB
> header) in the first section.

No, HAB (signing) is disabled.

Instead I'm using the CONFIG_FSPI_CONF_HEADER from [1]. It adds FSPI
(QSPI) specific header with 0x1000 size.

> 
> The image_pos is an absolute image position, so it doesn't matter what
> sections are written out as files. The image_pos will be the same
> regardless.

To have the board booting again - I do need to perform:

 imem_start -= 0x1000;
 dmem_start -= 0x1000;

added at [5].

> 
> Why are u-boot-spl-mkimage.signed.bin and u-boot-fit.signed.bin
> written out? Aren't they just intermediate images, not useful for
> flashing to the board? If not, why is the FSPI conf block before them?
> 

As stated above - I'm not using HAB so those are not created.

The FSPI block is required to boot the device with QSPI - it holds meta
data to configure the memory itself.

> There is a 'skip-at-start' property which might be useful here, so
> long as I understand the above correctly.

Ok - I will try it.

Thanks for your help :-)

> 
> Regards,
> Simon
> 
> 
> >
> >
> > Links:
> >
> > [1] -
> >  https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/imx8mm-u-boot.dtsi?ref_type=heads#L49
> >
> > [2] -
> > https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/ddr/imx/phy/helper.c#L27
> >
> > [3] -
> > https://github.com/ARM-software/u-boot/blob/master/tools/binman/README#L526
> >
> > [4] -
> > https://github.com/ARM-software/u-boot/blob/master/tools/binman/README#L371
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Erika Unter
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma@denx.de  

Links:

[5] -
https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/ddr/imx/phy/helper.c#L87


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-08-09  9:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  9:06 [Binman] Question regarding SPL symbol offsets generation Lukasz Majewski
2024-08-08 14:28 ` Simon Glass
2024-08-09  9:51   ` Lukasz Majewski [this message]
2024-08-15 12:20 ` Fabio Estevam
2024-08-15 20:14   ` Lukasz Majewski
2024-08-27 18:46     ` Fabio Estevam
2024-08-27 19:26       ` Simon Glass
2024-08-28  8:04         ` Lukasz Majewski
2024-09-02 22:06           ` Adam Ford
2024-09-05 13:54             ` Lukasz Majewski
2024-09-06  0:30               ` Simon Glass
2024-09-06  7:54                 ` Lukasz Majewski
2024-09-12  1:11                   ` Simon Glass
2024-09-12  7:06                     ` Lukasz Majewski
2024-11-04  1:41               ` Adam Ford
2024-11-04  2:00                 ` Adam Ford
2024-11-04  3:35                   ` Adam Ford
2024-11-04  8:14                   ` Lukasz Majewski
2024-11-09  1:04                     ` Adam Ford
2024-11-09  2:12                       ` Adam Ford
2024-11-09  2:15                         ` Fabio Estevam
2024-11-09 20:07                           ` Adam Ford
2024-08-28  8:03       ` Lukasz Majewski

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=20240809115158.537051d5@wsk \
    --to=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.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