mbox series

[0/3] Add support to build imx8 images using mainline uboot

Message ID 20210906094214.6142-1-heiko.thiery@gmail.com
Headers show
Series Add support to build imx8 images using mainline uboot | expand

Message

Heiko Thiery Sept. 6, 2021, 9:42 a.m. UTC
New U-Boot version support building the flash.bin bootimage using
binman. For that the imx specific firmware files like (LP)DDR and HDMI
firmware has to be located in the u-boot builddirectory.

Xavier Roumegue already posted a patchset [1] to add this support but did no
follow up version after getting review comments.

I have taken up these comments and prepared the patchset.

[1] https://lists.buildroot.org/pipermail/buildroot/2020-November/599906.html

Heiko Thiery (3):
  package/freescale-imx/firmware-imx: copy all (lp)ddr files
    unconditionaly
  boot/uboot: copy ATF bl31 binary to uboot package dir
  boot/uboot: copy IMX firmware files to uboot package dir

 boot/uboot/Config.in                          | 12 +++++++
 boot/uboot/uboot.mk                           | 35 +++++++++++++++++++
 .../firmware-imx/firmware-imx.mk              | 10 ++++++
 3 files changed, 57 insertions(+)

Comments

Fabio Estevam Sept. 6, 2021, 12:25 p.m. UTC | #1
Hi Heiko,

On Mon, Sep 6, 2021 at 6:42 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> New U-Boot version support building the flash.bin bootimage using
> binman. For that the imx specific firmware files like (LP)DDR and HDMI
> firmware has to be located in the u-boot builddirectory.
>
> Xavier Roumegue already posted a patchset [1] to add this support but did no
> follow up version after getting review comments.
>
> I have taken up these comments and prepared the patchset.
>
> [1] https://lists.buildroot.org/pipermail/buildroot/2020-November/599906.html
>
> Heiko Thiery (3):
>   package/freescale-imx/firmware-imx: copy all (lp)ddr files
>     unconditionaly
>   boot/uboot: copy ATF bl31 binary to uboot package dir
>   boot/uboot: copy IMX firmware files to uboot package dir

Thanks for working on this.

Would you have a git tree with all the required Buildroot patches to
get a bootable imx8mm image?

Thanks,

Fabio Estevam
Heiko Thiery Sept. 6, 2021, 1:32 p.m. UTC | #2
Hi Fabio,

Am Mo., 6. Sept. 2021 um 14:25 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
>
> Hi Heiko,
>
> On Mon, Sep 6, 2021 at 6:42 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> >
> > New U-Boot version support building the flash.bin bootimage using
> > binman. For that the imx specific firmware files like (LP)DDR and HDMI
> > firmware has to be located in the u-boot builddirectory.
> >
> > Xavier Roumegue already posted a patchset [1] to add this support but did no
> > follow up version after getting review comments.
> >
> > I have taken up these comments and prepared the patchset.
> >
> > [1] https://lists.buildroot.org/pipermail/buildroot/2020-November/599906.html
> >
> > Heiko Thiery (3):
> >   package/freescale-imx/firmware-imx: copy all (lp)ddr files
> >     unconditionaly
> >   boot/uboot: copy ATF bl31 binary to uboot package dir
> >   boot/uboot: copy IMX firmware files to uboot package dir
>
> Thanks for working on this.
>
> Would you have a git tree with all the required Buildroot patches to
> get a bootable imx8mm image?

What board are you exactly asking for? the nxp imx8mm evk? I have a
tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.

Maybe this also answers your question ;-/

[1] https://github.com/hthiery/buildroot/tree/uboot-imx
Fabio Estevam Sept. 6, 2021, 3:23 p.m. UTC | #3
Hi Heiko,

On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:

> What board are you exactly asking for? the nxp imx8mm evk? I have a
> tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
>
> Maybe this also answers your question ;-/
>
> [1] https://github.com/hthiery/buildroot/tree/uboot-imx

This helps, thanks.

I am wondering if we could make the files below generic?

board/kontron/pitx-imx8m/post-build.sh
board/kontron/pitx-imx8m/post-image.sh
board/kontron/pitx-imx8m/genimage.cfg

Thanks
Heiko Thiery Sept. 7, 2021, 6:36 a.m. UTC | #4
Hi Fabio,

