2019-10-07 08:07:36 +00:00
|
|
|
# Copyright (c) 2009-2012, 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
on init
|
|
|
|
# HMP scheduler settings
|
|
|
|
write /proc/sys/kernel/sched_ravg_hist_size 3
|
|
|
|
write /proc/sys/kernel/sched_window_stats_policy 3
|
|
|
|
|
|
|
|
# HMP Task packing settings for 8226
|
|
|
|
write /proc/sys/kernel/sched_small_task 50
|
|
|
|
|
2019-09-04 05:37:57 +00:00
|
|
|
# disable thermal core_control to update governor settings
|
2019-10-07 08:07:36 +00:00
|
|
|
write /sys/module/msm_thermal/core_control/enabled 0
|
|
|
|
|
2019-09-04 05:37:57 +00:00
|
|
|
# Switch to ondemand gonvernor
|
2019-10-07 08:07:36 +00:00
|
|
|
write /sys/devices/system/cpu/cpu0/online 1
|
2019-09-04 05:37:57 +00:00
|
|
|
write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 11
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 85
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 2
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core 70
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core 10
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq 787200
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/sync_freq 300000
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/step_up_early_hispeed 998400
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/step_up_interim_hispeed 1094400
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load 80
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 787200
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_early_factor 1
|
|
|
|
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_interim_factor 1
|
2019-10-07 08:07:36 +00:00
|
|
|
|
|
|
|
# enable thermal core_control now
|
|
|
|
write /sys/module/msm_thermal/core_control/enabled 1
|
|
|
|
|
|
|
|
# bring all CPUs online
|
|
|
|
write /sys/devices/system/cpu/cpu1/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu2/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu3/online 1
|
|
|
|
|
|
|
|
# Enable low power modes
|
|
|
|
write /sys/module/lpm_levels/parameters/sleep_disabled 0
|
|
|
|
write /sys/module/lpm_levels/enable_low_power/l2 4
|
|
|
|
|
|
|
|
# Set RPS mask
|
|
|
|
write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 2
|
|
|
|
|
|
|
|
# add a cpuset for the camera daemon
|
|
|
|
# we want all the cores for camera
|
|
|
|
mkdir /dev/cpuset/camera-daemon
|
|
|
|
chown system system /dev/cpuset/camera-daemon
|
|
|
|
chown system system /dev/cpuset/camera-daemon/tasks
|
|
|
|
chmod 0664 /dev/cpuset/camera-daemon/tasks
|
|
|
|
|
|
|
|
# Update foreground and background cpusets
|
|
|
|
# Reserve CPU 3 for the top app
|
|
|
|
write /dev/cpuset/foreground/cpus 0-2
|
|
|
|
write /dev/cpuset/background/cpus 0-2
|
|
|
|
write /dev/cpuset/system-background/cpus 0-1
|
|
|
|
write /dev/cpuset/top-app/cpus 0-3
|
|
|
|
write /dev/cpuset/camera-daemon/cpus 0-3
|
|
|
|
|
|
|
|
on charger
|
|
|
|
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system wait ro
|
|
|
|
|
|
|
|
wait /dev/block/platform/msm_sdcc.1/by-name/userdata
|
|
|
|
check_fs /dev/block/platform/msm_sdcc.1/by-name/userdata ext4
|
|
|
|
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata /data nosuid nodev noatime noauto_da_alloc,discard,journal_async_commit,errors=panic
|
|
|
|
chown system system /data
|
|
|
|
chmod 0771 /data
|
|
|
|
|
|
|
|
class_start charger
|
|
|
|
write /sys/devices/system/cpu/cpu1/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu2/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu3/online 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
|
|
|
|
write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 0
|
|
|
|
write /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled 0
|
|
|
|
write /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled 0
|
|
|
|
write /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled 0
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
|
|
|
|
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "interactive"
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "interactive"
|
|
|
|
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "interactive"
|
|
|
|
|
|
|
|
on property:sys.boot_completed=1
|
2019-02-22 00:04:45 +00:00
|
|
|
setprop vendor.post_boot.parsed 1
|
2019-10-07 08:07:36 +00:00
|
|
|
# Post boot services
|
|
|
|
rm /data/system/perfd/default_values
|
|
|
|
start mpdecision
|
|
|
|
|
|
|
|
on class_start:late_start
|
|
|
|
trigger enable-low-power
|
|
|
|
|
|
|
|
on property:init.svc.recovery=running
|
|
|
|
trigger enable-low-power
|