android_device_samsung_msm8.../rootdir/etc/init.qcom.power.rc
Deokgyu Yang a1f94d75eb gts3l-common: init: Set /dev/cpuset/restricted/cpus when boot completed
Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: I2fee697192e101f6c0b89e0f6eadeacf29d5d8a1
2021-09-22 22:00:04 +09:00

226 lines
11 KiB
Text

# 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
# Enable sched boost
write /proc/sys/kernel/sched_boost 1
on charger
wait /dev/block/platform/soc/${ro.boot.bootdevice}
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
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"
class_start sec-charger
start thermal-engine
setprop sys.usb.configfs 1
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
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif 0
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
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:39000 2100000:79000"
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
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads "85 1500000:90 1800000:95 2100000:99"
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time 19000
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis 39000
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 307200
write /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif 0
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 all LPMs (this will enable C4, D4, D3, E4 and M3 LPMs)
write /sys/module/lpm_levels/parameters/sleep_disabled "N"
# Set perfd properties
setprop vendor.post_boot.parsed 1
on property:sys.boot_completed=1
trigger enable-low-power
# Set I/O squeduler
setprop sys.io.scheduler "bfq"
# 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
write /dev/cpuset/restricted/cpus 0-1
on property:init.svc.recovery=running
trigger enable-low-power
service charger /system/bin/lpm
class sec-charger
user system
group system radio graphics input
capabilities SYS_BOOT
seclabel u:r:charger:s0
service energy-awareness /vendor/bin/energy-awareness
class main
user root
group system
oneshot