Last edited one week ago

DDRPERFM device tree configuration

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP21x lines, STM32MP23x lines, STM32MP25x lines

1. Article purpose[edit | edit source]

This article explains how to configure the STM32 DDR PMU driver when the peripheral is assigned to the Linux® OS.

The configuration is performed using the device tree mechanism, which provides a hardware description of the peripheral used by the STM32 DDR PMU driver.

2. DT bindings documentation[edit | edit source]

The DDRPERFM device tree bindings are composed of:

  • STM32 DDR PMU device tree bindings[1].

3. DT configuration[edit | edit source]

This hardware description is a combination of the Linux kernel STM32 microprocessor device tree files (.dtsi extension), OP-TEE RIF device tree files (for STM32MP23x lines More info.png and STM32MP25x lines More info.png .dtsi extension) and Linux kernel board device tree files (.dts extension). See the Device tree for an explanation of the device tree file split.

STM32CubeMX can be used to generate the board device tree. Refer to How to configure the DT using STM32CubeMX for more details.

3.1. DT configuration (STM32 level)[edit | edit source]

The DDRPERFM node, as perf node, is composed of several parts, listed in chapters below.

3.1.1. STM32 DDRPERFM RIF configuration[edit | edit source]

On STM32MP23x lines More info.png and STM32MP25x lines More info.png, the DDRPERFM peripheral clock is shared with the DDRCTRL_and_DDRPHYC_internal_peripherals.
By default, ST bootloaders enables only secure access to this clock resource. To allow Linux to probe the stm32_ddr_pmu driver, it is required to enable nonsecure access to the clock. This can be done in OP-TEE with this RCC RIF node configuration on resource 104 :

&rcc {
    st,protreg = <
        //...
        RIFPROT(RIF_RCC_RESOURCE(104), RIF_UNUSED, RIF_UNLOCK, RIF_NSEC, RIF_PRIV, RIF_UNUSED, RIF_SEM_DIS, RIF_CFDIS)
        //...
    >;
};

On STM32MP13x lines More info.png, STM32MP15x lines More info.png and STM32MP21x lines More info.png, the stm32_ddr_pmu driver probes without any needed RIF configuration.

3.1.2. STM32 DDRPERFM board configuration[edit | edit source]

On STM32MP23x lines More info.png and STM32MP25x lines More info.png, according to STM32 DDR PMU device tree bindings[2], the RAM type must be specified through the "st,dram-type" vendor property:

perf@480c0000 {
    compatible = "st,stm32mp25-ddr-pmu";
    reg = <0x480c0000 0x0 0x400>;
    clocks = <&rcc CK_BUS_DDRPERFM>;
    resets = <&rcc DDRPERFM_R>;
    access-controllers = <&rifsc 67>;
    st,dram-type = <0>;
    status = "disabled";
};