6from _hardware
import HardwareException, Expectation
7from _hardware_android
import HardwareAndroid
9CPU_CLOCK_RATE = 1728000
10GPU_CLOCK_RATE = 510000000
14 HardwareAndroid.__init__(self, adb)
17 HardwareAndroid.__enter__(self)
18 if not self.
_adb.is_root():
24 echo 1 > /sys/devices/system/cpu/cpu$N/online
25 echo userspace > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
26 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_max_freq
27 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_min_freq
28 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed
29 done
''' % tuple(CPU_CLOCK_RATE for _ in range(3)))
33 for N
in 0 1 2 3 7; do
34 echo 0 > /sys/devices/system/cpu/cpu$N/online
40 echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
41 echo 1 > /sys/
class/kgsl/kgsl-3d0/force_bus_on
42 echo 1 > /sys/
class/kgsl/kgsl-3d0/force_rail_on
43 echo 1 > /sys/
class/kgsl/kgsl-3d0/force_clk_on
44 echo 1000000 > /sys/
class/kgsl/kgsl-3d0/idle_timer
45 echo performance > /sys/
class/kgsl/kgsl-3d0/devfreq/governor
46 echo %i > /sys/
class/kgsl/kgsl-3d0/devfreq/max_freq
47 echo %i > /sys/
class/kgsl/kgsl-3d0/devfreq/min_freq
48 echo %i > /sys/
class/kgsl/kgsl-3d0/gpuclk
''' %
49 tuple(GPU_CLOCK_RATE for _
in range(3)))
54 echo performance > /sys/class/devfreq/qcom,cpubw.32/governor
55 echo 9887 > /sys/
class/devfreq/qcom,cpubw.32/max_freq
56 echo 9887 > /sys/
class/devfreq/qcom,cpubw.32/min_freq
57 echo performance > /sys/
class/devfreq/qcom,gpubw.70/governor
58 echo 9887 > /sys/
class/devfreq/qcom,gpubw.70/max_freq
59 echo 9887 > /sys/
class/devfreq/qcom,gpubw.70/min_freq
''')
64 HardwareAndroid.sanity_check(self)
66 if not self.
_adb.is_root():
70 cat /sys/class/power_supply/battery/capacity \
71 /sys/devices/system/cpu/online \
72 /sys/
class/thermal/thermal_zone14/temp \
73 /sys/
class/thermal/thermal_zone15/temp \
74 /sys/kernel/debug/clk/oxili_gfx3d_clk/measure \
75 /sys/kernel/debug/clk/bimc_clk/measure
77 cat /sys/devices/system/cpu/cpu$N/cpufreq/scaling_cur_freq
81 [Expectation(int, min_value=30, name='battery', sleeptime=30*60),
82 Expectation(str, exact_value=
'4-6', name=
'online cpus'),
83 Expectation(int, max_value=88, name=
'tsens_tz_sensor13'),
84 Expectation(int, max_value=88, name=
'tsens_tz_sensor14'),
85 Expectation(long, min_value=(GPU_CLOCK_RATE - 5000),
86 max_value=(GPU_CLOCK_RATE + 5000), name=
'gpu clock rate'),
87 Expectation(long, min_value=647995000, max_value=648007500,
88 name=
'ddr clock rate', sleeptime=10)] + \
89 [
Expectation(int, exact_value=CPU_CLOCK_RATE, name=
'cpu_%i clock rate' %i)
92 Expectation.check_all(expectations, result.splitlines())
#define check(reporter, ref, unref, make, kill)