Skip to main content
MWoło.2
Senior III
June 9, 2023
Solved

STM32MP135 optee framebuffer

  • June 9, 2023
  • 8 replies
  • 3727 views

Hi,

I have a problem with bringing up my custom board based on STM32MP135.

The problem is related to framebuffer optee

NOTICE: CPU: STM32MP135F Rev.Y 
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-3
INFO: PMIC version = 0x21 
INFO: Reset reason (0x35): 
INFO: Power-on Reset (rst_por) 
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000 
INFO: FCONF: Reading firmware configuration information for: stm32mp_io 
INFO: Using USB 
INFO: Instance 2 
INFO: Boot used partition fsbl1 
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):v2.6-dirty(a1f02f4f) 
NOTICE: BL2: Built : 13:14:26, Nov 23 2021 
INFO: BL2: Doing platform setup 
INFO: RAM: DDR3-DDR3L 16bits 533000kHz 
INFO: Memory size = 0x20000000 (512 MB) 
INFO: DFU USB START... 
INFO: handle USB : Suspend int 
INFO: USB Suspend mode 
INFO: handle USB : Reset 
INFO: handle USB : Reset 
INFO: phase ID :3, Manifestation 0 at c716a7de 
INFO: Send detach request 
INFO: Receive DFU Detach 
INFO: DFU USB STOP... 
INFO: BL2: Loading image id 1 
INFO: Loading image id=1 at address 0x30006000 
INFO: Image id=1 loaded: 0x30006000 - 0x30006246 
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000 
INFO: FCONF: Reading firmware configuration information for: mce_config 
INFO: FCONF: Reading firmware configuration information for: dyn_cfg 
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewal
INFO: BL2: Loading image id 4 
INFO: Loading image id=4 at address 0xde200000 
INFO: Image id=4 loaded: 0xde200000 - 0xde20001c 
INFO: OPTEE ep=0xde200000 
INFO: OPTEE header info: 
INFO: magic=0x4554504f 
INFO: version=0x2 
INFO: arch=0x0 
INFO: flags=0x0 
INFO: nb_images=0x1 
INFO: BL2: Loading image id 8 
INFO: Loading image id=8 at address 0xde200000 
INFO: Image id=8 loaded: 0xde200000 - 0xde2782e8 
INFO: BL2: Loading image id 2 
INFO: Loading image id=2 at address 0xc0400000 
INFO: Image id=2 loaded: 0xc0400000 - 0xc040dc38 
INFO: BL2: Skip loading image id 16 
INFO: BL2: Loading image id 5 
INFO: Loading image id=5 at address 0xc0000000 
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4534 
NOTICE: BL2: Booting BL32 
INFO: Entry point address = 0xde200000 
INFO: SPSR = 0x1d3 
I/TC: Early console on UART#4 
I/TC: 
I/TC: Non-secure external DT found 
I/TC: Embedded DTB found 
E/TC:0 0 display_get_fb_addr_from_dtb:55 Can't find optee-framebuffer 
E/TC:0 0 Panic at core/arch/arm/mm/core_mmu.c:364 <carve_out_tui_framebuffer> 
E/TC:0 0 TEE load address @ 0xde200000 
E/TC:0 0 Call stack: 
E/TC:0 0 0xde203cb5 
E/TC:0 0 0xde21bc31 
E/TC:0 0 0xde2040bb 
E/TC:0 0 0xde2037e9 
E/TC:0 0 0xde200198 

What do I need to add and where(in which DTS file) to pass through?

Thanks

BR Michal

This topic has been closed for replies.
Best answer by Kevin HUBER

Hello @Michał Wołowik​ ,

The OP-TEE frame buffer is a secure memory region dedicated to the display, used by Trusted UI in OP-TEE, protected by TZC. This region named optee-framebuffer is configured in OP-TEE device tree source core/arch/arm/dts/stm32mp135f-dk.dts 

The default configuration looks like this:

 optee_framebuffer: optee-framebuffer@dd000000 {
 /* Secure framebuffer memory */
 reg = <0xdd000000 0x1000000>;
 st,protreg = <TZC_REGION_S_RDWR 0>;
 };

Hope it helps,

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

8 replies

Kevin HUBER
Kevin HUBERBest answer
Technical Moderator
June 9, 2023

