U-Boot for the NXP i.MX8MQ EVK board

Quick Start
===========

- Build U-Boot
- Build the ARM Trusted firmware binary
- Get DDR firmware and mkimage tool
- Generate flash.bin using imx-mkimage
- Flash the binary into the SD card
- Boot

Build U-Boot
============

$ make mx8mq_evk_defconfig
$ make

Get and Build the ARM Trusted firmware
======================================

$ git clone https://source.codeaurora.org/external/imx/imx-atf
$ cd imx-atf/
$ git checkout origin/imx_4.9.51_imx8m_beta
$ make PLAT=imx8mq bl31

Get the DDR firmware and mkimage tool
==============================

$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.2.bin
$ chmod +x firmware-imx-7.2.bin
$ ./firmware-imx-7.2.bin

Download the imx-mkimage tool:

$ git clone https://source.codeaurora.org/external/imx/imx-mkimage/
$ cd imx-mkimage/
$ git checkout origin/imx_4.9.51_imx8m_beta


Generate flash.bin using imx-mkimage
====================================

Copy the following binaries to imx-mkimage/iMX8M folder:

$ cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/
$ cp u-boot/u-boot-nodtb.bin imx-mkimage/iMX8M/
$ cp u-boot/spl/u-boot-spl.bin imx-mkimage/iMX8M/
$ cp u-boot/arch/arm/dts/fsl-imx8mq-evk.dtb imx-mkimage/iMX8M/

Copy the following firmwares to imx-mkimage/iMX8 folder :

$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin imx-mkimage/iMX8M/
$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin imx-mkimage/iMX8M/
$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin imx-mkimage/iMX8M/
$ cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin imx-mkimage/iMX8M/

If you want to run with HDMI, copy signed_hdmi_imx8m.bin to imx-mkimage/iMX8M.

Before generating the flash.bin, transfer the mkimage generated by U-Boot to iMX8M folder:

$ cp u-boot/tools/mkimage imx-mkimage/iMX8M/
$ mv imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot

$ cd imx-mkimage/
$ make SOC=iMX8M flash_spl_uboot

Or for using HDMI:

$ make SOC=iMX8M flash_hdmi_spl_uboot

Flash the binary into the SD card
=================================

Burn the flash.bin binary to SD card offset 33KB:

$ sudo dd if=iMX8M/flash.bin of=/dev/sd[x] bs=1024 seek=33

Boot
====
Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
