1. Purpose[edit source]
This article presents the STM32MPU OP-TEE configuration profiles. Last section gives references to OP-TEE build environment where to apply the configuration tuning.
For information on the many configuration switches of OP-TEE, refer the the mainline documentation [1] and to OP-TEE configuration switches article.
2. Overview[edit source]
As detailed in STM32MPU OP-TEE Overview article, OP-TEE is used both as a system resource manager and as a secure service provider in STM32MPU software deliveries. Support for these services can be set from specific CFG_xxx configuration switches (see OP-TEE configuration switches) however STM32MPU defines an OP-TEE configuration profile directive, CFG_STM32MP_PROFILE, that allows to set whether OP-TEE embeds secure services or only the system resource services. This article describes these profiles and the related services embedded in OP-TEE OS.
3. OP-TEE system services profile[edit source]
OP-TEE system resource management profile is enabled with CFG_STM32MP_PROFILE=system_services.
OpenSTLinux is designed to run a Linux ® kernel on an Arm Cortex-A processor. In this architecture, Linux © kernel is designed to execute in the non-secure state of the processor. Arm specifies several standard interfaces for Linux ® kernel (more generally Cortex-A non-secure world software) to access resources that are under secure world control by processor and/or chip architecture design, even if these resources may not strictly require Root of Trust (RoT) constraints on their use. STM32MPU OP-TEE system services profile configures OP-TEE to embed only these services, disabling all secure services.
These services are exposed through several standard interfaces:
- Arm PSCI specification [2] covers CPU and system low power modes.
- Arm defines a secure watchdog service interface bound on an Arm SMCCC function ID.
The interface was introduced in Linux ® kernel v5.8 [3]. - Arm SCMI specification [4] covers system resources as clocks, voltage regulators, power domains.
- STM32MP15 exposes platform SiP and OEM SMC function IDs in the scope of the Arm SMCCC specification [5].
These SMC function IDs are used in early OpenSTLinux distribution OTP fuses access services and up to now for low power domains and voltage regulators control. - OP-TEE OS defines so-called PTA services, as standardized interfaces to access a few system resources.
The tables below lists the resource management services available from OP-TEE. Some of these services are default enabled in applicable STM32MP product lines but can be individually disabled with their related CFG_xxx configuration switch.
'required' means the service is embedded and cannot be disabled.
'optional' means the service is embedded and can be disabled.
'optional/off' means the service is not embedded and can be enabled.
'not applicable' means the service do not apply to the product line.
OP-TEE system services | STM32MP13x lines ![]() |
STM32MP15x lines ![]() |
STM32MP25x lines ![]() |
---|---|---|---|
SCMI services | required | required | required |
PSCI services | required | required | required for PMIC services |
Oscillator calibration service | optional (CFG_STM32_CLKCALIB=y) |
optional (CFG_STM32_CLKCALIB=y) |
required |
Wakeup source management | require | required | not applicable |
Power Domain service | required | required | not applicable |
OTP access services | optional (CFG_BSEC_PTA=y) |
optional (CFG_BSEC_PTA=y) |
optional (CFG_BSEC_PTA=y) |
Random generation service | optional (CFG_HWRNG_PTA=y) |
optional (CFG_HWRNG_PTA=y) |
optional (CFG_HWRNG_PTA=y) |
3.1. SCMI services[edit source]
3.2. PSCI services[edit source]
4. OP-TEE secure services profile[edit source]
OP-TEE secure services profile is enabled with CFG_STM32MP_PROFILE=secure_and_system_services.
This profile embeds all the system service described in the previous section OP-TEE system services profile and embeds secure services as support for Trusted Applications (TAs, see [6]), secure remote co-processor loading, random number generation and more.
All secure services are built as OP-TEE TAs, executed in Cortex-A secure unprivileged level, or as OP-TEE core built-in services (named PTAs, part of OP-TEE core firmware image). When secure services are used, STM32MPU hardware assistance can greatly enhance the security hardening of the platform.
OP-TEE secure services are listed in the table below. Each of these services is default enabled in applicable STM32MP product line default configuration but can be individually disabled from their related CFG_ configuration switch.
OP-TEE secure & system services | STM32MP13x lines ![]() |
STM32MP15x lines ![]() |
STM32MP25x lines ![]() |
---|---|---|---|
System services | |||
SCMI services | required | required | required |
PSCI services | required | required | required for PMIC services |
Oscillator calibration service | optional (CFG_STM32_CLKCALIB=y) |
optional (CFG_STM32_CLKCALIB=y) |
required |
Wakeup source management | required | required | not applicable |
Power Domain service | required | required | not applicable |
OTP access services | recommended (CFG_BSEC_PTA=y) |
recommended (CFG_BSEC_PTA=y) |
optional (CFG_BSEC_PTA=y) |
Random generation service | recommended (CFG_HWRNG_PTA=y) |
recommended (CFG_HWRNG_PTA=y) |
recommended (CFG_HWRNG_PTA=y) |
Secure services - Trustworthiness of external TAs and internal PTAs | |||
User Trusted application support (CFG_WITH_USER_TA=y) |
recommended | recommended | recommended |
NVMEM provisioning services (CFG_BSEC_PTA=y and stm32mp_nvmem TA) |
optional (default embedded) |
optional (default embedded) |
optional (default embedded) |
Remote proc services (CFG_STM32MP_REMOTEPROC=y and remoteproc TA) |
not applicable | optional (default embedded) |
optional (default embedded) |
OP-TEE trusted keys wrapping [7] (CFG_IN_TREE_EARLY_TAS+=trusted_keys/...) |
optional | optional | optional |
OP-TEE PKCS#11 token [8] (CFG_PKCS11_TA+=y and pkcs11 TA) |
optional | optional | optional |
OP-TEE StMM [9] for EFI secure variables (CFG_STMM_PATH=...) |
optional | optional | optional |
5. Platform default configuration and constraints[edit source]
5.1. STM32MP13 default profile[edit source]
Platform default configuration for STM32MP13x lines enables both system and secure service:
- CFG_STM32MP_PROFILE=secure_and_system_services
On STM32MP13x lines , OP-TEE OS is loaded in the external memory (DDR) that is encrypted thanks to DDRMCE.
On STM32MP13x lines
, secure services needs some STM32MPU subsystems be assigned to the secure world (STM32 RNG, STM32 AES, STM32 IWDG, etc...)
5.2. STM32MP15 default profile[edit source]
Platform default configuration for STM32MP15x lines enables only system resource management services:
- CFG_STM32MP_PROFILE=system_services
Because STM32MP15x lines does not offer DDR encryption support, enabling the secure services profile requires OP-TEE to execute in the small secure internal SYSRAM thanks to its "pager" mode (memory page swapping). The paging mechanism can affect OP-TEE service performances. This mode also requires to save/restoration the internal secure memory into/from the non-secure DDR, using STM32 CRYP and STM32 RNG assistance. Therefore STM32MP15A* and STM32MP15D* chips cannot support low power state when secure services are enabled. It is possible to assign SRAM1 and some other SRAMx if they are not used by the Cortex-M processor.
In order to enable OP-TEE secure services on STM32MP15x lines , one shall set CFG_STM32MP_PROFILE=secure_and_system_services. This profile runs OP-TEE is the secure SYSRAM with OP-TEE pager enabled. Refer to section STM32MP15 pager constraints for more information on configuration constraints when pager is enabled.
5.3. STM32MP25 default profile[edit source]
Platform default configuration for STM32MP25x lines enables both system and secure services:
- CFG_STM32MP_PROFILE=secure_and_system_services
OP-TEE OS is loaded in a secure memory region of the DDR, covered by the RISAF that supports memory region encryption and secure level management.
On STM32MP25x lines , secure services need some STM32MPU subsystems to be assigned to the secure world (STM32 RNG, STM32 AES, STM32 IWDG, etc...)
6. Details on build directives[edit source]
Article OP-TEE configuration switches details the CFG_xxx variable that are default set when building an OP-TEE image. The build environment can override some of the configuration switch values defined for a platform. How to pass these changes depends on the build environment, refer to these 3 sections:
- Build OP-TEE with the Distribution Package;
- Build OP-TEE with the Developer Package;
- Build OP-TEE in a mainline build environment.
![]() |
For ecosystem release ≤ v3.0.0 compatibility: |
7. References[edit source]