DDRCTRL and DDRPHYC internal peripherals
1 Article purpose
The purpose of this article is to:
- briefly introduce the DDRCTRL and DDRPHYC peripherals and their main features
- indicate the level of security supported by those hardware blocks
- explain how they can be allocated to the three runtime contexts and linked to the corresponding software components
- explain, when necessary, how to configure the DDRCTRL and DDRPHYC peripherals.
2 Peripheral overview
DDRCTRL and DDRPHYC peripherals are used to configure the physical interface to the external DDR memory.
Refer to STM32MP15 reference manuals for the complete features list, and to the software components, introduced below, to see which features are actually implemented.
2.2 Security support
DDRCTRL and DDRPHYC are secure aware (under ETZPC control).
Access to the DDR memory can be filtered via the TZC controller: for instance, it is possible to forbid access from the Cortex®-M4 to the DDR region used by the Cortex®-A7.
3 Peripheral usage and associated software
3.1 Boot time
DDRCTRL and DDRPHYC are kept secure and used by the FSBL to initialize the access to the DDR where it loads the SSBL (U-Boot) for execution.
STMicroelectronics wishes to make the DDR memory configuration as easy as possible, for this reason a DDR tuning function is available in STM32CubeMX tool in order to generate the device tree that is given to the FSBL to perform this initialization.
DDRCTRL and DDRPHYC are accessed at runtime by the secure monitor (from the FSBL or OP-TEE) to put the DDR in self-refresh state before going into Stop or Standby low power mode.
On Standby exit, the ROM code loads the FSBL that again configures the DDRCTRL and DDRPHYC before proceeding with the wake-up procedure.
The TZC controller is configured by TF-A to split the DDR in two regions:
- the first region, the largest one, is reserved for Linux (Cortex-A7 non-secure context)
- the second region, 32 Mbytes wide, is dedicated for OP-TEE (Cortex-A7 secure context). This area is used by its pager as a cache area from which it can load trusted applications that are authenticated in the SYSRAM internal memory before execution.
This split is visible in the overall memory mapping.
3.2.2 Software frameworks
|Core/RAM||DDR via DDRCTRL||Memory mapping||Memory mapping|
3.2.3 Peripheral configuration
The configuration by itself (values for DDRCTL and DDRPHY registers) is generated via STM32CubeMX tool in the device tree for the FSBL, according to the DDR configuration (type, size, frequency, speed grade).
3.2.4 Peripheral assignment
Check boxes illustrate the possible peripheral allocations supported by STM32 MPU Embedded Software:
- ☐ means that the peripheral can be assigned (☑) to the given runtime context.
- ✓ is used for system peripherals that cannot be unchecked because they are statically connected in the device.
Refer to How to assign an internal peripheral to a runtime context for more information on how to assign peripherals manually or via STM32CubeMX.
The present chapter describes STMicroelectronics recommendations or choice of implementation. Additional possiblities might be described in STM32MP15 reference manuals.
|Core/RAM||DDR via DDRCTRL||DDR||✓||✓|
4 How to go further
Device tree binding of DDR node:
- available in U-boot source : doc/device-tree-bindings/ram/st,stm32mp1-ddr.txt
Doubledata rate (memory domain)
Trusted Firmware for Arm Cortex-A
Open Portable Trusted Execution Environment
Random Access Memory
First Stage Boot Loader