All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
@ 2020-04-27 21:34 Xavier Roumegue
  2020-04-27 21:34 ` [Buildroot] [PATCH 2/3] configs/imx8mmevk: new defconfig Xavier Roumegue
                   ` (2 more replies)
  0 siblings, 3 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-04-27 21:34 UTC (permalink / raw)
  To: buildroot

This script aims to create an imx compatible boot image embedding
mainline components, using only upstream uboot mkimage tool, avoiding
dependencies on proprietary imx mkimage.

Mainline u-boot can generate a bootable image, but SPL soc proprietary
firmware dependencies have to be copied on uboot root dir.

This script prevents additional buildroot uboot recipe hacking to handle
custom SoC uboot build process.

The script actions summary is:
- Append DDR4 firmware to uboot spl binary
- Generate imx mkimage configuration file, extracting entry points from
  relevant elf files on the fly.
- Generate imx boot image using uboot upstream mkimage tool

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 .../common/imx/imx8-generate-fw-image.sh      | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100755 board/freescale/common/imx/imx8-generate-fw-image.sh

diff --git a/board/freescale/common/imx/imx8-generate-fw-image.sh b/board/freescale/common/imx/imx8-generate-fw-image.sh
new file mode 100755
index 0000000000..eb9e96265b
--- /dev/null
+++ b/board/freescale/common/imx/imx8-generate-fw-image.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+get_entry()
+{
+    local elf_file=$1
+    readelf -h "$elf_file" | sed -e '/Entry/!d;s/.*:.*\(0x[0-9a-fA-F]\)/\1/g'
+}
+
+gen_cfg_file()
+{
+cat <<EOF > "$CFG_OUTFILE"
+#define __ASSEMBLY__
+
+FIT
+BOOT_FROM	sd
+LOADER		${SPL_DDR_BIN}	${SPL_ENTRY}
+SECOND_LOADER	${UBOOT_BIN}		${UBOOT_ENTRY} 0x60000
+
+EOF
+}
+
+gen_1stloader_bin()
+{
+    SPL_BIN_PAD="$(mktemp --suffix spl_pad.bin)"
+    dd if="${SPL_BIN}" of="${SPL_BIN_PAD}"  bs=4 conv=sync
+    cat "${SPL_BIN_PAD}" "${DDR_FW_BIN}" > "${SPL_DDR_BIN}"
+}
+
+gen_fw_image()
+{
+    "${HOST_DIR}"/bin/mkimage -n "${CFG_OUTFILE}" -T imx8mimage -e "${SPL_ENTRY}" -d "${UBOOT_BIN}" "${FLASH_BIN}"
+
+}
+main()
+{
+    UBOOT_BIN="${BINARIES_DIR}/u-boot.itb"
+    UBOOT_ELF="${BINARIES_DIR}/u-boot"
+    SPL_DDR_BIN="${BINARIES_DIR}/u-boot-spl-ddr.bin"
+    SPL_BIN="${BINARIES_DIR}/u-boot-spl.bin"
+    SPL_ELF="${BINARIES_DIR}/u-boot-spl"
+    CFG_OUTFILE="${BINARIES_DIR}/bootimage.cfg"
+    FLASH_BIN="${BINARIES_DIR}/imx8-boot-sd.bin"
+    UBOOT_ENTRY="$(get_entry "${UBOOT_ELF}")"
+    SPL_ENTRY="$(get_entry "${SPL_ELF}")"
+    DDR_FW_BIN="${BINARIES_DIR}/lpddr4_pmu_train_fw.bin"
+
+    gen_1stloader_bin
+    gen_cfg_file
+    gen_fw_image
+}
+
+main "$@"
-- 
2.25.1

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