Am Mo., 6. Sept. 2021 um 17:23 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
>
> Hi Heiko,
>
> On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> > What board are you exactly asking for? the nxp imx8mm evk? I have a
> > tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
> >
> > Maybe this also answers your question ;-/
> >
> > [1] https://github.com/hthiery/buildroot/tree/uboot-imx
>
> This helps, thanks.
>
> I am wondering if we could make the files below generic?
>
> board/kontron/pitx-imx8m/post-build.sh
This is dependent on the boot method used by the board. Here we use a
boot script. But other than that can use e.g. extlinux. I think this
is not a candidate we can make generically.

> board/kontron/pitx-imx8m/post-image.sh
This calls the genimage. This could be removed and added directly into
the defconfig as BR2_ROOTFS_POST_IMAGE_SCRIPT.

> board/kontron/pitx-imx8m/genimage.cfg
Here I', not sure. Because it depends on the used bootmethod how the
image should look like. E.g. do we need to have a boot partion on not.
Gary Bisson Sept. 7, 2021, 8:36 a.m. UTC | #5
Hi Thiery,

On Tue, Sep 07, 2021 at 08:36:30AM +0200, Heiko Thiery wrote:
> Hi Fabio,
> 
> Am Mo., 6. Sept. 2021 um 17:23 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
> >
> > Hi Heiko,
> >
> > On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> >
> > > What board are you exactly asking for? the nxp imx8mm evk? I have a
> > > tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
> > >
> > > Maybe this also answers your question ;-/
> > >
> > > [1] https://github.com/hthiery/buildroot/tree/uboot-imx
> >
> > This helps, thanks.

I've tried this series with our U-Boot (2020.07 based) and it doesn't
work for me as using UBOOT_FORMAT_CUSTOM isn't sufficient as it only
copies the binaries selected but doesn't use it as target [1].

So I wonder, which U-Boot version are you using? Is the flash.bin
created automatically when issuing 'make all'?
In my version of U-Boot it requires to use 'make flash.bin' otherwise it
simply doesn't generate flash.bin.

I believe we would still need a new U-Boot target name [2] but I'd like
to understand how it worked for you

Regards,
Gary

[1] https://github.com/buildroot/buildroot/blob/master/boot/uboot/uboot.mk#L135
[2] http://patchwork.ozlabs.org/project/buildroot/patch/20201125183017.15585-5-xroumegue@gmail.com/
Heiko Thiery Sept. 7, 2021, 8:43 a.m. UTC | #6
Hi Gary,

Am Di., 7. Sept. 2021 um 10:36 Uhr schrieb Gary Bisson
<gary.bisson@boundarydevices.com>:
>
> Hi Thiery,
>
> On Tue, Sep 07, 2021 at 08:36:30AM +0200, Heiko Thiery wrote:
> > Hi Fabio,
> >
> > Am Mo., 6. Sept. 2021 um 17:23 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
> > >
> > > Hi Heiko,
> > >
> > > On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> > >
> > > > What board are you exactly asking for? the nxp imx8mm evk? I have a
> > > > tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
> > > >
> > > > Maybe this also answers your question ;-/
> > > >
> > > > [1] https://github.com/hthiery/buildroot/tree/uboot-imx
> > >
> > > This helps, thanks.
>
> I've tried this series with our U-Boot (2020.07 based) and it doesn't
> work for me as using UBOOT_FORMAT_CUSTOM isn't sufficient as it only
> copies the binaries selected but doesn't use it as target [1].
>
> So I wonder, which U-Boot version are you using? Is the flash.bin
> created automatically when issuing 'make all'?
> In my version of U-Boot it requires to use 'make flash.bin' otherwise it
> simply doesn't generate flash.bin.
>
> I believe we would still need a new U-Boot target name [2] but I'd like
> to understand how it worked for you

Yes, when switching to binman the "make all" target will create the
flash.bin (all output that is defined/described in binman). So in your
case when you use the "old" u-boot way of creating this output we have
to add a new u-boot target in buildroot.
Gary Bisson Sept. 7, 2021, 8:57 a.m. UTC | #7
Hi Thiery,

