1#!/system/bin/sh
2#
3# Copyright (C) 2023 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# Performance test setup for 2023 devices
18
19echo "Disabling Tskin thermal mitigation..."
20setprop persist.vendor.disable.thermal.control 1
21
22echo "Disabling TJ thermal mitigation..."
23setprop persist.vendor.disable.thermal.tj.control 1
24
25echo "Clearing cooling device states..."
26for i in /sys/devices/virtual/thermal/cooling_device*/user_vote; do echo 0 > "$i" 2>/dev/null; done
27for i in /sys/devices/virtual/thermal/cooling_device*/cur_state; do echo 0 > "$i" 2>/dev/null; done
28
29echo "Disabling powerhints..."
30setprop vendor.powerhal.init 0
31setprop ctl.restart vendor.power-hal-aidl
32
33# set max freq for all cores
34echo "Locking CPUs to the max freq..."
35for cpu_path in /sys/devices/system/cpu/cpu*[0-9]; do
36  local max_freq=`cat $cpu_path/cpufreq/cpuinfo_max_freq`
37  echo $max_freq > $cpu_path/cpufreq/scaling_max_freq
38  echo $max_freq > $cpu_path/cpufreq/scaling_min_freq
39
40  local cur_freq=`cat $cpu_path/cpufreq/cpuinfo_cur_freq`
41  echo "`basename $cpu_path` -> $cur_freq"
42done
43
44echo "Locking GPU to the max freq..."
45echo 890000 > /sys/devices/platform/1f000000.mali/scaling_max_freq
46echo 890000 > /sys/devices/platform/1f000000.mali/scaling_min_freq
47cat /sys/devices/platform/1f000000.mali/cur_freq
48
49echo "Locking Buses to the max freq..."
50for path in /sys/class/devfreq/*{bci,mif,dsu,int}; do
51  local max_freq=`cat $path/max_freq`
52  echo $max_freq > $path/exynos_data/debug_scaling_devfreq_max
53  echo $max_freq > $path/exynos_data/debug_scaling_devfreq_min
54
55  local cur_freq=`cat $path/cur_freq`
56  echo "`basename $path` -> $cur_freq"
57done
58
59