diff mbox series

[v2,2/3] boot/uboot: copy ATF bl31 binary to uboot package dir

Message ID 20210910140925.28138-3-heiko.thiery@gmail.com
State Accepted
Headers show
Series Add support to build imx8 images using mainline uboot | expand

Commit Message

Heiko Thiery Sept. 10, 2021, 2:09 p.m. UTC
If the U-Boot image is to be built with binman and the ATF binary is
used, the file is expected in the toplevel directory.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 boot/uboot/uboot.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Fabio Estevam Sept. 10, 2021, 2:27 p.m. UTC | #1
On Fri, Sep 10, 2021 at 11:10 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> If the U-Boot image is to be built with binman and the ATF binary is
> used, the file is expected in the toplevel directory.
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

This applies even if the image is built without binman:

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Heiko Thiery Sept. 10, 2021, 4:03 p.m. UTC | #2
Hi Fabio,

Am Fr., 10. Sept. 2021 um 16:27 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
>
> On Fri, Sep 10, 2021 at 11:10 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> >
> > If the U-Boot image is to be built with binman and the ATF binary is
> > used, the file is expected in the toplevel directory.
> >
> > Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
>
> This applies even if the image is built without binman:

I don't think that's quite right. With the old mainline uboot you
could also build the flash.bin, but that was optional. The make rule
'flash.bin' was not part of 'make all'. But with the change to binman
the files are now necessary, because 'make all' now also builds the
flash.bin.

> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Fabio Estevam Sept. 10, 2021, 4:08 p.m. UTC | #3
Hi Heiko,

On Fri, Sep 10, 2021 at 1:03 PM Heiko Thiery <heiko.thiery@gmail.com> wrote:

> I don't think that's quite right. With the old mainline uboot you
> could also build the flash.bin, but that was optional. The make rule
> 'flash.bin' was not part of 'make all'. But with the change to binman
> the files are now necessary, because 'make all' now also builds the
> flash.bin.

The need for bl31.bin present in the build directory was required even
prior to the binman conversion.

For example, let's take the U-Boot 2021.01 readme for imx8mm evk:
https://source.denx.de/u-boot/u-boot/-/blob/v2021.01/doc/board/freescale/imx8mm_evk.rst
Heiko Thiery Sept. 10, 2021, 6:09 p.m. UTC | #4
Hi Fabio,

Am Fr., 10. Sept. 2021 um 18:08 Uhr schrieb Fabio Estevam <festevam@gmail.com>:
>
> Hi Heiko,
>
> On Fri, Sep 10, 2021 at 1:03 PM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> > I don't think that's quite right. With the old mainline uboot you
> > could also build the flash.bin, but that was optional. The make rule
> > 'flash.bin' was not part of 'make all'. But with the change to binman
> > the files are now necessary, because 'make all' now also builds the
> > flash.bin.
>
> The need for bl31.bin present in the build directory was required even
> prior to the binman conversion.
>
> For example, let's take the U-Boot 2021.01 readme for imx8mm evk:
> https://source.denx.de/u-boot/u-boot/-/blob/v2021.01/doc/board/freescale/imx8mm_evk.rst

ah ok .. I was not aware of that. I just thought this requirement
comes from building via binman.

Thank you
Arnout Vandecappelle Sept. 11, 2021, 8:56 p.m. UTC | #5
On 10/09/2021 16:09, Heiko Thiery wrote:
> If the U-Boot image is to be built with binman and the ATF binary is
> used, the file is expected in the toplevel directory.
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

 Applied to master, thanks. I've updated the commit message to reflect that it's
not related to binman.

 Regards,
 Arnout

> ---
>  boot/uboot/uboot.mk | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 4f3c9b7c3a..1a840d9cc1 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -162,8 +162,16 @@ ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y)
>  UBOOT_DEPENDENCIES += arm-trusted-firmware
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)
>  UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.elf
> +define UBOOT_COPY_ATF_FIRMWARE
> +	cp $(BINARIES_DIR)/bl31.elf $(@D)/
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_ATF_FIRMWARE
>  else
>  UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
> +define UBOOT_COPY_ATF_FIRMWARE
> +	cp $(BINARIES_DIR)/bl31.bin $(@D)/
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_ATF_FIRMWARE
>  endif
>  endif
>  
>
diff mbox series

Patch

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 4f3c9b7c3a..1a840d9cc1 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -162,8 +162,16 @@  ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y)
 UBOOT_DEPENDENCIES += arm-trusted-firmware
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)
 UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.elf
+define UBOOT_COPY_ATF_FIRMWARE
+	cp $(BINARIES_DIR)/bl31.elf $(@D)/
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_ATF_FIRMWARE
 else
 UBOOT_MAKE_OPTS += BL31=$(BINARIES_DIR)/bl31.bin
+define UBOOT_COPY_ATF_FIRMWARE
+	cp $(BINARIES_DIR)/bl31.bin $(@D)/
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_ATF_FIRMWARE
 endif
 endif