aboutsummaryrefslogtreecommitdiff
path: root/rootdir/etc/init.qcom.power.rc
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2017-07-13 12:02:24 -0700
committerCosme Domínguez Díaz <cosme.ddiaz@gmail.com>2018-08-04 00:07:39 +0200
commitb0b5466053c8de0e3a04414cb9f1dc8eff4ed6a1 (patch)
tree7ac9fd0f9f162ca44de1a6b38af5e7d187bc1807 /rootdir/etc/init.qcom.power.rc
parent556263c3a4bb90ab7304ed846d55ab9a8bb12a9b (diff)
msm8996-common: Boost UFS during boot
Before: SystemServer_start : 6.5916 0.14159 SystemUi_start : 9.646 0.11627 system_server_ready : 10.341 0.16571 After: SystemServer_start : 6.5465 0.17295 SystemUi_start : 9.5017 0.13355 system_server_ready : 10.13 0.17956 Bug: 63644084 Test: 10 boot with packages/services/Car/tools/bootanalyze/bootanalyze.py Change-Id: I5509629bba6cddb35bb72d0f48283e2bf51cebd3
Diffstat (limited to 'rootdir/etc/init.qcom.power.rc')
-rw-r--r--rootdir/etc/init.qcom.power.rc40
1 files changed, 40 insertions, 0 deletions
diff --git a/rootdir/etc/init.qcom.power.rc b/rootdir/etc/init.qcom.power.rc
index 4a8c439..deda88c 100644
--- a/rootdir/etc/init.qcom.power.rc
+++ b/rootdir/etc/init.qcom.power.rc
@@ -1,3 +1,37 @@
+# Copyright (c) 2016, Code Aurora Forum. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Code Aurora nor
+# the names of its contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+on init
+ # Disable UFS powersaving
+ write /sys/devices/soc/624000.ufshc/clkscale_enable 0
+ write /sys/devices/soc/624000.ufshc/clkgate_enable 0
+ write /sys/devices/soc/624000.ufshc/624000.ufshc:ufs_variant/pm_qos_enable 0
+ write /sys/module/lpm_levels/parameters/sleep_disabled "Y"
+
on boot
# Bring back main cores CPU 0,2
write /sys/devices/system/cpu/cpu0/online 1
@@ -110,6 +144,12 @@ on enable-low-power
write /sys/class/devfreq/soc:qcom,memlat-cpu2/polling_interval 10
write /sys/class/devfreq/soc:qcom,mincpubw/governor "cpufreq"
+ # Enable UFS powersaving
+ write /sys/devices/soc/624000.ufshc/clkscale_enable 1
+ write /sys/devices/soc/624000.ufshc/clkgate_enable 1
+ write /sys/devices/soc/624000.ufshc/624000.ufshc:ufs_variant/pm_qos_enable 1
+
+ # Enable all LPMs (this will enable C4, D4, D3, E4 and M3 LPMs)
write /sys/module/lpm_levels/parameters/sleep_disabled "N"
# Set perfd properties