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
|
|
|
|
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
|
|
|
|
# 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
|
|
|
|
|
|
|
|
on charger
|
|
|
|
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
2021-09-22 14:54:56 +02:00
|
|
|
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
|
|
|
|
|
|
|
|
wait /dev/block/bootdevice/by-name/efs
|
|
|
|
mount ext4 /dev/block/bootdevice/by-name/efs /efs nosuid nodev noatime noauto_da_alloc,discard,data=ordered,errors=panic
|
|
|
|
mkdir /efs/Battery 0775 radio system
|
|
|
|
chown radio system /efs/Battery
|
|
|
|
chmod 0775 /efs/Battery
|
|
|
|
chmod 0664 /sys/class/power_supply/battery/batt_temp_table
|
|
|
|
chown system radio /sys/class/power_supply/battery/batt_temp_table
|
|
|
|
chmod 0664 /sys/class/power_supply/battery/batt_capacity_max
|
|
|
|
chown system radio /sys/class/power_supply/battery/batt_capacity_max
|
|
|
|
chmod 0664 /efs/Battery/batt_capacity_max
|
|
|
|
chown radio system /efs/Battery/batt_capacity_max
|
|
|
|
chmod 0664 /sys/class/power_supply/battery/battery_cycle
|
|
|
|
chown system radio /sys/class/power_supply/battery/battery_cycle
|
|
|
|
chmod 0664 /sys/class/power_supply/battery/batt_after_manufactured
|
|
|
|
chown system radio /sys/class/power_supply/battery/batt_after_manufactured
|
|
|
|
chown system radio /sys/class/power_supply/battery/cisd_fullcaprep_max
|
|
|
|
chmod 0660 /sys/class/power_supply/battery/cisd_fullcaprep_max
|
|
|
|
chown system radio /sys/class/power_supply/battery/cisd_data
|
|
|
|
chmod 0660 /sys/class/power_supply/battery/cisd_data
|
|
|
|
chown system system /efs/FactoryApp/cisd_data
|
|
|
|
chmod 0660 /efs/FactoryApp/cisd_data
|
|
|
|
chown system system /efs/FactoryApp/cisd_wc_data
|
|
|
|
chmod 0660 /efs/FactoryApp/cisd_wc_data
|
|
|
|
chown system system /efs/FactoryApp/asoc
|
|
|
|
chmod 0660 /efs/FactoryApp/asoc
|
|
|
|
chown system system /efs/FactoryApp/batt_after_manufactured
|
|
|
|
chmod 0640 /efs/FactoryApp/batt_after_manufactured
|
|
|
|
chown system system /efs/FactoryApp/batt_discharge_level
|
|
|
|
chmod 0640 /efs/FactoryApp/batt_discharge_level
|
|
|
|
chown system radio /sys/class/power_supply/battery/cisd_data_json
|
|
|
|
chmod 0660 /sys/class/power_supply/battery/cisd_data_json
|
|
|
|
copy /system/vendor/firmware/battery_data.dat /efs/Battery/battery_data.dat
|
|
|
|
chmod 0400 /efs/Battery/battery_data.dat
|
|
|
|
write /sys/class/power_supply/battery/batt_update_data "/efs/Battery/battery_data.dat"
|
|
|
|
chown radio system /efs
|
|
|
|
chmod 0771 /efs
|
|
|
|
chown radio system /efs/usb_hw_param
|
|
|
|
chmod 771 /efs/usb_hw_param
|
|
|
|
chown system system /efs/usb_hw_param/usb_hw_param.log
|
|
|
|
chmod 0660 /efs/usb_hw_param/usb_hw_param.log
|
|
|
|
mkdir /efs/lpm 0775 system system
|
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
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"
|
2021-09-22 14:54:56 +02:00
|
|
|
|
|
|
|
class_start sec-charger
|
2018-07-19 12:48:02 +02:00
|
|
|
start thermal-engine
|
|
|
|
|
2021-09-22 14:54:56 +02:00
|
|
|
setprop sys.usb.configfs 1
|
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
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
|
|
|
|
|
2022-02-22 10:37:54 +01:00
|
|
|
# Bring CPU 0, 2 online
|
|
|
|
write /sys/devices/system/cpu/cpu0/online 1
|
|
|
|
write /sys/devices/system/cpu/cpu2/online 1
|
|
|
|
|
2021-12-05 19:55:37 +01:00
|
|
|
# Configure governor settings for little cluster
|
2022-02-20 17:33:48 +01:00
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "blu_schedutil"
|
2022-02-21 12:30:32 +01:00
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/blu_schedutil/up_rate_limit_us 250
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/blu_schedutil/down_rate_limit_us 10000
|
|
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/blu_schedutil/iowait_boost_enable 1
|
2021-12-04 07:07:02 +01:00
|
|
|
|
2021-12-05 19:55:37 +01:00
|
|
|
# Configure governor settings for big cluster
|
2022-02-20 17:33:48 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "blu_schedutil"
|
2022-02-21 12:30:32 +01:00
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/blu_schedutil/up_rate_limit_us 250
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/blu_schedutil/down_rate_limit_us 10000
|
|
|
|
write /sys/devices/system/cpu/cpu2/cpufreq/blu_schedutil/iowait_boost_enable 1
|
2021-12-06 19:25:53 +01:00
|
|
|
|
2021-12-04 07:07:02 +01:00
|
|
|
# Set boottime stune value
|
|
|
|
write /dev/stune/schedtune.prefer_idle 1
|
2021-12-06 19:25:53 +01:00
|
|
|
write /dev/stune/schedtune.boost 10
|
|
|
|
|
|
|
|
# set default schedTune value for foreground/top-app (only affects EAS)
|
2021-12-04 07:07:02 +01:00
|
|
|
write /dev/stune/foreground/schedtune.prefer_idle 1
|
|
|
|
write /dev/stune/top-app/schedtune.boost 10
|
|
|
|
write /dev/stune/top-app/schedtune.prefer_idle 1
|
2021-12-06 19:25:53 +01:00
|
|
|
write /dev/stune/rt/schedtune.boost 30
|
|
|
|
write /dev/stune/rt/schedtune.prefer_idle 1
|
2021-12-04 07:07:02 +01:00
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
# Re-enable thermal hotplug
|
|
|
|
write /sys/module/msm_thermal/core_control/enabled 1
|
|
|
|
|
2021-12-06 19:53:52 +01:00
|
|
|
# Dynamic stune boost config
|
2022-02-09 06:00:12 +01:00
|
|
|
write /sys/module/cpu_boost/parameters/dynamic_stune_boost 10
|
2021-12-06 19:53:52 +01:00
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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 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
|
2021-12-04 07:07:02 +01:00
|
|
|
# Set runtime stune value
|
|
|
|
write /dev/stune/schedtune.prefer_idle 0
|
|
|
|
write /dev/stune/schedtune.boost 0
|
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
trigger enable-low-power
|
|
|
|
|
|
|
|
# Set I/O squeduler
|
|
|
|
setprop sys.io.scheduler "bfq"
|
|
|
|
|
2022-02-22 09:45:02 +01:00
|
|
|
# Set idle GPU to 133 Mhz
|
|
|
|
write /sys/class/kgsl/kgsl-3d0/default_pwrlevel 6
|
|
|
|
|
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
|
2021-09-22 15:00:04 +02:00
|
|
|
write /dev/cpuset/restricted/cpus 0-1
|
2019-02-11 21:56:38 +01:00
|
|
|
|
2018-07-19 12:48:02 +02:00
|
|
|
on property:init.svc.recovery=running
|
|
|
|
trigger enable-low-power
|
|
|
|
|
2021-09-22 14:54:56 +02:00
|
|
|
service charger /system/bin/lpm
|
|
|
|
class sec-charger
|
2021-05-12 15:30:36 +02:00
|
|
|
user system
|
2021-09-22 14:54:56 +02:00
|
|
|
group system radio graphics input
|
2021-05-12 15:30:36 +02:00
|
|
|
capabilities SYS_BOOT
|
|
|
|
seclabel u:r:charger:s0
|