2018-07-19 12:48:02 +02:00
|
|
|
# Copyright (c) 2016, Code Aurora Forum. 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 Code Aurora 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
|
|
|
|
# Disable UFS powersaving
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 0
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 0
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/${ro.boot.bootdevice}:ufs_variant/pm_qos_enable 0
|
|
|
|
write /sys/module/lpm_levels/parameters/sleep_disabled "Y"
|
|
|
|
|
|
|
|
# Drop write bit from cpu_max_freq so that libqti-perfd can't set it
|
|
|
|
chmod 0444 /sys/module/msm_performance/parameters/cpu_max_freq
|
|
|
|
|
|
|
|
on boot
|
|
|
|
# Update foreground and background cpusets
|
|
|
|
write /dev/cpuset/foreground/cpus 0-3
|
|
|
|
write /dev/cpuset/background/cpus 0-3
|
|
|
|
write /dev/cpuset/system-background/cpus 0-3
|
|
|
|
write /dev/cpuset/top-app/cpus 0-3
|
|
|
|
|
|
|
|
# Add a cpuset for the camera daemon
|
|
|
|
# we want all cores for camera
|
|
|
|
mkdir /dev/cpuset/camera-daemon
|
|
|
|
write /dev/cpuset/camera-daemon/cpus 0-3
|
|
|
|
write /dev/cpuset/camera-daemon/mems 0
|
|
|
|
chown system system /dev/cpuset/camera-daemon
|
|
|
|
chown system system /dev/cpuset/camera-daemon/tasks
|
|
|
|
chmod 0664 /dev/cpuset/camera-daemon/tasks
|
|
|
|
|
|
|
|
# Enable sched boost
|
|
|
|
write /proc/sys/kernel/sched_boost 1
|
|
|
|
|
|
|
|
on charger
|
|
|
|
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
|
|
|
# Enable UFS powersaving
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/${ro.boot.bootdevice}:ufs_variant/pm_qos_enable 1
|
|
|
|
write /sys/module/lpm_levels/parameters/sleep_disabled "N"
|
|
|
|
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "userspace"
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed 300000
|
|
|
|
write /sys/devices/system/cpu/cpu1/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "userspace"
|
|
|
|
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed 300000
|
|
|
|
write /sys/devices/system/cpu/cpu2/online 0
|
|
|
|
write /sys/devices/system/cpu/cpu3/online 0
|
|
|
|
write /sys/module/msm_thermal/parameters/enabled "N"
|
2019-02-11 21:56:38 +01:00
|
|
|
start vendor.hvdcp_opti
|
2018-07-19 12:48:02 +02:00
|
|
|
start thermal-engine
|
|
|
|
|
|
|
|
on enable-low-power
|
|
|
|
# Disable thermal hotplug to switch governor
|
|
|
|
write /sys/module/msm_thermal/core_control/enabled 0
|
|
|
|
|
|
|
|
# Enable Adaptive LMK
|
|
|
|
write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1
|
|
|
|
write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 81250
|
|
|
|
|
|
|
|
# Set sync wakee policy tunable
|
|
|
|
write /proc/sys/kernel/sched_prefer_sync_wakee_to_waker 1
|
|
|
|
|
|
|
|
# Configure governor settings for little cluster
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load 1
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif 1
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 19000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 90
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 960000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads 80
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 19000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis 79000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 307200
|
2019-02-11 21:56:38 +01:00
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif 0
|
2018-07-19 12:48:02 +02:00
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction 1
|
|
|
|
|
|
|
|
# Bring CPU2 online
|
|
|
|
write /sys/devices/system/cpu/cpu2/online 1
|
|
|
|
|
|
|
|
# Configure governor settings for big cluster
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "interactive"
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load 1
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif 1
|
2019-02-11 21:56:38 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:39000 2100000:79000"
|
2018-07-19 12:48:02 +02:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load 90
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate 20000
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq 1248000
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy 1
|
2019-02-11 21:56:38 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads "85 1500000:90 1800000:95 2100000:99"
|
2018-07-19 12:48:02 +02:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time 19000
|
2019-02-11 21:56:38 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis 39000
|
2018-07-19 12:48:02 +02:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 307200
|
2019-02-11 21:56:38 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif 0
|
2018-07-19 12:48:02 +02:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction 1
|
|
|
|
|
|
|
|
# Re-enable thermal hotplug
|
|
|
|
write /sys/module/msm_thermal/core_control/enabled 1
|
|
|
|
|
|
|
|
# Input boost config
|
|
|
|
write /sys/module/cpu_boost/parameters/input_boost_freq "0:1324800 2:1324800"
|
|
|
|
write /sys/module/cpu_boost/parameters/input_boost_ms 40
|
|
|
|
|
|
|
|
# Set big.LITTLE scheduler parameters
|
|
|
|
write /proc/sys/kernel/sched_boost 0
|
|
|
|
write /proc/sys/kernel/sched_upmigrate 95
|
|
|
|
write /proc/sys/kernel/sched_downmigrate 90
|
|
|
|
write /proc/sys/kernel/sched_freq_inc_notify 400000
|
|
|
|
write /proc/sys/kernel/sched_freq_dec_notify 400000
|
|
|
|
write /proc/sys/kernel/sched_spill_nr_run 3
|
|
|
|
write /proc/sys/kernel/sched_init_task_load 100
|
|
|
|
|
|
|
|
# Enable bus-dcvs
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/governor "bw_hwmon"
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/polling_interval 50
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/min_freq 1525
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/mbps_zones "1525 5195 11863 13763"
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/sample_ms 4
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent 34
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hist_memory 20
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hyst_length 10
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_ceil_mbps 0
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_io_percent 34
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_delay 20
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps 0
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/up_scale 250
|
|
|
|
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/idle_mbps 1600
|
|
|
|
|
|
|
|
write /sys/class/devfreq/soc:qcom,memlat-cpu0/governor "mem_latency"
|
|
|
|
write /sys/class/devfreq/soc:qcom,memlat-cpu0/polling_interval 10
|
|
|
|
write /sys/class/devfreq/soc:qcom,memlat-cpu2/governor "mem_latency"
|
|
|
|
write /sys/class/devfreq/soc:qcom,memlat-cpu2/polling_interval 10
|
|
|
|
write /sys/class/devfreq/soc:qcom,mincpubw/governor "cpufreq"
|
|
|
|
|
|
|
|
# Enable UFS powersaving
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1
|
|
|
|
write /sys/devices/soc/${ro.boot.bootdevice}/${ro.boot.bootdevice}:ufs_variant/pm_qos_enable 1
|
|
|
|
|
|
|
|
# Enable all LPMs (this will enable C4, D4, D3, E4 and M3 LPMs)
|
|
|
|
write /sys/module/lpm_levels/parameters/sleep_disabled "N"
|
|
|
|
|
|
|
|
# Set perfd properties
|
2021-05-12 15:30:36 +02:00
|
|
|
setprop vendor.post_boot.parsed 1
|
2018-07-19 12:48:02 +02:00
|
|
|
|
|
|
|
on property:sys.boot_completed=1
|
|
|
|
trigger enable-low-power
|
|
|
|
|
|
|
|
# Set I/O squeduler
|
|
|
|
setprop sys.io.scheduler "bfq"
|
|
|
|
|
|
|
|
# Start I/O prefetcher service
|
|
|
|
start iop
|
|
|
|
|
2019-02-11 21:56:38 +01:00
|
|
|
# Update cpusets now that boot is complete and we want better load balancing
|
|
|
|
write /dev/cpuset/top-app/cpus 0-3
|
|
|
|
write /dev/cpuset/foreground/cpus 0-2
|
|
|
|
write /dev/cpuset/background/cpus 0
|
|
|
|
write /dev/cpuset/system-background/cpus 0-2
|
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
on property:init.svc.recovery=running
|
|
|
|
trigger enable-low-power
|
|
|
|
|
2021-05-12 15:30:36 +02:00
|
|
|
service vendor.charger /system/bin/chargeonlymode
|
2018-07-19 12:51:34 +02:00
|
|
|
class charger
|
2021-05-12 15:30:36 +02:00
|
|
|
user system
|
|
|
|
group system graphics input
|
|
|
|
capabilities SYS_BOOT
|
|
|
|
seclabel u:r:charger:s0
|
2018-07-19 12:48:02 +02:00
|
|
|
|
|
|
|
service energy-awareness /vendor/bin/energy-awareness
|
|
|
|
class main
|
|
|
|
user root
|
|
|
|
group system
|
|
|
|
oneshot
|
|
|
|
|
2019-02-11 21:56:38 +01:00
|
|
|
service vendor.hvdcp_opti /vendor/bin/hvdcp_opti
|
2018-07-19 12:48:02 +02:00
|
|
|
class main
|
|
|
|
user root
|
|
|
|
group system wakelock
|