How to configure a 256MB DDR mapping from STM32 MPU Distribution Package

Revision as of 12:24, 14 February 2023 by Registered User (Created page with "<noinclude>{{ApplicableFor |MPUs list=STM32MP13x |MPUs checklist=STM32MP13x }}</noinclude> ==Purpose of article== This article describes how to update the STM32 MPU embedded S...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Applicable for STM32MP13x lines

1. Purpose of article[edit source]

This article describes how to update the STM32 MPU embedded Software distribution to a specific 256Mo DDR mapping in a STM32MP13x based product.
Note that the 256Mo software configuration can be performed on a STM32MP13 DK board (512Mo of DDR), in order to prototype the new mapping memory, but for this exercise, further software updates are requested , there are highlight in the article with the label (DDR512Mo).

2. Pre-requesites[edit source]

You are already familiar with the Yocto build process and OpenSTLinux distribution.

3. Introduction[edit source]

This article is a guideline for the user to update the STM32 MPU embedded Software in a distribution package of the OpenSTLinux distribution, according to his 256Mo hardware configuration. The process is based on a OpenSTlinux configured for the STM32MP13 DK board (512Mo of DDR), with the following DDR mapping. The default mapping defined for The OpenSTLinux on the STM32MP13 DK board for a st-image-weston image is : 0xe0000000 (end optee fw/TZDRAM) 0xde200000 (DDR_SEC_BASE/TZDRAM_START size 1e00000 protected by TZC 400, deb optee fw .text , DDR encrypted DDRMCE size 1e00000) 0xde000000 (SHMEM_START size 200000 no secure, optee mem size 2000000) 0xdd000000 (framebuffer protected access by DDR TZC size 1000000) 0xd0000000 (End of DDR cacheable in U-Boot) 0xc0000000 (DDR non secure) The target is to update is to target the following 260Mo mapping : 0xd0000000 0xcfc00000 (DDR_SEC_BASE/TZDRAM_START size DDR_NS_SIZE (400000/4Mo) protected by TZC 400, deb optee fw .txt, DDR encrypted DDRMCE) 0xcfb00000 (DDR_SHARE_BASE size DDR_SHARE_SIZE (100000/1Mo no secure , optee memmory reserved size 500000/5Mo) 0xceb00000 (optee-framebuffer) protected access by TZC 400 size 1000000/16Mo) 0xc8000000 (End of DDR cacheable in U-Boot, begin of linux CMA reserved size 8000000/128Mo) 0xc0000000 (DDR_NS_BASE/STM32MP_DDR_BASE)

The software modification requested in the STM32MP1 Distribution Package, have been performed with the "devtool" and "bitbake" tools. The following component need to be modified (TF-A, U-boot, OP-TEE, Linux Kernel).

4. DDR configuration[edit source]

The DDR is configured with the STM32CubeMX DDR tool, the tool creates the device tree source include file.

5. TF-A updates[edit source]

To update the TF-A firmware in the STM32MP1 Distribution Package, use the devtool tool: $PC > devtool modify tf-a-stm32mp The updates requested according to new mapping: Modify the DDR_SIZE (512Mo->256Mo) defined in file fdts/stm32mp135f-dk-config.dts

  1. define DDR_SIZE 0x10000000

Modify the DDR_SEC_SIZE (30 Mo -> 4Mo) and DDR_SHARE_SIZE (2Mo->1Mo) defined in file fdts/stm32mp13-fw-config.dtsi

  1. define DDR_SEC_SIZE 0x400000
  2. define DDR_SHARE_SIZE 0x100000

DDR512Mo: Modify the DDR_MEM_SIZE in the file fdts/stm32mp-ddr3-1x4Gb-1066-binF.dtsi . :

  1. define DDR_MEM_SIZE 0x10000000