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

cpufreq: make probing more robust

On some machines, when a different CPUFreq policy could be configured
for each CPU, there is not a top-level 'cpufreq' folder exposed
at top level but just per-CPU ones.

This patch makes the probing for CPUFreq support more robust by checking
on all the supported paths.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2015-10-01 17:59:12 +01:00
parent b19d76d4b0
commit cbe80da3a1

View File

@ -29,9 +29,20 @@ class CpufreqModule(Module):
@staticmethod @staticmethod
def probe(target): def probe(target):
path = '/sys/devices/system/cpu/cpufreq'
# x86 with Intel P-State driver
if target.abi == 'x86_64': if target.abi == 'x86_64':
path = '/sys/devices/system/cpu/intel_pstate' path = '/sys/devices/system/cpu/intel_pstate'
if target.file_exists(path):
return True
# Generic CPUFreq support (single policy)
path = '/sys/devices/system/cpu/cpufreq'
if target.file_exists(path):
return True
# Generic CPUFreq support (per CPU policy)
path = '/sys/devices/system/cpu/cpu0/cpufreq'
return target.file_exists(path) return target.file_exists(path)
def __init__(self, target): def __init__(self, target):