Enabling all A06 cores at boot time

Hi,
I’ve managed to assemble a DevTerm A06 and it’s working just fine. The only problem I have is that I can’t seem to enable the big cores at boot time. The following commands work after boot, from the CLI:

echo 1 > /sys/devices/system/cpu/cpu4/online
echo 1 > /sys/devices/system/cpu/cpu5/online

I’ve tried to sprinkle them liberally around a few startup scripts (including in rc.local). No matter what I do, there seems to be something that shuts down CPUs 4 and 5 a short time after boot:

[ 24.537068] CPU4: shutdown
[ 24.537091] psci: CPU4 killed (polled 0 ms)
[ 24.689668] CPU5: shutdown
[ 24.690767] psci: CPU5 killed (polled 0 ms)

If I turn those CPUs on manually after that they seem to stay up, but I’d really like them to be up from boot.

Does anyone know what is turning them off? Has anyone managed to get them up at boot time and keep them up? Thanks!

cpi@clockworkpi-a06:~$ sudo apt update
cpi@clockworkpi-a06:~$ sudo apt install devterm-gearbox-a06
cpi@clockworkpi-a06:~$ sudo devterm-a06-gearbox -s 6
    +-----------------------------------+-----------------+-----------+
    |            Cortex-A53             |   Cortex-A72    | Mali-T860 |
    +--------+--------+--------+--------+--------+--------+-----------+
    | CPU 0  | CPU 1  | CPU 2  | CPU 3  | CPU 4  | CPU 5  |   GPU     |
+---+--------+--------+--------+--------+--------+--------+-----------+
| 1 | 600 MHz|  OFF   |  OFF   |  OFF   |  OFF   |  OFF   |  200 MHz  |
+---+--------+--------+--------+--------+--------+--------+-----------+
| 2 | 800 MHz| 800 MHz|  OFF   |  OFF   |  OFF   |  OFF   |  200 MHz  |
+---+--------+--------+--------+--------+--------+--------+-----------+
| 3 |1008 MHz|1008 MHz|1008 MHz|1008 MHz|  OFF   |  OFF   |  400 MHz  |
+---+--------+--------+--------+--------+--------+--------+-----------+
| 4 |  OFF   |  OFF   |  OFF   |  OFF   |1008 MHz|1008 MHz|  400 MHz  |
+---+--------+--------+--------+--------+--------+--------+-----------+
| 5 |  OFF   |  OFF   |  OFF   |  OFF   |1200 MHz|1200 MHz|  400 MHz  |
+---+--------+--------+--------+--------+--------+--------+-----------+
|*6*|1416 MHz|1416 MHz|1416 MHz|1416 MHz|1800 MHz|1800 MHz|  800 MHz  | <===
+---+--------+--------+--------+--------+--------+--------+-----------+
CPU Governor: schedutil    GPU Governor: simple_ondemand
cpi@clockworkpi-a06:~$

Now add “/usr/bin/devterm-a06-gearbox -s 6” to /etc/rc.local so it runs at boot.
Don’t forget the “sleep 15” command above it.

cpi@clockworkpi-a06:~$ sudo vim /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

sleep 15
/usr/bin/devterm-a06-gearbox -s 6

exit 0
1 Like

Thanks Steven.

I ended up trying something like that (except I’m just enabling the cores through the CLI and I’m controlling the governor differently but no big deal).

However, I’m still curious about what’s stopping CPU 4 and 5 about 24 seconds into the boot process.

Surprisingly, it’s devterm-fan-temp-daemon-a06.service.

“sudo systemctl disable devterm-fan-temp-daemon-a06.service”, and boom - 6 cores on.

1 Like

Thought I’d post my updated systemd version. Would still work for you - just call your script instead.

/etc/systemd/system/devterm-a06-gearbox.service:

[Unit]
Description=devterm a06 gearbox service

[Service]
ExecStart=/usr/bin/devterm-a06-gearbox -s 6
Type=idle

[Install]
WantedBy=multi-user.target

Install:

cpi@clockworkpi-a06:~$ sudo vim /etc/systemd/system/devterm-a06-gearbox.service 
cpi@clockworkpi-a06:~$ sudo systemctl daemon-reload
cpi@clockworkpi-a06:~$ sudo systemctl enable devterm-a06-gearbox.service
Created symlink /etc/systemd/system/multi-user.target.wants/devterm-a06-gearbox.service → /etc/systemd/system/devterm-a06-gearbox.service.

Well, that’s surprising. I’ll see if I can dig through the code and figure out why that happens. Thanks for looking into this for me, I spent quite a bit of time trying to disable services that might have been related and I totally overlooked fan-temp. Though I suppose it makes sense it might care about the power profile of the CPU and how many cores are active, now that I think about it.

1 Like

Well, it seems to have been done on purpose:

/usr/local/bin/temp_fan_daemon_a06.py

def main(argv):
    global cpus
    scale = 'mid'
    gov   = 'schedutil'
    cpu_num = 4

I’ll replace cpu_num with 6 and see.

4 Likes