All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/3] Add support to build imx8 images using mainline uboot
@ 2021-09-10 14:09 Heiko Thiery
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 14:09 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, Heiko Thiery, Fabio Estevam, Xavier Roumegue

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(+)

-- 
2.30.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly
  2021-09-10 14:09 [Buildroot] [PATCH v2 0/3] Add support to build imx8 images using mainline uboot Heiko Thiery
@ 2021-09-10 14:09 ` Heiko Thiery
  2021-09-10 14:26   ` Fabio Estevam
  2021-09-11 20:56   ` Arnout Vandecappelle
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files " Heiko Thiery
  2 siblings, 2 replies; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 14:09 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Stephane Viau, Gary Bisson, Refik Tuzakli,
	Michael Walle, Thomas Petazzoni, Heiko Thiery, Fabio Estevam,
	Xavier Roumegue

In mainline u-boot more and more imx8 boards are switched to binman
to create the imx specific image (flash.bin). To support this the
(lp)ddr firmware training files are needed. For this to work all files
should be made available to the U-Boot build.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>
---

v2:
 - add reviewed-by (thanks Gary)

 package/freescale-imx/firmware-imx/firmware-imx.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index 1076cf85f1..29241342be 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -51,6 +51,11 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
 		$(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_2d_fw.bin > \
 		$(BINARIES_DIR)/lpddr4_pmu_train_fw.bin
 	ln -sf $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin $(BINARIES_DIR)/ddr_fw.bin
+
+	# U-Boot supports creation of the combined flash.bin image. To make
+	# sure that U-Boot can access all available files copy them to
+	# the binary dir.
+	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
 endef
 endif
 
@@ -69,6 +74,11 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
 		$(FIRMWARE_IMX_DDRFW_DIR)/ddr4_2d_201810_fw.bin > \
 		$(BINARIES_DIR)/ddr4_201810_fw.bin
 	ln -sf $(BINARIES_DIR)/ddr4_201810_fw.bin $(BINARIES_DIR)/ddr_fw.bin
+
+	# U-Boot supports creation of the combined flash.bin image. To make
+	# sure that U-Boot can access all available files copy them to
+	# the binary dir.
+	cp $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin $(BINARIES_DIR)/
 endef
 endif
 
-- 
2.30.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 14:09 [Buildroot] [PATCH v2 0/3] Add support to build imx8 images using mainline uboot Heiko Thiery
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
@ 2021-09-10 14:09 ` Heiko Thiery
  2021-09-10 14:27   ` Fabio Estevam
  2021-09-11 20:56   ` Arnout Vandecappelle
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files " Heiko Thiery
  2 siblings, 2 replies; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 14:09 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, Heiko Thiery, Fabio Estevam, Xavier Roumegue

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(+)

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
 
