Skip to main content
Version: BSP 6.x.y

Specifics: Build U-Boot for NXP i.MX 8M Mini/Plus-based SoMs

Introduction

This article describes additional specific steps about the compilation and the configuration of the boot container of the Toradex NXP i.MX 8M Mini/Plus-based System on Modules.

Prerequisites

Before continuing with this article, one must follow the steps in the article Build U-Boot From Source Code.

Build U-Boot: SoC-specific Steps

Some SoCs will require additional steps to build the components necessary for the boot. Check on the tabs below each step that refer to your specific SoC. If you are targetting a different SoC, you can skip this session.

The NXP i.MX 8M Mini/8M Plus requires a boot container. The boot container is built with the Yocto recipe imx-boot. Nevertheless, if you want to build it manually, this section provides information on how to do it.

Get and Build the ARM Trusted Firmware (Trusted Firmware A)

  1. Download the ARM Trusted Firmware (ATF).

    $ git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
    $ cd trusted-firmware-a
  2. Build the ATF. Make sure the environment variables are defined as in step 3 of Prepare the Environment for Cross Compilation in the Build U-Boot From Source Code article.

    $ export CROSS_COMPILE=aarch64-none-linux-gnu-
    $ make PLAT=imx8mm IMX_BOOT_UART_BASE=0x30860000 bl31
    $ cp build/imx8mm/release/bl31.bin ../

Get the DDR Firmware

$ cd ../
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.10.1.bin
$ chmod +x firmware-imx-8.10.1.bin
$ ./firmware-imx-8.10.1.bin
$ cp firmware-imx-8.10.1/firmware/ddr/synopsys/lpddr4*.bin ./

Assemble the Boot Container

Finally, to assemble the boot container, you need to obtain the imx-mkimage utility.

  1. Clone it from the NXP repository:

    $ git clone -b lf-5.15.32_2.0.0 https://github.com/nxp-imx/imx-mkimage.git

    The binary u-boot.bin is necessary for the final boot container. Make sure you followed the previous instructions in the Build U-Boot From Source Code article.

    The binary i.MX 8M Mini/8M Plus SoC boot container aggregates:

    • DDR training firmware (lpddr4_pmu_train*)
    • TF-A firmware (bl31.bin)
    • U-Boot SPL (spl/u-boot-spl.bin)
    • U-Boot proper (u-boot-nodtb.bin)
    • U-Boot device tree:
    • for Verdin iMX8M Mini: (arch/arm/dts/imx8mm-verdin.dtb renamed to fsl-imx8mm-evk.dtb)
    • for Verdin iMX8M Plus: (arch/arm/dts/imx8mp-verdin.dtb renamed to fsl-imx8mp-evk.dtb)
    • mkimage executable (tools/mkimage renamed to mkimage_uboot)
  2. Copy them to the iMX8M SoC directory inside imx-mkimage. For example, for Verdin iMX8MM:

    $ cd ./imx-mkimage/
    $ cp ../firmware-imx-*/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin iMX8M
    $ cp ../firmware-imx-*/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin iMX8M
    $ cp ../firmware-imx-*/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin iMX8M
    $ cp ../firmware-imx-*/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin iMX8M
    $ cp ../trusted-firmware-a/build/imx8mm/release/bl31.bin iMX8M
    $ cp ../workdir/u-boot-toradex/spl/u-boot-spl.bin iMX8M
    $ cp ../workdir/u-boot-toradex/u-boot-nodtb.bin iMX8M
    $ cp ../workdir/u-boot-toradex/arch/arm/dts/imx8mm-verdin.dtb iMX8M/fsl-imx8mm-evk.dtb
    $ cp ../workdir/u-boot-toradex/tools/mkimage iMX8M/mkimage_uboot
  3. Use make to build the boot container:

    $ make clean; make SOC=iMX8MM flash_evk_emmc_fastboot
    $ ls iMX8M/flash.bin
  4. Rename the file flash.bin to imx-boot so it will be suitable for a Toradex Easy Installer Image.

    $ mv iMX8M/flash.bin iMX8M/imx-boot

Deploy the U-Boot binary to an Image

Now that the adjustments were made, return to the Build U-Boot From Source Code article to deploy the U-Boot binary to an image.



Send Feedback!