How to populate and boot a board with OP-TEE

1 Introduction[edit]

OP-TEE overview can be found in OP-TEE_overview wiki page.

OP-TEE is a combined feature from Open Embedded point of view.
A combined feature is a combination of 2 Yocto variables MACHINE_FEATURES and DISTRO_FEATURES.
So a combined feature is activated only after these two variables are set.

Once the machine is defined with MACHINE_FEATURES += "optee" and the distro is set with DISTRO_FEATURES_append = " optee ", building the OpenSTLinux distribution will provide all necessary binaries to populate and boot with OP-TEE feature.
As a reminder, STMicroelectronics machine configuration files are located here:

  • meta-st/meta-st-stm32mp/conf/machine/*.conf

and STMicroelectronics distribution configuration file here:

  • meta-st/meta-st-openstlinux/conf/distro/include/openstlinux.inc

2 Usage[edit]

2.1 Programming the built image with OP-TEE[edit]

Inside the build-<distro>-<machine>/tmp-glibc/deploy/images/stm32mp1/flashlayout_st-image-weston folder, one of the OP-TEE Flash layout file must be selected:

Flashlayout_*-optee.tsv

Several devices to program (microSD, e•MMC...) are available on the board.

Once the Flash layout file has been selected, the STM32CubeProgrammer tool can be used as usual.

Info white.png Information
For microSD card and Evaluation board, the correct Flash layout file to use is: FlashLayout_sdcard_stm32mp157c-ev1-optee.tsv

2.2 Booting the built image with OP-TEE[edit]

During boot sequence, the OP-TEE integration trace should be displayed on the UART console log. The OP-TEE core boot stage trace should look like this:

I/TC:  Pager is enabled. Hashes: 1184 bytes
I/TC:  OP-TEE version: openstlinux-18-06-01
I/TC:  Initialized

The Linux kernel boot trace should show the successful probing of the OP-TEE Linux kernel driver:

optee: probing for conduit method from DT.
optee: initialized driver