Hello @Michał Wołowik​ ,

The OP-TEE frame buffer is a secure memory region dedicated to the display, used by Trusted UI in OP-TEE, protected by TZC. This region named optee-framebuffer is configured in OP-TEE device tree source core/arch/arm/dts/stm32mp135f-dk.dts 

The default configuration looks like this:

 optee_framebuffer: optee-framebuffer@dd000000 {
 /* Secure framebuffer memory */
 reg = <0xdd000000 0x1000000>;
 st,protreg = <TZC_REGION_S_RDWR 0>;
 };

Hope it helps,

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
MWoło.2
MWoło.2Author
Senior III
June 9, 2023

Hi Kevin,

now is a bit better but

I/TC: Non-secure external DT found 
I/TC: Embedded DTB found 
I/TC: OP-TEE version: 3.16.0-dev (gcc version 11.3.0 (GCC)) #1 Fri Jan 28 02:28m
I/TC: WARNING: This OP-TEE configuration might be insecure! 
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecturel
I/TC: Primary CPU initializing 
I/TC: WARNING: All debug access are allowed 
E/TC:0 0 assertion 'len > 0 && len < (sizeof(fr->name) - 1)' failed at core/dri>
E/TC:0 0 Panic at core/kernel/assert.c:28 <_assert_break> 
E/TC:0 0 TEE load address @ 0xde200000 
E/TC:0 0 Call stack: 
E/TC:0 0 0xde203cb5 
E/TC:0 0 0xde21bc31 
E/TC:0 0 0xde21a3df 
E/TC:0 0 0xde218e3d 
E/TC:0 0 0xde21a817 
E/TC:0 0 0xde21a8e1 
E/TC:0 0 0xde21afd7 
E/TC:0 0 0xde21c7f9 
E/TC:0 0 0xde203af7 
E/TC:0 0 0xde200198 

and the question is what now?

BR Michal

MWoło.2
MWoło.2Author
Senior III
June 9, 2023

After try to check how is in ...dk2 I get a bit different error

I/TC: Early console on UART#4
I/TC: 
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.16.0-dev (gcc version 11.3.0 (GCC)) #1 Fri Jan 28 02:28:18 PM UTC 2022 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: WARNING: All debug access are allowed
E/TC:0 0 Panic at core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c:218 <initialize_pmic_i2c>
E/TC:0 0 TEE load address @ 0xde200000
E/TC:0 0 Call stack:
E/TC:0 0 0xde203cb5
E/TC:0 0 0xde21bc31
E/TC:0 0 0xde208cc5
E/TC:0 0 0xde21a817
E/TC:0 0 0xde21a8e1
E/TC:0 0 0xde21afd7
E/TC:0 0 0xde21c7f9
E/TC:0 0 0xde203af7
E/TC:0 0 0xde200198

Weird and difficult in understanding.

MWoło.2
MWoło.2Author
Senior III
June 9, 2023

Finally, I got something like

NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):v2.6-dirty(a1f02f4f)
NOTICE: BL2: Built : 13:14:26, Nov 23 2021
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x20000000 (512 MB)
INFO: DFU USB START...
INFO: handle USB : Suspend int
INFO: USB Suspend mode
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: phase ID :3, Manifestation 0 at c716a90e
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0xde200000
INFO: Image id=4 loaded: 0xde200000 - 0xde20001c
INFO: OPTEE ep=0xde200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
INFO: BL2: Loading image id 8
INFO: Loading image id=8 at address 0xde200000
INFO: Image id=8 loaded: 0xde200000 - 0xde2782e8
INFO: BL2: Loading image id 2
INFO: Loading image id=2 at address 0xc0400000
INFO: Image id=2 loaded: 0xc0400000 - 0xc040dd68
INFO: BL2: Skip loading image id 16
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0000000
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4534
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0xde200000
INFO: SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.16.0-dev (gcc version 11.3.0 (GCC)) #1 Fri Jan 28 02:28:18 PM UTC 2022 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: WARNING: All debug access are allowed
E/TC:0 0 stm32mp1_pwr_irq_probe:349 Missing pinctrl description
E/TC:0 0 probe_driver_node:402 Failed to probe stm32mp1-pwr-irq on node pwr@50001010: 0xffff0006
E/TC:0 0 assertion 'pinctrl' failed at core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pwr_irq.c:258 <stm32mp1_pwr_irt_add>
E/TC:0 0 Panic at core/kernel/assert.c:28 <_assert_break>
E/TC:0 0 TEE load address @ 0xde200000
E/TC:0 0 Call stack:
E/TC:0 0 0xde203cb5
E/TC:0 0 0xde21bc31
E/TC:0 0 0xde21a3df
E/TC:0 0 0xde2094af
E/TC:0 0 0xde208fbd
E/TC:0 0 0xde21a817
E/TC:0 0 0xde21a8e1
E/TC:0 0 0xde21afd7
E/TC:0 0 0xde21c7f9
E/TC:0 0 0xde203af7
E/TC:0 0 0xde200198