* [Buildroot] [PATCH 2/3] configs/imx8mmevk: new defconfig
  2020-04-27 21:34 [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
@ 2020-04-27 21:34 ` Xavier Roumegue
  2020-04-27 21:34 ` [Buildroot] [PATCH 3/3] configs/imx8mqevk: " Xavier Roumegue
  2020-04-27 21:57 ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-04-27 21:34 UTC (permalink / raw)
  To: buildroot

Introduce NXP imx8mm evk board configuration that uses mainline atf,
uboot and kernel.

Mainline uboot mkimage tool generates the boot image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
Tested-by: Julien Olivain <juju@cotds.org>
---
 .gitlab-ci.yml                       |  1 +
 DEVELOPERS                           |  3 +++
 board/freescale/imx8mmevk/readme.txt | 35 ++++++++++++++++++++++--
 configs/imx8mmevk_defconfig          | 40 ++++++++++++++++++++++++++++
 4 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fa8e077a07..0a348d35ac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -210,6 +210,7 @@ imx6ulevk_defconfig: { extends: .defconfig }
 imx6ulpico_defconfig: { extends: .defconfig }
 imx7d-sdb_defconfig: { extends: .defconfig }
 imx7dpico_defconfig: { extends: .defconfig }
+imx8mmevk_defconfig: { extends: .defconfig }
 imx8mmpico_defconfig: { extends: .defconfig }
 imx8mpico_defconfig: { extends: .defconfig }
 lafrite_defconfig: { extends: .defconfig }
diff --git a/DEVELOPERS b/DEVELOPERS
index 34e19b451e..aa9504d25f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2637,6 +2637,9 @@ F:	package/python-pyusb/
 N:	Wojciech Nizi?ski <niziak@spox.org>
 F:	package/fwup/
 
+N:	Xavier Roumegue <xroumegue@gmail.com>
+F:	configs/imx8mmevk_defconfig
+
 N:	Yann E. MORIN <yann.morin.1998@free.fr>
 F:	board/friendlyarm/nanopi-neo/
 F:	configs/nanopi_neo_defconfig
diff --git a/board/freescale/imx8mmevk/readme.txt b/board/freescale/imx8mmevk/readme.txt
index 7b69405d30..e695dbe779 100644
--- a/board/freescale/imx8mmevk/readme.txt
+++ b/board/freescale/imx8mmevk/readme.txt
@@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
 This file documents the Buildroot support for the Freescale i.MX8MM
 EVK board.
 
-Build
-=====
+Building with NXP ATF, U-Boot and kernel
+========================================
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
@@ -32,6 +32,37 @@ You will find in output/images/ the following files:
   - u-boot-nodtb.bin
   - u-boot-spl-ddr.bin
 
+Building with mainline ATF, U-Boot and kernel
+=============================================
+First, configure Buildroot for the i.MX8MM EVK board:
+
+  make imx8mmevk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+    - bl31.bin
+    - bootimage.cfg
+    - boot.vfat
+    - Image
+    - imx8-boot-sd.bin
+    - imx8mm-evk.dtb
+    - lpddr4_pmu_train_fw.bin
+    - rootfs.ext2
+    - rootfs.ext4
+    - rootfs.tar
+    - sdcard.img
+    - signed_hdmi_imx8m.bin
+    - u-boot
+    - u-boot.bin
+    - u-boot.itb
+    - u-boot-nodtb.bin
+    - u-boot-spl
+    - u-boot-spl.bin
+    - u-boot-spl-ddr.bin
+
 Create a bootable SD card
 =========================
 
diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
new file mode 100644
index 0000000000..5b2b11b1c6
--- /dev/null
+++ b/configs/imx8mmevk_defconfig
@@ -0,0 +1,40 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx8-generate-fw-image.sh board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.6.7"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.04"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_FORMAT_ITB=y
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
-- 
2.25.1

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

* [Buildroot] [PATCH 3/3] configs/imx8mqevk: new defconfig
  2020-04-27 21:34 [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
  2020-04-27 21:34 ` [Buildroot] [PATCH 2/3] configs/imx8mmevk: new defconfig Xavier Roumegue
@ 2020-04-27 21:34 ` Xavier Roumegue
  2020-04-27 21:57 ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-04-27 21:34 UTC (permalink / raw)
  To: buildroot

Introduce NXP imx8mq evk board configuration that uses mainline atf,
uboot and kernel.

Mainline uboot mkimage tool generates the boot image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
Tested-by: Xavier Roumegue <xroumegue@gmail.com>
---
 .gitlab-ci.yml                       |  1 +
 DEVELOPERS                           |  1 +
 board/freescale/imx8mqevk/readme.txt | 35 ++++++++++++++++++++++--
 configs/imx8mqevk_defconfig          | 40 ++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 2 deletions(-)
 create mode 100644 configs/imx8mqevk_defconfig

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0a348d35ac..32ec5d0de1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -213,6 +213,7 @@ imx7dpico_defconfig: { extends: .defconfig }
 imx8mmevk_defconfig: { extends: .defconfig }
 imx8mmpico_defconfig: { extends: .defconfig }
 imx8mpico_defconfig: { extends: .defconfig }
+imx8mqevk_defconfig: { extends: .defconfig }
 lafrite_defconfig: { extends: .defconfig }
 lego_ev3_defconfig: { extends: .defconfig }
 licheepi_zero_defconfig: { extends: .defconfig }
diff --git a/DEVELOPERS b/DEVELOPERS
index aa9504d25f..fe11f43624 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2639,6 +2639,7 @@ F:	package/fwup/
 
 N:	Xavier Roumegue <xroumegue@gmail.com>
 F:	configs/imx8mmevk_defconfig
+F:	configs/imx8mqevk_defconfig
 
 N:	Yann E. MORIN <yann.morin.1998@free.fr>
 F:	board/friendlyarm/nanopi-neo/
diff --git a/board/freescale/imx8mqevk/readme.txt b/board/freescale/imx8mqevk/readme.txt
index e60eba4cb6..43573868e0 100644
--- a/board/freescale/imx8mqevk/readme.txt
+++ b/board/freescale/imx8mqevk/readme.txt
@@ -5,8 +5,8 @@ Freescale i.MX8MQ EVK board
 This file documents the Buildroot support for the Freescale i.MX8MQ
 EVK board.
 
-Build
-=====
+Building with NXP ATF, U-Boot and kernel
+========================================
 
 First, configure Buildroot for the i.MX8MQ EVK board:
 
@@ -33,6 +33,37 @@ You will find in output/images/ the following files:
   - u-boot-nodtb.bin
   - u-boot-spl-ddr.bin
 
+Building with mainline ATF, U-Boot and kernel
+=============================================
+First, configure Buildroot for the i.MX8MQ EVK board:
+
+  make imx8mqevk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+    - bl31.bin
+    - bootimage.cfg
+    - boot.vfat
+    - Image
+    - imx8-boot-sd.bin
+    - imx8mq-evk.dtb
+    - lpddr4_pmu_train_fw.bin
+    - rootfs.ext2
+    - rootfs.ext4
+    - rootfs.tar
+    - sdcard.img
+    - signed_hdmi_imx8m.bin
+    - u-boot
+    - u-boot.bin
+    - u-boot.itb
+    - u-boot-nodtb.bin
+    - u-boot-spl
+    - u-boot-spl.bin
+    - u-boot-spl-ddr.bin
+
 Create a bootable SD card
 =========================
 
diff --git a/configs/imx8mqevk_defconfig b/configs/imx8mqevk_defconfig
new file mode 100644
index 0000000000..365efdd668
--- /dev/null
+++ b/configs/imx8mqevk_defconfig
@@ -0,0 +1,40 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx8-generate-fw-image.sh board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.6.7"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mq-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mq"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.04"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_FORMAT_ITB=y
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x910000"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
-- 
2.25.1

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-04-27 21:34 [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
  2020-04-27 21:34 ` [Buildroot] [PATCH 2/3] configs/imx8mmevk: new defconfig Xavier Roumegue
  2020-04-27 21:34 ` [Buildroot] [PATCH 3/3] configs/imx8mqevk: " Xavier Roumegue
@ 2020-04-27 21:57 ` Thomas Petazzoni
  2020-04-28  8:53   ` Gary Bisson
  2020-04-28 21:50   ` Xavier Roumegue
  2 siblings, 2 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2020-04-27 21:57 UTC (permalink / raw)
  To: buildroot

Hello Xavier,

On Mon, 27 Apr 2020 23:34:00 +0200
Xavier Roumegue <xroumegue@gmail.com> wrote:

> This script aims to create an imx compatible boot image embedding
> mainline components, using only upstream uboot mkimage tool, avoiding
> dependencies on proprietary imx mkimage.
> 
> Mainline u-boot can generate a bootable image, but SPL soc proprietary
> firmware dependencies have to be copied on uboot root dir.
> 
> This script prevents additional buildroot uboot recipe hacking to handle
> custom SoC uboot build process.
> 
> The script actions summary is:
> - Append DDR4 firmware to uboot spl binary
> - Generate imx mkimage configuration file, extracting entry points from
>   relevant elf files on the fly.
> - Generate imx boot image using uboot upstream mkimage tool
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

Thanks for this proposal. Could you share a bit more details about the
upstream U-Boot i.MX8 image generation logic? How does it work, how do
you trigger it, which FW binaries need to be copied to the U-Boot build
directory, etc. ?

>  .../common/imx/imx8-generate-fw-image.sh      | 52 +++++++++++++++++++

We should perhaps find better names to distinguish
imx8-bootloader-prepare.sh from imx8-generate-fw-image.sh, and make it
clear which one is for which situation.

Also, is your script suitable for all i.MX8? I see upstream U-Boot has
separate image tools for i.MX8 and i.MX8M.

Thanks for your feedback,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-04-27 21:57 ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Thomas Petazzoni
@ 2020-04-28  8:53   ` Gary Bisson
  2020-04-28 20:05     ` Fabio Estevam
  2020-04-28 21:50   ` Xavier Roumegue
  1 sibling, 1 reply; 58+ messages in thread
From: Gary Bisson @ 2020-04-28  8:53 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

On Mon, Apr 27, 2020 at 11:57:04PM +0200, Thomas Petazzoni wrote:
> Hello Xavier,
> 
> On Mon, 27 Apr 2020 23:34:00 +0200
> Xavier Roumegue <xroumegue@gmail.com> wrote:
> 
> > This script aims to create an imx compatible boot image embedding
> > mainline components, using only upstream uboot mkimage tool, avoiding
> > dependencies on proprietary imx mkimage.
> > 
> > Mainline u-boot can generate a bootable image, but SPL soc proprietary
> > firmware dependencies have to be copied on uboot root dir.
> > 
> > This script prevents additional buildroot uboot recipe hacking to handle
> > custom SoC uboot build process.
> > 
> > The script actions summary is:
> > - Append DDR4 firmware to uboot spl binary
> > - Generate imx mkimage configuration file, extracting entry points from
> >   relevant elf files on the fly.
> > - Generate imx boot image using uboot upstream mkimage tool
> > 
> > Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> 
> Thanks for this proposal. Could you share a bit more details about the
> upstream U-Boot i.MX8 image generation logic? How does it work, how do
> you trigger it, which FW binaries need to be copied to the U-Boot build
> directory, etc. ?

Same, thanks for this proposal. However I'm not sure adding another
script to basically do the same thing is the preferred option.
The main difference being that it uses the U-Boot mkimage instead of
imx-mkimage.

Ideally I'd like to be able to use the flash.bin U-Boot target so that
we get rid of those post-build scripts for good.

Thomas, what U-Boot needs (for imx8m) are the DDR/HDMI firmware files from
firmware-imx package. The main issue actually is that U-Boot looks for
those binaries at its root. If we could make it point to $BINARIES_DIR
instead, we could use 'flash.bin' target with U-Boot custom dependencies
[1] (if this patch gets accepted) to ensure firmware-imx was built
beforehand.

Otherwise, if we decide to keep a post-build script, I'd rather have
only one, preferrably this one as it doesn't depend on imx-mkimage.
But as Fabio mentioned, it also needs to support 8QXP/8QM, then we could
replaces imx8-bootloader-prepare.sh and also remove imx-mkimage package.

Let me know your thoughts.

Regards,
Gary

[1] http://patchwork.ozlabs.org/project/buildroot/patch/20200425000629.2068191-1-heiko at sntech.de/

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-04-28  8:53   ` Gary Bisson
@ 2020-04-28 20:05     ` Fabio Estevam
  0 siblings, 0 replies; 58+ messages in thread
From: Fabio Estevam @ 2020-04-28 20:05 UTC (permalink / raw)
  To: buildroot

On Tue, Apr 28, 2020 at 5:53 AM Gary Bisson
<gary.bisson@boundarydevices.com> wrote:

> Same, thanks for this proposal. However I'm not sure adding another
> script to basically do the same thing is the preferred option.
> The main difference being that it uses the U-Boot mkimage instead of
> imx-mkimage.
>
> Ideally I'd like to be able to use the flash.bin U-Boot target so that
> we get rid of those post-build scripts for good.
>
> Thomas, what U-Boot needs (for imx8m) are the DDR/HDMI firmware files from
> firmware-imx package. The main issue actually is that U-Boot looks for
> those binaries at its root. If we could make it point to $BINARIES_DIR
> instead, we could use 'flash.bin' target with U-Boot custom dependencies
> [1] (if this patch gets accepted) to ensure firmware-imx was built
> beforehand.
>
> Otherwise, if we decide to keep a post-build script, I'd rather have
> only one, preferrably this one as it doesn't depend on imx-mkimage.
> But as Fabio mentioned, it also needs to support 8QXP/8QM, then we could
> replaces imx8-bootloader-prepare.sh and also remove imx-mkimage package.
>
> Let me know your thoughts.

In case it helps, Jon Nettleton also worked on adding Buildroot
support for i.MX8M booting mainline U-Boot at:
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572

Glad to see Xavier's patch and looking forward to being able to
generate a Buildroot image for i.MX8M/8X that can boot mainline U-Boot
and kernel.

Thanks

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-04-27 21:57 ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Thomas Petazzoni
  2020-04-28  8:53   ` Gary Bisson
@ 2020-04-28 21:50   ` Xavier Roumegue
  2020-11-03 22:39     ` Thomas Petazzoni
  1 sibling, 1 reply; 58+ messages in thread
From: Xavier Roumegue @ 2020-04-28 21:50 UTC (permalink / raw)
  To: buildroot

On Mon, Apr 27, 2020 at 11:57:04PM +0200, Thomas Petazzoni wrote:
> Hello Xavier,
>
> On Mon, 27 Apr 2020 23:34:00 +0200
> Xavier Roumegue <xroumegue@gmail.com> wrote:
>
> > This script aims to create an imx compatible boot image embedding
> > mainline components, using only upstream uboot mkimage tool, avoiding
> > dependencies on proprietary imx mkimage.
> >
> > Mainline u-boot can generate a bootable image, but SPL soc proprietary
> > firmware dependencies have to be copied on uboot root dir.
> >
> > This script prevents additional buildroot uboot recipe hacking to handle
> > custom SoC uboot build process.
> >
> > The script actions summary is:
> > - Append DDR4 firmware to uboot spl binary
> > - Generate imx mkimage configuration file, extracting entry points from
> >   relevant elf files on the fly.
> > - Generate imx boot image using uboot upstream mkimage tool
> >
> > Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
>
> Thanks for this proposal. Could you share a bit more details about the
> upstream U-Boot i.MX8 image generation logic? How does it work, how do
> you trigger it, which FW binaries need to be copied to the U-Boot build
> directory, etc. ?

Hello Thomas,
iMX8 Upstream uboot adds a custom target 'flash.bin', a bootable medium once
written to 33k offset.

1) On iMX8m[mqn], the (lp)ddr4 firmware, and hdmi fw for iMX8mq, have to be copied
in the uboot build dir prior to execute the build.
Additional SoC firmwares (system and security controllers) have to be copied
for iMX8X and iMX8QM.

2) (lp)ddr4 firmware is appended to uboot spl thanks to tools/imx8m_image.sh.
3) A config file per imx platform (*.cfg) is describing the imx mkimage parameters,
..i.e. loaders file paths and entry points, SoC firmwares, boot rom options,
etc..
4) Final loader is uboot.itb, generated as dependency of flash.bin for iMX
platforms, and using an its file generated by arch/arm/mach-imx/mkimage_fit_atf.sh.
ATF, TEE images have as well to be copied to uboot build dir, and their entry
points can be specified through environment variables.

5) Generate 'flash.bin'

The proposed script is taking care of 2), 3) and 5), with intention to support all
iMX8 platforms generating the mkimage config file on the fly and relying on
buildroot recipes to copy the required firmwares in images directory.

Current proposal does not generate the uboot FIT image, but this would likely be
an enhancement I would like to bring once 3) is achieved for all iMX8.

>
> >  .../common/imx/imx8-generate-fw-image.sh      | 52 +++++++++++++++++++
>
> We should perhaps find better names to distinguish
> imx8-bootloader-prepare.sh from imx8-generate-fw-image.sh, and make it
> clear which one is for which situation.
Would 'imx8-generate-upstream-image.sh' be more adapted ?

>
> Also, is your script suitable for all i.MX8? I see upstream U-Boot has
> separate image tools for i.MX8 and i.MX8M.
The current script supports only iMX8MM and iMX8MQ, but the concept is to
generate mkimage configuration file compatible with imx u-boot mkimage. So, this
scales up to any SoC supported by mainline u-boot.

Xavier
>
> Thanks for your feedback,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-04-28 21:50   ` Xavier Roumegue
@ 2020-11-03 22:39     ` Thomas Petazzoni
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                         ` (9 more replies)
  0 siblings, 10 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2020-11-03 22:39 UTC (permalink / raw)
  To: buildroot

Hello Xavier,

On Tue, 28 Apr 2020 23:50:46 +0200
Xavier Roumegue <xroumegue@gmail.com> wrote:

> Hello Thomas,
> iMX8 Upstream uboot adds a custom target 'flash.bin', a bootable medium once
> written to 33k offset.
> 
> 1) On iMX8m[mqn], the (lp)ddr4 firmware, and hdmi fw for iMX8mq, have to be copied
> in the uboot build dir prior to execute the build.
> Additional SoC firmwares (system and security controllers) have to be copied
> for iMX8X and iMX8QM.
> 
> 2) (lp)ddr4 firmware is appended to uboot spl thanks to tools/imx8m_image.sh.
> 3) A config file per imx platform (*.cfg) is describing the imx mkimage parameters,
> ..i.e. loaders file paths and entry points, SoC firmwares, boot rom options,
> etc..
> 4) Final loader is uboot.itb, generated as dependency of flash.bin for iMX
> platforms, and using an its file generated by arch/arm/mach-imx/mkimage_fit_atf.sh.
> ATF, TEE images have as well to be copied to uboot build dir, and their entry
> points can be specified through environment variables.
> 
> 5) Generate 'flash.bin'
> 
> The proposed script is taking care of 2), 3) and 5), with intention to support all
> iMX8 platforms generating the mkimage config file on the fly and relying on
> buildroot recipes to copy the required firmwares in images directory.
> 
> Current proposal does not generate the uboot FIT image, but this would likely be
> an enhancement I would like to bring once 3) is achieved for all iMX8.

Thanks a lot for providing those additional details, and sorry for the
long delay. After looking into this a bit, I really think we should
leverage more what U-Boot upstream is doing, and not re-invent all this
image creation logic.

So in fact, I do like better what
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
is doing. The only gotcha is that it uses BINDIR to point to
BINARIES_DIR, but BINDIR doesn't exist in upstream U-Boot, it seems to
be some SolidRun-specific change that we can't rely on.

But since this patch is also adding a
BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE, we can definitely add some logic
in uboot.mk to copy the i.MX firmware files within the U-Boot source
directory prior to the build. Yes, it's more logic in uboot.mk, but I
find that better than more logic in yet another custom shell script in
board/.

