clockworkpi

DevTerm A-06 core CPU frequency scaling

The DevTerm A-06 core modules have 6 processor cores, arranged in ARM big.LITTLE heterogeneous computing architecture, combining relatively battery-saving and slower processor ( LITTLE : #0, #1, #2, #3 ) cores with relatively more powerful and power-hungry ( big : #4, #5) ones. You could have to option to turn on or off any core at any time according to your own computing needs.

For example, the command to turn on core #5 is:

sudo sh -c "echo 1 > /sys/devices/system/cpu/cpu5/online"
the command to turn off core #0 is:

sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu0/online"

The result could be verified with htop command.

In addition, user could simply use a tool called cpupower-gui to configure core frequency and CPU scheduling governor: performance, powersave, or schedutil and conservative. While powersave mode aggressively keeps CPU cores running at the lowest frequency, the performance mode always run in highest frequency. schedutil and conservative will automatically adjust CPU frequency according to application requirement, to achieve the balance between power-saving and performance. That means, if you like, under extreme situations, the A-06 core module could be run either with only one LITTLE core at 408MHz, or with all six cores at 1416MHz. There is ample room in between for fine-tuning and dynamic controls. e.g. Android users love schedutil mode for its efficiency, for details about scaling and different scaling governors, please refer to:
https://wiki.archlinux.org/title/CPU_frequency_scaling

Similarly, A-06 GPU frequency and scheduling could be configured by setting:
/sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/

By default, the A-06 core modules are set to run on 4 cores, with conservative scaling governor, at 408-1000MHz.

You could play with these frequency scaling parameters according to your specific application needs. For example, with these following commands, the A-06 core could achieve potentially better power management than CM3.

echo schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 800000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

echo 0 > /sys/devices/system/cpu/cpu2/online
echo 0 > /sys/devices/system/cpu/cpu3/online

echo simple_ondemand > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/governor
echo 400000000 > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/max_freq
16 Likes
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu2/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu3/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu4/online"
sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu5/online"
sudo sh -c "echo schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"
sudo sh -c "echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
sudo sh -c "echo 800000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq"
sudo sh -c "echo simple_ondemand > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/governor"
sudo sh -c "echo 200000000 > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/max_freq"

This script above tested best performance while manages CPU temperature under 57 Celsius, without additional cooling.

3 Likes

Rev up your engines! Try this manual control on your A-06 core.
https://github.com/clockworkpi/DevTerm/blob/main/Code/A06/devterm-a06-gearbox

7 Likes

Just tested it. Works really well! Able to do most of my work in 2nd gear, which keeps the fan silent.

2 Likes

Nice tool, just tried it.out as well.
Could a sixth option be added, which enabled all 6 cores?

And I though the max freq for the big cores was 1.8Ghz, not 1.4?

3 Likes

I was confused by this as well. I’ve opened an issue asking for a code comment to be added, so that people downloading and looking at the script will know why they should (or should not) set particular core speed combinations.

2 Likes

thanks for bringing this to them.

Why for 5, only the two BIG core are activated?

You can have both little and BIG core at the same time, and having mulrplie cores do much a difference (depending on the task for sure) than just two “powerful” core.

You should have intermediate steps with both little and big core activated at the same time, and the highest with all 6 at full speed.

not limited

Based on various tests, we found that 5 levels can satisfy 90% of the applications

This is just a small tool based on experience. If you need it, you can set it up according to your needs. it’s just a python code

you can find the every cpu freq from
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

also the gpu
/sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/available_frequencies

4 Likes

Thanks for the details @guu!

I’ve opened Refactor A06 gearbox by str4d · Pull Request #8 · clockworkpi/DevTerm · GitHub which both adds the “maximum performance, maximum power (usage)” gear, and refactors the script to make it much easier to modify the gearing.

7 Likes

There’s a bug where the Gear 4 and 5 options will now activate CPU 0 and CPU 3 even though they shouldn’t. With those options single core apps will also default to using those slower CPUs instead of 4 and 5.

1 Like

the bug is fixed now

git pull it to test it out

3 Likes

thank you! excited to try this one out.