mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
Merge pull request #1 from derkling/drk-fixups
Fixup some modules initialization
This commit is contained in:
commit
db14589886
@ -29,7 +29,20 @@ class CpufreqModule(Module):
|
||||
|
||||
@staticmethod
|
||||
def probe(target):
|
||||
|
||||
# x86 with Intel P-State driver
|
||||
if target.abi == 'x86_64':
|
||||
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)
|
||||
|
||||
def __init__(self, target):
|
||||
|
@ -8,7 +8,10 @@ class HotplugModule(Module):
|
||||
|
||||
@classmethod
|
||||
def probe(cls, target): # pylint: disable=arguments-differ
|
||||
path = cls._cpu_path(target, 0)
|
||||
# If a system has just 1 CPU, it makes not sense to hotplug it.
|
||||
# If a system has more than 1 CPU, CPU0 could be configured to be not
|
||||
# hotpluggable. Thus, check for hotplug support by looking at CPU1
|
||||
path = cls._cpu_path(target, 1)
|
||||
return target.file_exists(path) and target.is_rooted
|
||||
|
||||
@classmethod
|
||||
@ -30,6 +33,8 @@ class HotplugModule(Module):
|
||||
|
||||
def hotplug(self, cpu, online):
|
||||
path = self._cpu_path(self.target, cpu)
|
||||
if not self.target.file_exists(path):
|
||||
return
|
||||
value = 1 if online else 0
|
||||
self.target.write_value(path, value)
|
||||
|
||||
|
@ -177,8 +177,8 @@ class Target(object):
|
||||
tid = id(threading.current_thread())
|
||||
self._connections[tid] = self.get_connection(timeout=timeout)
|
||||
self.busybox = self.get_installed('busybox')
|
||||
self._update_modules('connected')
|
||||
self.platform.update_from_target(self)
|
||||
self._update_modules('connected')
|
||||
if self.platform.big_core and self.load_default_modules:
|
||||
self._install_module(get_module('bl'))
|
||||
|
||||
|
@ -19,7 +19,13 @@ from contextlib import contextmanager
|
||||
from logging import Logger
|
||||
|
||||
import serial
|
||||
import fdpexpect
|
||||
|
||||
import pexpect
|
||||
from distutils.version import StrictVersion as V
|
||||
if V(pexpect.__version__) < V('4.0.0'):
|
||||
import fdpexpect
|
||||
else:
|
||||
from pexpect import fdpexpect
|
||||
# Adding pexpect exceptions into this module's namespace
|
||||
from pexpect import EOF, TIMEOUT # NOQA pylint: disable=W0611
|
||||
|
||||
|
@ -23,7 +23,12 @@ import threading
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
import pxssh
|
||||
import pexpect
|
||||
from distutils.version import StrictVersion as V
|
||||
if V(pexpect.__version__) < V('4.0.0'):
|
||||
import pxssh
|
||||
else:
|
||||
from pexpect import pxssh
|
||||
from pexpect import EOF, TIMEOUT, spawn
|
||||
|
||||
from devlib.exception import HostError, TargetError, TimeoutError
|
||||
|
Loading…
x
Reference in New Issue
Block a user