DDRCTRL and DDRPHYC internal peripherals

Stable: 23.06.2023 - 12:47 / Revision: 23.06.2023 - 12:44

I am here to prevent the first-page-empty bug!


Template:ArticleMainWriter Template:ArticleApprovedVersion


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.

2.1 Features

Refer to STM32MP15 reference manuals for the complete features list, and to the software components, introduced below, to know which features are really implemented.

2.2 Security support

DDRCTRL and DDRPHYC are secure aware (under ETZPC control).

The access to the DDR memory can be filtered alone via TZC controller: for instance, it is possible to forbid the 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 wants 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.

3.2 Runtime

3.2.1 Overview

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 configures again the DDRCTRL and DDRPHYC before proceeding with the wake up procedure, till Linux.

Caution: there is no runtime allocation for DDRCTRL and DDRPHYC since there are always initialized by the secure context. On the other hand, it is usefull to show that the DDR memory itself is only used by the Cortex®-A7 non-secure for Linux, as shown in the memory mapping, so this is the only possible configuration in STMicroelectronics distribution.

3.2.2 Software frameworks

Internal peripherals software table template

| Core/RAM
| DDR via DDRCTRL
| 
| Memory mapping
| 
|
|-
|}

3.2.3 Peripheral configuration

The configuration is applied during boot time by the SSBL (see Boot chains overview): TF-A or U-Boot SPL.

The configuration by itself (values for DDRCTL and DDRPHY registers) is generated via STM32CubeMX tool in the device tree for the SSBL according the DDR configuration (type, size, frequency, speed grade).

3.2.4 Peripheral assignment

Internal peripherals assignment table template

| rowspan="1" | Core/RAM
| rowspan="1" | DDR via DDRCTRL
| DDR
|
| 
|
|
|-
|}


4 How to go further

Device tree binding of DDR node:

5 References

IMPORTANT NOTICE – READ CAREFULLY
STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgment.

Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of purchasers’ products.

No license, express or implied, to any intellectual property right is granted by ST herein.

Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.

ST and the ST logo are trademarks of ST. For additional information about ST trademarks, refer to www.st.com/trademarks. All other product or service names are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.