#!/system/bin/sh # Copyright (c) 2012-2013, 2016, The Linux Foundation. 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 The Linux Foundation 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. # target=`getprop ro.board.platform` function configure_zram_parameters() { # Zram disk - 512MB size zram_enable=`getprop ro.vendor.qti.config.zram` if [ "$zram_enable" == "true" ]; then echo 536870912 > /sys/block/zram0/disksize mkswap /dev/block/zram0 swapon /dev/block/zram0 -p 32758 fi } function configure_memory_parameters() { # Set Memory paremeters. # # Set per_process_reclaim tuning parameters # 2GB 64-bit will have aggressive settings when compared to 1GB 32-bit # 1GB and less will use vmpressure range 50-70, 2GB will use 10-70 # 1GB and less will use 512 pages swap size, 2GB will use 1024 # # Set Low memory killer minfree parameters # 32 bit all memory configurations will use 15K series # 64 bit up to 2GB with use 14K, and above 2GB will use 18K # # Set ALMK parameters (usually above the highest minfree values) # 32 bit will have 53K & 64 bit will have 81K # ProductName=`getprop ro.product.name` if [ "$ProductName" == "msm8996" ]; then # Enable Adaptive LMK echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min configure_zram_parameters else arch_type=`uname -m` MemTotalStr=`cat /proc/meminfo | grep MemTotal` MemTotal=${MemTotalStr:16:8} # Read adj series and set adj threshold for PPR and ALMK. # This is required since adj values change from framework to framework. adj_series=`cat /sys/module/lowmemorykiller/parameters/adj` adj_1="${adj_series#*,}" set_almk_ppr_adj="${adj_1%%,*}" # PPR and ALMK should not act on HOME adj and below. # Normalized ADJ for HOME is 6. Hence multiply by 6 # ADJ score represented as INT in LMK params, actual score can be in decimal # Hence add 6 considering a worst case of 0.9 conversion to INT (0.9*6). set_almk_ppr_adj=$(((set_almk_ppr_adj * 6) + 6)) echo $set_almk_ppr_adj > /sys/module/lowmemorykiller/parameters/adj_max_shift echo $set_almk_ppr_adj > /sys/module/process_reclaim/parameters/min_score_adj #Set other memory parameters echo 1 > /sys/module/process_reclaim/parameters/enable_process_reclaim echo 70 > /sys/module/process_reclaim/parameters/pressure_max echo 30 > /sys/module/process_reclaim/parameters/swap_opt_eff echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk if [ "$arch_type" == "aarch64" ] && [ $MemTotal -gt 2097152 ]; then echo 10 > /sys/module/process_reclaim/parameters/pressure_min echo 1024 > /sys/module/process_reclaim/parameters/per_swap_size echo "18432,23040,27648,32256,55296,80640" > /sys/module/lowmemorykiller/parameters/minfree echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min elif [ "$arch_type" == "aarch64" ] && [ $MemTotal -gt 1048576 ]; then echo 10 > /sys/module/process_reclaim/parameters/pressure_min echo 1024 > /sys/module/process_reclaim/parameters/per_swap_size echo "14746,18432,22118,25805,40000,55000" > /sys/module/lowmemorykiller/parameters/minfree echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min elif [ "$arch_type" == "aarch64" ]; then echo 50 > /sys/module/process_reclaim/parameters/pressure_min echo 512 > /sys/module/process_reclaim/parameters/per_swap_size echo "14746,18432,22118,25805,40000,55000" > /sys/module/lowmemorykiller/parameters/minfree echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min else echo 50 > /sys/module/process_reclaim/parameters/pressure_min echo 512 > /sys/module/process_reclaim/parameters/per_swap_size echo "15360,19200,23040,26880,34415,43737" > /sys/module/lowmemorykiller/parameters/minfree echo 53059 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min fi configure_zram_parameters SWAP_ENABLE_THRESHOLD=1048576 swap_enable=`getprop ro.vendor.qti.config.swap` 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 # Enable swap initially only for 1 GB targets if [ "$MemTotal" -le "$SWAP_ENABLE_THRESHOLD" ] && [ "$swap_enable" == "true" ]; then # Static swiftness echo 1 > /proc/sys/vm/swap_ratio_enable echo 70 > /proc/sys/vm/swap_ratio # Swap disk - 200MB size if [ ! -f /data/system/swap/swapfile ]; then dd if=/dev/zero of=/data/system/swap/swapfile bs=1m count=200 fi mkswap /data/system/swap/swapfile swapon /data/system/swap/swapfile -p 32758 fi fi } function start_hbtp() { # Start the Host based Touch processing but not in the power off mode. bootmode=`getprop ro.bootmode` if [ "charger" != $bootmode ]; then start hbtp fi } case "$target" in "msm7201a_ffa" | "msm7201a_surf" | "msm7627_ffa" | "msm7627_6x" | "msm7627a" | "msm7627_surf" | \ "qsd8250_surf" | "qsd8250_ffa" | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "qsd8650a_st1x") echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ;; esac case "$target" in "msm7201a_ffa" | "msm7201a_surf") echo 500000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate ;; esac case "$target" in "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") echo 75000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 1 > /sys/module/pm2/parameters/idle_sleep_mode ;; esac case "$target" in "msm7201a_ffa" | "msm7201a_surf" | "msm7627_ffa" | "msm7627_6x" | "msm7627_surf" | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm7627a" ) echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq ;; esac case "$target" in "msm8660") echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache echo 1 > /sys/module/rpm_resources/enable_low_power/pxo echo 2 > /sys/module/rpm_resources/enable_low_power/vdd_dig echo 2 > /sys/module/rpm_resources/enable_low_power/vdd_mem echo 1 > /sys/module/rpm_resources/enable_low_power/rpm_cpu 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/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/cpu0/power_collapse/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_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 "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 4 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/mfreq chmod -h 220 /sys/devices/system/cpu/mfreq chown -h root.system /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu1/online ;; esac case "$target" in "msm8960") echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache echo 1 > /sys/module/rpm_resources/enable_low_power/pxo echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_dig echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_mem echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled 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 0 > /sys/module/msm_thermal/core_control/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 echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 4 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core echo 918000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq echo 1026000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor chown -h system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq echo 384000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 384000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq echo 1 > /sys/module/msm_thermal/core_control/enabled chown -h root.system /sys/devices/system/cpu/mfreq chmod -h 220 /sys/devices/system/cpu/mfreq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online # set DCVS parameters for CPU echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us echo 100000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_min_us echo 500000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_max_us echo 0 > /sys/module/msm_dcvs/cores/cpu0/slack_mode_dynamic echo 1000000 > /sys/module/msm_dcvs/cores/cpu0/disable_pc_threshold echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_max_us echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_min_us echo 100000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_min_us echo 500000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_max_us echo 0 > /sys/module/msm_dcvs/cores/cpu1/slack_mode_dynamic echo 1000000 > /sys/module/msm_dcvs/cores/cpu1/disable_pc_threshold echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_max_us echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_min_us echo 100000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_min_us echo 500000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_max_us echo 0 > /sys/module/msm_dcvs/cores/cpu2/slack_mode_dynamic echo 1000000 > /sys/module/msm_dcvs/cores/cpu2/disable_pc_threshold echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_max_us echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_min_us echo 100000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_min_us echo 500000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_max_us echo 0 > /sys/module/msm_dcvs/cores/cpu3/slack_mode_dynamic echo 1000000 > /sys/module/msm_dcvs/cores/cpu3/disable_pc_threshold # set DCVS parameters for GPU echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_max_us echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_min_us echo 0 > /sys/module/msm_dcvs/cores/gpu0/slack_mode_dynamic # set msm_mpdecision parameters echo 45000 > /sys/module/msm_mpdecision/slack_time_max_us echo 15000 > /sys/module/msm_mpdecision/slack_time_min_us echo 100000 > /sys/module/msm_mpdecision/em_win_size_min_us echo 1000000 > /sys/module/msm_mpdecision/em_win_size_max_us echo 3 > /sys/module/msm_mpdecision/online_util_pct_min echo 25 > /sys/module/msm_mpdecision/online_util_pct_max echo 97 > /sys/module/msm_mpdecision/em_max_util_pct echo 2 > /sys/module/msm_mpdecision/rq_avg_poll_ms echo 10 > /sys/module/msm_mpdecision/mp_em_rounding_point_min echo 85 > /sys/module/msm_mpdecision/mp_em_rounding_point_max echo 50 > /sys/module/msm_mpdecision/iowait_threshold_pct #set permissions for the nodes needed by display on/off hook chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us chown -h system /sys/module/msm_mpdecision/slack_time_max_us chown -h system /sys/module/msm_mpdecision/slack_time_min_us chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us chmod -h 664 /sys/module/msm_mpdecision/slack_time_max_us chmod -h 664 /sys/module/msm_mpdecision/slack_time_min_us 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 "130") echo 230 > /sys/class/gpio/export echo 228 > /sys/class/gpio/export echo 229 > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio230/direction echo "rising" > /sys/class/gpio/gpio230/edge echo "in" > /sys/class/gpio/gpio228/direction echo "rising" > /sys/class/gpio/gpio228/edge echo "in" > /sys/class/gpio/gpio229/direction echo "rising" > /sys/class/gpio/gpio229/edge echo 253 > /sys/class/gpio/export echo 254 > /sys/class/gpio/export echo 257 > /sys/class/gpio/export echo 258 > /sys/class/gpio/export echo 259 > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio253/direction echo "out" > /sys/class/gpio/gpio254/direction echo "out" > /sys/class/gpio/gpio257/direction echo "out" > /sys/class/gpio/gpio258/direction echo "out" > /sys/class/gpio/gpio259/direction chown -h media /sys/class/gpio/gpio253/value chown -h media /sys/class/gpio/gpio254/value chown -h media /sys/class/gpio/gpio257/value chown -h media /sys/class/gpio/gpio258/value chown -h media /sys/class/gpio/gpio259/value chown -h media /sys/class/gpio/gpio253/direction chown -h media /sys/class/gpio/gpio254/direction chown -h media /sys/class/gpio/gpio257/direction chown -h media /sys/class/gpio/gpio258/direction chown -h media /sys/class/gpio/gpio259/direction echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_dig echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_mem ;; esac ;; esac case "$target" in "msm8974") 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/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/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/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled echo 0 > /sys/module/msm_thermal/core_control/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 "208" | "211" | "214" | "217" | "209" | "212" | "215" | "218" | "194" | "210" | "213" | "216") for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor do echo "cpubw_hwmon" > $devfreq_gov done echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 20 > /sys/module/cpu_boost/parameters/boost_ms echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms setprop ro.qualcomm.perf.cores_online 2 ;; *) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq echo 1190400 > /sys/devices/system/cpu/cpufreq/ondemand/input_boost echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load ;; esac echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 1 > /sys/module/msm_thermal/core_control/enabled chown -h root.system /sys/devices/system/cpu/mfreq chmod -h 220 /sys/devices/system/cpu/mfreq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online echo 1 > /dev/cpuctl/apps/cpu.notify_on_migrate ;; 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 case "$soc_id" in "206" | "247" | "248" | "249" | "250") 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" | "263") echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled echo 10 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus if [ -f /sys/devices/soc0/platform_subtype_id ]; then platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` fi if [ -f /sys/devices/soc0/hw_platform ]; then hw_platform=`cat /sys/devices/soc0/hw_platform` fi case "$soc_id" in "239") case "$hw_platform" in "Surf") case "$platform_subtype_id" in "1") start_hbtp ;; esac ;; "MTP") case "$platform_subtype_id" in "3") start_hbtp ;; esac ;; esac ;; esac ;; "233" | "240" | "242") 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 "msm8226") 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 echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core echo 787200 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq echo 300000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online ;; esac case "$target" in "msm8610") 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 echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core echo 787200 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq echo 300000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq setprop ro.qualcomm.perf.min_freq 7 echo 1 > /sys/kernel/mm/ksm/deferred_timer chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online ;; 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 # HMP scheduler settings for 8916, 8936, 8939 echo 2 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size # HMP Task packing settings for 8916, 8936, 8939 echo 50 > /proc/sys/kernel/sched_small_task echo 50 > /proc/sys/kernel/sched_mostly_idle_load echo 10 > /proc/sys/kernel/sched_mostly_idle_nr_run # Apply governor settings for 8916 case "$soc_id" in "206" | "247" | "248" | "249" | "250") # disable thermal core_control to update scaling_min_freq echo 0 > /sys/module/msm_thermal/core_control/enabled echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled 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 "1 800000: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 # Bring up all cores online 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 ;; esac # Apply governor settings for 8936 case "$soc_id" in "233" | "240" | "242") # disable thermal core_control to update scaling_min_freq, interactive gov echo 0 > /sys/module/msm_thermal/core_control/enabled echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled echo "25000 1113600: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 960000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy echo "1 800000:85 1113600:90 1267200: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 # Bring up all cores online 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 ;; esac # Apply governor settings for 8939 case "$soc_id" in "239" | "241" | "263") for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov done # disable thermal core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled # enable governor for perf cluster echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "25000 1113600: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 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "1 800000:85 1113600:90 1267200:80" > /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 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable governor for power cluster echo 1 > /sys/devices/system/cpu/cpu4/online echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo "25000 800000: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 800000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "1 499200:75 800000:80" > /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 499200 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq # enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled # Bring up all cores online 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 # HMP scheduler (big.Little cluster related) settings echo 60 > /proc/sys/kernel/sched_upmigrate echo 40 > /proc/sys/kernel/sched_downmigrate ;; esac ;; esac case "$target" in "msm8952") 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 "264" | "289") # Apply Scheduler and Governor settings for 8952 # HMP scheduler settings echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size echo 20000000 > /proc/sys/kernel/sched_ravg_window # HMP Task packing settings echo 20 > /proc/sys/kernel/sched_small_task echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu4/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu5/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu6/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu7/sched_prefer_idle for devfreq_gov in /sys/class/devfreq/*qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov done for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent do echo 20 > $cpu_io_percent done for cpu_guard_band in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/guard_band_mbps do echo 30 > $cpu_guard_band done done for gpu_bimc_io_percent in /sys/class/devfreq/qcom,gpubw*/bw_hwmon/io_percent do echo 40 > $gpu_bimc_io_percent done # disable thermal & BCL core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do bcl_hotplug_mask=`cat $hotplug_mask` echo 0 > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` echo 0 > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # enable governor for perf cluster echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "19000 1113600:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 1113600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "1 960000:85 1113600:90 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable governor for power cluster echo 1 > /sys/devices/system/cpu/cpu4/online echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 800000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "1 800000:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor echo 800000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq # re-enable thermal & BCL core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do echo $bcl_hotplug_mask > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do echo $bcl_soc_hotplug_mask > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # Bring up all cores online 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 # Keeping Low power modes disabled echo 1 > /sys/module/lpm_levels/parameters/sleep_disabled # HMP scheduler (big.Little cluster related) settings echo 93 > /proc/sys/kernel/sched_upmigrate echo 83 > /proc/sys/kernel/sched_downmigrate # Enable sched guided freq control echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo 50000 > /proc/sys/kernel/sched_freq_inc_notify echo 50000 > /proc/sys/kernel/sched_freq_dec_notify # Enable core control echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus echo 68 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms # Enable dynamic clock gating echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating # Enable timer migration to little cluster echo 1 > /proc/sys/kernel/power_aware_timer_migration # Set Memory parameters configure_memory_parameters ;; *) panel=`cat /sys/class/graphics/fb0/modes` if [ "${panel:5:1}" == "x" ]; then panel=${panel:2:3} else panel=${panel:2:4} fi # Apply Scheduler and Governor settings for 8976 # SoC IDs are 266, 274, 277, 278 # HMP scheduler (big.Little cluster related) settings echo 95 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate if [ $panel -gt 1080 ]; then echo 2 > /proc/sys/kernel/sched_window_stats_policy echo 5 > /proc/sys/kernel/sched_ravg_hist_size else echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu4/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu5/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu6/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu7/sched_prefer_idle fi echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run for devfreq_gov in /sys/class/devfreq/*qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov done for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent do echo 20 > $cpu_io_percent done for cpu_guard_band in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/guard_band_mbps do echo 30 > $cpu_guard_band done done for gpu_bimc_io_percent in /sys/class/devfreq/qcom,gpubw*/bw_hwmon/io_percent do echo 40 > $gpu_bimc_io_percent done # disable thermal & BCL core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do bcl_hotplug_mask=`cat $hotplug_mask` echo 0 > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` echo 0 > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # enable governor for power cluster echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable governor for perf cluster echo 1 > /sys/devices/system/cpu/cpu4/online echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor echo 883200 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq if [ $panel -gt 1080 ]; then echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 1017600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo "80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 1382400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 800000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo "19000 1382400:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo "85 1382400:90 1747200:80" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads # HMP Task packing settings for 8976 echo 30 > /proc/sys/kernel/sched_small_task echo 20 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load echo 20 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load else echo 39000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 806400 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo "1 691200:90" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 1190400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo "19000 1190400:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo "85 1190400:90 1747200:80" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads # HMP Task packing settings for 8976 echo 20 > /proc/sys/kernel/sched_small_task echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load fi # re-enable thermal & BCL core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do echo $bcl_hotplug_mask > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do echo $bcl_soc_hotplug_mask > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # Bring up all cores online 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 #Disable CPU retention modes for 32bit builds ProductName=`getprop ro.product.name` if [ "$ProductName" == "msm8952_32" ] || [ "$ProductName" == "msm8952_32_LMT" ]; then echo N > /sys/module/lpm_levels/system/a72/cpu4/retention/idle_enabled echo N > /sys/module/lpm_levels/system/a72/cpu5/retention/idle_enabled echo N > /sys/module/lpm_levels/system/a72/cpu6/retention/idle_enabled echo N > /sys/module/lpm_levels/system/a72/cpu7/retention/idle_enabled fi # Enable Low power modes echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # Enable sched guided freq control echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo 50000 > /proc/sys/kernel/sched_freq_inc_notify echo 50000 > /proc/sys/kernel/sched_freq_dec_notify # Enable core control echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/max_cpus echo 68 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres echo 40 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms # Enable timer migration to little cluster echo 1 > /proc/sys/kernel/power_aware_timer_migration # Set Memory parameters configure_memory_parameters ;; esac ;; esac case "$target" in "msm8953") 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 if [ -f /sys/devices/soc0/hw_platform ]; then hw_platform=`cat /sys/devices/soc0/hw_platform` else hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi case "$soc_id" in "293" | "304" | "338" ) # Start Host based Touch processing case "$hw_platform" in "MTP" | "Surf" | "RCM" ) #if this directory is present, it means that a #1200p panel is connected to the device. dir="/sys/bus/i2c/devices/3-0038" if [ ! -d "$dir" ]; then start_hbtp fi ;; esac #scheduler settings echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size #task packing settings echo 0 > /sys/devices/system/cpu/cpu0/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu1/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu2/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu3/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu4/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu5/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu6/sched_static_cpu_pwr_cost echo 0 > /sys/devices/system/cpu/cpu7/sched_static_cpu_pwr_cost #init task load, restrict wakeups to preferred cluster echo 15 > /proc/sys/kernel/sched_init_task_load # spill load is set to 100% by default in the kernel echo 3 > /proc/sys/kernel/sched_spill_nr_run # Apply inter-cluster load balancer restrictions echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov done for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor do echo "bw_hwmon" > $devfreq_gov for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent do echo 34 > $cpu_io_percent done for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps do echo 0 > $cpu_guard_band done for cpu_hist_memory in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hist_memory do echo 20 > $cpu_hist_memory done for cpu_hyst_length in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hyst_length do echo 10 > $cpu_hyst_length done for cpu_idle_mbps in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/idle_mbps do echo 1600 > $cpu_idle_mbps done for cpu_low_power_delay in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_delay do echo 20 > $cpu_low_power_delay done for cpu_low_power_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_io_percent do echo 34 > $cpu_low_power_io_percent done for cpu_mbps_zones in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/mbps_zones do echo "1611 3221 5859 6445 7104" > $cpu_mbps_zones done for cpu_sample_ms in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/sample_ms do echo 4 > $cpu_sample_ms done for cpu_up_scale in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/up_scale do echo 250 > $cpu_up_scale done for cpu_min_freq in /sys/class/devfreq/soc:qcom,cpubw/min_freq do echo 1611 > $cpu_min_freq done done for gpu_bimc_io_percent in /sys/class/devfreq/soc:qcom,gpubw/bw_hwmon/io_percent do echo 40 > $gpu_bimc_io_percent done # Configure DCC module to capture critical register contents when device crashes for DCC_PATH in /sys/bus/platform/devices/*.dcc* do echo 0 > $DCC_PATH/enable echo cap > $DCC_PATH/func_type echo sram > $DCC_PATH/data_sink echo 1 > $DCC_PATH/config_reset # Register specifies APC CPR closed-loop settled voltage for current voltage corner echo 0xb1d2c18 1 > $DCC_PATH/config # Register specifies SW programmed open-loop voltage for current voltage corner echo 0xb1d2900 1 > $DCC_PATH/config # Register specifies APM switch settings and APM FSM state echo 0xb1112b0 1 > $DCC_PATH/config # Register specifies CPR mode change state and also #online cores input to CPR HW echo 0xb018798 1 > $DCC_PATH/config echo 1 > $DCC_PATH/enable done # disable thermal & BCL core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do bcl_hotplug_mask=`cat $hotplug_mask` echo 0 > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` echo 0 > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done #governor settings echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "19000 1401600:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate echo 1401600 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy echo "85 1401600:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 39000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # re-enable thermal & BCL core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do echo $bcl_hotplug_mask > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do echo $bcl_soc_hotplug_mask > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # Bring up all cores online 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 # Enable low power modes echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # SMP scheduler echo 85 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate echo 19 > /proc/sys/kernel/sched_upmigrate_min_nice # Enable sched guided freq control echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif echo 200000 > /proc/sys/kernel/sched_freq_inc_notify echo 200000 > /proc/sys/kernel/sched_freq_dec_notify # Set Memory parameters configure_memory_parameters ;; esac ;; esac case "$target" in "msm8937") 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 if [ -f /sys/devices/soc0/hw_platform ]; then hw_platform=`cat /sys/devices/soc0/hw_platform` else hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi case "$soc_id" in "303" | "307" | "308" | "309" | "320" ) # Start Host based Touch processing case "$hw_platform" in "MTP" | "Surf" | "RCM" ) start_hbtp ;; esac # Apply Scheduler and Governor settings for 8917 / 8920 # HMP scheduler settings echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size echo 20000000 > /proc/sys/kernel/sched_ravg_window echo 1 > /proc/sys/kernel/sched_restrict_tasks_spread #disable sched_boost in 8917 echo 0 > /proc/sys/kernel/sched_boost # HMP Task packing settings echo 20 > /proc/sys/kernel/sched_small_task echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle # core_ctl is not needed for 8917. Disable it. echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/disable for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov done for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor do echo "bw_hwmon" > $devfreq_gov for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent do echo 20 > $cpu_io_percent done for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps do echo 30 > $cpu_guard_band done done for gpu_bimc_io_percent in /sys/class/devfreq/soc:qcom,gpubw/bw_hwmon/io_percent do echo 40 > $gpu_bimc_io_percent done # disable thermal core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "19000 1094400:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate echo 1094400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy echo "1 960000:85 1094400:90" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # re-enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled # Disable L2-GDHS low power modes echo N > /sys/module/lpm_levels/perf/perf-l2-gdhs/idle_enabled echo N > /sys/module/lpm_levels/perf/perf-l2-gdhs/suspend_enabled # Bring up all cores online echo 1 > /sys/devices/system/cpu/cpu1/online echo 1 > /sys/devices/system/cpu/cpu2/online echo 1 > /sys/devices/system/cpu/cpu3/online # Enable low power modes echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # Enable sched guided freq control echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif echo 50000 > /proc/sys/kernel/sched_freq_inc_notify echo 50000 > /proc/sys/kernel/sched_freq_dec_notify # Set rps mask echo 2 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus # Enable dynamic clock gating echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating # Enable timer migration to little cluster echo 1 > /proc/sys/kernel/power_aware_timer_migration # Set Memory parameters configure_memory_parameters ;; *) ;; esac case "$soc_id" in "294" | "295" | "313" ) # Start Host based Touch processing case "$hw_platform" in "MTP" | "Surf" | "RCM" ) start_hbtp ;; esac # Apply Scheduler and Governor settings for 8937/8940 # HMP scheduler settings echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size echo 20000000 > /proc/sys/kernel/sched_ravg_window #disable sched_boost in 8937 echo 0 > /proc/sys/kernel/sched_boost # HMP Task packing settings echo 20 > /proc/sys/kernel/sched_small_task echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load echo 30 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run echo 3 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu4/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu5/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu6/sched_prefer_idle echo 0 > /sys/devices/system/cpu/cpu7/sched_prefer_idle for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov done for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor do echo "bw_hwmon" > $devfreq_gov for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent do echo 20 > $cpu_io_percent done for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps do echo 30 > $cpu_guard_band done done for gpu_bimc_io_percent in /sys/class/devfreq/soc:qcom,gpubw/bw_hwmon/io_percent do echo 40 > $gpu_bimc_io_percent done # disable thermal core_control to update interactive gov and core_ctl settings echo 0 > /sys/module/msm_thermal/core_control/enabled # enable governor for perf cluster echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "19000 1094400:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 1094400 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "1 960000:85 1094400:90 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable governor for power cluster echo 1 > /sys/devices/system/cpu/cpu4/online echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "1 768000:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq # Disable L2-GDHS low power modes echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/suspend_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/suspend_enabled # Bring up all cores online 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 # Enable low power modes echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # HMP scheduler (big.Little cluster related) settings echo 93 > /proc/sys/kernel/sched_upmigrate echo 83 > /proc/sys/kernel/sched_downmigrate # Enable sched guided freq control echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo 50000 > /proc/sys/kernel/sched_freq_inc_notify echo 50000 > /proc/sys/kernel/sched_freq_dec_notify # Enable core control echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus echo 68 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster # re-enable thermal core_control echo 1 > /sys/module/msm_thermal/core_control/enabled # Enable dynamic clock gating echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating # Enable timer migration to little cluster echo 1 > /proc/sys/kernel/power_aware_timer_migration # Set Memory parameters configure_memory_parameters ;; *) ;; esac ;; esac case "$target" in "sdm660") # Set the default IRQ affinity to the primary cluster. When a # CPU is isolated/hotplugged, the IRQ affinity is adjusted # to one of the CPU from the default IRQ affinity mask. echo f > /proc/irq/default_smp_affinity 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 if [ -f /sys/devices/soc0/hw_platform ]; then hw_platform=`cat /sys/devices/soc0/hw_platform` else hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi panel=`cat /sys/class/graphics/fb0/modes` if [ "${panel:5:1}" == "x" ]; then panel=${panel:2:3} else panel=${panel:2:4} fi if [ $panel -gt 1080 ]; then echo 2 > /proc/sys/kernel/sched_window_stats_policy echo 5 > /proc/sys/kernel/sched_ravg_hist_size else echo 3 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size fi #Apply settings for sdm660 case "$soc_id" in "317" | "324" | "325" | "326" ) echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms echo 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres # Setting b.L scheduler parameters echo 96 > /proc/sys/kernel/sched_upmigrate echo 90 > /proc/sys/kernel/sched_downmigrate echo 200 > /proc/sys/kernel/sched_group_upmigrate echo 180 > /proc/sys/kernel/sched_group_downmigrate echo 0 > /proc/sys/kernel/sched_select_prev_cpu_us echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify echo 5 > /proc/sys/kernel/sched_spill_nr_run echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill echo 100000 > /proc/sys/kernel/sched_short_burst_ns # cpuset settings echo 0-3 > /dev/cpuset/background/cpus echo 0-3 > /dev/cpuset/system-background/cpus # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled # online CPU0 echo 1 > /sys/devices/system/cpu/cpu0/online # configure governor settings for little cluster echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo "19000 1401600:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 1401600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "85 1747200:95" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 39000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 633600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down # online CPU4 echo 1 > /sys/devices/system/cpu/cpu4/online # configure governor settings for big cluster echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo "19000 1401600:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "85 1401600:90 2150400:95" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 59000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo 1113600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/fast_ramp_down # bring all cores online echo 1 > /sys/devices/system/cpu/cpu0/online 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 # configure LPM echo N > /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled # enable LPM echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled # Set Memory parameters configure_memory_parameters # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* do echo "bw_hwmon" > $cpubw/governor echo 50 > $cpubw/polling_interval echo 762 > $cpubw/min_freq echo "1525 3143 5859 7759 9887 10327 11863 13763" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms echo 85 > $cpubw/bw_hwmon/io_percent echo 100 > $cpubw/bw_hwmon/decay_rate echo 50 > $cpubw/bw_hwmon/bw_step echo 20 > $cpubw/bw_hwmon/hist_memory echo 0 > $cpubw/bw_hwmon/hyst_length echo 80 > $cpubw/bw_hwmon/down_thres echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps echo 34 > $cpubw/bw_hwmon/low_power_io_percent echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps done for memlat in /sys/class/devfreq/*qcom,memlat-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval echo 400 > $memlat/mem_latency/ratio_ceil done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor # Start Host based Touch processing case "$hw_platform" in "MTP" | "Surf" | "RCM" | "QRD" ) start_hbtp ;; esac ;; esac #Apply settings for sdm630 case "$soc_id" in "318" | "327" ) # Start Host based Touch processing case "$hw_platform" in "MTP" | "Surf" | "RCM" | "QRD" ) start_hbtp ;; esac # Setting b.L scheduler parameters echo 85 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate echo 900 > /proc/sys/kernel/sched_group_upmigrate echo 900 > /proc/sys/kernel/sched_group_downmigrate echo 0 > /proc/sys/kernel/sched_select_prev_cpu_us echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify echo 3 > /proc/sys/kernel/sched_spill_nr_run #init task load, restrict wakeups to preferred cluster echo 15 > /proc/sys/kernel/sched_init_task_load echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill echo 50000 > /proc/sys/kernel/sched_short_burst_ns # cpuset settings echo 0-3 > /dev/cpuset/background/cpus echo 0-3 > /dev/cpuset/system-background/cpus # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do bcl_hotplug_mask=`cat $hotplug_mask` echo 0 > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` echo 0 > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # online CPU0 echo 1 > /sys/devices/system/cpu/cpu0/online # configure governor settings for Big cluster(CPU0 to CPU3) echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo "19000 1344000:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 1344000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "85 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 39000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 787200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif # online CPU4 echo 1 > /sys/devices/system/cpu/cpu4/online # configure governor settings for Little cluster(CPU4 to CPU7) echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo "19000 1094400:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 1094400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "85 1094400:80" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo 614400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif # bring all cores online echo 1 > /sys/devices/system/cpu/cpu0/online 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 # configure LPM echo N > /sys/module/lpm_levels/system/perf/cpu0/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu1/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu2/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu3/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu4/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu5/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu6/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu7/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled # enable LPM echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do echo $bcl_hotplug_mask > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do echo $bcl_soc_hotplug_mask > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # Set Memory parameters configure_memory_parameters # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* do echo "bw_hwmon" > $cpubw/governor echo 50 > $cpubw/polling_interval echo 762 > $cpubw/min_freq echo "1525 3143 4173 5195 5859 7759 9887 10327" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms echo 85 > $cpubw/bw_hwmon/io_percent echo 20 > $cpubw/bw_hwmon/hist_memory echo 0 > $cpubw/bw_hwmon/hyst_length echo 100 > $cpubw/bw_hwmon/decay_rate echo 50 > $cpubw/bw_hwmon/bw_step echo 80 > $cpubw/bw_hwmon/down_thres echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps echo 50 > $cpubw/bw_hwmon/low_power_io_percent echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps done for memlat in /sys/class/devfreq/*qcom,memlat-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval echo 400 > $memlat/mem_latency/ratio_ceil done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor ;; esac ;; esac case "$target" in "apq8084") 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/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/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/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled echo 0 > /sys/module/msm_thermal/core_control/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 for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor do echo "cpubw_hwmon" > $devfreq_gov done echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 1497600 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 20 > /sys/module/cpu_boost/parameters/boost_ms echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms echo 1 > /dev/cpuctl/apps/cpu.notify_on_migrate echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq echo 1 > /sys/module/msm_thermal/core_control/enabled setprop ro.qualcomm.perf.cores_online 2 chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/mfreq chmod -h 220 /sys/devices/system/cpu/mfreq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online ;; esac case "$target" in "mpq8092") 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/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/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/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled echo 0 > /sys/module/msm_thermal/core_control/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 echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq echo 1 > /sys/module/msm_thermal/core_control/enabled chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/mfreq chmod -h 220 /sys/devices/system/cpu/mfreq chown -h root.system /sys/devices/system/cpu/cpu1/online chown -h root.system /sys/devices/system/cpu/cpu2/online chown -h root.system /sys/devices/system/cpu/cpu3/online chmod -h 664 /sys/devices/system/cpu/cpu1/online chmod -h 664 /sys/devices/system/cpu/cpu2/online chmod -h 664 /sys/devices/system/cpu/cpu3/online ;; esac case "$target" in "msm8992") # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled echo -n disable > /sys/devices/soc.*/qcom,bcl.*/mode bcl_hotplug_mask=`cat /sys/devices/soc.*/qcom,bcl.*/hotplug_mask` echo 0 > /sys/devices/soc.*/qcom,bcl.*/hotplug_mask echo -n enable > /sys/devices/soc.*/qcom,bcl.*/mode echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # configure governor settings for little cluster echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 80000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # online CPU4 echo 1 > /sys/devices/system/cpu/cpu4/online # configure governor settings for big cluster echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 1536000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 80000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo 384000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled echo -n disable > /sys/devices/soc.*/qcom,bcl.*/mode echo $bcl_hotplug_mask > /sys/devices/soc.*/qcom,bcl.*/hotplug_mask echo $bcl_soc_hotplug_mask > /sys/devices/soc.*/qcom,bcl.*/hotplug_soc_mask echo -n enable > /sys/devices/soc.*/qcom,bcl.*/mode # plugin remaining A57s echo 1 > /sys/devices/system/cpu/cpu5/online # input boost configuration echo 0:1248000 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms # Enable task migration fixups in the scheduler echo 1 > /proc/sys/kernel/sched_migration_fixup for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov done #enable rps static configuration echo 8 > /sys/class/net/rmnet_ipa0/queues/rx-0/rps_cpus echo 30 > /proc/sys/kernel/sched_small_task ;; esac case "$target" in "msm8994") # ensure at most one A57 is online when thermal hotplug is disabled echo 0 > /sys/devices/system/cpu/cpu5/online echo 0 > /sys/devices/system/cpu/cpu6/online echo 0 > /sys/devices/system/cpu/cpu7/online # in case CPU4 is online, limit its frequency echo 960000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq # Limit A57 max freq from msm_perf module in case CPU 4 is offline echo "4:960000 5:960000 6:960000 7:960000" > /sys/module/msm_performance/parameters/cpu_max_freq # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do bcl_hotplug_mask=`cat $hotplug_mask` echo 0 > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` echo 0 > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # configure governor settings for little cluster echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 80000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # online CPU4 echo 1 > /sys/devices/system/cpu/cpu4/online # Best effort limiting for first time boot if msm_performance module is absent echo 960000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq # configure governor settings for big cluster echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo "19000 1400000:39000 1700000:19000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 1248000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 80000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo 384000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq # restore A57's max cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n disable > $mode done for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask do echo $bcl_hotplug_mask > $hotplug_mask done for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask do echo $bcl_soc_hotplug_mask > $hotplug_soc_mask done for mode in /sys/devices/soc.0/qcom,bcl.*/mode do echo -n enable > $mode done # plugin remaining A57s echo 1 > /sys/devices/system/cpu/cpu5/online echo 1 > /sys/devices/system/cpu/cpu6/online echo 1 > /sys/devices/system/cpu/cpu7/online echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled # Restore CPU 4 max freq from msm_performance echo "4:4294967295 5:4294967295 6:4294967295 7:4294967295" > /sys/module/msm_performance/parameters/cpu_max_freq # input boost configuration echo 0:1344000 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms # Setting b.L scheduler parameters echo 1 > /proc/sys/kernel/sched_migration_fixup echo 30 > /proc/sys/kernel/sched_small_task echo 20 > /proc/sys/kernel/sched_mostly_idle_load echo 3 > /proc/sys/kernel/sched_mostly_idle_nr_run echo 99 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify #enable rps static configuration echo 8 > /sys/class/net/rmnet_ipa0/queues/rx-0/rps_cpus for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov done ;; esac case "$target" in "msm8996") # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode bcl_hotplug_mask=`cat /sys/devices/soc/soc:qcom,bcl/hotplug_mask` echo 0 > /sys/devices/soc/soc:qcom,bcl/hotplug_mask bcl_soc_hotplug_mask=`cat /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask` echo 0 > /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask echo -n enable > /sys/devices/soc/soc:qcom,bcl/mode # configure governor settings for little cluster echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 79000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif # online CPU2 echo 1 > /sys/devices/system/cpu/cpu2/online # configure governor settings for big cluster echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif echo "19000 1400000:39000 1700000:19000 2100000:79000" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate echo 1248000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy echo "85 1500000:90 1800000:70 2100000:95" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads echo 19000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time echo 79000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode echo $bcl_hotplug_mask > /sys/devices/soc/soc:qcom,bcl/hotplug_mask echo $bcl_soc_hotplug_mask > /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask echo -n enable > /sys/devices/soc/soc:qcom,bcl/mode # input boost configuration echo "0:1324800 2:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms # Setting b.L scheduler parameters echo 0 > /proc/sys/kernel/sched_boost echo 1 > /proc/sys/kernel/sched_migration_fixup echo 45 > /proc/sys/kernel/sched_downmigrate echo 45 > /proc/sys/kernel/sched_upmigrate echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify echo 3 > /proc/sys/kernel/sched_spill_nr_run echo 100 > /proc/sys/kernel/sched_init_task_load # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* do echo "bw_hwmon" > $cpubw/governor echo 50 > $cpubw/polling_interval echo 1525 > $cpubw/min_freq echo "1525 5195 11863 13763" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms echo 34 > $cpubw/bw_hwmon/io_percent echo 20 > $cpubw/bw_hwmon/hist_memory echo 10 > $cpubw/bw_hwmon/hyst_length echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps echo 34 > $cpubw/bw_hwmon/low_power_io_percent echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps done for memlat in /sys/class/devfreq/*qcom,memlat-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor soc_revision=`cat /sys/devices/soc0/revision` if [ "$soc_revision" == "2.0" ]; then #Disable suspend for v2.0 echo pwr_dbg > /sys/power/wake_lock elif [ "$soc_revision" == "2.1" ]; then # Enable C4.D4.E4.M3 LPM modes # Disable D3 state echo 0 > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled echo 0 > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled # Disable DEF-FPC mode echo N > /sys/module/lpm_levels/system/pwr/cpu0/fpc-def/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu1/fpc-def/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu2/fpc-def/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu3/fpc-def/idle_enabled else # Enable all LPMs by default # This will enable C4, D4, D3, E4 and M3 LPMs echo N > /sys/module/lpm_levels/parameters/sleep_disabled fi echo N > /sys/module/lpm_levels/parameters/sleep_disabled # Starting io prefetcher service start iop # Set Memory parameters configure_memory_parameters ;; esac case "$target" in "sdm845") # Set the default IRQ affinity to the silver cluster. When a # CPU is isolated/hotplugged, the IRQ affinity is adjusted # to one of the CPU from the default IRQ affinity mask. echo f > /proc/irq/default_smp_affinity 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 "321") #sdm845 start_hbtp ;; esac # Core control parameters echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms echo 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres # Setting b.L scheduler parameters echo 95 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate echo 100 > /proc/sys/kernel/sched_group_upmigrate echo 95 > /proc/sys/kernel/sched_group_downmigrate echo 0 > /proc/sys/kernel/sched_select_prev_cpu_us echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify echo 5 > /proc/sys/kernel/sched_spill_nr_run echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill # configure governor settings for little cluster echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us echo 1209600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq # configure governor settings for big cluster echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/rate_limit_us echo 1574400 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* do echo "bw_hwmon" > $cpubw/governor echo 50 > $cpubw/polling_interval echo "2288 4577 6500 8132 9155 10681" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms echo 34 > $cpubw/bw_hwmon/io_percent echo 20 > $cpubw/bw_hwmon/hist_memory echo 10 > $cpubw/bw_hwmon/hyst_length echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps echo 34 > $cpubw/bw_hwmon/low_power_io_percent echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps done for llccbw in /sys/class/devfreq/*qcom,llccbw* do echo "bw_hwmon" > $llccbw/governor echo 50 > $llccbw/polling_interval echo "1720 2929 4943 5931 6881" > $llccbw/bw_hwmon/mbps_zones echo 4 > $llccbw/bw_hwmon/sample_ms echo 68 > $llccbw/bw_hwmon/io_percent echo 20 > $llccbw/bw_hwmon/hist_memory echo 10 > $llccbw/bw_hwmon/hyst_length echo 0 > $llccbw/bw_hwmon/low_power_ceil_mbps echo 68 > $llccbw/bw_hwmon/low_power_io_percent echo 20 > $llccbw/bw_hwmon/low_power_delay echo 0 > $llccbw/bw_hwmon/guard_band_mbps echo 250 > $llccbw/bw_hwmon/up_scale echo 1600 > $llccbw/bw_hwmon/idle_mbps done #Enable mem_latency governor for DDR scaling for memlat in /sys/class/devfreq/*qcom,memlat-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval echo 400 > $memlat/mem_latency/ratio_ceil done #Enable mem_latency governor for L3 scaling for memlat in /sys/class/devfreq/*qcom,l3-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval echo 400 > $memlat/mem_latency/ratio_ceil done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor # cpuset parameters echo 0-3 > /dev/cpuset/background/cpus echo 0-3 > /dev/cpuset/system-background/cpus # Turn off scheduler boost at the end echo 0 > /proc/sys/kernel/sched_boost # Turn on sleep modes. echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled #Disable CX PC echo 49 385 > /d/regulator/soc:rpmh-regulator-cxlvl-pm8998_s9_level/voltage echo 1 > /d/regulator/soc:rpmh-regulator-cxlvl-pm8998_s9_level/enable ;; esac case "$target" in "msm8998" | "apq8098_latv") echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms echo 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres # Setting b.L scheduler parameters echo 1 > /proc/sys/kernel/sched_migration_fixup echo 95 > /proc/sys/kernel/sched_upmigrate echo 90 > /proc/sys/kernel/sched_downmigrate echo 100 > /proc/sys/kernel/sched_group_upmigrate echo 95 > /proc/sys/kernel/sched_group_downmigrate echo 0 > /proc/sys/kernel/sched_select_prev_cpu_us echo 400000 > /proc/sys/kernel/sched_freq_inc_notify echo 400000 > /proc/sys/kernel/sched_freq_dec_notify echo 5 > /proc/sys/kernel/sched_spill_nr_run echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill start iop # disable thermal bcl hotplug to switch governor echo 0 > /sys/module/msm_thermal/core_control/enabled # online CPU0 echo 1 > /sys/devices/system/cpu/cpu0/online # configure governor settings for little cluster echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate echo 1248000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy echo "83 1804800:95" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 79000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif # online CPU4 echo 1 > /sys/devices/system/cpu/cpu4/online # configure governor settings for big cluster echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif echo 19000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate echo 1574400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy echo "83 1939200:90 2016000:95" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 19000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 79000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis echo 300000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled # Enable input boost configuration echo "0:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* do echo "bw_hwmon" > $cpubw/governor echo 50 > $cpubw/polling_interval echo 1525 > $cpubw/min_freq echo "3143 5859 11863 13763" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms echo 34 > $cpubw/bw_hwmon/io_percent echo 20 > $cpubw/bw_hwmon/hist_memory echo 10 > $cpubw/bw_hwmon/hyst_length echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps echo 34 > $cpubw/bw_hwmon/low_power_io_percent echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps done for memlat in /sys/class/devfreq/*qcom,memlat-cpu* do echo "mem_latency" > $memlat/governor echo 10 > $memlat/polling_interval echo 400 > $memlat/mem_latency/ratio_ceil done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor 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 if [ -f /sys/devices/soc0/hw_platform ]; then hw_platform=`cat /sys/devices/soc0/hw_platform` else hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi if [ -f /sys/devices/soc0/platform_version ]; then platform_version=`cat /sys/devices/soc0/platform_version` platform_major_version=$((10#${platform_version}>>16)) fi if [ -f /sys/devices/soc0/platform_subtype_id ]; then platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` fi case "$soc_id" in "292") #msm8998 apq8098_latv # Start Host based Touch processing case "$hw_platform" in "QRD") case "$platform_subtype_id" in "0") start_hbtp ;; "16") if [ $platform_major_version -lt 6 ]; then start_hbtp fi ;; esac ;; esac ;; esac echo N > /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled echo N > /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled echo N > /sys/module/lpm_levels/parameters/sleep_disabled echo 0-3 > /dev/cpuset/background/cpus echo 0-3 > /dev/cpuset/system-background/cpus echo 0 > /proc/sys/kernel/sched_boost ;; esac case "$target" in "msm8909") 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 # HMP scheduler settings for 8909 similiar to 8916 echo 2 > /proc/sys/kernel/sched_window_stats_policy echo 3 > /proc/sys/kernel/sched_ravg_hist_size # HMP Task packing settings for 8909 similiar to 8916 echo 30 > /proc/sys/kernel/sched_small_task echo 50 > /proc/sys/kernel/sched_mostly_idle_load echo 10 > /proc/sys/kernel/sched_mostly_idle_nr_run # Apply governor settings for 8909 # disable thermal core_control to update scaling_min_freq echo 0 > /sys/module/msm_thermal/core_control/enabled echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 400000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled echo "25000 800000: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 800000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy echo "1 400000: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 # Bring up all cores online 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 0 > /sys/module/lpm_levels/parameters/sleep_disabled for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov done # Set Memory parameters configure_memory_parameters ;; esac case "$target" in "msm7627_ffa" | "msm7627_surf" | "msm7627_6x") echo 25000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate ;; esac case "$target" in "qsd8250_surf" | "qsd8250_ffa" | "qsd8650a_st1x") echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate ;; esac case "$target" in "qsd8650a_st1x") mount -t debugfs none /sys/kernel/debug ;; esac chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor chown -h system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy emmc_boot=`getprop ro.boot.emmc` case "$emmc_boot" in "true") chown -h system /sys/devices/platform/rs300000a7.65536/force_sync chown -h system /sys/devices/platform/rs300000a7.65536/sync_sts chown -h system /sys/devices/platform/rs300100a7.65536/force_sync chown -h system /sys/devices/platform/rs300100a7.65536/sync_sts ;; esac case "$target" in "msm8960" | "msm8660" | "msm7630_surf") echo 10 > /sys/devices/platform/msm_sdcc.3/idle_timeout ;; "msm7627a") echo 10 > /sys/devices/platform/msm_sdcc.1/idle_timeout ;; esac # Post-setup services case "$target" in "msm8660" | "msm8960" | "msm8226" | "msm8610" | "mpq8092" ) start mpdecision ;; "msm8916") setprop sys.post_boot.parsed 1 ;; "msm8909") setprop sys.post_boot.parsed 1 ;; "msm8952") setprop sys.post_boot.parsed 1 ;; "msm8937" | "msm8953") echo 128 > /sys/block/mmcblk0/bdi/read_ahead_kb echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb echo 128 > /sys/block/dm-0/queue/read_ahead_kb echo 128 > /sys/block/dm-1/queue/read_ahead_kb setprop sys.post_boot.parsed 1 start gamed ;; "msm8974") start mpdecision echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb ;; "msm8994" | "msm8992" | "msm8996" | "msm8998" | "sdm660" | "apq8098_latv" | "sdm845") setprop sys.post_boot.parsed 1 ;; "apq8084") rm /data/system/perfd/default_values start mpdecision echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb echo 512 > /sys/block/sda/bdi/read_ahead_kb echo 512 > /sys/block/sdb/bdi/read_ahead_kb echo 512 > /sys/block/sdc/bdi/read_ahead_kb echo 512 > /sys/block/sdd/bdi/read_ahead_kb echo 512 > /sys/block/sde/bdi/read_ahead_kb echo 512 > /sys/block/sdf/bdi/read_ahead_kb echo 512 > /sys/block/sdg/bdi/read_ahead_kb echo 512 > /sys/block/sdh/bdi/read_ahead_kb ;; "msm7627a") 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 "127" | "128" | "129") start mpdecision ;; esac ;; esac # Enable Power modes and set the CPU Freq Sampling rates case "$target" in "msm7627a") start qosmgrd echo 1 > /sys/module/pm2/modes/cpu0/standalone_power_collapse/idle_enabled echo 1 > /sys/module/pm2/modes/cpu1/standalone_power_collapse/idle_enabled echo 1 > /sys/module/pm2/modes/cpu0/standalone_power_collapse/suspend_enabled echo 1 > /sys/module/pm2/modes/cpu1/standalone_power_collapse/suspend_enabled #SuspendPC: echo 1 > /sys/module/pm2/modes/cpu0/power_collapse/suspend_enabled #IdlePC: echo 1 > /sys/module/pm2/modes/cpu0/power_collapse/idle_enabled echo 25000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate ;; esac # Change adj level and min_free_kbytes setting for lowmemory killer to kick in case "$target" in "msm7627a") echo 0,1,2,4,9,12 > /sys/module/lowmemorykiller/parameters/adj echo 5120 > /proc/sys/vm/min_free_kbytes ;; esac # Install AdrenoTest.apk if not already installed if [ -f /data/prebuilt/AdrenoTest.apk ]; then if [ ! -d /data/data/com.qualcomm.adrenotest ]; then pm install /data/prebuilt/AdrenoTest.apk fi fi # Install SWE_Browser.apk if not already installed if [ -f /data/prebuilt/SWE_AndroidBrowser.apk ]; then if [ ! -d /data/data/com.android.swe.browser ]; then pm install /data/prebuilt/SWE_AndroidBrowser.apk fi fi # Change adj level and min_free_kbytes setting for lowmemory killer to kick in case "$target" in "msm8660") start qosmgrd echo 0,1,2,4,9,12 > /sys/module/lowmemorykiller/parameters/adj echo 5120 > /proc/sys/vm/min_free_kbytes ;; esac # Let kernel know our image version/variant/crm_version if [ -f /sys/devices/soc0/select_image ]; then image_version="10:" image_version+=`getprop ro.build.id` image_version+=":" image_version+=`getprop ro.build.version.incremental` image_variant=`getprop ro.product.name` image_variant+="-" image_variant+=`getprop ro.build.type` oem_version=`getprop ro.build.version.codename` echo 10 > /sys/devices/soc0/select_image echo $image_version > /sys/devices/soc0/image_version echo $image_variant > /sys/devices/soc0/image_variant echo $oem_version > /sys/devices/soc0/image_crm_version fi # Change console log level as per console config property console_config=`getprop persist.console.silent.config` case "$console_config" in "1") echo "Enable console config to $console_config" echo 0 > /proc/sys/kernel/printk ;; *) echo "Enable console config to $console_config" ;; esac