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