public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Marek Vasut <marex@denx.de>, Adam Ford <aford173@gmail.com>
Cc: u-boot@lists.denx.de, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Alper Nebi Yasak <alpernebiyasak@gmail.com>,
	Andrejs Cainikovs <andrejs.cainikovs@toradex.com>,
	Angus Ainslie <angus@akkea.ca>,
	Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	Fabio Estevam <festevam@gmail.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Simon Glass <sjg@chromium.org>,
	Stefan Eichenberger <stefan.eichenberger@toradex.com>,
	Stefano Babic <sbabic@denx.de>,
	Tim Harvey <tharvey@gateworks.com>, Tom Rini <trini@konsulko.com>,
	kernel@puri.sm, u-boot@dh-electronics.com
Subject: Re: [PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman
Date: Fri, 8 Nov 2024 17:21:43 +0100	[thread overview]
Message-ID: <20241108172143.77f0e267@wsk> (raw)
In-Reply-To: <bf90d794-7b70-4e9a-ae79-fd9297f2a0fc@denx.de>

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

Hi Marek, Adam

> On 11/7/24 2:55 AM, Adam Ford wrote:
> > On Tue, Apr 23, 2024 at 1:33 PM Marek Vasut <marex@denx.de> wrote:  
> >>
> >> Rework the flash.bin image generation such that it uses the new
> >> binman nxp_imx8mimage etype. This way, the flash.bin is assembled
> >> in correct order using plain binman, without any workarounds or
> >> sections assembled in special DT node order.
> >>
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >> ---  
> > 
> > This introduced a regression on the 8M Nano with
> > CONFIG_FSPI_CONF_HEADER set.  As is, the board doesn't appear to do
> > anything.
> > 
> > Looking at the binary blob that is generated, the offset for the SPL
> > phase is missing, so SPL starts at 0x5c0 instead of 0x1000, but
> > adding offset = <0x1000> isn't sufficient.
> > 
> > Adding the offset = <0x1000>  starts the SPL phase, but it hangs
> > right away and doesn't past the version message:
> > U-Boot SPL 2024.07-rc1-00155-g37e50627ef-dirty (Nov 06 2024 -
> > 19:16:52 -0600)
> > 
> > <hangs here>
> > 
> > I have only tested this on a Nano, but I think the issue would
> > likely affect Plus since their boot ROM is similar.  I currently
> > don't have a Mini in my possession right now, so I cannot verify
> > the behavior on it.  
> 
> I think Lukasz was able to reproduce it on Mini. I have a few Mini
> here, but none of them use FSPI.
> 
> iMX8MP never supported FSPI ?
> 
> >  From what I can tell, reverting this patch appears to restore boot
> > operation.   I don't know enough about the mkimage tool, but I have
> > tried changing  nxp,boot-from and that doesn't seem to fix it
> > either.
> > 
> > When I diff the binaries, it looks like a fairly significant about
> > of the values have changed, but the various magic numbers and offets
> > appear correct.  This makes me wonder if setting the offsets being
> > passed to mkimage are getting in the way.
> > 
> > If remove the references to  CONFIG_FSPI_CONF_HEADER in the device
> > tree, a regular image is built.  I then use dd to create a new file
> > which has the FSPI header at 0x400, and moves the beginning of the
> > rest of the image to 0x1000.  This process boots the board just
> > fine. This leads me to believe that something in the imx8 mkimage
> > tool is doing something different when fspi is enabled.  
> 
> [...]
> 
> > I'd like to rework the binman to build a standard flash.bin without
> > the Flexspi stuff, then create a second file like fspi.bin (or
> > something similar) which inserts the FSPI header at 0x400 and then
> > just places the entirely of flash.bin contents placed at 0x1000 in a
> > way that doesn't pass these offsets to imx8 mkimage tool.  
> 
> That looks like a workaround . It would be much better if binman
> would generate suitable flash.bin blob with FSPI header. Maybe the
> FSPI header needs to be generated by binman using yet another etype,
> and the SPL/U-Boot have to be positioned properly according to the
> binman node content in imx8mm-u-boot.dtsi ?
> 
> (I also have hard time with binman tool)

I've managed to nail down which offsets are shifted by 0x1000. The
"only" only problem is to add this "fix" to binman... :)

Please refer to below discussion/link:
https://lore.kernel.org/all/CAFLszTh65OkyXnG3L7XTJFK69EYdj4DZwYGxizu4877n-mCw-w@mail.gmail.com/T/


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-11-08 16:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 18:31 [PATCH 1/3] binman: Add nxp_imx8mimage etype Marek Vasut
2024-04-23 18:31 ` [PATCH 2/3] ARM: dts: imx: Switch Ronetix iMX8MQ-CM to imx8mq-u-boot.dtsi Marek Vasut
2024-04-23 18:31 ` [PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman Marek Vasut
2024-04-25 20:34   ` Tim Harvey
2024-04-25 20:39     ` Fabio Estevam
2024-04-25 23:33     ` Marek Vasut
2024-11-07  1:55   ` Adam Ford
2024-11-08 15:07     ` Marek Vasut
2024-11-08 16:21       ` Lukasz Majewski [this message]

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=20241108172143.77f0e267@wsk \
    --to=lukma@denx.de \
    --cc=aford173@gmail.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=andrejs.cainikovs@toradex.com \
    --cc=angus@akkea.ca \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=kernel@puri.sm \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marex@denx.de \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sbabic@denx.de \
    --cc=sjg@chromium.org \
    --cc=stefan.eichenberger@toradex.com \
    --cc=tharvey@gateworks.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@dh-electronics.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.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