Colibri iMX8X V1.0B - kernel 5.4


I am trying to build new kernel for iMX8QXP. I have succeed with older version 4.14 and because there is new BSP 5 available, I wanted to be updated.
I followed instructions same as before but kernel will not boot (hang in Starting kernel).

First of all I realized that U-Boot update may be required, so i flashed Torzion with newer U-Boot (current version of U-Boot is U-Boot 2020.04-5.1.0-devel+git.5ac61784dd4c). This is first question, because in instructions the required git branch is toradex_imx_v2020.04_5.4.24_2.1.0:
(1) is it OK to use the one which comes with Torizon image?
I’m trying to avoid building my own U-Boot and I want use everything possible from Toradex.

Following instructions I downloaded compiler for arm64, set environment variables, cloned git repo with branch toradex_5.4-2.1.x-imx, made defconfig, build image and device tree imx8qxp-colibri-eval-v3.dtb.

export ARCH=arm64
export DTC_FLAGS="-@"
export PATH=/opt/imx8/gcc/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/:$PATH
export CROSS_COMPILE=aarch64-linux-gnu-
export LOCALVERSION="${id}"
export VERSION=`make kernelversion`
test -d var/${ID} && echo "${ID} already exists!" || mkdir -vp var/${ID}/boot

make defconfig
make -j10 Image 2>&1 | tee var/${ID}/build.log

make DTC_FLAGS="-@" freescale/imx8qxp-colibri-eval-v3.dtb

cp -v arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtb var/${ID}/boot/
cp -v arch/arm64/boot/Image var/${ID}/boot/

I am booting from SD Card, on first partition there is boot.scr, imx8qxp-colibri-eval-v3.dtb and Image.

My U-Boot script:

# config
test -n ${kernel_image} || env set kernel_image Image

# set dtb file
env set fdt_file 'imx8qxp-colibri-eval-v3.dtb'

test -n ${kernel_image} || env set kernel_image ${boot_file}

echo Loading dtb
# load dtb
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdt_file}

# get uuid
part uuid ${devtype} ${devnum}:2 uuid
# emmc args
#env set console ttyLP3,115200 uart_from_osc
env set console ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200
env set emmcargs root=PARTUUID=${uuid} ro rootfstype=ext4 rootwait console=${console}
# boot args
env set bootargs ${defargs} ${emmcargs} ${setupargs} ${vidargs} ${tdxargs}
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${kernel_image}

# Run A7 - boot image
echo emmcargs ${emmcargs}
echo bootargs ${bootargs}
echo kernel_image ${kernel_image}
echo kernel_addr_r ${kernel_addr_r}
echo fdt_addr_r ${fdt_addr_r}
echo booti ${kernel_addr_r} - ${fdt_addr_r}

booti ${kernel_addr_r} - ${fdt_addr_r}

Output from LPUART3 is following:

U-Boot 2020.04-5.1.0-devel+git.5ac61784dd4c (Jan 01 1970 - 00:00:00 +0000)

CPU:   NXP i.MX8QXP RevB A35 at 1200 MHz at 20C

DRAM:  2 GiB
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT V1.0B, Serial# 06494192

  - SCFW 732e719a, SECO-FW 376e3c15, IMX-MKIMAGE 6745ccdc, ATF 
  - U-Boot 2020.04-5.1.0-devel+git.5ac61784dd4c 

flash target is MMC:0
Net:   eth0: ethernet@5b040000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
1059 bytes read in 16 ms (64.5 KiB/s)
## Executing script at 83200000
Loading dtb
122607 bytes read in 26 ms (4.5 MiB/s)
23656960 bytes read in 1216 ms (18.6 MiB/s)
emmcargs root=PARTUUID=a8971233-02 ro rootfstype=ext4 rootwait console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200
bootargs root=PARTUUID=a8971233-02 ro rootfstype=ext4 rootwait console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200 video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off
kernel_image Image
kernel_addr_r 0x80280000
fdt_addr_r 0x83100000
booti 0x80280000 - 0x83100000
## Flattened Device Tree blob at 83100000
   Booting using the fdt blob at 0x83100000
   Loading Device Tree to 00000000fd655000, end 00000000fd675eee ... OK