-- 
2.30.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files to uboot package dir
  2021-09-10 14:09 [Buildroot] [PATCH v2 0/3] Add support to build imx8 images using mainline uboot Heiko Thiery
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
@ 2021-09-10 14:09 ` Heiko Thiery
  2021-09-10 14:32   ` Fabio Estevam
  2021-09-11 20:57   ` Arnout Vandecappelle
  2 siblings, 2 replies; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 14:09 UTC (permalink / raw)
  To: buildroot
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, Heiko Thiery, Fabio Estevam, Xavier Roumegue

If the U-Boot image is to be built with binman and one of the i.MX
firmware files (ddr, hdmi) is used, the files are expected in the
toplevel directory.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---

v2:
 - small changes in commit messages (thanks Stephane)
 - use "i.MX 8M" for consistency (thanks Stephane)

 boot/uboot/Config.in | 12 ++++++++++++
 boot/uboot/uboot.mk  | 27 +++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 0854fb13cc..da518db118 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -239,6 +239,18 @@ config BR2_TARGET_UBOOT_NEEDS_OPENSBI
 	  and that the OpenSBI variable pointing to OpenSBI binary,
 	  is passed during the Buildroot build.
 
+config BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE
+	bool "U-Boot needs firmware-imx"
+	depends on BR2_PACKAGE_FIRMWARE_IMX
+	depends on BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW || \
+		BR2_PACKAGE_FIRMWARE_IMX_NEEDS_HDMI_FW
+	help
+	  Some IMX platforms (such as iMX8m, iMX8mq, iIMX8mm, iIMX8mn)
+	  encapsulate NXP specific firmware (DDR, HDMI) inside U-Boot.
+	  This option makes sure the imx firmware gets built prior to
+	  U-Boot and copies the files from the buildroot binary dir
+	  into the U-Boot source dir.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 1a840d9cc1..cf8d6b1f39 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -180,6 +180,33 @@ UBOOT_DEPENDENCIES += opensbi
 UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin
 endif
 
+# New U-Boot versions can create the IMX specific boot images
+# and needs the some NXP firmware blobs.
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE),y)
+UBOOT_DEPENDENCIES += firmware-imx
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_NEEDS_HDMI_FW),y)
+define UBOOT_COPY_IMX_DDR_FIRMWARE
+	cp $(BINARIES_DIR)/signed_hdmi_imx8m.bin $(@D)/
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_DDR_FIRMWARE
+endif
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
+define UBOOT_COPY_IMX_LPDDR4_FIRMWARE
+	cp $(BINARIES_DIR)/lpddr4*.bin $(@D)/
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_LPDDR4_FIRMWARE
+endif
+
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
+define UBOOT_COPY_IMX_DDR4_FIRMWARE
+	cp $(BINARIES_DIR)/ddr4*.bin $(@D)/
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_DDR4_FIRMWARE
+endif
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
 UBOOT_DEPENDENCIES += host-dtc
 endif
-- 
2.30.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
@ 2021-09-10 14:26   ` Fabio Estevam
  2021-09-11 20:56   ` Arnout Vandecappelle
  1 sibling, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2021-09-10 14:26 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: Gary Bisson, Stephane Viau, Gary Bisson, Refik Tuzakli,
	Michael Walle, Thomas Petazzoni, buildroot, Xavier Roumegue

Hi Heiko,

On Fri, Sep 10, 2021 at 11:10 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> In mainline u-boot more and more imx8 boards are switched to binman
> to create the imx specific image (flash.bin). To support this the
> (lp)ddr firmware training files are needed. For this to work all files
> should be made available to the U-Boot build.
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
@ 2021-09-10 14:27   ` Fabio Estevam
  2021-09-10 16:03     ` Heiko Thiery
  2021-09-11 20:56   ` Arnout Vandecappelle
  1 sibling, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2021-09-10 14:27 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, buildroot, Xavier Roumegue

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>
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files to uboot package dir
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files " Heiko Thiery
@ 2021-09-10 14:32   ` Fabio Estevam
  2021-09-11 20:57   ` Arnout Vandecappelle
  1 sibling, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2021-09-10 14:32 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, buildroot, Xavier Roumegue

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 one of the i.MX
> firmware files (ddr, hdmi) is used, the files are expected in the
> toplevel directory.

I would remove binman from the description as this is not binman related.
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

> +config BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE
> +       bool "U-Boot needs firmware-imx"
> +       depends on BR2_PACKAGE_FIRMWARE_IMX
> +       depends on BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW || \
> +               BR2_PACKAGE_FIRMWARE_IMX_NEEDS_HDMI_FW
> +       help
> +         Some IMX platforms (such as iMX8m, iMX8mq, iIMX8mm, iIMX8mn)
> +         encapsulate NXP specific firmware (DDR, HDMI) inside U-Boot.
> +         This option makes sure the imx firmware gets built prior to

The imx firmwares are binaries, so they are not built. Please adjust it to:

"This option makes sure that the imx firmwares are copied into the U-Boot
source directory".

> +         U-Boot and copies the files from the buildroot binary dir
> +         into the U-Boot source dir.
> +
>  menu "U-Boot binary format"
>
>  config BR2_TARGET_UBOOT_FORMAT_AIS
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 1a840d9cc1..cf8d6b1f39 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -180,6 +180,33 @@ UBOOT_DEPENDENCIES += opensbi
>  UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin
>  endif
>
> +# New U-Boot versions can create the IMX specific boot images

s/New/Mainline

> +# and needs the some NXP firmware blobs.

s/needs the some/need some

