CPU Frequency Scaling

Zynq UltraScale plus MPSoC Power Management

Release Date
2023-04-24

On ZU+, the APU cluster has four A53 cores. All the four cores are clocked by the same clock source apu_ref_clk. So, it should be noted that whenever clock scaling is applied, it is applied to all the four cores.

Linux supports CPU frequency scaling based on different governors. These settings can be enabled in Petalinux and controlled using sysfs entries at runtime.

The “userspace” governor enables users to switch between different CPU frequencies by means of sysfs interface. This governor can be used for experimenting and also in end applications where a custom closed loop switching of frequencies is desired.

Governors that perform automatic frequency scaling based on the load on CPUs are readily available in the Linux kernel and can be enabled as default governors depending on the nature of end application. For example, “ondemand” frequency governor can be used to automatically ramp up the CPU frequencies where there is load and ramp down when the system is on lighter loads.

Details on “cpufreq” governors can be found at https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt

Here is a snapshot of Petalinux Kernel config showing available cpufreq governors:

There are open source applications available to control and monitor cpufreq governors and states. One such application which can be built from Petalinux is “cpufreq-info”. To enable this application, follow the screenshot below after running “petalinux-config -c rootfs”

Here is an example of using cpufreq-info utility to view the throttling of operating frequencies performed by the governor based on load.

$ cpufreq-info -s -m 300 MHz:70.68%, 400 MHz:0.03%, 600 MHz:0.00%, 1.20 GHz:29.29%  (189)

In the above log, it can be observed that the frequency was brought down to 300MHz for around 70% of the time.