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
This commit is contained in:
Anil kumar mamidala 2014-08-22 16:09:41 +05:30 committed by Gopal G Goberu
parent f45a812490
commit aa0066b998
1 changed files with 82 additions and 30 deletions

View File

@ -337,27 +337,29 @@ 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
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
case "$target" in
@ -454,6 +456,15 @@ esac
case "$target" in
"msm8916")
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
@ -465,6 +476,47 @@ case "$target" in
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