Do you think you could rework your patch in this direction ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components
  2020-11-03 22:39     ` Thomas Petazzoni
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 " Xavier Roumegue
                           ` (8 more replies)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                         ` (8 subsequent siblings)
  9 siblings, 9 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

This patch set aims to add support for booting imx8m platforms with upstream
BSP components, avoiding the use of proprietary imx-mkimage tool.

Uboot is using its embedded mkimage tool and a per platform configuration file
to generate the boot medium thanks to additional imx specific makefile targets.

Delegating the bootable image generation to uboot requires proprietary SoC
firmwares either involved in the boot flow or eventually requiring
authentication to be copied in the uboot build directory.

As per Thomas proposal, this patch set mainly adds an option to copy a files
list, from binaries folder to uboot build directory as dependency of uboot
build step.

This was inspired from SolidRun patch below:
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
but this was adapted to prevent uboot patches and generalize the approach to
any platforms.

Changes v1 -> v2:
    - Initial patch set proposal was using a dedicated board script to
      generate the boot image as buildroot step, templatizing the configuration
      file used to define the boot image and reusing the firmwares from the
      binaries folder.
    - imx8mq platform does not boot with hdmi fw embedded in the boot image and
      recent arm trusted firmware, so imx8mq config file is removed since a
      change to uboot mkimage configuration file is required.

Xavier Roumegue (8):
  package/freescale-imx/firmware-imx: Add option to install all ddr fw
    files
  boot/uboot: Add option to install fw files list to uboot build
    directory
  freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  boot/uboot/imx8: Add new target needed for mainline u-boot
  board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  board/freescale/common/imx8: Use post build generated uboot image if
    present
  board/freescale/common/imx8: Templatize uboot image name
  configs/imx8mmevk: new defconfig

 DEVELOPERS                                    |  3 ++
 .../common/imx/genimage.cfg.template_imx8     |  2 +-
 board/freescale/common/imx/post-image.sh      |  6 +++-
 board/freescale/imx8mmevk/readme.txt          | 29 ++++++++++++++--
 boot/uboot/Config.in                          | 19 +++++++++++
 boot/uboot/uboot.mk                           | 15 ++++++++
 configs/imx8mmevk_defconfig                   | 34 +++++++++++++++++++
 package/freescale-imx/firmware-imx/Config.in  |  4 +++
 .../firmware-imx/firmware-imx.mk              | 12 +++++++
 9 files changed, 120 insertions(+), 4 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

--
2.28.0

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

* [Buildroot] [PATCH v2 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-03 22:39     ` Thomas Petazzoni
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
                         ` (7 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
BINARIES_DIR.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 package/freescale-imx/firmware-imx/Config.in       |  3 +++
 package/freescale-imx/firmware-imx/firmware-imx.mk | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 587f402426..2ed6d4254d 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -81,6 +81,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 	help
 	  The DMEM firmware will be padded to this length
 
+config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
+    bool
+
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index fb3cfe640b..c5ae4fad25 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -36,6 +36,16 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
 		$(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(3)).bin
 endef
 
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE),y)
+define FIRMWARE_IMX_COPY_DDR_FW
+	cp $(1) $(BINARIES_DIR)/
+endef
+else
+define FIRMWARE_IMX_COPY_DDR_FW
+	true
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 
@@ -51,6 +61,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin)
 endef
 endif
 
@@ -69,6 +80,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin)
 endef
 endif
 
-- 
2.28.0

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

* [Buildroot] [PATCH v2 2/8] boot/uboot: Add option to install fw files list to uboot build directory
  2020-11-03 22:39     ` Thomas Petazzoni
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
                         ` (6 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

This copies a list of fw files, which have to be installed by others
packages to BINARIES_DIR to uboot build directory.
Some platforms, such as imx8, require firmware files located in the
build directory to generate a bootable image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 boot/uboot/Config.in | 14 ++++++++++++++
 boot/uboot/uboot.mk  |  9 +++++++++
 2 files changed, 23 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index e4a0f48deb..f44a5b4976 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -229,6 +229,20 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 endchoice
 
+config BR2_TARGET_UBOOT_NEEDS_FW
+    bool "U-Boot needs FW files"
+    help
+      Some platforms (such as iMX8) requires subsystem firmware files
+      encapsulated within the u-boot payload such as this configure properly the
+      memory subystem or those later require authentication from boot ROM.
+
+config BR2_TARGET_UBOOT_FW_FILES
+    depends on BR2_TARGET_UBOOT_NEEDS_FW
+    string "Firmware files list"
+    help
+      Specify the list of files to be copied in the u-boot build directory from
+      the binary folder.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 72d5df412d..7a77fdb20b 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -428,6 +428,15 @@ define UBOOT_KCONFIG_FIXUP_CMDS
 	$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
 endef
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_FW),y)
+define UBOOT_COPY_TARGET_FW
+	$(foreach f,$(BR2_TARGET_UBOOT_FW_FILES), \
+		cp -f $(BINARIES_DIR)/$(call qstrip,$(f)) $(@D)/
+	)
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_TARGET_FW
+endif
+
 ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
 
 #
-- 
2.28.0

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

* [Buildroot] [PATCH v2 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (2 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
                         ` (5 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 package/freescale-imx/firmware-imx/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 2ed6d4254d..69381e71b5 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -83,6 +83,7 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 
 config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
     bool
+    default y if BR2_TARGET_UBOOT_NEEDS_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
-- 
2.28.0

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

* [Buildroot] [PATCH v2 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (3 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
                         ` (4 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Mainline u-boot support for the iMX8M based boards is no longer
using the external imx-mkimage command and instead building
the fit image directly inside U-Boot.

This fit image usually embeds ddr/hdmi firmware for iMX8M target.

Inspired from
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 boot/uboot/Config.in | 5 +++++
 boot/uboot/uboot.mk  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index f44a5b4976..9d6e520cb6 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -280,6 +280,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
 config BR2_TARGET_UBOOT_FORMAT_ITB
 	bool "u-boot.itb"
 
+config BR2_TARGET_UBOOT_FORMAT_IMX_FIT
+	bool "flash.bin"
+	select BR2_PACKAGE_FIRMWARE_IMX
+	select BR2_TARGET_UBOOT_NEEDS_FW
+
 config BR2_TARGET_UBOOT_FORMAT_KWB
 	bool "u-boot.kwb (Marvell)"
 	depends on BR2_arm
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 7a77fdb20b..2625248310 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -101,6 +101,12 @@ UBOOT_BINS += u-boot.imx
 UBOOT_MAKE_TARGET += u-boot.imx
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_IMX_FIT),y)
+UBOOT_BINS = flash.bin
+UBOOT_MAKE_TARGET += flash.bin
+UBOOT_DEPENDENCIES += firmware-imx
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
 UBOOT_BINS += u-boot.sb
 UBOOT_MAKE_TARGET += u-boot.sb
-- 
2.28.0

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

* [Buildroot] [PATCH v2 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (4 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
                         ` (3 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 06ccaac3a4..1cca1849be 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -70,6 +70,8 @@ uboot_image()
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y$" ${BR2_CONFIG}; then
+		echo "flash.bin"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y$" ${BR2_CONFIG}; then
 	    echo "u-boot-dtb.img"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMG=y$" ${BR2_CONFIG}; then
-- 
2.28.0

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

* [Buildroot] [PATCH v2 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (5 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
                         ` (2 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Stick the uboot image filename to "imx8-boot-sd.bin" in case the
final uboot image, embedding fw files, is generated thanks to a post
build script.

This takes precedence over all uboot images generating during uboot
build.

This should help to remove the dedicated imx8 config template file

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 1cca1849be..7916b8dae6 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -66,7 +66,9 @@ imx_offset()
 
 uboot_image()
 {
-	if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
+	if [ -e "${BINARIES_DIR}"/imx8-boot-sd.bin ]; then
+		echo "imx8-boot-sd.bin"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
-- 
2.28.0

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

* [Buildroot] [PATCH v2 7/8] board/freescale/common/imx8: Templatize uboot image name
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (6 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  2020-11-10 20:44       ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/genimage.cfg.template_imx8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/genimage.cfg.template_imx8 b/board/freescale/common/imx/genimage.cfg.template_imx8
index 5689205083..b9d6dbde27 100644
--- a/board/freescale/common/imx/genimage.cfg.template_imx8
+++ b/board/freescale/common/imx/genimage.cfg.template_imx8
@@ -23,7 +23,7 @@ image sdcard.img {
 
   partition imx-boot {
     in-partition-table = "no"
-    image = "imx8-boot-sd.bin"
+    image = "%UBOOTBIN%"
     offset = %IMXOFFSET%
   }
 
-- 
2.28.0

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

* [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (7 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
@ 2020-11-07 13:59       ` Xavier Roumegue
  2020-11-08  0:05         ` Fabio Estevam
  2020-11-10 20:44       ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
  9 siblings, 1 reply; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-07 13:59 UTC (permalink / raw)
  To: buildroot

Introduce NXP imx8mm evk board configuration that uses mainline atf,
uboot and kernel.

Mainline uboot mkimage tool generates the boot image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 DEVELOPERS                           |  3 +++
 board/freescale/imx8mmevk/readme.txt | 29 ++++++++++++++++++++++--
 configs/imx8mmevk_defconfig          | 34 ++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 2 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 43cc1b55ae..9f5e23b612 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2690,6 +2690,9 @@ F:	package/fwup/
 N:	Yair Ben Avraham <yairba@protonmail.com>
 F:	package/gloox/
 
+N:	Xavier Roumegue <xroumegue@gmail.com>
+F:	configs/imx8mmevk_defconfig
+
 N:	Yann E. MORIN <yann.morin.1998@free.fr>
 F:	board/friendlyarm/nanopi-neo/
 F:	configs/nanopi_neo_defconfig
diff --git a/board/freescale/imx8mmevk/readme.txt b/board/freescale/imx8mmevk/readme.txt
index 7b69405d30..be3b54e40d 100644
--- a/board/freescale/imx8mmevk/readme.txt
+++ b/board/freescale/imx8mmevk/readme.txt
@@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
 This file documents the Buildroot support for the Freescale i.MX8MM
 EVK board.
 
-Build
-=====
+Building with NXP ATF, U-Boot and kernel
+========================================
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
@@ -32,6 +32,31 @@ You will find in output/images/ the following files:
   - u-boot-nodtb.bin
   - u-boot-spl-ddr.bin
 
+Building with mainline ATF, U-Boot and kernel
+=============================================
+First, configure Buildroot for the i.MX8MM EVK board:
+
+  make imx8mmevk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+    - bl31.bin
+    - boot.vfat
+    - ddr_fw.bin
+    - flash.bin
+    - Image
+    - imx8mm-evk.dtb
+    - [lp]ddr4_*.bin
+    - rootfs.ext2
+    - rootfs.ext4
+    - rootfs.tar
+    - sdcard.img
+    - u-boot-spl
+    - u-boot-spl.bin
+
 Create a bootable SD card
 =========================
 
diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
new file mode 100644
index 0000000000..c5245b3470
--- /dev/null
+++ b/configs/imx8mmevk_defconfig
@@ -0,0 +1,34 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
-- 
2.28.0

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

* [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
@ 2020-11-08  0:05         ` Fabio Estevam
  2020-11-10 20:23           ` Xavier Roumegue
  0 siblings, 1 reply; 58+ messages in thread
From: Fabio Estevam @ 2020-11-08  0:05 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

On Sat, Nov 7, 2020 at 10:59 AM Xavier Roumegue <xroumegue@gmail.com> wrote:
>
> Introduce NXP imx8mm evk board configuration that uses mainline atf,
> uboot and kernel.
>
> Mainline uboot mkimage tool generates the boot image.

Thanks for working on this series!

> +BR2_aarch64=y
> +BR2_ARM_FPU_VFPV3=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
> +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y

You missed to pass the specific kernel version like:
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.7"


> +BR2_PACKAGE_FREESCALE_IMX=y
> +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
> +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> +BR2_TARGET_UBOOT_FORMAT_ELF=y
> +BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"

You missed to pass the specific U-Boot version like:
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"

Thanks

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

* [Buildroot] [PATCH v3 0/8] Add imx8mm platform using only upstream components
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                           ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

This patch set aims to add support for booting imx8m platforms with upstream
BSP components, avoiding the use of proprietary imx-mkimage tool.

Uboot is using its embedded mkimage tool and a per platform configuration file
to generate the boot medium thanks to additional imx specific makefile targets.

Delegating the bootable image generation to uboot requires proprietary SoC
firmwares either involved in the boot flow or eventually requiring
authentication to be copied in the uboot build directory.

As per Thomas proposal, this patch set mainly adds an option to copy a files
list, from binaries folder to uboot build directory as dependency of uboot
build step.

This was inspired from SolidRun patch below:
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
but this was adapted to prevent uboot patches and generalize the approach to
any platforms.

Changes v1 -> v2:
    - Initial patch set proposal was using a dedicated board script to
      generate the boot image as buildroot step, templatizing the configuration
      file used to define the boot image and reusing the firmwares from the
      binaries folder.
    - imx8mq platform does not boot with hdmi fw embedded in the boot image and
      recent arm trusted firmware, so imx8mq config file is removed since a
      change to uboot mkimage configuration file is required.
Changes v2 -> v3:
    - Use custom version for kernel, uboot (Suggested by Fabio Estevam)

Xavier Roumegue (8):
  package/freescale-imx/firmware-imx: Add option to install all ddr fw
    files
  boot/uboot: Add option to install fw files list to uboot build
    directory
  freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  boot/uboot/imx8: Add new target needed for mainline u-boot
  board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  board/freescale/common/imx8: Use post build generated uboot image if
    present
  board/freescale/common/imx8: Templatize uboot image name
  configs/imx8mmevk: new defconfig

 DEVELOPERS                                    |  3 ++
 .../common/imx/genimage.cfg.template_imx8     |  2 +-
 board/freescale/common/imx/post-image.sh      |  6 ++-
 board/freescale/imx8mmevk/readme.txt          | 29 +++++++++++++-
 boot/uboot/Config.in                          | 19 +++++++++
 boot/uboot/uboot.mk                           | 15 +++++++
 configs/imx8mmevk_defconfig                   | 40 +++++++++++++++++++
 package/freescale-imx/firmware-imx/Config.in  |  4 ++
 .../firmware-imx/firmware-imx.mk              | 12 ++++++
 9 files changed, 126 insertions(+), 4 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

--
2.28.0

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

* [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 " Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-25  9:15           ` Stephane Viau
                             ` (9 more replies)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
                           ` (6 subsequent siblings)
  8 siblings, 10 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
BINARIES_DIR.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 package/freescale-imx/firmware-imx/Config.in       |  3 +++
 package/freescale-imx/firmware-imx/firmware-imx.mk | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 587f402426..2ed6d4254d 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -81,6 +81,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 	help
 	  The DMEM firmware will be padded to this length
 
+config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
+    bool
+
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index fb3cfe640b..c5ae4fad25 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -36,6 +36,16 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
 		$(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(3)).bin
 endef
 
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE),y)
+define FIRMWARE_IMX_COPY_DDR_FW
+	cp $(1) $(BINARIES_DIR)/
+endef
+else
+define FIRMWARE_IMX_COPY_DDR_FW
+	true
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 
@@ -51,6 +61,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin)
 endef
 endif
 
@@ -69,6 +80,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin)
 endef
 endif
 
-- 
2.28.0

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

* [Buildroot] [PATCH v3 2/8] boot/uboot: Add option to install fw files list to uboot build directory
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 " Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
                           ` (5 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

This copies a list of fw files, which have to be installed by others
packages to BINARIES_DIR to uboot build directory.
Some platforms, such as imx8, require firmware files located in the
build directory to generate a bootable image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 boot/uboot/Config.in | 14 ++++++++++++++
 boot/uboot/uboot.mk  |  9 +++++++++
 2 files changed, 23 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index e4a0f48deb..f44a5b4976 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -229,6 +229,20 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 endchoice
 
+config BR2_TARGET_UBOOT_NEEDS_FW
+    bool "U-Boot needs FW files"
+    help
+      Some platforms (such as iMX8) requires subsystem firmware files
+      encapsulated within the u-boot payload such as this configure properly the
+      memory subystem or those later require authentication from boot ROM.
+
+config BR2_TARGET_UBOOT_FW_FILES
+    depends on BR2_TARGET_UBOOT_NEEDS_FW
+    string "Firmware files list"
+    help
+      Specify the list of files to be copied in the u-boot build directory from
+      the binary folder.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 72d5df412d..7a77fdb20b 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -428,6 +428,15 @@ define UBOOT_KCONFIG_FIXUP_CMDS
 	$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
 endef
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_FW),y)
+define UBOOT_COPY_TARGET_FW
+	$(foreach f,$(BR2_TARGET_UBOOT_FW_FILES), \
+		cp -f $(BINARIES_DIR)/$(call qstrip,$(f)) $(@D)/
+	)
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_TARGET_FW
+endif
+
 ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
 
 #
-- 
2.28.0

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

* [Buildroot] [PATCH v3 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (2 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
                           ` (4 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 package/freescale-imx/firmware-imx/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 2ed6d4254d..69381e71b5 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -83,6 +83,7 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 
 config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
     bool
+    default y if BR2_TARGET_UBOOT_NEEDS_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
-- 
2.28.0

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

* [Buildroot] [PATCH v3 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (3 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
                           ` (3 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Mainline u-boot support for the iMX8M based boards is no longer
using the external imx-mkimage command and instead building
the fit image directly inside U-Boot.

This fit image usually embeds ddr/hdmi firmware for iMX8M target.

Inspired from
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 boot/uboot/Config.in | 5 +++++
 boot/uboot/uboot.mk  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index f44a5b4976..9d6e520cb6 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -280,6 +280,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
 config BR2_TARGET_UBOOT_FORMAT_ITB
 	bool "u-boot.itb"
 
+config BR2_TARGET_UBOOT_FORMAT_IMX_FIT
+	bool "flash.bin"
+	select BR2_PACKAGE_FIRMWARE_IMX
+	select BR2_TARGET_UBOOT_NEEDS_FW
+
 config BR2_TARGET_UBOOT_FORMAT_KWB
 	bool "u-boot.kwb (Marvell)"
 	depends on BR2_arm
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 7a77fdb20b..2625248310 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -101,6 +101,12 @@ UBOOT_BINS += u-boot.imx
 UBOOT_MAKE_TARGET += u-boot.imx
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_IMX_FIT),y)
+UBOOT_BINS = flash.bin
+UBOOT_MAKE_TARGET += flash.bin
+UBOOT_DEPENDENCIES += firmware-imx
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
 UBOOT_BINS += u-boot.sb
 UBOOT_MAKE_TARGET += u-boot.sb
-- 
2.28.0

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

* [Buildroot] [PATCH v3 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (4 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
                           ` (2 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 06ccaac3a4..1cca1849be 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -70,6 +70,8 @@ uboot_image()
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y$" ${BR2_CONFIG}; then
+		echo "flash.bin"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y$" ${BR2_CONFIG}; then
 	    echo "u-boot-dtb.img"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMG=y$" ${BR2_CONFIG}; then
-- 
2.28.0

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

* [Buildroot] [PATCH v3 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (5 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Stick the uboot image filename to "imx8-boot-sd.bin" in case the
final uboot image, embedding fw files, is generated thanks to a post
build script.

This takes precedence over all uboot images generating during uboot
build.

This should help to remove the dedicated imx8 config template file

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 1cca1849be..7916b8dae6 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -66,7 +66,9 @@ imx_offset()
 
 uboot_image()
 {
-	if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
+	if [ -e "${BINARIES_DIR}"/imx8-boot-sd.bin ]; then
+		echo "imx8-boot-sd.bin"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
-- 
2.28.0

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

* [Buildroot] [PATCH v3 7/8] board/freescale/common/imx8: Templatize uboot image name
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (6 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  8 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/genimage.cfg.template_imx8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/genimage.cfg.template_imx8 b/board/freescale/common/imx/genimage.cfg.template_imx8
index 5689205083..b9d6dbde27 100644
--- a/board/freescale/common/imx/genimage.cfg.template_imx8
+++ b/board/freescale/common/imx/genimage.cfg.template_imx8
@@ -23,7 +23,7 @@ image sdcard.img {
 
   partition imx-boot {
     in-partition-table = "no"
-    image = "imx8-boot-sd.bin"
+    image = "%UBOOTBIN%"
     offset = %IMXOFFSET%
   }
 
-- 
2.28.0

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

* [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                           ` (7 preceding siblings ...)
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
@ 2020-11-09 14:23         ` Xavier Roumegue
  2020-11-09 20:27           ` Julien Olivain
  2020-11-11 20:31           ` Fabio Estevam
  8 siblings, 2 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-09 14:23 UTC (permalink / raw)
  To: buildroot

Introduce NXP imx8mm evk board configuration that uses mainline atf,
uboot and kernel.

Mainline uboot mkimage tool generates the boot image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

---
Changes v2 -> v3:
    - Set a custom version to uboot/kernel (Suggested by Fabio Estevam)
---
 DEVELOPERS                           |  3 +++
 board/freescale/imx8mmevk/readme.txt | 29 ++++++++++++++++++--
 configs/imx8mmevk_defconfig          | 40 ++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 43cc1b55ae..9f5e23b612 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2690,6 +2690,9 @@ F:	package/fwup/
 N:	Yair Ben Avraham <yairba@protonmail.com>
 F:	package/gloox/
 
+N:	Xavier Roumegue <xroumegue@gmail.com>
+F:	configs/imx8mmevk_defconfig
+
 N:	Yann E. MORIN <yann.morin.1998@free.fr>
 F:	board/friendlyarm/nanopi-neo/
 F:	configs/nanopi_neo_defconfig
diff --git a/board/freescale/imx8mmevk/readme.txt b/board/freescale/imx8mmevk/readme.txt
index 7b69405d30..be3b54e40d 100644
--- a/board/freescale/imx8mmevk/readme.txt
+++ b/board/freescale/imx8mmevk/readme.txt
@@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
 This file documents the Buildroot support for the Freescale i.MX8MM
 EVK board.
 
-Build
-=====
+Building with NXP ATF, U-Boot and kernel
+========================================
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
@@ -32,6 +32,31 @@ You will find in output/images/ the following files:
   - u-boot-nodtb.bin
   - u-boot-spl-ddr.bin
 
+Building with mainline ATF, U-Boot and kernel
+=============================================
+First, configure Buildroot for the i.MX8MM EVK board:
+
+  make imx8mmevk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+    - bl31.bin
+    - boot.vfat
+    - ddr_fw.bin
+    - flash.bin
+    - Image
+    - imx8mm-evk.dtb
+    - [lp]ddr4_*.bin
+    - rootfs.ext2
+    - rootfs.ext4
+    - rootfs.tar
+    - sdcard.img
+    - u-boot-spl
+    - u-boot-spl.bin
+
 Create a bootable SD card
 =========================
 
diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
new file mode 100644
index 0000000000..089acd506c
--- /dev/null
+++ b/configs/imx8mmevk_defconfig
@@ -0,0 +1,40 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.18"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
-- 
2.28.0

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

* [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
@ 2020-11-09 20:27           ` Julien Olivain
  2020-11-11 20:31           ` Fabio Estevam
  1 sibling, 0 replies; 58+ messages in thread
From: Julien Olivain @ 2020-11-09 20:27 UTC (permalink / raw)
  To: buildroot

Hi,

On 09/11/2020 15:23, Xavier Roumegue wrote:
> Introduce NXP imx8mm evk board configuration that uses mainline atf,
> uboot and kernel.
> 
> Mainline uboot mkimage tool generates the boot image.
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

Tested-by: Julien Olivain <ju.o@free.fr>
[Julien: tested on i.MX8M Mini EVK Rev A with LPDDR4]

> 
> ---
> Changes v2 -> v3:
>     - Set a custom version to uboot/kernel (Suggested by Fabio Estevam)
> ---
>  DEVELOPERS                           |  3 +++
>  board/freescale/imx8mmevk/readme.txt | 29 ++++++++++++++++++--
>  configs/imx8mmevk_defconfig          | 40 ++++++++++++++++++++++++++++
>  3 files changed, 70 insertions(+), 2 deletions(-)
>  create mode 100644 configs/imx8mmevk_defconfig
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 43cc1b55ae..9f5e23b612 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2690,6 +2690,9 @@ F:	package/fwup/
>  N:	Yair Ben Avraham <yairba@protonmail.com>
>  F:	package/gloox/
> 
> +N:	Xavier Roumegue <xroumegue@gmail.com>
> +F:	configs/imx8mmevk_defconfig
> +
>  N:	Yann E. MORIN <yann.morin.1998@free.fr>
>  F:	board/friendlyarm/nanopi-neo/
>  F:	configs/nanopi_neo_defconfig
> diff --git a/board/freescale/imx8mmevk/readme.txt
> b/board/freescale/imx8mmevk/readme.txt
> index 7b69405d30..be3b54e40d 100644
> --- a/board/freescale/imx8mmevk/readme.txt
> +++ b/board/freescale/imx8mmevk/readme.txt
> @@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
>  This file documents the Buildroot support for the Freescale i.MX8MM
>  EVK board.
> 
> -Build
> -=====
> +Building with NXP ATF, U-Boot and kernel
> +========================================
> 
>  First, configure Buildroot for the i.MX8MM EVK board:
> 
> @@ -32,6 +32,31 @@ You will find in output/images/ the following files:
>    - u-boot-nodtb.bin
>    - u-boot-spl-ddr.bin
> 
> +Building with mainline ATF, U-Boot and kernel
> +=============================================
> +First, configure Buildroot for the i.MX8MM EVK board:
> +
> +  make imx8mmevk_defconfig
> +
> +Build all components:
> +
> +  make
> +
> +You will find in output/images/ the following files:
> +    - bl31.bin
> +    - boot.vfat
> +    - ddr_fw.bin
> +    - flash.bin
> +    - Image
> +    - imx8mm-evk.dtb
> +    - [lp]ddr4_*.bin
> +    - rootfs.ext2
> +    - rootfs.ext4
> +    - rootfs.tar
> +    - sdcard.img
> +    - u-boot-spl
> +    - u-boot-spl.bin
> +
>  Create a bootable SD card
>  =========================
> 
> diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
> new file mode 100644
> index 0000000000..089acd506c
> --- /dev/null
> +++ b/configs/imx8mmevk_defconfig
> @@ -0,0 +1,40 @@
> +BR2_aarch64=y
> +BR2_ARM_FPU_VFPV3=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.18"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
> +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_PACKAGE_FREESCALE_IMX=y
> +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
> +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> +BR2_TARGET_UBOOT_FORMAT_ELF=y
> +BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
> +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y
> +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
> +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y

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

* [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig
  2020-11-08  0:05         ` Fabio Estevam
@ 2020-11-10 20:23           ` Xavier Roumegue
  0 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-10 20:23 UTC (permalink / raw)
  To: buildroot

On Sat, Nov 07, 2020 at 09:05:10PM -0300, Fabio Estevam wrote:
Hi Fabio,
> Hi Xavier,
>
> On Sat, Nov 7, 2020 at 10:59 AM Xavier Roumegue <xroumegue@gmail.com> wrote:
> >
> > Introduce NXP imx8mm evk board configuration that uses mainline atf,
> > uboot and kernel.
> >
> > Mainline uboot mkimage tool generates the boot image.
>
> Thanks for working on this series!
>
> > +BR2_aarch64=y
> > +BR2_ARM_FPU_VFPV3=y
> > +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
> > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
> > +BR2_LINUX_KERNEL=y
> > +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> > +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> > +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
> > +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
>
> You missed to pass the specific kernel version like:
> BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.7"
>
>
> > +BR2_PACKAGE_FREESCALE_IMX=y
> > +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
> > +BR2_TARGET_ROOTFS_EXT2=y
> > +BR2_TARGET_ROOTFS_EXT2_4=y
> > +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
> > +BR2_TARGET_UBOOT=y
> > +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
> > +BR2_TARGET_UBOOT_NEEDS_DTC=y
> > +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> > +BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
> > +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> > +BR2_TARGET_UBOOT_FORMAT_ELF=y
> > +BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
> > +BR2_TARGET_UBOOT_SPL=y
> > +BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
>
> You missed to pass the specific U-Boot version like:
> BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"

Thanks for catching my mistake.
Patch series updated to v3

Xavier

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

* [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary
  2020-11-03 22:39     ` Thomas Petazzoni
                         ` (8 preceding siblings ...)
  2020-11-07 13:59       ` [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
@ 2020-11-10 20:44       ` Xavier Roumegue
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-10 20:44 UTC (permalink / raw)
  To: buildroot

On Tue, Nov 03, 2020 at 11:39:34PM +0100, Thomas Petazzoni wrote:
Hello Thomas,
> Hello Xavier,
>
> On Tue, 28 Apr 2020 23:50:46 +0200
> Xavier Roumegue <xroumegue@gmail.com> wrote:
>
> > Hello Thomas,
> > iMX8 Upstream uboot adds a custom target 'flash.bin', a bootable medium once
> > written to 33k offset.
> >
> > 1) On iMX8m[mqn], the (lp)ddr4 firmware, and hdmi fw for iMX8mq, have to be copied
> > in the uboot build dir prior to execute the build.
> > Additional SoC firmwares (system and security controllers) have to be copied
> > for iMX8X and iMX8QM.
> >
> > 2) (lp)ddr4 firmware is appended to uboot spl thanks to tools/imx8m_image.sh.
> > 3) A config file per imx platform (*.cfg) is describing the imx mkimage parameters,
> > ..i.e. loaders file paths and entry points, SoC firmwares, boot rom options,
> > etc..
> > 4) Final loader is uboot.itb, generated as dependency of flash.bin for iMX
> > platforms, and using an its file generated by arch/arm/mach-imx/mkimage_fit_atf.sh.
> > ATF, TEE images have as well to be copied to uboot build dir, and their entry
> > points can be specified through environment variables.
> >
> > 5) Generate 'flash.bin'
> >
> > The proposed script is taking care of 2), 3) and 5), with intention to support all
> > iMX8 platforms generating the mkimage config file on the fly and relying on
> > buildroot recipes to copy the required firmwares in images directory.
> >
> > Current proposal does not generate the uboot FIT image, but this would likely be
> > an enhancement I would like to bring once 3) is achieved for all iMX8.
>
> Thanks a lot for providing those additional details, and sorry for the
> long delay. After looking into this a bit, I really think we should
> leverage more what U-Boot upstream is doing, and not re-invent all this
> image creation logic.
>
> So in fact, I do like better what
> https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
> is doing. The only gotcha is that it uses BINDIR to point to
> BINARIES_DIR, but BINDIR doesn't exist in upstream U-Boot, it seems to
> be some SolidRun-specific change that we can't rely on.
>
> But since this patch is also adding a
> BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE, we can definitely add some logic
> in uboot.mk to copy the i.MX firmware files within the U-Boot source
> directory prior to the build. Yes, it's more logic in uboot.mk, but I
> find that better than more logic in yet another custom shell script in
> board/.
>
> Do you think you could rework your patch in this direction ?

I reworked the patch series as per your suggestion.
I tried to be as much generic as possible on the uboot recipe patch.

Please, let me know your thoughts, in case this needs additional rework..
I would like to carry on with upstream configurations on imx8m[qnp] evk boards.

Thanks.
 Xavier

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

* [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  2020-11-09 20:27           ` Julien Olivain
@ 2020-11-11 20:31           ` Fabio Estevam
  1 sibling, 0 replies; 58+ messages in thread
From: Fabio Estevam @ 2020-11-11 20:31 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

On Mon, Nov 9, 2020 at 11:23 AM Xavier Roumegue <xroumegue@gmail.com> wrote:
>
> Introduce NXP imx8mm evk board configuration that uses mainline atf,
> uboot and kernel.
>
> Mainline uboot mkimage tool generates the boot image.
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
>
> ---
> Changes v2 -> v3:
>     - Set a custom version to uboot/kernel (Suggested by Fabio Estevam)

It looks good now:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

Looking forward to seeing this patch series applied :-)

Thanks for your work!

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

* [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
@ 2020-11-25  9:15           ` Stephane Viau
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
                             ` (8 subsequent siblings)
  9 siblings, 0 replies; 58+ messages in thread
From: Stephane Viau @ 2020-11-25  9:15 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

>________________________________________
>From: buildroot <buildroot-bounces@busybox.net> on behalf of Xavier Roumegue <xroumegue@gmail.com>
>Sent: Monday, November 9, 2020 2:23 PM
>To: buildroot at buildroot.org; Thomas Petazzoni
>Cc: Gary Bisson; Xavier Roumegue; Fabio Estevam; Gilles Talis; Refik Tuzakli; Julien Olivain
>Subject: [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
>
>Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
>BINARIES_DIR.
>
>Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
>---
> package/freescale-imx/firmware-imx/Config.in       |  3 +++
> package/freescale-imx/firmware-imx/firmware-imx.mk | 12 ++++++++++++
> 2 files changed, 15 insertions(+)
>
>diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
>index 587f402426..2ed6d4254d 100644
>--- a/package/freescale-imx/firmware-imx/Config.in
>+++ b/package/freescale-imx/firmware-imx/Config.in
>@@ -81,6 +81,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
>        help
>          The DMEM firmware will be padded to this length
>
>+config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
>+    bool

Can you please fix the 'make check-package' error?
The same applies to a few of your other patches from the series.

>+
> endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
>
> endif # BR2_PACKAGE_FIRMWARE_IMX
>diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
>index fb3cfe640b..c5ae4fad25 100644
>--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
>+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
>@@ -36,6 +36,16 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
>                $(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(3)).bin
> endef
>
>+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE),y)
>+define FIRMWARE_IMX_COPY_DDR_FW
>+       cp $(1) $(BINARIES_DIR)/
>+endef
>+else
>+define FIRMWARE_IMX_COPY_DDR_FW
>+       true
>+endef
>+endif
>+
> ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
> FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>
>@@ -51,6 +61,7 @@ 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
>+       $(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin)
> endef
> endif
>
>@@ -69,6 +80,7 @@ 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
>+       $(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin)
> endef
> endif
>
>--
>2.28.0
>
>_______________________________________________
>buildroot mailing list
>buildroot at busybox.net
>http://lists.busybox.net/mailman/listinfo/buildroot
>

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

* [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
  2020-11-25  9:15           ` Stephane Viau
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:24             ` Heiko Thiery
  2021-01-23 22:23             ` Thomas Petazzoni
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (7 subsequent siblings)
  9 siblings, 2 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

This patch set aims to add support for booting imx8m platforms with upstream
BSP components, avoiding the use of proprietary imx-mkimage tool.

Uboot is using its embedded mkimage tool and a per platform configuration file
to generate the boot medium thanks to additional imx specific makefile targets.

Delegating the bootable image generation to uboot requires proprietary SoC
firmwares either involved in the boot flow or eventually requiring
authentication to be copied in the uboot build directory.

As per Thomas proposal, this patch set mainly adds an option to copy a files
list, from binaries folder to uboot build directory as dependency of uboot
build step.

This was inspired from SolidRun patch below:
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
but this was adapted to prevent uboot patches and generalize the approach to
any platforms.

Changes v1 -> v2:
    - Initial patch set proposal was using a dedicated board script to
      generate the boot image as buildroot step, templatizing the configuration
      file used to define the boot image and reusing the firmwares from the
      binaries folder.
    - imx8mq platform does not boot with hdmi fw embedded in the boot image and
      recent arm trusted firmware, so imx8mq config file is removed since a
      change to uboot mkimage configuration file is required.
Changes v2 -> v3:
    - Use custom version for kernel, uboot (Suggested by Fabio Estevam)
Changes v3 -> v4:
    - Fix check-package reported issues (Reported by Stephane Viau)

Xavier Roumegue (8):
  package/freescale-imx/firmware-imx: Add option to install all ddr fw
    files
  boot/uboot: Add option to install fw files list to uboot build
    directory
  package/freescale-imx/firmware-imx: Copy of all DDR files if uboot
    needs fw.
  boot/uboot/imx8: Add new target needed for mainline u-boot
  board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  board/freescale/common/imx8: Use post build generated uboot image if
    present
  board/freescale/common/imx8: Templatize uboot image name
  configs/imx8mmevk: new defconfig

 DEVELOPERS                                    |  3 ++
 .../common/imx/genimage.cfg.template_imx8     |  2 +-
 board/freescale/common/imx/post-image.sh      |  6 ++-
 board/freescale/imx8mmevk/readme.txt          | 29 +++++++++++++-
 boot/uboot/Config.in                          | 20 ++++++++++
 boot/uboot/uboot.mk                           | 15 +++++++
 configs/imx8mmevk_defconfig                   | 40 +++++++++++++++++++
 package/freescale-imx/firmware-imx/Config.in  |  4 ++
 .../firmware-imx/firmware-imx.mk              | 12 ++++++
 9 files changed, 127 insertions(+), 4 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

--
2.29.2

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

* [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
  2020-11-25  9:15           ` Stephane Viau
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:25             ` Heiko Thiery
                               ` (2 more replies)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
                             ` (6 subsequent siblings)
  9 siblings, 3 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
BINARIES_DIR.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

---
Changes v3 -> v4:
    - Fix indentation issue (detected by Stephane Viau)
---
 package/freescale-imx/firmware-imx/Config.in       |  3 +++
 package/freescale-imx/firmware-imx/firmware-imx.mk | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 587f402426..09ccacb0c1 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -81,6 +81,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 	help
 	  The DMEM firmware will be padded to this length
 
+config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
+	bool
+
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index fb3cfe640b..c5ae4fad25 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -36,6 +36,16 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
 		$(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(3)).bin
 endef
 
+ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE),y)
+define FIRMWARE_IMX_COPY_DDR_FW
+	cp $(1) $(BINARIES_DIR)/
+endef
+else
+define FIRMWARE_IMX_COPY_DDR_FW
+	true
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
 FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
 
@@ -51,6 +61,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin)
 endef
 endif
 
@@ -69,6 +80,7 @@ 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
+	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin)
 endef
 endif
 
-- 
2.29.2

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

* [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (2 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:26             ` Heiko Thiery
  2021-01-23 22:32             ` Thomas Petazzoni
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
                             ` (5 subsequent siblings)
  9 siblings, 2 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

This copies a list of fw files, which have to be installed by others
packages to BINARIES_DIR to uboot build directory.
Some platforms, such as imx8, require firmware files located in the
build directory to generate a bootable image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

---
Changes v3 -> v4:
    - Fix indentation issue (detected by Stephane Viau)
---
 boot/uboot/Config.in | 15 +++++++++++++++
 boot/uboot/uboot.mk  |  9 +++++++++
 2 files changed, 24 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index e4a0f48deb..f2faff826b 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -229,6 +229,21 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 
 endchoice
 
+config BR2_TARGET_UBOOT_NEEDS_FW
+	bool "U-Boot needs FW files"
+	help
+	  Some platforms (such as iMX8) requires subsystem firmware
+	  files encapsulated within the u-boot payload such as this
+	  configure properly the memory subystem or those later
+	  require authentication from boot ROM.
+
+config BR2_TARGET_UBOOT_FW_FILES
+	string "Firmware files list"
+	depends on BR2_TARGET_UBOOT_NEEDS_FW
+	help
+	  Specify the list of files to be copied in the u-boot
+	  build directory from the binary folder.
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index d2b4e8dc60..44fefe2843 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -428,6 +428,15 @@ define UBOOT_KCONFIG_FIXUP_CMDS
 	$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
 endef
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_FW),y)
+define UBOOT_COPY_TARGET_FW
+	$(foreach f,$(BR2_TARGET_UBOOT_FW_FILES), \
+		cp -f $(BINARIES_DIR)/$(call qstrip,$(f)) $(@D)/
+	)
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_TARGET_FW
+endif
+
 ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
 
 #
-- 
2.29.2

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

* [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (3 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:27             ` Heiko Thiery
  2021-01-23 22:33             ` Thomas Petazzoni
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
                             ` (4 subsequent siblings)
  9 siblings, 2 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 package/freescale-imx/firmware-imx/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index 09ccacb0c1..c704d78637 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -83,6 +83,7 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
 
 config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
 	bool
+	default y if BR2_TARGET_UBOOT_NEEDS_FW
 
 endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
 
-- 
2.29.2

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

* [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (4 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:27             ` Heiko Thiery
                               ` (2 more replies)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
                             ` (3 subsequent siblings)
  9 siblings, 3 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Mainline u-boot support for the iMX8M based boards is no longer
using the external imx-mkimage command and instead building
the fit image directly inside U-Boot.

This fit image usually embeds ddr/hdmi firmware for iMX8M target.

Inspired from
https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 boot/uboot/Config.in | 5 +++++
 boot/uboot/uboot.mk  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index f2faff826b..2e1d836cf8 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -281,6 +281,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
 config BR2_TARGET_UBOOT_FORMAT_ITB
 	bool "u-boot.itb"
 
+config BR2_TARGET_UBOOT_FORMAT_IMX_FIT
+	bool "flash.bin"
+	select BR2_PACKAGE_FIRMWARE_IMX
+	select BR2_TARGET_UBOOT_NEEDS_FW
+
 config BR2_TARGET_UBOOT_FORMAT_KWB
 	bool "u-boot.kwb (Marvell)"
 	depends on BR2_arm
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 44fefe2843..30a073a200 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -101,6 +101,12 @@ UBOOT_BINS += u-boot.imx
 UBOOT_MAKE_TARGET += u-boot.imx
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_IMX_FIT),y)
+UBOOT_BINS = flash.bin
+UBOOT_MAKE_TARGET += flash.bin
+UBOOT_DEPENDENCIES += firmware-imx
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
 UBOOT_BINS += u-boot.sb
 UBOOT_MAKE_TARGET += u-boot.sb
-- 
2.29.2

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

* [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (5 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:28             ` Heiko Thiery
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
                             ` (2 subsequent siblings)
  9 siblings, 1 reply; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 06ccaac3a4..1cca1849be 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -70,6 +70,8 @@ uboot_image()
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y$" ${BR2_CONFIG}; then
+		echo "flash.bin"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y$" ${BR2_CONFIG}; then
 	    echo "u-boot-dtb.img"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMG=y$" ${BR2_CONFIG}; then
-- 
2.29.2

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

* [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (6 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-14 22:28             ` Heiko Thiery
  2021-01-23 22:36             ` Thomas Petazzoni
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  9 siblings, 2 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Stick the uboot image filename to "imx8-boot-sd.bin" in case the
final uboot image, embedding fw files, is generated thanks to a post
build script.

This takes precedence over all uboot images generating during uboot
build.

This should help to remove the dedicated imx8 config template file

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/post-image.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 1cca1849be..7916b8dae6 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -66,7 +66,9 @@ imx_offset()
 
 uboot_image()
 {
-	if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
+	if [ -e "${BINARIES_DIR}"/imx8-boot-sd.bin ]; then
+		echo "imx8-boot-sd.bin"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot-dtb.imx"
 	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
 		echo "u-boot.imx"
-- 
2.29.2

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

* [Buildroot] [PATCH v4 7/8] board/freescale/common/imx8: Templatize uboot image name
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (7 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
  9 siblings, 0 replies; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
---
 board/freescale/common/imx/genimage.cfg.template_imx8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/genimage.cfg.template_imx8 b/board/freescale/common/imx/genimage.cfg.template_imx8
index 5689205083..b9d6dbde27 100644
--- a/board/freescale/common/imx/genimage.cfg.template_imx8
+++ b/board/freescale/common/imx/genimage.cfg.template_imx8
@@ -23,7 +23,7 @@ image sdcard.img {
 
   partition imx-boot {
     in-partition-table = "no"
-    image = "imx8-boot-sd.bin"
+    image = "%UBOOTBIN%"
     offset = %IMXOFFSET%
   }
 
-- 
2.29.2

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

* [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig
  2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
                             ` (8 preceding siblings ...)
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
@ 2020-11-25 18:30           ` Xavier Roumegue
  2020-12-06 11:03             ` Gilles Talis
  9 siblings, 1 reply; 58+ messages in thread
From: Xavier Roumegue @ 2020-11-25 18:30 UTC (permalink / raw)
  To: buildroot

Introduce NXP imx8mm evk board configuration that uses mainline atf,
uboot and kernel.

Mainline uboot mkimage tool generates the boot image.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
Tested-by: Julien Olivain <ju.o@free.fr>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
---
 DEVELOPERS                           |  3 +++
 board/freescale/imx8mmevk/readme.txt | 29 ++++++++++++++++++--
 configs/imx8mmevk_defconfig          | 40 ++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 configs/imx8mmevk_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 9ab1e125f4..a1efd0dc98 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2684,6 +2684,9 @@ F:	package/fwup/
 N:	Yair Ben Avraham <yairba@protonmail.com>
 F:	package/gloox/
 
+N:	Xavier Roumegue <xroumegue@gmail.com>
+F:	configs/imx8mmevk_defconfig
+
 N:	Yann E. MORIN <yann.morin.1998@free.fr>
 F:	board/friendlyarm/nanopi-neo/
 F:	configs/nanopi_neo_defconfig
diff --git a/board/freescale/imx8mmevk/readme.txt b/board/freescale/imx8mmevk/readme.txt
index 7b69405d30..be3b54e40d 100644
--- a/board/freescale/imx8mmevk/readme.txt
+++ b/board/freescale/imx8mmevk/readme.txt
@@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
 This file documents the Buildroot support for the Freescale i.MX8MM
 EVK board.
 
-Build
-=====
+Building with NXP ATF, U-Boot and kernel
+========================================
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
@@ -32,6 +32,31 @@ You will find in output/images/ the following files:
   - u-boot-nodtb.bin
   - u-boot-spl-ddr.bin
 
+Building with mainline ATF, U-Boot and kernel
+=============================================
+First, configure Buildroot for the i.MX8MM EVK board:
+
+  make imx8mmevk_defconfig
+
+Build all components:
+
+  make
+
+You will find in output/images/ the following files:
+    - bl31.bin
+    - boot.vfat
+    - ddr_fw.bin
+    - flash.bin
+    - Image
+    - imx8mm-evk.dtb
+    - [lp]ddr4_*.bin
+    - rootfs.ext2
+    - rootfs.ext4
+    - rootfs.tar
+    - sdcard.img
+    - u-boot-spl
+    - u-boot-spl.bin
+
 Create a bootable SD card
 =========================
 
diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
new file mode 100644
index 0000000000..089acd506c
--- /dev/null
+++ b/configs/imx8mmevk_defconfig
@@ -0,0 +1,40 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.18"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
-- 
2.29.2

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

* [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
@ 2020-12-06 11:03             ` Gilles Talis
  0 siblings, 0 replies; 58+ messages in thread
From: Gilles Talis @ 2020-12-06 11:03 UTC (permalink / raw)
  To: buildroot

Hello Xavier, all,

Successfully tested on my imx8mm evk board.

Le mer. 25 nov. 2020 ? 19:31, Xavier Roumegue <xroumegue@gmail.com> a ?crit :
>
> Introduce NXP imx8mm evk board configuration that uses mainline atf,
> uboot and kernel.
>
> Mainline uboot mkimage tool generates the boot image.
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> Tested-by: Julien Olivain <ju.o@free.fr>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> ---
>  DEVELOPERS                           |  3 +++
>  board/freescale/imx8mmevk/readme.txt | 29 ++++++++++++++++++--
>  configs/imx8mmevk_defconfig          | 40 ++++++++++++++++++++++++++++
>  3 files changed, 70 insertions(+), 2 deletions(-)
>  create mode 100644 configs/imx8mmevk_defconfig
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 9ab1e125f4..a1efd0dc98 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2684,6 +2684,9 @@ F:        package/fwup/
>  N:     Yair Ben Avraham <yairba@protonmail.com>
>  F:     package/gloox/
>
> +N:     Xavier Roumegue <xroumegue@gmail.com>
> +F:     configs/imx8mmevk_defconfig
> +
>  N:     Yann E. MORIN <yann.morin.1998@free.fr>
>  F:     board/friendlyarm/nanopi-neo/
>  F:     configs/nanopi_neo_defconfig
> diff --git a/board/freescale/imx8mmevk/readme.txt b/board/freescale/imx8mmevk/readme.txt
> index 7b69405d30..be3b54e40d 100644
> --- a/board/freescale/imx8mmevk/readme.txt
> +++ b/board/freescale/imx8mmevk/readme.txt
> @@ -5,8 +5,8 @@ Freescale i.MX8MM EVK board
>  This file documents the Buildroot support for the Freescale i.MX8MM
>  EVK board.
>
> -Build
> -=====
> +Building with NXP ATF, U-Boot and kernel
> +========================================
>
>  First, configure Buildroot for the i.MX8MM EVK board:
>
> @@ -32,6 +32,31 @@ You will find in output/images/ the following files:
>    - u-boot-nodtb.bin
>    - u-boot-spl-ddr.bin
>
> +Building with mainline ATF, U-Boot and kernel
> +=============================================
> +First, configure Buildroot for the i.MX8MM EVK board:
> +
> +  make imx8mmevk_defconfig
> +
> +Build all components:
> +
> +  make
> +
> +You will find in output/images/ the following files:
> +    - bl31.bin
> +    - boot.vfat
> +    - ddr_fw.bin
> +    - flash.bin
> +    - Image
> +    - imx8mm-evk.dtb
> +    - [lp]ddr4_*.bin
> +    - rootfs.ext2
> +    - rootfs.ext4
> +    - rootfs.tar
> +    - sdcard.img
> +    - u-boot-spl
> +    - u-boot-spl.bin
> +
>  Create a bootable SD card
>  =========================
>
> diff --git a/configs/imx8mmevk_defconfig b/configs/imx8mmevk_defconfig
> new file mode 100644
> index 0000000000..089acd506c
> --- /dev/null
> +++ b/configs/imx8mmevk_defconfig
> @@ -0,0 +1,40 @@
> +BR2_aarch64=y
> +BR2_ARM_FPU_VFPV3=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.18"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
> +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_PACKAGE_FREESCALE_IMX=y
> +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.3"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_FW_FILES="lpddr4*.bin"
> +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> +BR2_TARGET_UBOOT_FORMAT_ELF=y
> +BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin spl/u-boot-spl"
> +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="ATF_LOAD_ADDR=0x920000"
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y
> +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
> +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
> --
> 2.29.2
>

Tested-by: Gilles Talis <gilles.talis@gmail.com>

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

* [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
@ 2020-12-14 22:24             ` Heiko Thiery
  2021-01-23 22:23             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:24 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Am Mi., 25. Nov. 2020 um 19:30 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> This patch set aims to add support for booting imx8m platforms with upstream
> BSP components, avoiding the use of proprietary imx-mkimage tool.
>
> Uboot is using its embedded mkimage tool and a per platform configuration file
> to generate the boot medium thanks to additional imx specific makefile targets.
>
> Delegating the bootable image generation to uboot requires proprietary SoC
> firmwares either involved in the boot flow or eventually requiring
> authentication to be copied in the uboot build directory.
>
> As per Thomas proposal, this patch set mainly adds an option to copy a files
> list, from binaries folder to uboot build directory as dependency of uboot
> build step.
>
> This was inspired from SolidRun patch below:
> https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
> but this was adapted to prevent uboot patches and generalize the approach to
> any platforms.

I gave the whole series a try. I was successfully able to create the
U-Boot flash.bin for an imx8mq SOC.

So it works for me. Thank you.

-- 
Heiko

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

* [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
@ 2020-12-14 22:25             ` Heiko Thiery
  2020-12-23 14:32             ` Gary Bisson
  2021-01-23 22:29             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:25 UTC (permalink / raw)
  To: buildroot

HI Xavier,

Am Mi., 25. Nov. 2020 um 19:31 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
> BINARIES_DIR.
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

-- 
Heiko

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

* [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
@ 2020-12-14 22:26             ` Heiko Thiery
  2021-01-23 22:32             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:26 UTC (permalink / raw)
  To: buildroot

Am Mi., 25. Nov. 2020 um 19:31 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> This copies a list of fw files, which have to be installed by others
> packages to BINARIES_DIR to uboot build directory.
> Some platforms, such as imx8, require firmware files located in the
> build directory to generate a bootable image.
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

>
> ---
> Changes v3 -> v4:
>     - Fix indentation issue (detected by Stephane Viau)
> ---
>  boot/uboot/Config.in | 15 +++++++++++++++
>  boot/uboot/uboot.mk  |  9 +++++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index e4a0f48deb..f2faff826b 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -229,6 +229,21 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
>
>  endchoice
>
> +config BR2_TARGET_UBOOT_NEEDS_FW
> +       bool "U-Boot needs FW files"
> +       help
> +         Some platforms (such as iMX8) requires subsystem firmware
> +         files encapsulated within the u-boot payload such as this
> +         configure properly the memory subystem or those later
> +         require authentication from boot ROM.
> +
> +config BR2_TARGET_UBOOT_FW_FILES
> +       string "Firmware files list"
> +       depends on BR2_TARGET_UBOOT_NEEDS_FW
> +       help
> +         Specify the list of files to be copied in the u-boot
> +         build directory from the binary folder.
> +
>  menu "U-Boot binary format"
>
>  config BR2_TARGET_UBOOT_FORMAT_AIS
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index d2b4e8dc60..44fefe2843 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -428,6 +428,15 @@ define UBOOT_KCONFIG_FIXUP_CMDS
>         $(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
>  endef
>
> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_FW),y)
> +define UBOOT_COPY_TARGET_FW
> +       $(foreach f,$(BR2_TARGET_UBOOT_FW_FILES), \
> +               cp -f $(BINARIES_DIR)/$(call qstrip,$(f)) $(@D)/
> +       )
> +endef
> +UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_TARGET_FW
> +endif
> +
>  ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
>
>  #

-- 
Heiko

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

* [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
@ 2020-12-14 22:27             ` Heiko Thiery
  2021-01-23 22:33             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:27 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Am Mi., 25. Nov. 2020 um 19:31 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

> ---
>  package/freescale-imx/firmware-imx/Config.in | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
> index 09ccacb0c1..c704d78637 100644
> --- a/package/freescale-imx/firmware-imx/Config.in
> +++ b/package/freescale-imx/firmware-imx/Config.in
> @@ -83,6 +83,7 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
>
>  config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
>         bool
> +       default y if BR2_TARGET_UBOOT_NEEDS_FW
>
>  endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
>

-- 
Heiko

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

* [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
@ 2020-12-14 22:27             ` Heiko Thiery
  2020-12-23 14:42             ` Gary Bisson
  2021-01-23 22:34             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:27 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Am Mi., 25. Nov. 2020 um 19:31 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> Mainline u-boot support for the iMX8M based boards is no longer
> using the external imx-mkimage command and instead building
> the fit image directly inside U-Boot.
>
> This fit image usually embeds ddr/hdmi firmware for iMX8M target.
>
> Inspired from
> https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

> ---
>  boot/uboot/Config.in | 5 +++++
>  boot/uboot/uboot.mk  | 6 ++++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index f2faff826b..2e1d836cf8 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -281,6 +281,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
>  config BR2_TARGET_UBOOT_FORMAT_ITB
>         bool "u-boot.itb"
>
> +config BR2_TARGET_UBOOT_FORMAT_IMX_FIT
> +       bool "flash.bin"
> +       select BR2_PACKAGE_FIRMWARE_IMX
> +       select BR2_TARGET_UBOOT_NEEDS_FW
> +
>  config BR2_TARGET_UBOOT_FORMAT_KWB
>         bool "u-boot.kwb (Marvell)"
>         depends on BR2_arm
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 44fefe2843..30a073a200 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -101,6 +101,12 @@ UBOOT_BINS += u-boot.imx
>  UBOOT_MAKE_TARGET += u-boot.imx
>  endif
>
> +ifeq ($(BR2_TARGET_UBOOT_FORMAT_IMX_FIT),y)
> +UBOOT_BINS = flash.bin
> +UBOOT_MAKE_TARGET += flash.bin
> +UBOOT_DEPENDENCIES += firmware-imx
> +endif
> +
>  ifeq ($(BR2_TARGET_UBOOT_FORMAT_SB),y)
>  UBOOT_BINS += u-boot.sb
>  UBOOT_MAKE_TARGET += u-boot.sb

-- 
Heiko

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

* [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
@ 2020-12-14 22:28             ` Heiko Thiery
  0 siblings, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:28 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Am Mi., 25. Nov. 2020 um 19:32 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

> ---
>  board/freescale/common/imx/post-image.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
> index 06ccaac3a4..1cca1849be 100755
> --- a/board/freescale/common/imx/post-image.sh
> +++ b/board/freescale/common/imx/post-image.sh
> @@ -70,6 +70,8 @@ uboot_image()
>                 echo "u-boot-dtb.imx"
>         elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
>                 echo "u-boot.imx"
> +       elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX_FIT=y$" ${BR2_CONFIG}; then
> +               echo "flash.bin"
>         elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y$" ${BR2_CONFIG}; then
>             echo "u-boot-dtb.img"
>         elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMG=y$" ${BR2_CONFIG}; then

-- 
Heiko

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

* [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
@ 2020-12-14 22:28             ` Heiko Thiery
  2021-01-23 22:36             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Heiko Thiery @ 2020-12-14 22:28 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Am Mi., 25. Nov. 2020 um 19:32 Uhr schrieb Xavier Roumegue
<xroumegue@gmail.com>:
>
> Stick the uboot image filename to "imx8-boot-sd.bin" in case the
> final uboot image, embedding fw files, is generated thanks to a post
> build script.
>
> This takes precedence over all uboot images generating during uboot
> build.
>
> This should help to remove the dedicated imx8 config template file
>
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

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

> ---
>  board/freescale/common/imx/post-image.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
> index 1cca1849be..7916b8dae6 100755
> --- a/board/freescale/common/imx/post-image.sh
> +++ b/board/freescale/common/imx/post-image.sh
> @@ -66,7 +66,9 @@ imx_offset()
>
>  uboot_image()
>  {
> -       if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
> +       if [ -e "${BINARIES_DIR}"/imx8-boot-sd.bin ]; then
> +               echo "imx8-boot-sd.bin"
> +       elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
>                 echo "u-boot-dtb.imx"
>         elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
>                 echo "u-boot.imx"

-- 
Heiko

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

* [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
  2020-12-14 22:25             ` Heiko Thiery
@ 2020-12-23 14:32             ` Gary Bisson
  2021-01-23 22:29             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Gary Bisson @ 2020-12-23 14:32 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

Thanks for your contribution.

On Wed, Nov 25, 2020 at 07:30:10PM +0100, Xavier Roumegue wrote:
> Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
> BINARIES_DIR.
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
> Changes v3 -> v4:
>     - Fix indentation issue (detected by Stephane Viau)
> ---
>  package/freescale-imx/firmware-imx/Config.in       |  3 +++
>  package/freescale-imx/firmware-imx/firmware-imx.mk | 12 ++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
> index 587f402426..09ccacb0c1 100644
> --- a/package/freescale-imx/firmware-imx/Config.in
> +++ b/package/freescale-imx/firmware-imx/Config.in
> @@ -81,6 +81,9 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
>  	help
>  	  The DMEM firmware will be padded to this length
>  
> +config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
> +	bool
> +
>  endif # BR2_PACKAGE_FIRMWARE_IMX_NEEDS_DDR_FW
>  
>  endif # BR2_PACKAGE_FIRMWARE_IMX
> diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
> index fb3cfe640b..c5ae4fad25 100644
> --- a/package/freescale-imx/firmware-imx/firmware-imx.mk
> +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
> @@ -36,6 +36,16 @@ define FIRMWARE_IMX_PREPARE_DDR_FW
>  		$(FIRMWARE_IMX_DDRFW_DIR)/$(strip $(3)).bin
>  endef
>  
> +ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE),y)
> +define FIRMWARE_IMX_COPY_DDR_FW
> +	cp $(1) $(BINARIES_DIR)/
> +endef
> +else
> +define FIRMWARE_IMX_COPY_DDR_FW
> +	true
> +endef
> +endif
> +
>  ifeq ($(BR2_PACKAGE_FIRMWARE_IMX_LPDDR4),y)
>  FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys
>  
> @@ -51,6 +61,7 @@ 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
> +	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4*.bin)
>  endef
>  endif
>  
> @@ -69,6 +80,7 @@ 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
> +	$(call FIRMWARE_IMX_COPY_DDR_FW, $(FIRMWARE_IMX_DDRFW_DIR)/ddr4*.bin)

Overvall I'm not against this but have a few remarks:
1- Wouldn't it be just easier to copy the ddr binaries in BINARIES_DIR
without adding another option for it?
My take is that we should make that copy without adding
FIRMWARE_IMX_COPY_DDR_FW. We could even remove ddr_fw.bin generation
from here and leave it to imx8-bootloader-prepare.sh to do it. And as a
second step the best would be to get rid of this script when everybody
moved to U-Boot flash.bin generation.
Maybe Thomas has some insights as to what is the preferred option.

2- If we keep that option to make the copy, maybe just merge this patch
with "Copy of all DDR files if uboot needs fw." and move the squashed
commit _after_ UBOOT_NEEDS_FW patch.

Regards,
Gary

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

* [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
  2020-12-14 22:27             ` Heiko Thiery
@ 2020-12-23 14:42             ` Gary Bisson
  2021-01-23 22:34             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Gary Bisson @ 2020-12-23 14:42 UTC (permalink / raw)
  To: buildroot

Hi Xavier,

On Wed, Nov 25, 2020 at 07:30:13PM +0100, Xavier Roumegue wrote:
> Mainline u-boot support for the iMX8M based boards is no longer
> using the external imx-mkimage command and instead building
> the fit image directly inside U-Boot.
> 
> This fit image usually embeds ddr/hdmi firmware for iMX8M target.
> 
> Inspired from
> https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
>  boot/uboot/Config.in | 5 +++++
>  boot/uboot/uboot.mk  | 6 ++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index f2faff826b..2e1d836cf8 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -281,6 +281,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
>  config BR2_TARGET_UBOOT_FORMAT_ITB
>  	bool "u-boot.itb"
>  
> +config BR2_TARGET_UBOOT_FORMAT_IMX_FIT

I know this was copied from SolidRun but I'm not a fan of the IMX_FIT
name. True flash.bin includes a FIT image but SPL/FW etc are outside of
it, it's not just a FIT image.
Maybe NXP will do another boot image format in the future that will also
include a FIT image but the rest would be different.
Since the U-Boot target is simply "flash.bin" I would name it
UBOOT_FORMAT_FLASH_BIN.

> +	bool "flash.bin"
> +	select BR2_PACKAGE_FIRMWARE_IMX

You can't do that unfortunately, you need to either have a test around
that option or add a depends on BR2_PACKAGE_FREESCALE_IMX.

Otherwise it will give this:
WARNING: unmet direct dependencies detected for BR2_PACKAGE_FIRMWARE_IMX
  Depends on [n]: BR2_PACKAGE_FREESCALE_IMX [=n] && (BR2_arm [=y] || BR2_aarch64 [=n])
  Selected by [y]:
  - BR2_TARGET_UBOOT_FORMAT_IMX_FIT [=y] && BR2_TARGET_UBOOT [=y]

Regards,
Gary

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

* [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
  2020-12-14 22:24             ` Heiko Thiery
@ 2021-01-23 22:23             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:23 UTC (permalink / raw)
  To: buildroot

Hello Xavier,

On Wed, 25 Nov 2020 19:30:09 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

>  DEVELOPERS                                    |  3 ++
>  .../common/imx/genimage.cfg.template_imx8     |  2 +-
>  board/freescale/common/imx/post-image.sh      |  6 ++-
>  board/freescale/imx8mmevk/readme.txt          | 29 +++++++++++++-
>  boot/uboot/Config.in                          | 20 ++++++++++
>  boot/uboot/uboot.mk                           | 15 +++++++
>  configs/imx8mmevk_defconfig                   | 40 +++++++++++++++++++
>  package/freescale-imx/firmware-imx/Config.in  |  4 ++
>  .../firmware-imx/firmware-imx.mk              | 12 ++++++
>  9 files changed, 127 insertions(+), 4 deletions(-)
>  create mode 100644 configs/imx8mmevk_defconfig

Sorry for the long delay on this patch series, but I finally took some
time to look into it. Unfortunately, I'm still not quite happy about
how things are handled. I will reply to individual patches to explain
what I dislike and how I believe it should be changed.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
  2020-12-14 22:25             ` Heiko Thiery
  2020-12-23 14:32             ` Gary Bisson
@ 2021-01-23 22:29             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:29 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 25 Nov 2020 19:30:10 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

> Selecting this option will copy all ([lp]ddr4.bin) DDR training files to
> BINARIES_DIR.
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>

The commit log is very limited, but I think I figured out what's going
on: the upstream U-Boot script tools/imx8m_image.sh needs the "raw" DDR
firmware files provided by upstream firmware-imx, and not the already
"mungled" files generated by Buildroot firmware-imx.mk.

So overall, I think the right direction to take would be to make
firmware-imx.mk simply install the raw firmware files to
$(BINARIES_DIR). From there, we would have two paths:

 - For (old ?) NXP-specific U-Boot,
   board/freescale/common/imx/imx8-bootloader-prepare.sh would take
   care of doing the munging of those firmware files.

 - For upstream U-Boot, the munging of those firmware files is directly
   done by the U-Boot build system.

So, I'd like to see a first patch that makes firmware-imx.mk just
install the raw firmware files (either DDR4 or LPDDR4) to
$(BINARIES_DIR) and that changes
board/freescale/common/imx/imx8-bootloader-prepare.sh to do the munging
that was previously done by firmware-imx.mk.

With this, no need for this obscure
BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE option.

One question: firmware-imx has multiple "versions" of each firmware
file, for example:

-rw-r--r-- 1 thomas thomas  1668 16 nov.  10:10 lpddr4_pmu_train_1d_dmem_201904.bin
-rw-r--r-- 1 thomas thomas  1660 16 nov.  10:10 lpddr4_pmu_train_1d_dmem_202006.bin
-rw-r--r-- 1 thomas thomas  1668 16 nov.  10:10 lpddr4_pmu_train_1d_dmem.bin

Our current firmware-imx.mk uses the 201810 version for DDR4, but
upstream U-Boot uses the variant with no version in its name. Is it
important ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
  2020-12-14 22:26             ` Heiko Thiery
@ 2021-01-23 22:32             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 25 Nov 2020 19:30:11 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

> This copies a list of fw files, which have to be installed by others
> packages to BINARIES_DIR to uboot build directory.
> Some platforms, such as imx8, require firmware files located in the
> build directory to generate a bootable image.
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> 
> ---
> Changes v3 -> v4:
>     - Fix indentation issue (detected by Stephane Viau)
> ---
>  boot/uboot/Config.in | 15 +++++++++++++++
>  boot/uboot/uboot.mk  |  9 +++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index e4a0f48deb..f2faff826b 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -229,6 +229,21 @@ config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
>  
>  endchoice
>  
> +config BR2_TARGET_UBOOT_NEEDS_FW
> +	bool "U-Boot needs FW files"
> +	help
> +	  Some platforms (such as iMX8) requires subsystem firmware
> +	  files encapsulated within the u-boot payload such as this
> +	  configure properly the memory subystem or those later
> +	  require authentication from boot ROM.
> +
> +config BR2_TARGET_UBOOT_FW_FILES
> +	string "Firmware files list"
> +	depends on BR2_TARGET_UBOOT_NEEDS_FW
> +	help
> +	  Specify the list of files to be copied in the u-boot
> +	  build directory from the binary folder.

These options don't work, because the firmware files would typically be
provided by another package... and without adding a dependency from
U-Boot on this other package, it won't work. I know you've added this
dependency on the other BR2_TARGET_UBOOT_FORMAT_IMX_FIT option, but I
think this is wrong, as flash.bin is not necessarily IMX related.

So instead, I would prefer a patch that adds a simple option:

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

and in the .mk file:

ifeq ($(BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE),y)
UBOOT_DEPENDENCIES += firmware-imx
define UBOOT_COPY_IMX_DDR_FIRMWARE
	cp $(BINARIES_DIR)/... $(@D)/
endef
UBOOT_PRE_BUILD_HOOKS += UBOOT_COPY_IMX_DDR_FIRMWARE
endif

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw.
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
  2020-12-14 22:27             ` Heiko Thiery
@ 2021-01-23 22:33             ` Thomas Petazzoni
  1 sibling, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:33 UTC (permalink / raw)
  To: buildroot

On Wed, 25 Nov 2020 19:30:12 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> ---
>  package/freescale-imx/firmware-imx/Config.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
> index 09ccacb0c1..c704d78637 100644
> --- a/package/freescale-imx/firmware-imx/Config.in
> +++ b/package/freescale-imx/firmware-imx/Config.in
> @@ -83,6 +83,7 @@ config BR2_PACKAGE_FIRMWARE_IMX_DMEM_LEN
>  
>  config BR2_PACKAGE_FIRMWARE_IMX_DDR_FW_MULTIPLE
>  	bool
> +	default y if BR2_TARGET_UBOOT_NEEDS_FW

See my proposal on PATCH 2/8, which makes this change unnecessary.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
  2020-12-14 22:27             ` Heiko Thiery
  2020-12-23 14:42             ` Gary Bisson
@ 2021-01-23 22:34             ` Thomas Petazzoni
  2 siblings, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:34 UTC (permalink / raw)
  To: buildroot

On Wed, 25 Nov 2020 19:30:13 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

> Mainline u-boot support for the iMX8M based boards is no longer
> using the external imx-mkimage command and instead building
> the fit image directly inside U-Boot.
> 
> This fit image usually embeds ddr/hdmi firmware for iMX8M target.
> 
> Inspired from
> https://github.com/SolidRun/buildroot/commit/0f2b2971e836b508bf9c2dac34426a59a9d83572
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> ---
>  boot/uboot/Config.in | 5 +++++
>  boot/uboot/uboot.mk  | 6 ++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index f2faff826b..2e1d836cf8 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -281,6 +281,11 @@ config BR2_TARGET_UBOOT_FORMAT_DTB_IMX
>  config BR2_TARGET_UBOOT_FORMAT_ITB
>  	bool "u-boot.itb"
>  
> +config BR2_TARGET_UBOOT_FORMAT_IMX_FIT
> +	bool "flash.bin"
> +	select BR2_PACKAGE_FIRMWARE_IMX
> +	select BR2_TARGET_UBOOT_NEEDS_FW

I concur with Gary here, this should be just:

config BR2_TARGET_UBOOT_FORMAT_FLASH_BIN
	bool "flash.bin"

and it should just trigger the build of the "flash.bin" target. The
dependency on i.MX firmware should be handled by the separate U-Boot
option I have proposed in reply to your PATCH 2/8.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2020-11-25 18:30           ` [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
  2020-12-14 22:28             ` Heiko Thiery
@ 2021-01-23 22:36             ` Thomas Petazzoni
  2021-01-23 22:42               ` Thomas Petazzoni
  1 sibling, 1 reply; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:36 UTC (permalink / raw)
  To: buildroot

On Wed, 25 Nov 2020 19:30:15 +0100
Xavier Roumegue <xroumegue@gmail.com> wrote:

> Stick the uboot image filename to "imx8-boot-sd.bin" in case the
> final uboot image, embedding fw files, is generated thanks to a post
> build script.
> 
> This takes precedence over all uboot images generating during uboot
> build.
> 
> This should help to remove the dedicated imx8 config template file
> 
> Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
> ---
>  board/freescale/common/imx/post-image.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

I don't really understand what the purpose of this change is. Indeed,
you're not removing the dedicated imx8 config template file in your
patch series. And even your defconfig calls
board/freescale/common/imx/post-image.sh, which based on:

        elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y$" ${BR2_CONFIG}; then
                echo "genimage.cfg.template_imx8"

will use the imx8 config template file for genimage.

So I'm rather confused by what's going on here.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present
  2021-01-23 22:36             ` Thomas Petazzoni
@ 2021-01-23 22:42               ` Thomas Petazzoni
  0 siblings, 0 replies; 58+ messages in thread
From: Thomas Petazzoni @ 2021-01-23 22:42 UTC (permalink / raw)
  To: buildroot

On Sat, 23 Jan 2021 23:36:28 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> I don't really understand what the purpose of this change is. Indeed,
> you're not removing the dedicated imx8 config template file in your
> patch series. And even your defconfig calls
> board/freescale/common/imx/post-image.sh, which based on:
> 
>         elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y$" ${BR2_CONFIG}; then
>                 echo "genimage.cfg.template_imx8"
> 
> will use the imx8 config template file for genimage.
> 
> So I'm rather confused by what's going on here.

Ah, I think that I see. The bootloader image name for i.MX8 always used
to be imx8-boot-sd.bin, so it was hardcoded in
genimage.cfg.template_imx8. But now, it might be imx8-boot-sd.bin for
old vendor U-Boot, or flash.bin for new upstream U-Boot.

And since you have no way to know which one is used, this patch is
proposing to rely on the existence of imx8-boot-sd.bin to decide if it
should be used or not.

I am not a huge fan of the proposed solution, but I don't have a very
nice proposal to make. We could extend post-image.sh to check if we're
on an i.MX8 platform, and if so, if BR2_TARGET_UBOOT_FLASH_BIN=y, use
flash.bin, otherwise use imx8-boot-sd.bin, but maybe that's getting
over-complicated.

So I think, let's stick with your solution, but with a better commit
log that explains what's going on.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2021-01-23 22:42 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 21:34 [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue
2020-04-27 21:34 ` [Buildroot] [PATCH 2/3] configs/imx8mmevk: new defconfig Xavier Roumegue
2020-04-27 21:34 ` [Buildroot] [PATCH 3/3] configs/imx8mqevk: " Xavier Roumegue
2020-04-27 21:57 ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Thomas Petazzoni
2020-04-28  8:53   ` Gary Bisson
2020-04-28 20:05     ` Fabio Estevam
2020-04-28 21:50   ` Xavier Roumegue
2020-11-03 22:39     ` Thomas Petazzoni
2020-11-07 13:59       ` [Buildroot] [PATCH v2 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 " Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
2020-11-25  9:15           ` Stephane Viau
2020-11-25 18:30           ` [Buildroot] [PATCH v4 0/8] Add imx8mm platform using only upstream components Xavier Roumegue
2020-12-14 22:24             ` Heiko Thiery
2021-01-23 22:23             ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
2020-12-14 22:25             ` Heiko Thiery
2020-12-23 14:32             ` Gary Bisson
2021-01-23 22:29             ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
2020-12-14 22:26             ` Heiko Thiery
2021-01-23 22:32             ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 3/8] package/freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
2020-12-14 22:27             ` Heiko Thiery
2021-01-23 22:33             ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
2020-12-14 22:27             ` Heiko Thiery
2020-12-23 14:42             ` Gary Bisson
2021-01-23 22:34             ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
2020-12-14 22:28             ` Heiko Thiery
2020-11-25 18:30           ` [Buildroot] [PATCH v4 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
2020-12-14 22:28             ` Heiko Thiery
2021-01-23 22:36             ` Thomas Petazzoni
2021-01-23 22:42               ` Thomas Petazzoni
2020-11-25 18:30           ` [Buildroot] [PATCH v4 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
2020-11-25 18:30           ` [Buildroot] [PATCH v4 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
2020-12-06 11:03             ` Gilles Talis
2020-11-09 14:23         ` [Buildroot] [PATCH v3 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
2020-11-09 14:23         ` [Buildroot] [PATCH v3 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
2020-11-09 20:27           ` Julien Olivain
2020-11-11 20:31           ` Fabio Estevam
2020-11-07 13:59       ` [Buildroot] [PATCH v2 1/8] package/freescale-imx/firmware-imx: Add option to install all ddr fw files Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 2/8] boot/uboot: Add option to install fw files list to uboot build directory Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 3/8] freescale-imx/firmware-imx: Copy of all DDR files if uboot needs fw Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 4/8] boot/uboot/imx8: Add new target needed for mainline u-boot Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 5/8] board/freescale/common/imx: Add Support for uboot 'flash.bin' image Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 6/8] board/freescale/common/imx8: Use post build generated uboot image if present Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 7/8] board/freescale/common/imx8: Templatize uboot image name Xavier Roumegue
2020-11-07 13:59       ` [Buildroot] [PATCH v2 8/8] configs/imx8mmevk: new defconfig Xavier Roumegue
2020-11-08  0:05         ` Fabio Estevam
2020-11-10 20:23           ` Xavier Roumegue
2020-11-10 20:44       ` [Buildroot] [PATCH 1/3] board/freescale/imx: Add helper to generate fw binary Xavier Roumegue

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.