cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP153, How to change CPU frequency?

SScar.2
Senior

Hi, 

I have a custom board based on a STM32MP153 and I'm trying to reduce CPU (MPU) max frequency... Now it's running at 650Mhz, which is the default configuration. looking at the Wiki : https://wiki.st.com/stm32mpu/wiki/How_to_change_the_CPU_frequency#CPU_frequency_configuration_2 

in the configuration side, it seems to me that changing PLL1 clock is enough (thanks to TF-A algorithm).

But nothing is changing... Running the command 

cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq

 I still see 650Mhz and u-boot prints always 650Mhz: 

 

 

U-Boot 2021.10-stm32mp-r1-dirty (Oct 04 2021 - 15:09:26 +0000)

CPU: STM32MP153CAC Rev.Z
Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15
Board: stm32mp1 in trusted mode (st,stm32mp157c-es-dcc-proto-b-mx)
DRAM:  1 GiB
Clocks:
- MPU : 650 MHz
- MCU : 165 MHz
- AXI : 201.333 MHz
- PER : 0 MHz
- DDR : 302 MHz

 

The other peripherals (e.g. AXI or DDR) seems to change under PLLs modifications (TF-A config). 

NOTE: i'm trying to reach 350Mhz, my application doesn't require a lot of computational power and I'd like to reduce also temperatures...

 

Thanks a lot! 
 

1 ACCEPTED SOLUTION

Accepted Solutions
SScar.2
Senior

I think I found a workaround: 

I add this entry in all custom .dts files (device tree exported from CubeMX for my custom board): 

//try opp table custom
&cpu0_opp_table {
opp-650000000 {
opp-hz = /bits/ 64 <350000000>; //test 350 Mhz
opp-microvolt = <1200000>;
opp-supported-hw = <0x1>;
};
};

Of course, it is ugly but, it seems to work, more or less. I don't see any difference in TF-A and U-Boot debug prints (MCU freq still 650Mhz), but in the kernel, I tested that performance is decreased (less CPU occupation % at runtime and 5s slower boot),  and the command 

cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq

shows 350000, which is correct. 

View solution in original post

1 REPLY 1
SScar.2
Senior

I think I found a workaround: 

I add this entry in all custom .dts files (device tree exported from CubeMX for my custom board): 

//try opp table custom
&cpu0_opp_table {
opp-650000000 {
opp-hz = /bits/ 64 <350000000>; //test 350 Mhz
opp-microvolt = <1200000>;
opp-supported-hw = <0x1>;
};
};

Of course, it is ugly but, it seems to work, more or less. I don't see any difference in TF-A and U-Boot debug prints (MCU freq still 650Mhz), but in the kernel, I tested that performance is decreased (less CPU occupation % at runtime and 5s slower boot),  and the command 

cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq

shows 350000, which is correct.