I don't understand this one

E/TC:0 0 stm32mp1_pwr_irq_probe:349 Missing pinctrl description
E/TC:0 0 probe_driver_node:402 Failed to probe stm32mp1-pwr-irq on node pwr@50001010: 0xffff0006
E/TC:0 0 assertion 'pinctrl' failed at core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pwr_irq.c:258 <stm32mp1_pwr_irt_add>

In my custom board, the IRQ from PMIC is connected to PI1 and PMIC_WKUP to PC13.

Where can I find information on how to configure it correctly?

 

I attached my optee dts. Maybe someone with bigger experience than me can give me some hints.

 

Thanks a lot for any help

BR Michal

 

MWoło.2
MWoło.2Author
Senior III
June 10, 2023

Hi,

after a lot of hours later

I/TC: Embedded DTB found 
I/TC: OP-TEE version: 3.16.0-dev (gcc version 11.3.0 (GCC)) #1 Fri Jan 28 02:28:18 PM UTC 2022 arm 
I/TC: WARNING: This OP-TEE configuration might be insecure! 
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html 
I/TC: Primary CPU initializing 
I/TC: WARNING: All debug access are allowed 
I/TC: Platform sI/TC: DTB enables console (non-secure) 
E/TC:0 0 assertion 'p->pa' failed at core/arch/arm/mm/core_mmu.c:2421 <io_pa_or_va> 
E/TC:0 0 Panic at core/kernel/assert.c:28 <_assert_break> 
E/TC:0 0 TEE load address @ 0xde200000 
E/TC:0 0 Call stack: 
E/TC:0 0 0xde203cb5 
E/TC:0 0 0xde21bc31 
E/TC:0 0 0xde21a3df 
E/TC:0 0 0xde2053bb 
E/TC:0 0 0xde212635 
E/TC:0 0 0xde212a09 
E/TC:0 0 0xde212c9d 
E/TC:0 0 0xde226b01 
E/TC:0 0 0xde21c7f9 
E/TC:0 0 0xde203af7 
E/TC:0 0 0xde200198 

still something is missing.

MWoło.2
MWoło.2Author
Senior III
June 10, 2023

OK I think I found a solution

# Indicate which STM32MP package are used: 'A', 'C', 'D' or 'F'
CUBEMX_SOC_PACKAGE = "F"

Previously was set to "C".

Topic can be closed.

Kevin HUBER
Technical Moderator
June 12, 2023

Hello @Michał Wołowik​ ,

So, you were able to boot your OPTEE?

Thanks to have provided more information and the solution that helped you to solve the latest issue, it will maybe help other people.

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
MWoło.2
MWoło.2Author
Senior III
June 12, 2023

Hi Kevin,

Yes, I'm able to boot in OPTEE.

Critical for me was missing configured and enabled component named 'saes' and the wrong package chosen.

I tested many configurations in which I enabled and disabled a component like 'saes, pka, hash' etc.

Critical for me was 'saes'.

The optee is much more complicated than trusted. I prefer to use trusted but for this CPU the *.tsv files do not exist only optee. Without *.tsv You can't program Your memories (EMMC/SD-Card) via Cube Programmer.

Additionally, I discover that Cube Mx wrongly calculate MPU frequency. In my case, I see in Cube that MPU should work with 900MHz but U-Boot shows only 64MHz. I work around this using the rcc configuration from OlivierK and now have 650MHz on MPU. But this issue is a separate topic.

Thanks

Best Regards

Michal