How to set max cpu frequency and cores on ODROID-N2/C4

ODROID-N2 has dual-core cortex-A53 and quad-core cortex-A73.
Also ODROID-C4 has quad-core cortex-a55.

  • Cortex-A53 : Little cores, CPU0 and CPU1
# cat /sys/devices/system/cpu/cpufreq/policy0/related_cpus
0 1
  • Cortex-A73 : Big cores, CPU2, CPU3, CPU4 and CPU5
# cat /sys/devices/system/cpu/cpufreq/policy2/related_cpus
2 3 4 5
  • Cortex-A55 : Little cores, CPU0, CPU1, CPU2 and CPU3
# cat /sys/devices/system/cpu/cpufreq/policy0/related_cpus
0 1 2 3

Here are the available cpu frequency sets and you can set one of them as max. cpu frequency using boot.ini

ODROID-N2

The available list of A73 cpu frequency set (big cores)

Here are the available cpu frequency sets for A73, big cores.
We recommend 1.800GHz as default for A73 core.

frequency notation on boot.ini
2.004 GHz “2004” (overclock)
1.908 GHz “1908” (overclock)
1.800 GHz “1800”
1.704 GHz “1704”
1.608 GHz “1608”
1.512 GHz “1512”
1.398 GHz “1398”
1.200 GHz “1200”
1.000 GHz “1000”
667 MHz “667”
500 MHz “500”
250 MHz “250”
100 MHz “100”

You can try a higher frequency sets than 1.8GHz, like 1.9GHz and 2.0GHz,
but there is NO GUARANTEE that all ODROID-N2 boards are stable with those frequency sets.

In case of A73 1.9GHz, only 80% amount of ODROID-N2 test samples are successful for heavy load tests,
and over 70% samples have booting issues with 2.0GHz option.

It's only 7~8% gain you can derive with the higher clocks. That’s not a big benefit compared with much loss of system stability.

The available list of A53 cpu frequency set (little cores)

Here are the common sets we recommend under normal conditions.

frequency notation on boot.ini
1.992 GHz “1992” (overclock)
1.896 GHz “1896”
1.704 GHz “1704”
1.608 GHz “1608”
1.512 GHz “1512”
1.398 GHz “1398”
1.200 GHz “1200”
1.000 GHz “1000”
667 MHz “667”
500 MHz “500”
250 MHz “250”
100 MHz “100”

ODROID-C4

The available list of A55 cpu frequency set

Here are the common sets we recommend under normal conditions.

frequency notation on boot.ini
2.016 GHz “2016” (overclock)
1.908 GHz “1908”
1.800 GHz “1800”
1.704 GHz “1704”
1.608 GHz “1608”
1.512 GHz “1512”
1.404 GHz “1404”
1.200 GHz “1200”
1.000 GHz “1000”
667 MHz “667”
500 MHz “500”
250 MHz “250”
100 MHz “100”

setting boot.ini

ODROID-N2

Please modify max_freq_a73 and max_freq_a53 based on the aforementioned frequency table. The unit of max_freq_a73 and max_freq_a53 in boot.ini is MHz.

If you don't set max_freq parameters in bootargs or the setting value is wrong one which doesn't exist in frequency table, max_freq for A73 will be set as “1.800GHz” and max_freq for A53 will be set as “1.896GHz” by default.

### boot.ini
 
# max cpu frequency for big core, A73 in MHz unit
# setenv max_freq_a73 "2004"  # 2.004 GHz (overclock)
# setenv max_freq_a73 "1908"  # 1.908 GHz (overclock)
setenv max_freq_a73 "1800"  # 1.8 GHz, default value
# setenv max_freq_a73 "1704"  # 1.704 GHz
 
# max cpu frequency for little core, A53 in MHz unit
# setenv max_freq_a53 "1992"  # 1.992 GHz (overclock)
setenv max_freq_a53 "1896"  # 1.896 GHz, default value
# setenv max_freq_a53 "1704"  # 1.704 GHz

After setting it, then be sure you do reboot.

You can check the frequency list as following.

ex) setenv max_freq_a53 “1896”

$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies 
100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1896000 

ex) setenv max_freq_a73 “1800”

$ cat /sys/devices/system/cpu/cpufreq/policy2/scaling_available_frequencies                                                
100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1800000 

ODROID-C4

Please modify max_freq_a55 based on the aforementioned frequency table. The unit of max_freq_a55 in boot.ini is MHz.

If you don't set max_freq_a55 parameters in bootargs or the setting value is the wrong one which doesn't exist in a frequency table, max_freq for A55 will be set as “1.800 GHz” by default.

### boot.ini
 
# max cpu frequency for little core, A55 in MHz unit
# setenv max_freq_a55 "2016"  # 2.016 GHz (overclock)
# setenv max_freq_a55 "1908"  # 1.908 GHz, default value
setenv max_freq_a55 "1800"  # 1.800 GHz

After setting it, then be sure you do reboot.

You can check the frequency list as following.

ex) setenv max_freq_a55 “2016”

$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies 
100000 250000 500000 667000 1000000 1200000 1404000 1500000 1608000 1704000 1800000 1908000 2016000

Also, you can set cpu-cores you want to activate using boot.ini

The available range is “4” to “6” on ODROID-N2. The ODROID-C4 has 4 cpu-cores.

setting boot.ini
ODROID-N2
### boot.ini
 
# max cpu-cores
# setenv maxcpus "4"
# setenv maxcpus "5"
setenv maxcpus "6"

After setting it, then please be sure you do reboot.

You can check the activated cpu cores as following.

ex) setenv maxcpus “4”

root@odroid:~# cat /sys/devices/system/cpu/online 
0-3
root@odroid:~# cat /sys/devices/system/cpu/offline 
4-5
ODROID-N2
root@odroid:~# cat /proc/cpuinfo 
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
processor       : 1
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
processor       : 2
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd09
CPU revision    : 2
 
processor       : 3
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd09
CPU revision    : 2
 
Hardware        : Hardkernel ODROID-N2
Revision        : 0400
ODROID-C4
root@odroid:~# cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd05
CPU revision    : 0
 
processor       : 1
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd05
CPU revision    : 0
 
processor       : 2
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd05
CPU revision    : 0
 
CPU info        : 2b0c1000011b2e000004343932473850
Serial          : ----
Hardware        : Hardkernel ODROID-C4
Revision        : 0500
2020/03/16 17:26 · luke.go