Sandeep Patil | 17f2b47 | 2017-04-13 13:13:36 -0700 | [diff] [blame] | 1 | #!/vendor/bin/sh |
Thierry Strudel | b4d838b | 2016-04-08 12:54:52 -0700 | [diff] [blame] | 2 | |
| 3 | ################################################################################ |
| 4 | # helper functions to allow Android init like script |
| 5 | |
| 6 | function write() { |
| 7 | echo -n $2 > $1 |
| 8 | } |
| 9 | |
| 10 | function copy() { |
| 11 | cat $1 > $2 |
| 12 | } |
| 13 | |
| 14 | ################################################################################ |
| 15 | |
Thierry Strudel | b4d838b | 2016-04-08 12:54:52 -0700 | [diff] [blame] | 16 | # Enable bus-dcvs |
| 17 | for 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 |
| 32 | done |
| 33 | |
| 34 | for memlat in /sys/class/devfreq/*qcom,memlat-cpu* ; do |
| 35 | write $memlat/governor "mem_latency" |
| 36 | write $memlat/polling_interval 10 |
| 37 | done |
| 38 | |
Wei Wang | 0f10118 | 2017-07-20 15:05:22 -0700 | [diff] [blame] | 39 | setprop sys.post_boot.parsed 1 |
Siqi Lin | bf58c6d | 2016-08-29 17:17:01 -0700 | [diff] [blame] | 40 | |
| 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 |
| 43 | if [[ $(getprop ro.debuggable) == "1" && ! -e /sys/class/tty/ttyHSL0 ]] |
| 44 | then |
| 45 | write /sys/module/printk/parameters/console_suspend N |
| 46 | fi |