1# 2# Copyright (C) 2017 The Android Open-Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17on property:sys.boot_completed=1 18 # Enable bus-dcvs 19 write /sys/class/devfreq/soc:qcom,cpubw/governor "bw_hwmon" 20 write /sys/class/devfreq/soc:qcom,cpubw/polling_interval 50 21 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/mbps_zones "1144 1720 2086 2929 3879 5931 6881" 22 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/sample_ms 4 23 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent 68 24 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hist_memory 20 25 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hyst_length 10 26 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/down_thres 80 27 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps 0 28 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/up_scale 250 29 write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/idle_mbps 1600 30 31 write /sys/class/devfreq/soc:qcom,mincpubw/governor "cpufreq" 32 33 # Enable memlat governor 34 write /sys/class/devfreq/soc:qcom,memlat-cpu0/governor "mem_latency" 35 write /sys/class/devfreq/soc:qcom,memlat-cpu0/polling_interval 10 36 write /sys/class/devfreq/soc:qcom,memlat-cpu0/mem_latency/ratio_ceil 400 37 write /sys/class/devfreq/soc:qcom,memlat-cpu6/governor "mem_latency" 38 write /sys/class/devfreq/soc:qcom,memlat-cpu6/polling_interval 10 39 write /sys/class/devfreq/soc:qcom,memlat-cpu6/mem_latency/ratio_ceil 400 40 41 write /sys/class/devfreq/soc:qcom,l3-cpu0/governor "mem_latency" 42 write /sys/class/devfreq/soc:qcom,l3-cpu0/polling_interval 10 43 write /sys/class/devfreq/soc:qcom,l3-cpu0/mem_latency/ratio_ceil 400 44 write /sys/class/devfreq/soc:qcom,l3-cpu6/governor "mem_latency" 45 write /sys/class/devfreq/soc:qcom,l3-cpu6/polling_interval 10 46 write /sys/class/devfreq/soc:qcom,l3-cpu6/mem_latency/ratio_ceil 400 47 48 # Limit the min frequency of LC to 576MHz 49 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 576000 50 51 # Limit the min frequency of BC to 825MHz 52 write /sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq 825600 53 54 # Turn on sleep modes. 55 write /sys/module/lpm_levels/parameters/sleep_disabled 0 56 57 # Enable idle state listener 58 write /sys/class/drm/card0/device/idle_encoder_mask 1 59 write /sys/class/drm/card0/device/idle_timeout_ms 100 60 61 # Change l3-cdsp to userspace governor 62 write /sys/class/devfreq/soc:qcom,l3-cdsp/governor userspace 63 chown system system /sys/class/devfreq/soc:qcom,l3-cdsp/userspace/set_freq 64 65 # Disable CPU Retention 66 write /sys/module/lpm_levels/L3/cpu0/ret/idle_enabled N 67 write /sys/module/lpm_levels/L3/cpu1/ret/idle_enabled N 68 write /sys/module/lpm_levels/L3/cpu2/ret/idle_enabled N 69 write /sys/module/lpm_levels/L3/cpu3/ret/idle_enabled N 70 write /sys/module/lpm_levels/L3/cpu4/ret/idle_enabled N 71 write /sys/module/lpm_levels/L3/cpu5/ret/idle_enabled N 72 write /sys/module/lpm_levels/L3/cpu6/ret/idle_enabled N 73 write /sys/module/lpm_levels/L3/cpu7/ret/idle_enabled N 74 75# Disable console_suspend to get better logging for kernel crashes 76on boot 77 write /sys/module/printk/parameters/console_suspend N 78 79 #Enable suspend to idle mode to reduce latency during suspend/resume 80 write /sys/power/mem_sleep "s2idle" 81 82# If UART is on, enable console_suspend on boot_complete to save power 83on property:sys.boot_completed=1 && property:init.svc.console=running 84 write /sys/module/printk/parameters/console_suspend Y 85