CPU freq and num of cores: Difference between revisions
No edit summary |
|||
Line 32: | Line 32: | ||
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | ||
To read about the different governors, see the following page from the Linux documentation:<br> | To read about the different governors, see the following page from the Linux documentation:<br> | ||
https://github.com/varigit/linux | https://github.com/varigit/linux-imx/blob/imx_4.9.11_1.0.0_ga-var01/Documentation/cpu-freq/governors.txt<br> | ||
<br> | <br> | ||
To set the current governor: | To set the current governor: |
Revision as of 17:48, 7 February 2018
note that there are a few other differences between some of the i.MX SOC models, like RAM bus width (32bit on the Solo, 64bit on the Quad) and some graphics acceleration features.
See the full change list here:
CPU cores
There are two ways to disable/enable CPU cores:
1. Add 'maxcpus=n' (n being the number of cores you wish to activate), to the kernel command line (the bootargs from U-Boot).
E.g. Assuming you are using our latest U-Boot, stop at the U-Boot command line and enter:
=> setenv kernelargs maxcpus=2
2. To disable/enable cores at kernel runtime:
Disbale core X:
# echo 0 > /sys/devices/system/cpu/cpuX/online
Enable core X:
# echo 1 > /sys/devices/system/cpu/cpuX/online
(X being the core number you want to enable/disable, and can range from 0 to 3)
To see the active cores, run:
# cat /proc/cpuinfo
CPU frequencies
Governors:
There are a few freq. governors which sets the freq. policy.
The default freq. governor is "ondemand", which sets the CPU frequency depending on the current system load.
To list all available governors:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
To read about the different governors, see the following page from the Linux documentation:
https://github.com/varigit/linux-imx/blob/imx_4.9.11_1.0.0_ga-var01/Documentation/cpu-freq/governors.txt
To set the current governor:
# echo GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
(GOVERNOR being one of the available governors)
Useful commands:
To see the available CPU frequencies:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
To see the current CPU frequency:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
Common scenarios:
1. Use the default "ondemand" governor and limit the maximum allowed CPU freq. using the following commands:
To see the current maximum allowed CPU frequency:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
To set the maximum allowed CPU frequency:
# echo FREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(FREQ being one of the available CPU frequencies)
2. Use the "userspace" governor and set the CPU to a specific frequency using the following command:
# echo FREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
(FREQ being one of the available CPU frequencies)