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:vendor.setup.power=1 18 # Enable suspend clock reporting 19 write /sys/kernel/debug/clk/debug_suspend 1 20 21 # Enable bus-dcvs 22 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/governor bw_hwmon 23 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/polling_interval 50 24 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/mbps_zones "2288 4577 7110 9155 12298 14236 16265" 25 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/sample_ms 4 26 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/io_percent 68 27 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hist_memory 20 28 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hyst_length 0 29 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/down_thres 80 30 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/guard_band_mbps 0 31 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/up_scale 250 32 write /sys/devices/platform/soc/soc:qcom,cpu-cpu-llcc-bw/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/idle_mbps 1600 33 34 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/governor bw_hwmon 35 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/polling_interval 50 36 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/mbps_zones "1144 1720 2086 2929 3879 5931 6881 7980" 37 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/sample_ms 4 38 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/io_percent 68 39 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/hist_memory 20 40 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/hyst_length 0 41 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/down_thres 80 42 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/guard_band_mbps 0 43 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/up_scale 250 44 write /sys/devices/platform/soc/soc:qcom,cpu-llcc-ddr-bw/devfreq/soc:qcom,cpu-llcc-ddr-bw/bw_hwmon/idle_mbps 1600 45 46 write /sys/devices/virtual/npu/msm_npu/pwr 1 47 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/governor "bw_hwmon" 48 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/polling_interval 40 49 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/mbps_zones "1144 1720 2086 2929 3879 5931 6881 7980" 50 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/sample_ms 4 51 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/io_percent 80 52 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/hist_memory 20 53 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/hyst_length 10 54 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/down_thres 30 55 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/guard_band_mbps 0 56 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/up_scale 250 57 write /sys/devices/platform/soc/soc:qcom,npu-llcc-ddr-bw/devfreq/soc:qcom,npu-llcc-ddr-bw/bw_hwmon/idle_mbps 0 58 write /sys/devices/virtual/npu/msm_npu/pwr 0 59 60 write /sys/devices/virtual/npu/msm_npu/pwr 1 61 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/governor "bw_hwmon" 62 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/polling_interval 40 63 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/mbps_zones "1144 1720 2086 2929 3879 5931 6881 7980" 64 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/sample_ms 4 65 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/io_percent 80 66 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/hist_memory 20 67 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/hyst_length 10 68 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/down_thres 30 69 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/guard_band_mbps 0 70 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/up_scale 250 71 write /sys/devices/platform/soc/soc:qcom,npudsp-npu-ddr-bw/devfreq/soc:qcom,npudsp-npu-ddr-bw/bw_hwmon/idle_mbps 0 72 write /sys/devices/virtual/npu/msm_npu/pwr 0 73 74 write /sys/devices/virtual/npu/msm_npu/pwr 1 75 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/governor "bw_hwmon" 76 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/polling_interval 40 77 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/mbps_zones "2288 4577 7110 9155 12298 14236 16265" 78 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/sample_ms 4 79 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/io_percent 100 80 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/hist_memory 20 81 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/hyst_length 10 82 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/down_thres 30 83 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/guard_band_mbps 0 84 write /sys/devices/platform/soc/soc:qcom,npu-npu-llcc-bw/devfreq/soc:qcom,npu-npu-llcc-bw/bw_hwmon/up_scale 250 85 write /sys/devices/virtual/npu/msm_npu/pwr 0 86 87 #Enable mem_latency governor for L3, LLCC, and DDR scaling 88 write /sys/devices/platform/soc/soc:qcom,cpu0-cpu-llcc-lat/devfreq/soc:qcom,cpu0-cpu-llcc-lat/governor mem_latency 89 write /sys/devices/platform/soc/soc:qcom,cpu0-cpu-llcc-lat/devfreq/soc:qcom,cpu0-cpu-llcc-lat/polling_interval 10 90 write /sys/devices/platform/soc/soc:qcom,cpu0-cpu-llcc-lat/devfreq/soc:qcom,cpu0-cpu-llcc-lat/mem_latency/ratio_ceil 400 91 92 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/governor mem_latency 93 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/polling_interval 10 94 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu0-cpu-l3-lat/mem_latency/ratio_ceil 400 95 96 write /sys/devices/platform/soc/soc:qcom,cpu0-llcc-ddr-lat/devfreq/soc:qcom,cpu0-llcc-ddr-lat/governor mem_latency 97 write /sys/devices/platform/soc/soc:qcom,cpu0-llcc-ddr-lat/devfreq/soc:qcom,cpu0-llcc-ddr-lat/polling_interval 10 98 write /sys/devices/platform/soc/soc:qcom,cpu0-llcc-ddr-lat/devfreq/soc:qcom,cpu0-llcc-ddr-lat/mem_latency/ratio_ceil 400 99 100 write /sys/devices/platform/soc/soc:qcom,cpu6-cpu-llcc-lat/devfreq/soc:qcom,cpu6-cpu-llcc-lat/governor mem_latency 101 write /sys/devices/platform/soc/soc:qcom,cpu6-cpu-llcc-lat/devfreq/soc:qcom,cpu6-cpu-llcc-lat/polling_interval 10 102 write /sys/devices/platform/soc/soc:qcom,cpu6-cpu-llcc-lat/devfreq/soc:qcom,cpu6-cpu-llcc-lat/mem_latency/ratio_ceil 400 103 104 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/governor mem_latency 105 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/polling_interval 10 106 #Gold L3 ratio ceil 107 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu6-cpu-l3-lat/mem_latency/ratio_ceil 4000 108 109 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/governor mem_latency 110 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/polling_interval 10 111 #Prime L3 ratio ceil 112 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cpu7-cpu-l3-lat/mem_latency/ratio_ceil 4000 113 114 write /sys/devices/platform/soc/soc:qcom,cpu6-llcc-ddr-lat/devfreq/soc:qcom,cpu6-llcc-ddr-lat/governor mem_latency 115 write /sys/devices/platform/soc/soc:qcom,cpu6-llcc-ddr-lat/devfreq/soc:qcom,cpu6-llcc-ddr-lat/polling_interval 10 116 write /sys/devices/platform/soc/soc:qcom,cpu6-llcc-ddr-lat/devfreq/soc:qcom,cpu6-llcc-ddr-lat/mem_latency/ratio_ceil 400 117 118 #Enable compute governor for gold latfloor 119 write /sys/devices/platform/soc/soc:qcom,cpu0-cpu-ddr-latfloor/devfreq/soc:qcom,cpu0-cpu-ddr-latfloor/governor compute 120 write /sys/devices/platform/soc/soc:qcom,cpu0-cpu-ddr-latfloor/devfreq/soc:qcom,cpu0-cpu-ddr-latfloor/polling_interval 10 121 122 write /sys/devices/platform/soc/soc:qcom,cpu6-cpu-ddr-latfloor/devfreq/soc:qcom,cpu6-cpu-ddr-latfloor/governor compute 123 write /sys/devices/platform/soc/soc:qcom,cpu6-cpu-ddr-latfloor/devfreq/soc:qcom,cpu6-cpu-ddr-latfloor/polling_interval 10 124 125 write /sys/devices/platform/soc/soc:qcom,cpu7-cpu-ddr-latfloor/devfreq/soc:qcom,cpu7-cpu-ddr-latfloor/governor compute 126 write /sys/devices/platform/soc/soc:qcom,cpu7-cpu-ddr-latfloor/devfreq/soc:qcom,cpu7-cpu-ddr-latfloor/polling_interval 10 127 128 #Enable cdspl3 governor for L3 cdsp nodes 129 write /sys/devices/platform/soc/18321000.qcom,devfreq-l3/18321000.qcom,devfreq-l3:qcom,cdsp-cdsp-l3-lat/devfreq/18321000.qcom,devfreq-l3:qcom,cdsp-cdsp-l3-lat/governor cdspl3 130 131 # Enable powersaving 132 write /sys/module/lpm_levels/parameters/sleep_disabled 0 133 134 # Enable UFS powersaving 135 write /sys/devices/platform/soc/${ro.boot.bootdevice}/clkgate_enable 1 136 137 # Enable idle state listener 138 write /sys/class/drm/card0/device/idle_encoder_mask 1 139 write /sys/class/drm/card0/device/idle_timeout_ms 100 140 141 #Enable PowerHAL hint processing 142 setprop vendor.powerhal.init 1 143 144on boot 145 # Disable console_suspend to get better logging for kernel crashes 146 write /sys/module/printk/parameters/console_suspend N 147 148# If UART is on, enable console_suspend on boot_complete to save power 149on property:sys.boot_completed=1 && property:init.svc.console=running 150 write /sys/module/printk/parameters/console_suspend Y 151