How to use non-rpmsg.dtbs on i.MX 8QXP

Showing results for 
Search instead for 
Did you mean: 

How to use non-rpmsg.dtbs on i.MX 8QXP

No ratings

How to use non-rpmsg.dtbs on i.MX 8QXP

The i.MX 8QXP MEK does not allow the OV5640/LVDS/LCD usage only by changing the device tree anymore. It occurs because the M4 owns the i2c resources, so the A core must use rpmsg to enable virtual drivers.

Due to this, if the user changes the device tree, for instance, the *ov5640.dtb, the kernel won't boot, entering in the following loop:

 [    8.603353] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).     
 [    8.610025] [drm] No driver support for vblank timestamp query.             
 [    8.616077] imx-drm display-subsystem: bound imx-drm-dpu-bliteng.2 (ops dpu_)
 [    8.624978] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_op)
 [    8.632526] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_op)
 [    8.639833] imx-drm display-subsystem: failed to bind ldb@562210e0 (ops imx_7
 [    8.648428] imx-drm display-subsystem: master bind failed: -517

With the approach provided in this post, it is possible to make this change manually, only by changing the flash.bin at U-boot for a non-m4 one.
In order to make the changes to the flash.bin file, it’s needed to obtain the following files:

- u-boot.bin from internal u-boot provided by NXP.

- scfw_tcm.bin from SCFW porting kit

- bl31.bin from ARM Trusted Firmware

- SECO firmware container image


The described procedures in this document target a GNU/Linux (Ubuntu 20.04 LTS) and it’s focused on iMX8QXP B0 + BSP L4.19.35_1.1.0.

Required packages

1 - Install ARM64 ToolChain:

1.1 - Install ARM64 GCC and G++ cross-compilers:

# apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

2 - Install ARM32 GCC6 ToolChain:

2.1 - Download the ARM32 6 Toolchain and install it:

$ mkdir ~/gcc_toolchain

$ cp ~/Downloads/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 ~/gcc_toolchain/

$ cd ~/gcc_toolchain/

$ tar xvjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2

# apt-get update

# apt-get install srecord

3 - Download MKimage

3.1 - Create a new directory desired to the packages:

$ mkdir flash_build
$ cp flash_build

3.1 - Clone the MKimage:

$ git clone -b imx_4.19.35_1.1.0

4 - U-boot build

4.1 - Clone the U-boot 

$ git clone -b imx_v2019.04_4.19.35_1.1.0
$ cd uboot-imx

4.2 - Export the ARM64 ToolChain: 

$ export ARCH=arm64
$ export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-

4.3 - Build it: 

$ unset LDFLAGS
$ make -j4 imx8qxp_mek_defconfig
$ make

4.4 - Copy the binary files to the MKimage/iMX8QX directory: 

$ cp spl/u-boot-spl.bin ../imx-mkimage/iMX8QX/

$ cp u-boot-nodtb.bin ../imx-mkimage/iMX8QX/

$ cd ..


5 - ARM Trusted Firmware

5.1 - Clone the imx-atf: 

$ git clone -b imx_4.19.35_1.1.0

$ cd imx-atf

5.2 - Build it: 

$ unset LDFLAGS
$ make PLAT=imx8qx bl31

5.3 - Copy the binary files to the MKimage/iMX8QX directory: 

$ cp build/imx8qx/release/bl31.bin ../imx-mkimage/iMX8QX/

$ cd ..


6 - SCFW

6.1 - Export the ARM32 GCC6 Toolchain: 

$ export TOOLS=~/gcc_toolchain/

6.2 - Download the BSP L4.19.35_1.1.0_SCFW and copy it to the flash_build directory: 

$ cp ~/Downloads/imx-scfw-porting-kit-

$ tar xvzf imx-scfw-porting-kit-

$ cd packages/

$ chmod a+x imx-scfw-porting-kit-

$ ./imx-scfw-porting-kit-

6.3 - Build it to i.MX 8QXP MEK B0: 

$ cd imx-scfw-porting-kit-

$ tar xvzf scfw_export_mx8qx_b0.tar.gz

$ cd scfw_export_mx8qx_b0/

$ make qx R=B0 B=mek

6.4 - Copy the binary file to the MKimage/iMX8QX directory: 

$ cp build_mx8qx_b0/scfw_tcm.bin ../../../../imx-mkimage/iMX8QX/

$ cp ../../../../

7 - SECO Firmware Container Image

7.1 - Download the SECO firmware binaries and copy it to the flash_build directory

$ cp ~/Downloads/firmware-imx-7.9.bin .

$ chmod a+x firmware-imx-7.9.bin

7.2 - Copy the binary files to the MKimage/iMX8QX directory: 

$ cp firmware-imx-7.9/firmware/seco/mx8qx-ahab-container.img /imx-mkimage/iMX8QX/

8 - Build flash.bin

8.1 - In a new terminal, open the imx-mkimage directory:

$ cd flash_build/imx-mkimage

8.2 - Build it: 

$ make SOC=iMX8QX flash

8.3 - Deploy it to the SDCard: 

$ sudo dd if=iMX8QX/flash.bin of=/dev/sdX bs=1k seek=32 && sync

Now, you are able to use any non-rpmsg.dtb without kernel errors.

Pedro Jardim:


I also see this same kernel error loop if I attempt to use xen (on the same i.MX 8QXP MEK board).

If you are doing your own Yocto build, I don't think you need to do all the steps indicated above.

In the tmp/deploy/images/imx8qxpmek/ directory you can find both:

  • imx-boot-imx8qxpmek-sd.bin-flash_linux_m4
  • imx-boot-imx8qxpmek-sd.bin-flash_spl

I was able to get past the above error and boot dom0 by doing:

(on target)

dd if=imx-boot-imx8qxpmek-sd.bin-flash_spl bs=1k seek=32 of=/dev/mmcblk1



(or on dev host)

dd if=imx-boot-imx8qxpmek-sd.bin-flash_spl bs=1k seek=32 of=/dev/sdX


(re-mount sdcard)

(press return to enter u-boot)

The default dtb will not work now, however, I can then do:

=> run xenmmcboot

Thanks greglarson‌,

Hope more people can find this place and, thanks to you, we have more than one step-by-step to fix it.

Best Regards,


Version history
Revision #:
2 of 2
Last update:
‎09-10-2020 02:59 AM
Updated by: