From aa0066b99879b3b5f53335e2cc725da7ab15ed1f Mon Sep 17 00:00:00 2001 From: Anil kumar mamidala Date: Fri, 22 Aug 2014 16:09:41 +0530 Subject: [PATCH] init: qcom: post_boot: Enable low power modes for 8916, 8939 and 8936 With cluster architecture the low power mode sysfs nodes are changed. Enable all low power modes through single control now for both these targets. Change-Id: I5ea404490742f679bf08fe1053854941afa9453c --- rootdir/etc/init.qcom.post_boot.sh | 112 +++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 30 deletions(-) diff --git a/rootdir/etc/init.qcom.post_boot.sh b/rootdir/etc/init.qcom.post_boot.sh index 88be0270..3e2aa9e5 100755 --- a/rootdir/etc/init.qcom.post_boot.sh +++ b/rootdir/etc/init.qcom.post_boot.sh @@ -337,26 +337,28 @@ esac case "$target" in "msm8916") - echo 4 > /sys/module/lpm_levels/enable_low_power/l2 - echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled - echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled - echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled - echo 1 > /sys/devices/system/cpu/cpu1/online - echo 1 > /sys/devices/system/cpu/cpu2/online - echo 1 > /sys/devices/system/cpu/cpu3/online + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + case "$soc_id" in + "206") + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + ;; + "239" | "241" ) + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + ;; + "233") + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + ;; + esac ;; esac @@ -454,16 +456,66 @@ esac case "$target" in "msm8916") - echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - echo "25000 1094400:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay - echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load - echo 25000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate - echo 998400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq - echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy - echo "85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads - echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time - echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor - echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + # Apply governor settings for 8916 + case "$soc_id" in + "206") + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "25000 1094400:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + echo 25000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate + echo 998400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + echo "85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads + echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + ;; + esac + + # Apply governor settings for 8939 + case "$soc_id" in + "239" | "241" ) + for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor + do + echo "bw_hwmon" > $devfreq_gov + done + # enable governor for perf cluster + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "25000 800000:50000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay + echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + echo 25000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate + echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy + echo "85 800000:90" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads + echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time + echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor + echo 400000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # enable governor for power cluster + echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor + echo "25000 499200:50000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay + echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load + echo 25000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate + echo 499200 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy + echo "85 499200:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads + echo 50000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time + echo 50000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor + echo 249600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online + echo 1 > /sys/devices/system/cpu/cpu5/online + echo 1 > /sys/devices/system/cpu/cpu6/online + echo 1 > /sys/devices/system/cpu/cpu7/online + ;; + esac ;; esac