Skip to main content
Visitor II
September 15, 2022
Solved

optee 3.12, stm32mp1 custom board and DRAM (256M) sizes.

  • September 15, 2022
  • 1 reply
  • 2507 views

I have a custom board with a stm32mp151c and 256M DRAM.

Trying to get optee 3.12 from ecosystem 3.0.0 to start.

Everything works fine with tf-a 2.4-r1 and sp_min, u-boot 2020.10 etc.

But I can't get optee to start. I've enabled a high loglevel and the last print I get from optee is:

...

I/TC: Pager is enabled. Hashes: 2208 bytes

Then everything goes quiet. No stacktrace, fault, or anything else. Just "dead".

To me, this looks like some very basic issue with DRAM sizes etc. But I can't say for sure.

My dts looks correct with memory regions and declarations.

But I noticed that in the build conf.mk was getting some weird stuff.

CFG_DRAM_SIZE

CFG_SHMEM_START

CFG_TZDRAM_START

These three had some wonky values for a 256M board. And they seem to be used?

So my conclusion is that it does not suffice to set dts properties for optee, some tweaking of platform memory sizes (looks like there are options for 512M 1G etc, but not 256M) needs to be done.

Anything else that needs to be fixed for a 256M board?

Maybe this information can be valuable to someone with a custom board.

    This topic has been closed for replies.
    Best answer by OlivierK

    Hi milkylainen (Community Member)

    You may need to change the optee board level dts file containing mem size.

    for instance in OPTEE in stm32mp135f-dk.dts

    memory@c0000000 {

    device_type = "memory";

    reg = <0xc0000000 0x10000000>;

    };

    rmem_linux: optee-rmem-linux@c0000000 {

    /* Linux kernel memory shared with other masters */

    reg = <0xc0000000 0x0d000000>;

    st,protreg = <

    TZC_REGION_S_NONE

    TZC_REGION_NSEC_ALL_ACCESS_

    RDWR

    >;

    };

    rmem_framebuffer: optee-rmem-framebuffer@cd000000 {

    /* Secure framebuffer memory */

    reg = <0xcd000000 0x1000000>;

    st,protreg = <TZC_REGION_S_RDWR 0>;

    no-map;

    };

    The OPTEE conf.mk change the DDR size for 256M

    in /core/arch/arm/plat-stm32mp1/conf.mk

    CFG_DRAM_SIZE ?= 0x10000000

    Regards,

    Olivier

    1 reply

    OlivierKAnswer
    Technical Moderator
    September 15, 2022

    Hi milkylainen (Community Member)

    You may need to change the optee board level dts file containing mem size.

    for instance in OPTEE in stm32mp135f-dk.dts

    memory@c0000000 {

    device_type = "memory";

    reg = <0xc0000000 0x10000000>;

    };

    rmem_linux: optee-rmem-linux@c0000000 {

    /* Linux kernel memory shared with other masters */

    reg = <0xc0000000 0x0d000000>;

    st,protreg = <

    TZC_REGION_S_NONE

    TZC_REGION_NSEC_ALL_ACCESS_

    RDWR

    >;

    };

    rmem_framebuffer: optee-rmem-framebuffer@cd000000 {

    /* Secure framebuffer memory */

    reg = <0xcd000000 0x1000000>;

    st,protreg = <TZC_REGION_S_RDWR 0>;

    no-map;

    };

    The OPTEE conf.mk change the DDR size for 256M

    in /core/arch/arm/plat-stm32mp1/conf.mk

    CFG_DRAM_SIZE ?= 0x10000000

    Regards,

    Olivier

    Visitor II
    September 15, 2022

    I pushed the CFG_x values from my additional custom board layer.

    optee starts just fine now. Tnx.