Running OP-TEE OS on Colibri I.MX6ULL

Dear Community,

We are trying to run OPTEE OS on the Colibri i.MX6ULL following the steps mentioned in this Forum post OPTEE support on colibri i.Mx6ULL module - Toradex Community.

However, it is not possible for us to get it running. Have there been more experiments with OPTEE on Toradex boards so far? It would be great if someone could shed some light on the topic.

Steps we conducted to try run OPTEE on imx6ull:

  1. Setup Toradex Yocto branch zeus:

    repo init -u Index of /toradex-bsp-platform.git -b LinuxImage4.0
    repo sync

  2. add layers needed for optee os

    git clone -b zeus meta-linaro.git - Linaro layer for OpenEmbedded.
    git clone -b zeus GitHub - priv-kweihmann/meta-sca: Layer for static code analysis and security hardening

add meta-linaro/meta-optee and meta-sca to bblayers.conf

  1. add optee os configuartion to local.conf

    IMAGE_INSTALL_append = “optee-os optee-client optee-examples”
    OPTEEMACHINE = “imx”
    OPTEEOUTPUTMACHINE = “imx”
    OPTEE_ARCH = “arm32”

  2. Build images
    . export

    bitbake core-image-minimal

  3. build uTee image

    ./tmp/sysroots-components/x86_64/u-boot-tools-native/usr/bin/mkimage -A arm -O linux -C none -a 0x9dffffe4 -e 0x9e000000 -d ./deploy/images/colibri-imx6ull/optee/tee.bin uTee

  4. Configure Board to load and boot uTee, zImage and deviceTree (According to forum post mentioned above)

Copy uTee zImage and .dtb to tftp server

In Uboot:
setenv tee_file uTee

setenv tee_loadaddr 0x83000000
setenv tee_tftp ‘tftp ${kernel_addr_r} ${kernel_file}; tftp ${fdt_addr_r} ${fdt_file}; tftp ${tee_loadaddr} ${tee_file}’

setenv teeboot ‘run tee_tftp; run setup; setenv bootargs ${defargs} ${ubiargs} ${setupargs} ${vidargs};
echo Booting from NAND…; ubi part ubi && bootm ${tee_loadaddr} - ${fdt_addr_r}’

saveenv
run teeboot

Result:
After this, OPTEE does not seem to start properly. The output is as follows:

Colibri iMX6ULL # run teeboot
ethernet@020b4000 Waiting for PHY auto negotiation to complete… done
Using ethernet@020b4000 device
TFTP from server 192.168.10.34; our IP address is 192.168.10.2
Filename ‘zImage’.
Load address: 0x81000000
Loading: ################################################## 5.5 MiB
9.9 MiB/s
done
Bytes transferred = 5747584 (57b380 hex)
Using ethernet@020b4000 device
TFTP from server 192.168.10.34; our IP address is 192.168.10.2
Filename ‘imx6ull-colibri-wifi-eval-v3.dtb’.
Load address: 0x82100000
Loading: ################################################## 54.3 KiB
3.3 MiB/s
done
Bytes transferred = 55560 (d908 hex)
Using ethernet@020b4000 device
TFTP from server 192.168.10.34; our IP address is 192.168.10.2
Filename ‘uTee’.
Load address: 0x83000000
Loading: ################################################## 317.3 KiB
7.9 MiB/s
done
Bytes transferred = 324924 (4f53c hex)
Booting from NAND…
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd5
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd5 (name “ubi”, size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4058, bad PEBs: 6, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 13
18860596
ubi0: available PEBs: 0, total reserved PEBs: 4058, PEBs reserved for bad PEB ha
ndling: 74

Booting kernel from Legacy Image at 83000000 …

Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 324860 Bytes = 317.2 KiB
Load Address: 9dffffe4
Entry Point: 9e000000
Verifying Checksum … OK

Flattened Device Tree blob at 82100000

Booting using the fdt blob at 0x82100000
Loading Kernel Image … OK
Using Device Tree in place at 82100000, end 82110907
Updating MTD partitions…

Starting kernel …

E/TC:0 0 plat_rng_init:354 Warning: seeding RNG with zeroes
E/TC:0 0 call_initcalls:32 Initial call 0x9e04a97c failed
E/TC:0 0
E/TC:0 0 Core data-abort at address 0x98c40004
E/TC:0 0 fsr 0x00001008 ttbr0 0x9e06c06a ttbr1 0x9e06c06a cidr 0x0
E/TC:0 0 cpu #0 cpsr 0x600001f3
E/TC:0 0 r0 0x98c40000 r4 0x9e07b180 r8 0x9e044061 r12 0x0a52143e
E/TC:0 0 r1 0x0000ccc0 r5 0x9e04a990 r9 0x00000001 sp 0x9e07b178
E/TC:0 0 r2 0x00000004 r6 0x9e045205 r10 0x9e07b1d4 lr 0x9e00af45
E/TC:0 0 r3 0x0000000a r7 0x9e0451e9 r11 0x0000000a pc 0x9e00bd48
E/TC:0 0
E/TC:0 0 Core data-abort at address 0x98c40004
E/TC:0 0 fsr 0x00001008 ttbr0 0x9e06c06a ttbr1 0x9e06c06a cidr 0x0
E/TC:0 0 cpu #0 cpsr 0x600001f3
E/TC:0 0 r0 0x98c40000 r4 0x9e07b180 r8 0x9e044061 r12 0x0a52143e
E/TC:0 0 r1 0x0000ccc0 r5 0x9e04a990 r9 0x00000001 sp 0x9e07b178
E/TC:0 0 r2 0x00000004 r6 0x9e045205 r10 0x9e07b1d4 lr 0x9e00af45
E/TC:0 0 r3 0x0000000a r7 0x9e0451e9 r11 0x0000000a pc 0x9e00bd48
E/TC:0 0
E/TC:0 0 Core data-abort at address 0x98c40004
E/TC:0 0 fsr 0x00001008 ttbr0 0x9e06c06a ttbr1 0x9e06c06a cidr 0x0
E/TC:0 0 cpu #0 cpsr 0x600001f3
E/TC:0 0 r0 0x98c40000 r4 0x9e07b180 r8 0x9e044061 r12 0x0a52143e
E/TC:0 0 r1 0x0000ccc0 r5 0x9e04a990 r9 0x00000001 sp 0x9e07b178
E/TC:0 0 r2 0x00000004 r6 0x9e045205 r10 0x9e07b1d4 lr 0x9e00af45
E/TC:0 0 r3 0x0000000a r7 0x9e0451e9 r11 0x0000000a pc 0x9e00bd48

The core-data abort at address 0x… lines keep repeating as if there were some kind of loop.

I would be very happy to get some information on how to properly boot OPTEE on colibri imx6ull.

Thanks and Regards
Corinna

To people having the same problem: We were able to fix it and boot OPTEE by using OPTEE OS version 3.10 (instead of 3.7 used by meta-linaro branch zeus) and applying this tutorial (http://mrvan.github.io/optee-imx6ul).

Hi @corinna

Perfect that it works. Thanks for your feedback.

Best regards,
Jaski