OPTEE support on colibri i.Mx6ULL module

Hello,

  • I’m having an issue when trying to load the root file system while I’m using OPTEE as a secure operating system before Linux.

  • I’m able to load the root filesystem when I’m not using OPTEE before Linux.

  • Right now I’m using below version and revision of u-boot-toradex:
    u-boot version : 2016.11-2.8.5
    u-boot commit : 02735f400478c6e9afc432fda1149abef630657c
    u-boot branch : 2016.11-toradex

  • The same thing was working fine when I was using the previous u-boot-toradex version 2016.11-2.7.4.

  • Please find the logs for the same here.

Thanks and Regards,

Sumit Gajjar

Greetings @Sumit_Gajjar,

I have actually recently played around with OPTEE and was able chainload into the linux kernel. Though that was on the i.MX7 with eMMC. The raw NAND of the i.MX6ULL may complicate some things.

From what I can see in the attached logs are you booting OPTEE from raw NAND? What kind of boot command are you running to initiate?

Best Regards,
Jeremias

Hi @jeremias.tx,

From what I can see in the attached logs are you booting OPTEE from raw NAND? What kind of boot command are you running to initiate?

Right now actually I’m loading OPTEE from TFTP at 0x83000000 address, using below command following boot command:

  • tftp 0x81000000 colibri-imx6ull/zImage ;tftp 0x82100000 colibri-imx6ull/imx6ull-colibri-eval-v3.dtb ;tftp 0x83000000 colibri-imx6ull/uTee
  • run setup; setenv bootargs ${defargs} ${ubiargs} ${setupargs} ${vidargs}; echo Booting from NAND…; ubi part ubi && bootm 0x83000000 - 0x82100000

Using this method I was able to boot OPTEE and successfully boot kernel and load root filesystem when I was using the previous version of u-boot-toradex 2016.11-2.7.4.

Thanks and Regards,

Sumit Gajjar

Hi @Sumit_Gajjar,

Just to confirm it seems you were able to load OPTEE to the i.MX6ULL? Seems like the trick was running the setup commands in u-boot before booting into OPTEE.

Best Regards,
Jeremias

Hi @jeremias.tx,

Just to confirm it seems you were able to load OPTEE to the i.MX6ULL?
Yes, I’m able to load OPTEE to i.MX6ULL.
Seems like the trick was running the setup commands in u-boot before booting into OPTEE.
Yes, before booting OPTEE u-boot run setup command and set bootargs environment variable then boot.

**Thanks and Regards,

Sumit Gajjar**

Perfect that it works. Thanks for the feedback.

Hi @jaski.tx @jeremias.tx,

I am still having issue when using u-boot-toradex revision as u-boot version : 2016.11-2.8.5 u-boot commit : 02735f400478c6e9afc432fda1149abef630657c u-boot branch : 2016.11-toradex.

I’m not able to load root filesystem, when using above u-boot version.

Thanks and Regards,
Sumit Gajjar

Please note that BSP 2.8b5 is considered an obsolete beta version and as such is no longer supported. Please update to BSP 2.8b6 and re-try your use case. Thanks!

Hi @marcel.tx,

I have tested on U-Boot 2016.112.8.6+g83a53c1 please find the logs attached here.
It’s still not able to load root filesystem.

Thanks and Regards,

Sumit Gajjar

Hi @Sumit_Gajjar,

Just so I understand you were able to get OPTEE to boot with U-boot 2016.11-2.7.4 but 2016.11-2.8.5 fails, correct?

2016.11-2.8.5 is on commit 02735f400478c6e9afc432fda1149abef630657c, right?
What commit is your 2016.11-2.7.4 on?

Hi @jeremias.tx,

Just so I understand you were able to get OPTEE to boot with U-boot 2016.11-2.7.4 but 2016.11-2.8.5 fails, correct?

Yes, please find the logs for the same here.

2016.11-2.8.5 is on commit 02735f400478c6e9afc432fda1149abef630657c, right?

Yes, 2016.11-2.8.5 is on commit 02735f400478c6e9afc432fda1149abef630657c.

What commit is your 2016.11-2.7.4 on?

2016.11-2.7.4 is on commit 1b121c6ab548a9af0a27876e9eaa0c654c1dc3e1.

Thanks and Regards,

Sumit Gajjar

Hi @Sumit_Gajjar,

There doesn’t seem to be any significant changes between the two U-boot commits that would affect OPTEE.

But now that I look closer at your boot logs, both cases seem to be able to load the kernel from OPTEE succesfully. However, in the failure case the nand driver seems to initialize incorrectly.

Are you using different or the same zImage (kernel) in both cases? How about the device tree?

Best Regards,
Jeremias

If you are indeed otherwise using the exact same setup, which is not so clear from your logs, then I would suggest for you to bisect it to find the root cause. Please also note that BSP 2.7.4 was never really supported on the Colibri iNX6ULL and that you may want to upgrade to a recent V1.1A module as well.

Hi @Sumit_Gajjar,

I think, this issue is not in U-boot. I had faced same issue while deploying optee os on imx6ull board with U-boot version 2.8.5. I solved this issue by changing configuration variable in optee os.
Are you using CFG_DT_ADDR configuration variable while building optee os? if yes, then remove CFG_DT_ADDR configuration variable and build and test it. Because, We have already passed dtb address along with optee address in U-boot using bootm command (bootm ${optee_addr_r} ${fdt_addr_r}), so no need to again pass dtb address in optee. Two times dtb call, one from U-boot and second from optee os. So that, kernel is misbehaving.

Thanks,
KG