Reviewed-by: Fabio Estevam <festevam@gmail.com>
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 14:27   ` Fabio Estevam
@ 2021-09-10 16:03     ` Heiko Thiery
  2021-09-10 16:08       ` Fabio Estevam
  0 siblings, 1 reply; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 16:03 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, buildroot, Xavier Roumegue

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>

-- 
Heiko
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 16:03     ` Heiko Thiery
@ 2021-09-10 16:08       ` Fabio Estevam
  2021-09-10 18:09         ` Heiko Thiery
  0 siblings, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2021-09-10 16:08 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, buildroot, Xavier Roumegue

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
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 16:08       ` Fabio Estevam
@ 2021-09-10 18:09         ` Heiko Thiery
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Thiery @ 2021-09-10 18:09 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Gary Bisson, Stephane Viau, Refik Tuzakli, Michael Walle,
	Thomas Petazzoni, buildroot, Xavier Roumegue

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

-- 
Heiko
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
  2021-09-10 14:26   ` Fabio Estevam
@ 2021-09-11 20:56   ` Arnout Vandecappelle
  1 sibling, 0 replies; 13+ messages in thread
From: Arnout Vandecappelle @ 2021-09-11 20:56 UTC (permalink / raw)
  To: Heiko Thiery, buildroot
  Cc: Gary Bisson, Xavier Roumegue, Stephane Viau, Gary Bisson,
	Refik Tuzakli, Michael Walle, Thomas Petazzoni, Fabio Estevam



On 10/09/2021 16:09, Heiko Thiery wrote:
> In mainline u-boot more and more imx8 boards are switched to binman
> to create the imx specific image (flash.bin). To support this the
> (lp)ddr firmware training files are needed. For this to work all files
> should be made available to the U-Boot build.
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> Reviewed-by: Gary Bisson <gary.bisson@boundarydevices.com>

 Applied to master, thanks.

 Regards,
 Arnout

