Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Thiery <heiko.thiery@gmail.com>
To: buildroot@buildroot.org
Cc: Gary Bisson <bisson.gary@gmail.com>,
	Stephane Viau <stephane.viau@oss.nxp.com>,
	Refik Tuzakli <tuzakli.refik@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Heiko Thiery <heiko.thiery@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Xavier Roumegue <xroumegue@gmail.com>
Subject: [Buildroot] [PATCH 3/3] boot/uboot: copy IMX firmware files to uboot package dir
Date: Mon,  6 Sep 2021 11:42:18 +0200	[thread overview]
Message-ID: <20210906094214.6142-4-heiko.thiery@gmail.com> (raw)
In-Reply-To: <20210906094214.6142-1-heiko.thiery@gmail.com>

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

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 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

  parent reply	other threads:[~2021-09-06  9:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  9:42 [Buildroot] [PATCH 0/3] Add support to build imx8 images using mainline uboot Heiko Thiery
2021-09-06  9:42 ` [Buildroot] [PATCH 1/3] package/freescale-imx/firmware-imx: copy all (lp)ddr files unconditionaly Heiko Thiery
2021-09-07  8:29   ` Gary Bisson
2021-09-06  9:42 ` [Buildroot] [PATCH 2/3] boot/uboot: copy ATF bl31 binary to uboot package dir Heiko Thiery
2021-09-06 10:23   ` Michael Walle
2021-09-07  9:16     ` Heiko Thiery
2021-09-06  9:42 ` Heiko Thiery [this message]
2021-09-06 12:45   ` [Buildroot] [PATCH 3/3] boot/uboot: copy IMX firmware files " Stephane Viau (OSS)
2021-09-06 12:48     ` Fabio Estevam
2021-09-06 12:57       ` Stephane Viau (OSS)
2021-09-06 13:20         ` Heiko Thiery
2021-09-06 12:25 ` [Buildroot] [PATCH 0/3] Add support to build imx8 images using mainline uboot Fabio Estevam
2021-09-06 13:32   ` Heiko Thiery
2021-09-06 15:23     ` Fabio Estevam
2021-09-07  6:36       ` Heiko Thiery
2021-09-07  8:36         ` Gary Bisson
2021-09-07  8:43           ` Heiko Thiery
2021-09-07  8:57             ` Gary Bisson
2021-09-07  9:03               ` Heiko Thiery

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=20210906094214.6142-4-heiko.thiery@gmail.com \
    --to=heiko.thiery@gmail.com \
    --cc=bisson.gary@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=festevam@gmail.com \
    --cc=stephane.viau@oss.nxp.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tuzakli.refik@gmail.com \
    --cc=xroumegue@gmail.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