IMX8 OPTEE: Difference between revisions

From Variscite Wiki
(Use MACHINE_NAME variable to point to the correct conf file instead of hardcoded link)
(Set the DRAM size dinamically according to the HARDWARE_NAME)
Line 31: Line 31:
The DRAM size is configured by the variable TEE_CFG_DDR_SIZE, which is initialized in {{#var:META_VARISCITE_GIT}}/blob/{{#var:META_VARISCITE_BRANCH}}/conf/machine/{{#var:MACHINE_NAME}}.conf and may be updated directly or overidden in conf/local.conf.
The DRAM size is configured by the variable TEE_CFG_DDR_SIZE, which is initialized in {{#var:META_VARISCITE_GIT}}/blob/{{#var:META_VARISCITE_BRANCH}}/conf/machine/{{#var:MACHINE_NAME}}.conf and may be updated directly or overidden in conf/local.conf.


For example, override TEE_CFG_DDR_SIZE to 2GB:
{{#switch: {{#var:HARDWARE_NAME}} |
DART-MX8M = {{#vardefine: MEM_SIZE|4}}{{#vardefine: MEM_HEX|0x100000000}} |
DART-MX8M-MINI = {{#vardefine: MEM_SIZE|2}}{{#vardefine: MEM_HEX|0x80000000}} |
DART-MX8M-PLUS = {{#vardefine: MEM_SIZE|4}}{{#vardefine: MEM_HEX|0x100000000}} |
VAR-SOM-MX8 = {{#vardefine: MEM_SIZE|4}}{{#vardefine: MEM_HEX|0x100000000}} |
VAR-SOM-MX8M-NANO = {{#vardefine: MEM_SIZE|1}}{{#vardefine: MEM_HEX|0x40000000}} |
VAR-SOM-MX8X = {{#vardefine: MEM_SIZE|1}}{{#vardefine: MEM_HEX|0x40000000}}}}


  TEE_CFG_DDR_SIZE = "0x80000000"
For example, override TEE_CFG_DDR_SIZE to {{#var:MEM_SIZE}}GB:
 
  TEE_CFG_DDR_SIZE = "{{#var:MEM_HEX}}"

Revision as of 14:24, 9 January 2023

DART-MX8M-PLUS OPTEE

OP-TEE Introduction

NXP Platforms are enabled with Open Portable TEE (OP-TEE), which is an open source project which contains a full implementation to make up a complete Trusted Execution Environment.

For more information, please see the following resources from NXP:

Enable OP-TEE with Yocto

To enable OP-TEE, add the following to conf/local.conf:

MACHINE_FEATURES:append = " optee"
DISTRO_FEATURES:append = " optee"
IMAGE_INSTALL:append = " optee-os optee-test"

Then, rebuild the Yocto image and test OP-TEE using the xtest utility.

For more information about how to rebuild the Yocto, follow the steps here: Build Yocto from source code.

OP-TEE Memory Configuration

The DRAM memory size is hardcoded in optee-os and needs to be updated according to the memory configuration of your SoM.

The DRAM size is configured by the variable TEE_CFG_DDR_SIZE, which is initialized in https://github.com/varigit/meta-variscite-bsp/blob/kirkstone/conf/machine/imx8mp-var-dart.conf and may be updated directly or overidden in conf/local.conf.


For example, override TEE_CFG_DDR_SIZE to 4GB:

TEE_CFG_DDR_SIZE = "0x100000000"