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
18 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

4 Likes

thank you! excited to try this one out.

Noticed the latest version has a 6th gear profile that’s an “all out” profile… All cores, max speed for all, including 1.8ghz for the A72 cores. In 6th gear DevTerm performance feels like a modern PC. Most excellent!

Odd, I tried the 6th gear but the machine hangs soon after. I can only run my unit in gear 5 it seems.

I had a crash also (I mention it on a post related to required voltages). My crash occurred when my batteries dropped below 4V and I was on that profile.

It was working amazing on full batteries so I’m thinking the CPU’s demands all out might be a bit much for the battery design. Kind of wish 4x 18650’s were supported in 2 parallel pairs for added voltage. I bet it would be easier to keep it stable at full speed.

Hi all, I’ve definitely run into stability issues with the batteries I’m currently using, and similarly, it happens when load is high and their output drops below 4V. Fairly reproducible on gear 5, when playing videos or driving an external display, so I’m thinking it’s the batteries.

So i was wondering, how does one get this utility. git clone and that link? Still very much in the process of learning, would greatly appreciate the help, even a point to the right direction. Thank you!

The gear-shift script? You can just download it - or, if you’d prefer:

wget https://raw.githubusercontent.com/clockworkpi/DevTerm/main/Code/A06/devterm-a06-gearbox && chmod a+x devterm-a06-gearbox

Then just type sudo ./devterm-a06-gearbox -s N where N is a number between 1 and 6. 4 is DevTerm default clocks, big cores disabled, little cores at 1GHz, 400MHz GPU, and 6 is RK3399 defaults, big cores at 1.8GHz, little cores at 1.4GHz, 800MHz GPU - but be warned, it gets toasty on that setting.

3 Likes

Thank you very, very much!!!

1 Like