1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

cpufreq: add methods to configure all CPUs at once

Sometimes it could be required to change governor or frequency for a all the
online CPUs of a target. This patch provides an utility method to easily
do that using a single method call.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2015-09-17 17:39:32 +01:00
parent 4dcb4974e5
commit b598b38f12

View File

@ -349,3 +349,17 @@ class CpufreqModule(Module):
for cpu in online_cpus:
self.set_frequency(cpu, freq, exact)
def set_all_frequencies(self, freq, exact=False):
self.target.execute(
"for CPU in /sys/devices/system/cpu/cpu[0-9]*; do "\
"echo {} > $CPU/cpufreq/scaling_cur_freq; "\
"done"\
.format(freq), as_root=True)
def set_all_governors(self, governor):
self.target.execute(
"for CPU in /sys/devices/system/cpu/cpu[0-9]*; do "\
"echo {} > $CPU/cpufreq/scaling_governor; "\
"done"\
.format(governor), as_root=True)