TQMa8MPxL - YOCTO Linux BSP documentation
CPU
The STKa8MPxL supports DVFS (dynamic voltage and frequency scaling). By default the governor ondemand is set.
Governors are power schemes for the CPU. Only one can be active at a time.
| Governor | Description |
|---|---|
| performance | Run the CPU at the maximum frequency. |
| powersave | Run the CPU at the minimum frequency. |
| userspace | Run the CPU at user-specified frequencies. |
| ondemand | Scales the frequency dynamically according to current load. Jumps to the highest frequency and then possibly back down as the idle time increases. |
| conservative | Scales the frequency dynamically according to current load. Scales the frequency more gradually than ondemand. |
| schedutil | Scheduler-driven CPU frequency selection |
You can change the current governor with the following command:
cpufreq-set -g <governor> (e.g. cpufreq-set -g performance)
Disable CPU Core temporarily
At runtime it is possible to disable multiple CPU cores via the Linux sysfs. On a system that has four CPU cores, a maximum of three cores can be disabled.
To disable a CPU core, the value 0 must be written to the CPU core specific file /sys/devices/system/cpu/cpu<N>/online where <N> is the number of the Core (the counting starts at zero).
e.g. disable the forth CPU core:
echo 0 > /sys/devices/system/cpu/cpu3/online
To check which CPU core(s) are currently enabled the following command can be used:
grep "processor" /proc/cpuinfo
The CPU core can be enabled again by writing the value 1 to /sys/devices/system/cpu/cpu<N>/online.
e.g. enable the forth CPU core:
echo 1 > /sys/devices/system/cpu/cpu3/online
Set ammount of CPU Cores permanently
It is possible to limit the maximium amount of cores with the the maxcpus= parameter in the kernel command line. To add the new parameter a new U-boot variable addcpu has to be created.
setenv addcpu maxcpus=${cpu_num}
The amount of cores is set by the cpu_num variable, for example if cpu num is set to 2 only two cores will be started.
setenv cpu_num 2