TF-A not able to load OPTEE OS images when OPTEE OS images are signed.
Hello,
I am currently facing an issue with TFA (2.0-stm32mp-r3 from last STM32MP15 OpenSTLinux release 20-02-19) on my STM32MP157C-DK2 board,
TF-A built with wiki defined flags:
ARM_ARCH_MAJOR=7
ARCH=aarch32
PLAT=stm32mp1
DTB_FILE_NAME=stm32mp157c-dk2.dtb
AARCH32_SP=optee
STM32MP_BOOT_ONLY=1
DEBUG=1
V=1
TF-A, OPTEE-OS and U-Boot images are signed using STM32MP_SigningTool_CLI (linux version)
Hash of public key is burned into OTP WORD 24 to 31
TF-A is not able to load OPTEE OS images when images are signed.
NOTICE: CPU: STM32MP157CAC Rev.B
NOTICE: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
NOTICE: Board: MB1272 Var2 Rev.C-01
NOTICE: Boot authentication Success
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: PMIC version = 0x10
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.0-r3.0(debug):
NOTICE: BL2: Built : 10:35:37, Mar 28 2020
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.45
INFO: Memory size = 0x20000000 (512 MB)
INFO: BL2 runs OP-TEE setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffc0000
WARNING: Failed to determine the size of the image id=4 (-12)
ERROR: BL2: Failed to load image (-12)If I put unsigned OPTEE OS images on MMC, there is no problem. TF-A goes on U-Boot signature verification and it works ...
NOTICE: CPU: STM32MP157CAC Rev.B
NOTICE: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
NOTICE: Board: MB1272 Var2 Rev.C-01
NOTICE: Boot authentication Success
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: PMIC version = 0x10
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.0-r3.0(debug):
NOTICE: BL2: Built : 10:35:37, Mar 28 2020
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.45
INFO: Memory size = 0x20000000 (512 MB)
INFO: BL2 runs OP-TEE setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffc0000
INFO: STM32 Image size : 512
WARNING: Skip signature check (header option)
INFO: Image id=4 loaded: 0x2ffc0000 - 0x2ffc0200
INFO: OPTEE ep=0x2ffc0000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x2
INFO: BL2: Loading image id 21
INFO: Loading image id=21 at address 0x2ffc0000
INFO: STM32 Image size : 108968
WARNING: Skip signature check (header option)
INFO: Image id=21 loaded: 0x2ffc0000 - 0x2ffda9a8
INFO: BL2: Loading image id 22
INFO: Loading image id=22 at address 0xde000000
INFO: STM32 Image size : 163840
WARNING: Skip signature check (header option)
INFO: Image id=22 loaded: 0xde000000 - 0xde028000
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: STM32 Image size : 639777
INFO: Check signature on Non-Full-Secured platform
INFO: Image id=5 loaded: 0xc0100000 - 0xc019c321
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2ffc0000
INFO: SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC:
I/TC: Pager is enabled. Hashes: 1536 bytes
I/TC: Pager pool size: 88kB
I/TC: OP-TEE version: Unknown #1 jeudi 26 mars 2020, 16:13:52 (UTC+0000) arm
I/TC: Platform stm32mp1: flavor stm32mp157c - device tree stm32mp157c-dk2
I/TC: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
I/TC: UART console probed from DT (non secure)
I/TC: stm32mp HSI (18): secure
I/TC: stm32mp LSI (19): secure
I/TC: stm32mp HSE (20): secure
I/TC: stm32mp PLL2 (27): secure
I/TC: stm32mp PLL2_R (30): secure
I/TC: Initialized
U-Boot 2018.11-stm32mp-r4 (Mar 27 2020 - 14:24:03 +0100)
CPU: STM32MP157CAC Rev.B
Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
Board: stm32mp1 in op-tee mode (st,stm32mp157c-dk2)
Board: MB1272 Var2 Rev.C-01
DRAM: 480 MiB
Clocks:
- MPU : 650 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
****************************************************
* WARNING 500mA power supply detected *
* Current too low, use a 3A power supply! *
****************************************************
NAND: 0 MiB
MMC: STM32 SDMMC2: 0, STM32 SDMMC2: 1
Loading Environment from MMC... OK
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@5800a000
Hit any key to stop autoboot: 0 Here is the MMC partitionning information:
PartNum Name Address Size Description
------------------------------------------------------------
1 fsbl1 0x00000022 0x200 Tf-A
2 fsbl2 0x00000222 0x200 Tf-A
3 ssbl 0x00000422 0x800 U-Boot
4 teeh 0x00000C22 0x200 OP-TEE OS header image
5 teed 0x00000E22 0x200 OP-TEE OS paged data
6 teex 0x00001022 0x200 OP-TEE OS resident core
7 ssbl-env 0x00001222 0x10 U-Boot env
...
Could anyone help ?
Kind regards,
Sebastien
