@@ -1,5 +1,112 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/ {
+ binman: binman {
+ multiple-images;
+ };
+};
+
+&binman {
+ u-boot-spl-ddr {
+ filename = "u-boot-spl-ddr.bin";
+ pad-byte = <0xff>;
+ align-size = <4>;
+ align = <4>;
+
+ u-boot-spl {
+ align-end = <4>;
+ };
+
+ blob_1: blob-ext@1 {
+ filename = "lpddr4_pmu_train_1d_imem.bin";
+ size = <0x8000>;
+ };
+
+ blob_2: blob-ext@2 {
+ filename = "lpddr4_pmu_train_1d_dmem.bin";
+ size = <0x4000>;
+ };
+
+ blob_3: blob-ext@3 {
+ filename = "lpddr4_pmu_train_2d_imem.bin";
+ size = <0x8000>;
+ };
+
+ blob_4: blob-ext@4 {
+ filename = "lpddr4_pmu_train_2d_dmem.bin";
+ size = <0x4000>;
+ };
+ };
+
+ flash {
+ mkimage {
+ args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+
+ blob {
+ filename = "u-boot-spl-ddr.bin";
+ };
+ };
+ };
+
+ itb {
+ filename = "u-boot.itb";
+
+ fit {
+ description = "Configuration to load ATF before U-Boot";
+ #address-cells = <1>;
+ fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+
+ images {
+ uboot {
+ description = "U-Boot (64-bit)";
+ type = "standalone";
+ arch = "arm64";
+ compression = "none";
+ load = <CONFIG_SYS_TEXT_BASE>;
+
+ uboot_blob: blob-ext {
+ filename = "u-boot-nodtb.bin";
+ };
+ };
+
+ atf {
+ description = "ARM Trusted Firmware";
+ type = "firmware";
+ arch = "arm64";
+ compression = "none";
+ load = <0x910000>;
+ entry = <0x910000>;
+
+ atf_blob: blob-ext {
+ filename = "bl31.bin";
+ };
+ };
+
+ fdt {
+ description = "NAME";
+ type = "flat_dt";
+ compression = "none";
+
+ uboot_fdt_blob: blob-ext {
+ filename = "u-boot.dtb";
+ };
+ };
+ };
+
+ configurations {
+ default = "conf";
+
+ conf {
+ description = "NAME";
+ firmware = "uboot";
+ loadables = "atf";
+ fdt = "fdt";
+ };
+ };
+ };
+ };
+};
+
&usdhc1 {
mmc-hs400-1_8v;
};
@@ -36,6 +36,7 @@ config TARGET_IMX8MQ_CM
config TARGET_IMX8MQ_EVK
bool "imx8mq_evk"
+ select BINMAN
select IMX8MQ
select IMX8M_LPDDR4
@@ -10,6 +10,6 @@ config SYS_CONFIG_NAME
default "imx8mq_evk"
config IMX_CONFIG
- default "arch/arm/mach-imx/imx8m/imximage.cfg"
+ default "board/freescale/imx8mq_evk/imximage-8mq-lpddr4.cfg"
endif
new file mode 100644
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+BOOT_FROM sd
+LOADER mkimage.flash.mkimage 0x7E1000
@@ -24,7 +24,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000
CONFIG_FIT=y
CONFIG_FIT_EXTERNAL_OFFSET=0x3000
CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_BOARD_LATE_INIT=y
CONFIG_SPL_BOARD_INIT=y
@@ -9,7 +9,7 @@ Quick Start
-----------
- Build the ARM Trusted firmware binary
-- Get ddr and hdmi fimware
+- Obtain DDR firmware from NXP website
- Build U-Boot
- Boot
@@ -18,7 +18,8 @@ Get and Build the ARM Trusted firmware
Note: srctree is U-Boot source directory
Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
-branch: imx_5.4.47_2.2.0
+branch: lf_v2.4
+Tag: lf-5.10.52-2.1.0
.. code-block:: bash
@@ -30,11 +31,10 @@ Get the ddr and hdmi firmware
.. code-block:: bash
- $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin
- $ chmod +x firmware-imx-8.9.bin
- $ ./firmware-imx-8.9.bin
- $ cp firmware-imx-8.9/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(builddir)
- $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
+ $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.13.bin
+ $ chmod +x firmware-imx-8.13.bin
+ $ ./firmware-imx-8.13.bin
+ $ cp firmware-imx-8.13/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
Build U-Boot
------------
@@ -43,14 +43,18 @@ Build U-Boot
$ export CROSS_COMPILE=aarch64-poky-linux-
$ make imx8mq_evk_defconfig
- $ make flash.bin
+ $ export ATF_LOAD_ADDR=0x910000
+ $ make
-Burn the flash.bin to MicroSD card offset 33KB:
+Burn the flash.bin (offset 33KB) and u-boot.itb (offset 384KB) to MicroSD card:
.. code-block:: bash
$sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc
+ $sudo dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=notrunc
Boot
----
-Set Boot switch SW801: 1100 and Bmode: 10 to boot from Micro SD.
+Set Boot switches to boot from Micro SD:
+SW801: 1100
+SW802: 10
Currently i.MX8MQ EVK board still targeting the old image generation approach for image generation, which relies on the FIT generator that has been dropped from the tree. Switch the board to use binman instead, which is a standard image generator now. Update board documentation to correct build command, and advise latest firmware and TF-A versions to use. NOTE: New image produced by binman does not have Signed HDMI FW support, this has been left on the side and does not interfere with the general boot flow. Tested on: [i.MX8MQ rev2.0] Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> --- arch/arm/dts/imx8mq-evk-u-boot.dtsi | 107 ++++++++++++++++++ arch/arm/mach-imx/imx8m/Kconfig | 1 + board/freescale/imx8mq_evk/Kconfig | 2 +- .../imx8mq_evk/imximage-8mq-lpddr4.cfg | 9 ++ configs/imx8mq_evk_defconfig | 2 +- doc/board/nxp/imx8mq_evk.rst | 24 ++-- 6 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 board/freescale/imx8mq_evk/imximage-8mq-lpddr4.cfg base-commit: 5b9ee01685290653671072d0030cd7ba9da3a705