Starting kernel ...


Am I missing something or do You see something wrong?
Thanks for advice.

Greetings @slezak.martin!

Since you want to update your kernel to the 5.4, the fastest way to do this would be to install BSP 5 itself, which you can do using the Toradex Easy Installer. It should already come with the 5.4 downstream kernel and you wouldn’t need to recompile anything. Is this feasible for your use case?

Regarding your compilation procedure, I noticed you forgot to load the specific defconfig for the Colibri iMX8X, which would be make colibri-imx8x_defconfig. This can lead to issues such as the kernel hang you’ve experienced.

Hello @gustavo.tx ,

I know about this option, but I am using custom board, Iris is only for develop purpose, so it is not usable for us.

I bumped on make colibri-imx8x_defconfig too, but it is only for U-Boot build, not for kernel.

develop/git/linux-toradex# make colibri-imx8x_defconfig
      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/kconfig/conf.o
      HOSTCC  scripts/kconfig/confdata.o
      HOSTCC  scripts/kconfig/expr.o
      LEX     scripts/kconfig/lexer.lex.c
      YACC    scripts/kconfig/[ch]
      HOSTCC  scripts/kconfig/lexer.lex.o
      HOSTCC  scripts/kconfig/
      HOSTCC  scripts/kconfig/preprocess.o
      HOSTCC  scripts/kconfig/symbol.o
      HOSTLD  scripts/kconfig/conf
    *** Can't find default configuration "arch/arm64/configs/colibri-imx8x_defconfig"!
    make[1]: *** [scripts/kconfig/Makefile:90: colibri-imx8x_defconfig] Error 1
    make: *** [Makefile:590: colibri-imx8x_defconfig] Error 2

Hi @slezak.martin!

This does not depend on the carrier board you’re using. You can still migrate to BSP 5 on your custom carrier board. Since you’re already aiming to upgrade your kernel, it’s just a matter of upgrading your device trees and the Yocto recipe for your image.

My point is that it would be easier for you to migrate to BSP 5, which already comes with kernel 5.4, than mix the previous BSP with a newer kernel. Using the complete BSP also means that the configuration is thoroughly tested.

You’re right about the defconfig, the one I mentioned is the U-Boot configuration. make defconfig is correct for the iMX8 downstream kernel versions, as you were doing before.

Please let me know a little bit more about what you’re aiming to do and your hardware set up so we can sort these issues out.

Hi @gustavo.tx.

We’re using Toradex kernel with concrete configuration, drivers, build-in modules and only necessary kernel modules on custom carrier board with own distro. Everything works well till BSP 5 or to be exact before kernel branch toradex_5.4-2.1.x-imx. Tried kernels from toradex_4.14-2.0.x-imx and toradex_4.14-2.3.x-imx and both works well.

Due new revision of our carrier board I needed to update device tree and it makes perfect sense updating to last BSP version at this point, if possible.

I started with Iris and BSP 5 to see, how things are.
And I’ve ended at this point - can’t boot kernel (branch toradex_5.4-2.1.x-imx) on Iris with defconfig and imx8qxp-colibri-eval-v3.dtb.
I updated U-Boot to last available via Tezi (current U-Boot version: U-Boot 2020.04-5.1.0-devel+git.5ac61784dd4c (Jan 01 1970 - 00:00:00 +0000)

So my aim is to boot this kernel on Iris at the moment.
Then I’ll continue with updating kernel config & modules and updating device tree for our carrier board.

Thank You

Please consult the following article on our developer website concerning how to build it.

And keep in mind that such obsolete early access prototypes may require a special legacy MACHINE=colibri-imx8-v10b to be used.