> ---
> 
> v2:
>  - add reviewed-by (thanks Gary)
> 
>  package/freescale-imx/firmware-imx/firmware-imx.mk | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
> index 1076cf85f1..29241342be 100644
> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
> @@ -51,6 +51,11 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>  		$(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_2d_fw.bin > \
>  		$(BINARIES_DIR)/lpddr4_pmu_train_fw.bin
>  	ln -sf $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin $(BINARIES_DIR)/ddr_fw.bin
> +
> +	# U-Boot supports creation of the combined flash.bin image. To make
> +	# sure that U-Boot can access all available files copy them to
> +	# the binary dir.
> +	cp $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin $(BINARIES_DIR)/
>  endef
>  endif
>  
> @@ -69,6 +74,11 @@ define FIRMWARE_IMX_INSTALL_IMAGE_DDR_FW
>  		$(FIRMWARE_IMX_DDRFW_DIR)/ddr4_2d_201810_fw.bin > \
>  		$(BINARIES_DIR)/ddr4_201810_fw.bin
>  	ln -sf $(BINARIES_DIR)/ddr4_201810_fw.bin $(BINARIES_DIR)/ddr_fw.bin
> +
> +	# U-Boot supports creation of the combined flash.bin image. To make
> +	# sure that U-Boot can access all available files copy them to
> +	# the binary dir.
> +	cp $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin $(BINARIES_DIR)/
>  endef
>  endif
>  
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
  2021-09-10 14:27   ` Fabio Estevam
@ 2021-09-11 20:56   ` Arnout Vandecappelle
  1 sibling, 0 replies; 13+ messages in thread
From: Arnout Vandecappelle @ 2021-09-11 20:56 UTC (permalink / raw)
  To: Heiko Thiery, buildroot
  Cc: Gary Bisson, Xavier Roumegue, Stephane Viau, Refik Tuzakli,
	Michael Walle, Thomas Petazzoni, Fabio Estevam



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
>  
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files to uboot package dir
  2021-09-10 14:09 ` [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files " Heiko Thiery
  2021-09-10 14:32   ` Fabio Estevam
@ 2021-09-11 20:57   ` Arnout Vandecappelle
  1 sibling, 0 replies; 13+ messages in thread
From: Arnout Vandecappelle @ 2021-09-11 20:57 UTC (permalink / raw)
  To: Heiko Thiery, buildroot
  Cc: Gary Bisson, Xavier Roumegue, Stephane Viau, Refik Tuzakli,
	Michael Walle, Thomas Petazzoni, Fabio Estevam



On 10/09/2021 16:09, Heiko Thiery wrote:
> If the U-Boot image is to be built with binman and one of the i.MX
> firmware files (ddr, hdmi) is used, the files are expected in the
> toplevel directory.
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

 I was too lazy to update with all of Fabio's comments :-) so I marked as
Changes Requested.

 Regards,
 Arnout

> ---
> 
> v2:
>  - small changes in commit messages (thanks Stephane)
>  - use "i.MX 8M" for consistency (thanks Stephane)
> 
>  boot/uboot/Config.in | 12 ++++++++++++
>  boot/uboot/uboot.mk  | 27 +++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 0854fb13cc..da518db118 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -239,6 +239,18 @@ config BR2_TARGET_UBOOT_NEEDS_OPENSBI
>  	  and that the OpenSBI variable pointing to OpenSBI binary,
>  	  is passed during the Buildroot build.
>  
> +config BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE
> +	bool "U-Boot needs firmware-imx"
> +	depends on BR2_PACKAGE_FIRMWARE_IMX
> +	depends on BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW || \
> +		BR2_PACKAGE_FIRMWARE_IMX_NEEDS_HDMI_FW
> +	help
> +	  Some IMX platforms (such as iMX8m, iMX8mq, iIMX8mm, iIMX8mn)
> +	  encapsulate NXP specific firmware (DDR, HDMI) inside U-Boot.
> +	  This option makes sure the imx firmware gets built prior to
> +	  U-Boot and copies the files from the buildroot binary dir
> +	  into the U-Boot source dir.
> +
>  menu "U-Boot binary format"
>  
>  config BR2_TARGET_UBOOT_FORMAT_AIS
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 1a840d9cc1..cf8d6b1f39 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -180,6 +180,33 @@ UBOOT_DEPENDENCIES += opensbi
>  UBOOT_MAKE_OPTS += OPENSBI=$(BINARIES_DIR)/fw_dynamic.bin
>  endif
>  
> +# New U-Boot versions can create the IMX specific boot images
> +# and needs the some NXP firmware blobs.
> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE),y)
> +UBOOT_DEPENDENCIES += firmware-imx
> +
> +ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_NEEDS_HDMI_FW),y)
> +define UBOOT_COPY_IMX_DDR_FIRMWARE
> +	cp $(BINARIES_DIR)/signed_hdmi_imx8m.bin $(@D)/
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_DDR_FIRMWARE
> +endif
> +
> +ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
> +define UBOOT_COPY_IMX_LPDDR4_FIRMWARE
> +	cp $(BINARIES_DIR)/lpddr4*.bin $(@D)/
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_LPDDR4_FIRMWARE
> +endif
> +
> +ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR4),y)
> +define UBOOT_COPY_IMX_DDR4_FIRMWARE
> +	cp $(BINARIES_DIR)/ddr4*.bin $(@D)/
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_DDR4_FIRMWARE
> +endif
> +endif
> +
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_DTC),y)
>  UBOOT_DEPENDENCIES += host-dtc
>  endif
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-11 20:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 14:09 [Buildroot] [PATCH v2 0/3] Add support to build imx8 images using mainline uboot Heiko Thiery
2021-09-10 14:09 ` [Buildroot] [PATCH v2 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
2021-09-10 14:26   ` Fabio Estevam
2021-09-11 20:56   ` Arnout Vandecappelle
2021-09-10 14:09 ` [Buildroot] [PATCH v2 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
2021-09-10 14:27   ` Fabio Estevam
2021-09-10 16:03     ` Heiko Thiery
2021-09-10 16:08       ` Fabio Estevam
2021-09-10 18:09         ` Heiko Thiery
2021-09-11 20:56   ` Arnout Vandecappelle
2021-09-10 14:09 ` [Buildroot] [PATCH v2 3/3] boot/uboot: copy IMX firmware files " Heiko Thiery
2021-09-10 14:32   ` Fabio Estevam
2021-09-11 20:57   ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.