blob: 2ee32d8e2b5cfdc5930fe050c898b96c4b726e6a [file] [log] [blame]
Sandeep Patil17f2b472017-04-13 13:13:36 -07001#!/vendor/bin/sh
Thierry Strudelb4d838b2016-04-08 12:54:52 -07002
3################################################################################
4# helper functions to allow Android init like script
5
6function write() {
7 echo -n $2 > $1
8}
9
10function copy() {
11 cat $1 > $2
12}
13
14################################################################################
15
Thierry Strudelb4d838b2016-04-08 12:54:52 -070016# Enable bus-dcvs
17for cpubw in /sys/class/devfreq/*qcom,cpubw* ; do
18 write $cpubw/governor "bw_hwmon"
19 write $cpubw/polling_interval 50
20 write $cpubw/min_freq 1525
21 write $cpubw/bw_hwmon/mbps_zones "1525 5195 11863 13763"
22 write $cpubw/bw_hwmon/sample_ms 4
23 write $cpubw/bw_hwmon/io_percent 34
24 write $cpubw/bw_hwmon/hist_memory 20
25 write $cpubw/bw_hwmon/hyst_length 10
26 write $cpubw/bw_hwmon/low_power_ceil_mbps 0
27 write $cpubw/bw_hwmon/low_power_io_percent 34
28 write $cpubw/bw_hwmon/low_power_delay 20
29 write $cpubw/bw_hwmon/guard_band_mbps 0
30 write $cpubw/bw_hwmon/up_scale 250
31 write $cpubw/bw_hwmon/idle_mbps 1600
32done
33
34for memlat in /sys/class/devfreq/*qcom,memlat-cpu* ; do
35 write $memlat/governor "mem_latency"
36 write $memlat/polling_interval 10
37done
38
Wei Wang0f101182017-07-20 15:05:22 -070039setprop sys.post_boot.parsed 1
Siqi Linbf58c6d2016-08-29 17:17:01 -070040
41# On debuggable builds, enable console_suspend if uart is enabled to save power
42# Otherwise, disable console_suspend to get better logging for kernel crashes
43if [[ $(getprop ro.debuggable) == "1" && ! -e /sys/class/tty/ttyHSL0 ]]
44then
45 write /sys/module/printk/parameters/console_suspend N
46fi