On Tue, Sep 07, 2021 at 10:43:43AM +0200, Heiko Thiery wrote:
> Hi Gary,
> 
> Am Di., 7. Sept. 2021 um 10:36 Uhr schrieb Gary Bisson
> <gary.bisson@boundarydevices.com>:
> >
> > Hi Thiery,
> >
> > On Tue, Sep 07, 2021 at 08:36:30AM +0200, Heiko Thiery wrote:
> > > Hi Fabio,
> > >
> > > Am Mo., 6. Sept. 2021 um 17:23 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
> > > >
> > > > Hi Heiko,
> > > >
> > > > On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> > > >
> > > > > What board are you exactly asking for? the nxp imx8mm evk? I have a
> > > > > tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
> > > > >
> > > > > Maybe this also answers your question ;-/
> > > > >
> > > > > [1] https://github.com/hthiery/buildroot/tree/uboot-imx
> > > >
> > > > This helps, thanks.
> >
> > I've tried this series with our U-Boot (2020.07 based) and it doesn't
> > work for me as using UBOOT_FORMAT_CUSTOM isn't sufficient as it only
> > copies the binaries selected but doesn't use it as target [1].
> >
> > So I wonder, which U-Boot version are you using? Is the flash.bin
> > created automatically when issuing 'make all'?
> > In my version of U-Boot it requires to use 'make flash.bin' otherwise it
> > simply doesn't generate flash.bin.
> >
> > I believe we would still need a new U-Boot target name [2] but I'd like
> > to understand how it worked for you
> 
> Yes, when switching to binman the "make all" target will create the
> flash.bin (all output that is defined/described in binman). So in your
> case when you use the "old" u-boot way of creating this output we have
> to add a new u-boot target in buildroot.

Thanks for the quick reply. Indeed I just saw in your U-Boot tree how
the binman description was done, it's pretty neat.
So do you know if the flash.bin target is here to stay in U-Boot or is
binman to new way to go and flash.bin becomes an outdated target? I know
it's more of a U-Boot question than Buildroot but just to understand if
it even makes sense to add the target if it's going to disappear in
upcoming releases.

Regards,
Gary
Heiko Thiery Sept. 7, 2021, 9:03 a.m. UTC | #8
Hi Gary,

Am Di., 7. Sept. 2021 um 10:58 Uhr schrieb Gary Bisson
<gary.bisson@boundarydevices.com>:
>
> Hi Thiery,
>
> On Tue, Sep 07, 2021 at 10:43:43AM +0200, Heiko Thiery wrote:
> > Hi Gary,
> >
> > Am Di., 7. Sept. 2021 um 10:36 Uhr schrieb Gary Bisson
> > <gary.bisson@boundarydevices.com>:
> > >
> > > Hi Thiery,
> > >
> > > On Tue, Sep 07, 2021 at 08:36:30AM +0200, Heiko Thiery wrote:
> > > > Hi Fabio,
> > > >
> > > > Am Mo., 6. Sept. 2021 um 17:23 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
> > > > >
> > > > > Hi Heiko,
> > > > >
> > > > > On Mon, Sep 6, 2021 at 10:32 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> > > > >
> > > > > > What board are you exactly asking for? the nxp imx8mm evk? I have a
> > > > > > tree for the kontron pitx-imx8m [1] that has an i.MX8MQ.
> > > > > >
> > > > > > Maybe this also answers your question ;-/
> > > > > >
> > > > > > [1] https://github.com/hthiery/buildroot/tree/uboot-imx
> > > > >
> > > > > This helps, thanks.
> > >
> > > I've tried this series with our U-Boot (2020.07 based) and it doesn't
> > > work for me as using UBOOT_FORMAT_CUSTOM isn't sufficient as it only
> > > copies the binaries selected but doesn't use it as target [1].
> > >
> > > So I wonder, which U-Boot version are you using? Is the flash.bin
> > > created automatically when issuing 'make all'?
> > > In my version of U-Boot it requires to use 'make flash.bin' otherwise it
> > > simply doesn't generate flash.bin.
> > >
> > > I believe we would still need a new U-Boot target name [2] but I'd like
> > > to understand how it worked for you
> >
> > Yes, when switching to binman the "make all" target will create the
> > flash.bin (all output that is defined/described in binman). So in your
> > case when you use the "old" u-boot way of creating this output we have
> > to add a new u-boot target in buildroot.
>
> Thanks for the quick reply. Indeed I just saw in your U-Boot tree how
> the binman description was done, it's pretty neat.
> So do you know if the flash.bin target is here to stay in U-Boot or is
> binman to new way to go and flash.bin becomes an outdated target? I know
> it's more of a U-Boot question than Buildroot but just to understand if
> it even makes sense to add the target if it's going to disappear in
> upcoming releases.

As far as I understand the goal is to switch to binman for all boards.
That would mean the flash.bin target will disappear. But what about
having a custom build target in buildroot?