sm8450-common: Move kernel related init scripts to tree

This commit is contained in:
Arian 2024-05-22 02:43:11 +02:00
parent 8ef094f64f
commit 23490ac956
9 changed files with 0 additions and 1254 deletions

View file

@ -1,227 +0,0 @@
#=============================================================================
# Copyright (c) 2021-2022 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
rev=`cat /sys/devices/soc0/revision`
ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
ddr_type4="07"
ddr_type5="08"
# Core control parameters for gold
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 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
# Core control parameters for gold+
echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres
# Controls how many more tasks should be eligible to run on gold CPUs
# w.r.t number of gold CPUs available to trigger assist (max number of
# tasks eligible to run on previous cluster minus number of CPUs in
# the previous cluster).
#
# Setting to 1 by default which means there should be at least
# 4 tasks eligible to run on gold cluster (tasks running on gold cores
# plus misfit tasks on silver cores) to trigger assitance from gold+.
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh
# Disable Core control on silver
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Setting b.L scheduler parameters
echo 85 85 > /proc/sys/walt/sched_downmigrate
echo 95 95 > /proc/sys/walt/sched_upmigrate
echo 85 > /proc/sys/walt/sched_group_downmigrate
echo 100 > /proc/sys/walt/sched_group_upmigrate
echo 1 > /proc/sys/walt/sched_walt_rotate_big_tasks
echo 400000000 > /proc/sys/walt/sched_coloc_downmigrate_ns
echo 39000000 39000000 39000000 39000000 39000000 39000000 39000000 5000000 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_ns
echo 240 > /proc/sys/walt/sched_coloc_busy_hysteresis_enable_cpus
echo 10 10 10 10 10 10 10 95 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_busy_pct
echo 5000000 5000000 5000000 5000000 5000000 5000000 5000000 2000000 > /proc/sys/walt/sched_util_busy_hyst_cpu_ns
echo 255 > /proc/sys/walt/sched_util_busy_hysteresis_enable_cpus
echo 15 15 15 15 15 15 15 15 > /proc/sys/walt/sched_util_busy_hyst_cpu_util
# set the threshold for low latency task boost feature which prioritize
# binder activity tasks
echo 325 > /proc/sys/walt/walt_low_latency_task_threshold
# cpuset parameters
echo 0-2 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
echo 4-7 > /dev/cpuset/foreground/boost/cpus
echo 0-2,4-7 > /dev/cpuset/foreground/cpus
echo 0-7 > /dev/cpuset/top-app/cpus
echo 0-7 > /dev/cpuset/audio-app/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/walt/sched_boost
# Reset the RT boost, which is 1024 (max) by default.
echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default
# configure governor settings for silver cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
echo 1228800 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
echo 556800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 1804800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl
# configure input boost settings
echo 1228800 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
echo 120 > /proc/sys/walt/input_boost/input_boost_ms
echo 1785600 0 0 0 2169600 0 0 2419200 > /proc/sys/walt/input_boost/powerkey_input_boost_freq
echo 120 > /proc/sys/walt/input_boost/powerkey_input_boost_ms
# configure governor settings for gold cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/up_rate_limit_us
echo 1555200 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy4/walt/pl
# configure governor settings for gold+ cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
echo 1651200 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy7/walt/pl
# colocation V3 settings
echo 768000 > /sys/devices/system/cpu/cpufreq/policy4/walt/rtg_boost_freq
# configure bus-dcvs
bus_dcvs="/sys/devices/system/cpu/bus_dcvs"
for device in $bus_dcvs/*
do
cat $device/hw_min_freq > $device/boost_freq
done
for llccbw in $bus_dcvs/LLCC/*bwmon-llcc
do
echo "4577 7110 9155 12298 14236 15258" > $llccbw/mbps_zones
echo 4 > $llccbw/sample_ms
echo 80 > $llccbw/io_percent
echo 20 > $llccbw/hist_memory
echo 10 > $llccbw/hyst_length
echo 30 > $llccbw/down_thres
echo 0 > $llccbw/guard_band_mbps
echo 250 > $llccbw/up_scale
echo 1600 > $llccbw/idle_mbps
echo 806000 > $llccbw/max_freq
echo 40 > $llccbw/window_ms
done
for ddrbw in $bus_dcvs/DDR/*bwmon-ddr
do
echo "1720 2086 2929 3879 6515 7980 12191" > $ddrbw/mbps_zones
echo 4 > $ddrbw/sample_ms
echo 80 > $ddrbw/io_percent
echo 20 > $ddrbw/hist_memory
echo 10 > $ddrbw/hyst_length
echo 30 > $ddrbw/down_thres
echo 0 > $ddrbw/guard_band_mbps
echo 250 > $ddrbw/up_scale
echo 1600 > $ddrbw/idle_mbps
echo 2092000 > $ddrbw/max_freq
echo 40 > $ddrbw/window_ms
done
for latfloor in $bus_dcvs/*/*latfloor
do
echo 25000 > $latfloor/ipm_ceil
done
for l3silver in $bus_dcvs/L3/*silver
do
echo 1708800 > $l3silver/max_freq
done
for l3gold in $bus_dcvs/L3/*gold
do
echo 4000 > $l3gold/ipm_ceil
echo 1708800 > $l3gold/max_freq
done
for l3prime in $bus_dcvs/L3/*prime
do
echo 20000 > $l3prime/ipm_ceil
echo 1708800 > $l3prime/max_freq
done
for l3pcompute in $bus_dcvs/L3/*prime-compute
do
echo 1708800 > $l3pcompute/max_freq
done
for ddrprime in $bus_dcvs/DDR/*prime
do
echo 25 > $ddrprime/freq_scale_pct
echo 1881 > $ddrprime/freq_scale_limit_mhz
done
for qosgold in $bus_dcvs/DDRQOS/*gold
do
echo 50 > $qosgold/ipm_ceil
done
echo 0 > /sys/kernel/msm_performance/parameters/splh_log_level
#set s2idle as default
echo s2idle > /sys/power/mem_sleep
#Enable LPM
echo N > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled
# 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.vendor.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
setprop vendor.post_boot.parsed 1
#Limit the dmabuf pool for zizhan
vendor_name=`getprop ro.product.vendor.name`
case "$vendor_name" in
"zizhan")
echo 120000 > /sys/kernel/dma_mi_pool/msm_total_pools_max
;;
*)
;;
esac

View file

@ -1,222 +0,0 @@
#=============================================================================
# Copyright (c) 2021-2022 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
rev=`cat /sys/devices/soc0/revision`
ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
ddr_type4="07"
ddr_type5="08"
# Core control parameters for gold
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 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
# Core control parameters for gold+
echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres
# Controls how many more tasks should be eligible to run on gold CPUs
# w.r.t number of gold CPUs available to trigger assist (max number of
# tasks eligible to run on previous cluster minus number of CPUs in
# the previous cluster).
#
# Setting to 1 by default which means there should be at least
# 4 tasks eligible to run on gold cluster (tasks running on gold cores
# plus misfit tasks on silver cores) to trigger assitance from gold+.
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh
# Disable Core control on silver
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Apply inter-cluster load balancer restrictions
echo 0 > /proc/sys/kernel/sched_restrict_cluster_spill
# Setting b.L scheduler parameters
echo 85 85 > /proc/sys/walt/sched_downmigrate
echo 95 95 > /proc/sys/walt/sched_upmigrate
echo 85 > /proc/sys/walt/sched_group_downmigrate
echo 100 > /proc/sys/walt/sched_group_upmigrate
echo 1 > /proc/sys/walt/sched_walt_rotate_big_tasks
echo 0 > /proc/sys/walt/sched_coloc_busy_hysteresis_enable_cpus
echo 255 > /proc/sys/walt/sched_util_busy_hysteresis_enable_cpus
echo 8500000 8500000 8500000 8500000 5000000 5000000 5000000 2000000 > /proc/sys/walt/sched_util_busy_hyst_cpu_ns
echo 1 1 1 1 15 15 15 15 > /proc/sys/walt/sched_util_busy_hyst_cpu_util
# Setting SPM parameters
echo 1200:1708000 2100:3196000 > /sys/devices/system/cpu/bus_dcvs/DDR/soc:qcom,memlat:ddr:gold/spm_freq_map
echo 1200:1708000 2100:3196000 > /sys/devices/system/cpu/bus_dcvs/DDR/soc:qcom,memlat:ddr:prime/spm_freq_map
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
echo 4-7 > /dev/cpuset/foreground/boost/cpus
echo 0-7 > /dev/cpuset/foreground/cpus
echo 0-7 > /dev/cpuset/top-app/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/walt/sched_boost
# Reset the RT boost, which is 1024 (max) by default.
echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default
# configure governor settings for silver cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
echo 1094400 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
echo 614400 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl
# configure input boost settings
echo 1094400 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
echo 120 > /proc/sys/walt/input_boost/input_boost_ms
echo 1804800 0 0 0 2054400 0 0 2169600 > /proc/sys/walt/input_boost/powerkey_input_boost_freq
echo 200 > /proc/sys/walt/input_boost/powerkey_input_boost_ms
# configure governor settings for gold cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/up_rate_limit_us
echo 1132800 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_freq
echo 652800 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_load
echo -6 > /sys/devices/system/cpu/cpufreq/policy4/walt/boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/pl
# configure governor settings for gold+ cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
echo 1401600 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
echo 768000 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_load
echo -6 > /sys/devices/system/cpu/cpufreq/policy7/walt/boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/pl
# colocation V3 settings
echo 614400 > /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
echo 51 > /proc/sys/walt/sched_min_task_util_for_boost
echo 35 > /proc/sys/walt/sched_min_task_util_for_colocation
echo 20000000 > /proc/sys/walt/sched_task_unfilter_period
# Enable conservative pl
echo 1 > /proc/sys/walt/sched_conservative_pl
# configure bus-dcvs
bus_dcvs="/sys/devices/system/cpu/bus_dcvs"
for device in $bus_dcvs/*
do
cat $device/hw_min_freq > $device/boost_freq
done
for llccbw in $bus_dcvs/LLCC/*bwmon-llcc
do
echo "4577 7110 9155 12298 14236 15258" > $llccbw/mbps_zones
echo 4 > $llccbw/sample_ms
echo 68 > $llccbw/io_percent
echo 20 > $llccbw/hist_memory
echo 80 > $llccbw/down_thres
echo 0 > $llccbw/guard_band_mbps
echo 250 > $llccbw/up_scale
echo 1600 > $llccbw/idle_mbps
echo 40 > $llccbw/window_ms
done
for ddrbw in $bus_dcvs/DDR/*bwmon-ddr
do
if [ ${ddr_type:4:2} == $ddr_type4 ]; then
echo "1144 1720 2086 2929 3879 5931 6515 8136" > $ddrbw/mbps_zones
elif [ ${ddr_type:4:2} == $ddr_type5 ]; then
echo "1720 2086 2929 3879 5931 6515 7980 12191" > $ddrbw/mbps_zones
fi
echo 4 > $ddrbw/sample_ms
echo 68 > $ddrbw/io_percent
echo 20 > $ddrbw/hist_memory
echo 80 > $ddrbw/down_thres
echo 0 > $ddrbw/guard_band_mbps
echo 250 > $ddrbw/up_scale
echo 1600 > $ddrbw/idle_mbps
echo 48 > $ddrbw/window_ms
done
for latfloor in $bus_dcvs/*/*latfloor
do
echo 25000 > $latfloor/ipm_ceil
done
for l3gold in $bus_dcvs/L3/*gold
do
echo 4000 > $l3gold/ipm_ceil
echo 60 > $l3gold/wb_pct_thres
done
for l3prime in $bus_dcvs/L3/*prime
do
echo 20000 > $l3prime/ipm_ceil
echo 60 > $l3prime/wb_pct_thres
done
for ddrprime in $bus_dcvs/DDR/*prime
do
echo 25 > $ddrprime/freq_scale_pct
echo 1881 > $ddrprime/freq_scale_limit_mhz
done
for qosgold in $bus_dcvs/DDRQOS/*gold
do
echo 50 > $qosgold/ipm_ceil
done
=============================================
#set s2idle as default suspend mode
echo s2idle > /sys/power/mem_sleep
# Enable LPM
echo N > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled
# 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.vendor.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
# Disable wsf for diwali targets beacause we are using efk.
# wsf Range : 1..1000 So set to bare minimum value 1.
echo 1 > /proc/sys/vm/watermark_scale_factor
setprop vendor.post_boot.parsed 1

View file

@ -1,257 +0,0 @@
#=============================================================================
# Copyright (c) 2020-2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, 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.
#=============================================================================
rev=`cat /sys/devices/soc0/revision`
ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
ddr_type4="07"
ddr_type5="08"
# Core control parameters for gold
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 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
# Core control parameters for gold+
echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres
# Controls how many more tasks should be eligible to run on gold CPUs
# w.r.t number of gold CPUs available to trigger assist (max number of
# tasks eligible to run on previous cluster minus number of CPUs in
# the previous cluster).
#
# Setting to 1 by default which means there should be at least
# 4 tasks eligible to run on gold cluster (tasks running on gold cores
# plus misfit tasks on silver cores) to trigger assitance from gold+.
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh
# Disable Core control on silver
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Setting b.L scheduler parameters
echo 95 95 > /proc/sys/walt/sched_upmigrate
echo 85 85 > /proc/sys/walt/sched_downmigrate
echo 100 > /proc/sys/walt/sched_group_upmigrate
echo 85 > /proc/sys/walt/sched_group_downmigrate
echo 1 > /proc/sys/walt/sched_walt_rotate_big_tasks
echo 400000000 > /proc/sys/walt/sched_coloc_downmigrate_ns
echo 39000000 39000000 39000000 39000000 39000000 39000000 39000000 5000000 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_ns
echo 240 > /proc/sys/walt/sched_coloc_busy_hysteresis_enable_cpus
echo 10 10 10 10 10 10 10 95 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_busy_pct
echo 5000000 5000000 5000000 5000000 5000000 5000000 5000000 2000000 > /proc/sys/walt/sched_util_busy_hyst_cpu_ns
echo 255 > /proc/sys/walt/sched_util_busy_hysteresis_enable_cpus
echo 15 15 15 15 15 15 15 15 > /proc/sys/walt/sched_util_busy_hyst_cpu_util
# XM power profiling
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/target_load_thresh
echo 4 > /sys/devices/system/cpu/cpufreq/policy0/walt/target_load_shift
echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default
# set the threshold for low latency task boost feature which prioritize
# binder activity tasks
echo 325 > /proc/sys/walt/walt_low_latency_task_threshold
# cpuset parameters
echo 0-2 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
echo 4-7 > /dev/cpuset/foreground/boost/cpus
echo 0-2,4-7 > /dev/cpuset/foreground/cpus
echo 0-7 > /dev/cpuset/top-app/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/walt/sched_boost
# Reset the RT boost, which is 1024 (max) by default.
echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default
# configure governor settings for silver cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
echo 800000 > /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
if [ $rev == "1.0" ]; then
echo 1190400 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
else
echo 998000 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
fi
echo 614400 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl
# configure input boost settings
if [ $rev == "1.0" ]; then
echo 1382800 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
else
echo 1171200 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
fi
echo 100 > /proc/sys/walt/input_boost/input_boost_ms
echo 1785600 0 0 0 2169600 0 0 2419200 > /proc/sys/walt/input_boost/powerkey_input_boost_freq
echo 120 > /proc/sys/walt/input_boost/powerkey_input_boost_ms
# configure governor settings for gold cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/up_rate_limit_us
echo 600000 > /sys/devices/system/cpu/cpufreq/policy4/walt/rtg_boost_freq
if [ $rev == "1.0" ]; then
echo 1497600 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_freq
else
echo 1497600 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_freq
fi
echo 1 > /sys/devices/system/cpu/cpufreq/policy4/walt/pl
# configure governor settings for gold+ cluster
echo "walt" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
if [ $rev == "1.0" ]; then
echo 1536000 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
else
echo 1536000 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
fi
echo 1 > /sys/devices/system/cpu/cpufreq/policy7/walt/pl
# configure bus-dcvs
bus_dcvs="/sys/devices/system/cpu/bus_dcvs"
for device in $bus_dcvs/*
do
cat $device/hw_min_freq > $device/boost_freq
done
for llccbw in $bus_dcvs/LLCC/*bwmon-llcc
do
echo "4577 7110 9155 12298 14236 15258" > $llccbw/mbps_zones
echo 4 > $llccbw/sample_ms
echo 80 > $llccbw/io_percent
echo 20 > $llccbw/hist_memory
echo 10 > $llccbw/hyst_length
echo 30 > $llccbw/down_thres
echo 0 > $llccbw/guard_band_mbps
echo 250 > $llccbw/up_scale
echo 1600 > $llccbw/idle_mbps
echo 806000 > $llccbw/max_freq
echo 40 > $llccbw/window_ms
done
for ddrbw in $bus_dcvs/DDR/*bwmon-ddr
do
echo "1720 2086 2929 3879 6515 7980 12191" > $ddrbw/mbps_zones
echo 4 > $ddrbw/sample_ms
echo 80 > $ddrbw/io_percent
echo 20 > $ddrbw/hist_memory
echo 10 > $ddrbw/hyst_length
echo 30 > $ddrbw/down_thres
echo 0 > $ddrbw/guard_band_mbps
echo 250 > $ddrbw/up_scale
echo 1600 > $ddrbw/idle_mbps
echo 2092000 > $ddrbw/max_freq
echo 40 > $ddrbw/window_ms
done
for latfloor in $bus_dcvs/*/*latfloor
do
echo 25000 > $latfloor/ipm_ceil
done
for l3gold in $bus_dcvs/L3/*gold
do
echo 4000 > $l3gold/ipm_ceil
done
for l3prime in $bus_dcvs/L3/*prime
do
echo 20000 > $l3prime/ipm_ceil
done
for ddrprime in $bus_dcvs/DDR/*prime
do
echo 25 > $ddrprime/freq_scale_pct
echo 1881 > $ddrprime/freq_scale_limit_mhz
done
for qosgold in $bus_dcvs/DDRQOS/*gold
do
echo 50 > $qosgold/ipm_ceil
done
if [ "$rev" == "1.0" ]; then
echo Y > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled
echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu4/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu5/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu6/cpuidle/state1/disable
echo 1 > /sys/devices/system/cpu/cpu7/cpuidle/state1/disable
echo 0 > "/sys/devices/platform/hypervisor/hypervisor:qcom,gh-watchdog/wakeup_enable"
else
echo N > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled
fi
echo s2idle > /sys/power/mem_sleep
# 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.vendor.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
setprop vendor.post_boot.parsed 1

View file

@ -1,198 +0,0 @@
#=============================================================================
# Copyright (c) 2019-2022 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, 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.
#=============================================================================
function configure_zram_parameters() {
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
low_ram=`getprop ro.config.low_ram`
# Zram disk - 75% for Go and < 2GB devices .
# For >2GB Non-Go devices, size = 50% of RAM size. Limit the size to 4GB.
# And enable lz4 zram compression for Go targets.
let RamSizeGB="( $MemTotal / 1048576 ) + 1"
diskSizeUnit=M
if [ $RamSizeGB -le 2 ]; then
let zRamSizeMB="( $RamSizeGB * 1024 ) * 3 / 4"
else
let zRamSizeMB="( $RamSizeGB * 1024 ) / 2"
fi
# use MB avoid 32 bit overflow
if [ $zRamSizeMB -gt 4096 ]; then
let zRamSizeMB=4096
fi
if [ "$low_ram" == "true" ]; then
echo lz4 > /sys/block/zram0/comp_algorithm
fi
if [ -f /sys/block/zram0/disksize ]; then
if [ -f /sys/block/zram0/use_dedup ]; then
echo 1 > /sys/block/zram0/use_dedup
fi
echo "$zRamSizeMB""$diskSizeUnit" > /sys/block/zram0/disksize
# ZRAM may use more memory than it saves if SLAB_STORE_USER
# debug option is enabled.
if [ -e /sys/kernel/slab/zs_handle ]; then
echo 0 > /sys/kernel/slab/zs_handle/store_user
fi
if [ -e /sys/kernel/slab/zspage ]; then
echo 0 > /sys/kernel/slab/zspage/store_user
fi
mkswap /dev/block/zram0
swapon /dev/block/zram0 -p 32758
fi
}
function configure_read_ahead_kb_values() {
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
dmpts=$(ls /sys/block/*/queue/read_ahead_kb | grep -e dm -e mmc -e sd)
# dmpts holds below read_ahead_kb nodes if exists:
# /sys/block/dm-0/queue/read_ahead_kb to /sys/block/dm-10/queue/read_ahead_kb
# /sys/block/sda/queue/read_ahead_kb to /sys/block/sdh/queue/read_ahead_kb
# Set 128 for <= 4GB &
# set 512 for >= 5GB targets.
if [ $MemTotal -le 4194304 ]; then
ra_kb=128
else
ra_kb=512
fi
if [ -f /sys/block/mmcblk0/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0/bdi/read_ahead_kb
fi
if [ -f /sys/block/mmcblk0rpmb/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb
fi
for dm in $dmpts; do
if [ `cat $(dirname $dm)/../removable` -eq 0 ]; then
echo $ra_kb > $dm
fi
done
}
function configure_memory_parameters() {
# Set Memory parameters.
#
# Set per_process_reclaim tuning parameters
# All targets will use vmpressure range 50-70,
# All targets will use 512 pages swap size.
#
# Set Low memory killer minfree parameters
# 32 bit Non-Go, all memory configurations will use 15K series
# 32 bit Go, all memory configurations will use uLMK + Memcg
# 64 bit will use Google default LMK series.
#
# Set ALMK parameters (usually above the highest minfree values)
# vmpressure_file_min threshold is always set slightly higher
# than LMK minfree's last bin value for all targets. It is calculated as
# vmpressure_file_min = (last bin - second last bin ) + last bin
#
# Set allocstall_threshold to 0 for all targets.
#
ProductName=`getprop ro.product.name`
configure_zram_parameters
configure_read_ahead_kb_values
if [ "$ProductName" == "liuqin" ] || [ "$ProductName" == "yudi" ]; then
echo 200 > /proc/sys/vm/swappiness
else
echo 100 > /proc/sys/vm/swappiness
fi
echo 1 > /proc/sys/vm/watermark_scale_factor
echo 0 > /proc/sys/vm/watermark_boost_factor
# Disable periodic kcompactd wakeups. We do not use THP, so having many
# huge pages is not as necessary.
echo 0 > /proc/sys/vm/compaction_proactiveness
# With THP enabled, the kernel greatly increases min_free_kbytes over its
# default value. Disable THP to prevent resetting of min_free_kbytes
# value during online/offline pages.
if [ -f /sys/kernel/mm/transparent_hugepage/enabled ]; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
let RamSizeGB="( $MemTotal / 1048576 ) + 1"
# Set the min_free_kbytes to standard kernel value
if [ $RamSizeGB -ge 8 ]; then
echo 11584 > /proc/sys/vm/min_free_kbytes
elif [ $RamSizeGB -ge 4 ]; then
echo 8192 > /proc/sys/vm/min_free_kbytes
elif [ $RamSizeGB -ge 2 ]; then
echo 5792 > /proc/sys/vm/min_free_kbytes
else
echo 4096 > /proc/sys/vm/min_free_kbytes
fi
echo 11584 > /proc/sys/vm/min_free_kbytes
}
configure_memory_parameters
if [ -f /sys/devices/soc0/chip_family ]; then
chipfamily=`cat /sys/devices/soc0/chip_family`
fi
case "$chipfamily" in
"0x74")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-taro.sh
;;
"0x7B"|"0x7b")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-diwali.sh
;;
"0x82")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-cape.sh
;;
*)
echo "***WARNING***: Invalid chip family\n\t No postboot settings applied!!\n"
;;
esac
ProductName=`getprop ro.product.name`
if [ "$ProductName" == "liuqin" ] || [ "$ProductName" == "yudi" ]; then
sleep 600
echo 100 > /proc/sys/vm/swappiness
fi

View file

@ -1,81 +0,0 @@
#! /vendor/bin/sh
#=============================================================================
# Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, 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.
#=============================================================================
verify_pasr_support()
{
ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
ddr_type5="08"
# MIUI ADD:
devicename=`getprop ro.product.device`
if [ -d /sys/kernel/mem-offline ]; then
#only LPDDR5 supports PAAR
if [ ${ddr_type:4:2} != $ddr_type5 ]; then
setprop vendor.pasr.activemode.enabled false
fi
setprop vendor.pasr.enabled false
fi
# MIUI ADD:
if [ "$devicename" == "liuqin" ]; then
echo 3 > /proc/sys/vm/page-cluster
else
echo 0 > /proc/sys/vm/page-cluster
fi
}
start_msm_irqbalance()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
# MIUI ADD: START
set_page_cluster()
{
devicename=`getprop ro.product.device`
if [ "$devicename" == "yudi" ]; then
echo 3 > /proc/sys/vm/page-cluster
else
echo 0 > /proc/sys/vm/page-cluster
fi
}
# END
start_msm_irqbalance
verify_pasr_support
# MIUI ADD:
set_page_cluster

View file

@ -1,27 +0,0 @@
#!/vendor/bin/sh
#=============================================================================
# Copyright (c) 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
write_with_check() {
local i=60
while [ $i -gt 0 ]
do
if [ -f "$1" ]; then
break
fi
sleep 1
i=$(($i-1))
done
if [ ! -f "$1" ]; then
exit 1
fi
echo $2 > $1
}
write_with_check "$1" "$2"

View file

@ -1,45 +0,0 @@
#! /vendor/bin/sh
#=============================================================================
# Copyright (c) 2019-2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
VENDOR_DIR="/vendor/lib/modules"
VENDOR_DLKM_DIR="/vendor_dlkm/lib/modules"
MODPROBE="/vendor/bin/modprobe"
# vendor modules partition could be /vendor/lib/modules or /vendor_dlkm/lib/modules
POSSIBLE_DIRS="${VENDOR_DLKM_DIR} ${VENDOR_DIR}"
for dir in ${POSSIBLE_DIRS} ;
do
if [ ! -e ${dir}/modules.load ]; then
continue
fi
if [ -e ${dir}/modules.blocklist ]; then
blocklist_expr="$(sed -n -e 's/blocklist \(.*\)/\1/p' ${dir}/modules.blocklist | sed -e 's/-/_/g' -e 's/^/-e /')"
else
# Use pattern that won't be found in modules list so that all modules pass through grep below
blocklist_expr="-e %"
fi
# Filter out modules in blocklist - we would see unnecessary errors otherwise
load_modules=$(cat ${dir}/modules.load | grep -w -v ${blocklist_expr})
first_module=$(echo ${load_modules} | cut -d " " -f1)
other_modules=$(echo ${load_modules} | cut -d " " -f2-)
if ! ${MODPROBE} -b -s -d ${dir} -a ${first_module} > /dev/null ; then
continue
fi
# load modules individually in case one of them fails to init
for module in ${other_modules}; do
( ${MODPROBE} -b -s -d ${dir} -a ${module} > /dev/null ) &
done
wait
setprop vendor.all.modules.ready 1
exit 0
done
exit 1

View file

@ -1,189 +0,0 @@
#=============================================================================
# Copyright (c) 2019-2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, 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.
#=============================================================================
import /vendor/etc/init/hw/init.qti.kernel.test.rc
on early-init
start vendor.modprobe
# Mount tracefs in /sys/kernel/tracing as CONFIG_DEBUG_FS might be
# disabled and /sys/kernel/debug/tracing might not be available
mount tracefs tracefs /sys/kernel/tracing
chmod 0755 /sys/kernel/tracing
chown root system /dev/kmsg
chmod 0620 /dev/kmsg
write /proc/sys/kernel/sched_boost 1
write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
on init
wait_for_prop vendor.all.modules.ready 1
# Create cgroup mount point for memory
mkdir /sys/fs/cgroup/memory/bg 0750 root system
write /sys/fs/cgroup/memory/bg/memory.swappiness 140
write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/bg/tasks
chmod 0660 /sys/fs/cgroup/memory/bg/tasks
# update scheduler tunables
write /dev/cpuctl/foreground/cpu.uclamp.sched_boost_no_override 1
write /dev/cpuctl/top-app/cpu.uclamp.sched_boost_no_override 1
write /dev/cpuctl/background/cpu.uclamp.colocate 0
write /dev/cpuctl/foreground/cpu.uclamp.colocate 0
write /dev/cpuctl/top-app/cpu.uclamp.colocate 1
on post-fs
# set aggressive read ahead for dm-0 and dm-1 during boot up
write /sys/block/dm-0/queue/read_ahead_kb 2048
write /sys/block/dm-1/queue/read_ahead_kb 2048
write /sys/block/dm-2/queue/read_ahead_kb 2048
on early-boot
# Allow subsystem (modem etc) debugging
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_adsp/boot 1
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_cdsp/boot 1
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/devices/virtual/cvp/cvp/boot 1
on boot
# Set the console loglevel to < KERN_WARN
# Set the default message loglevel to KERN_INFO
write /proc/sys/kernel/printk "4 6 1 7"
# Allow access to dload sysfs node
chown root system /sys/kernel/dload/emmc_dload
chmod 0660 /sys/kernel/dload/emmc_dload
chown root system /dev/block/bootdevice/by-name/ramdump
chmod 0660 /dev/block/bootdevice/by-name/ramdump
chown root system /sys/kernel/dload/dload_mode
chmod 0660 /sys/kernel/dload/dload_mode
# set the io-scheduler to bfq on all mq support devices
write /sys/block/sdb/queue/scheduler bfq
write /sys/block/sdc/queue/scheduler bfq
write /sys/block/sdd/queue/scheduler bfq
write /sys/block/sde/queue/scheduler bfq
write /sys/block/sdf/queue/scheduler bfq
write /sys/block/sdg/queue/scheduler bfq
write /sys/block/sdh/queue/scheduler bfq
write /sys/class/block/mmcblk0/queue/scheduler bfq
write /sys/class/block/mmcblk1/queue/scheduler bfq
# update io-scheduler tunables
write /sys/block/sdb/queue/iosched/slice_idle 0
write /sys/block/sdc/queue/iosched/slice_idle 0
write /sys/block/sdd/queue/iosched/slice_idle 0
write /sys/block/sde/queue/iosched/slice_idle 0
write /sys/block/sdf/queue/iosched/slice_idle 0
write /sys/block/sdg/queue/iosched/slice_idle 0
write /sys/block/sdh/queue/iosched/slice_idle 0
write /sys/class/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/class/block/mmcblk1/queue/iosched/slice_idle 0
on boot && property:persist.sys.stability.smartfocusio=on
write /sys/block/sda/queue/scheduler cpq
on property:persist.sys.stability.smartfocusio=off
write /sys/block/sda/queue/scheduler bfq
write /sys/block/sda/queue/iosched/slice_idle 0
# Allow access to memory hotplug device attributes
chown system system /sys/kernel/mem-offline/anon_migrate
on post-fs-data
# Create directory used for dump collection
mkdir /data/vendor/ssrdump 0770 root system
on property:persist.sys.ssr.enable_debug=*
write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug}
on property:persist.sys.mba_boot_timeout=*
write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout}
on property:persist.sys.modem_auth_timeout=*
write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${persist.sys.modem_auth_timeout}
on property:persist.sys.pil_proxy_timeout=*
write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout}
on property:persist.vendor.ssr.enable_ramdumps=1
write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
on property:persist.vendor.ssr.enable_ramdumps=0
write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
on property:persist.vendor.sys.rawdump_copy=1
write /sys/kernel/dload/emmc_dload 1
on property:persist.vendor.sys.rawdump_copy=0
write /sys/kernel/dload/emmc_dload 0
service kernel-boot /vendor/bin/sh /vendor/bin/init.qti.kernel.sh
class core
user root
group root
disabled
oneshot
service kernel-post-boot /vendor/bin/sh /vendor/bin/init.kernel.post_boot.sh
class core
user root
group root system wakelock graphics
disabled
oneshot
on property:sys.boot_completed=1
write /dev/kmsg "Boot completed "
#Reset read ahead for dm-0, dm-1 and dm-2 to 512kb
write /sys/block/dm-0/queue/read_ahead_kb 512
write /sys/block/dm-1/queue/read_ahead_kb 512
write /sys/block/dm-2/queue/read_ahead_kb 512
start kernel-boot
start kernel-post-boot
on property:init.svc.vendor.charger=running
start kernel-post-boot
service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
class core
user root
group root
disabled
service vendor.modprobe /vendor/bin/vendor_modprobe.sh
class main
user root
group root system
disabled
stdio_to_kmsg
seclabel u:r:vendor_modprobe:s0
oneshot

View file

@ -150,15 +150,9 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/hw/vendor.xiaomi.sensor.communicate@1.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.xiaomi.sensor.communicate@1.0-service \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/ims_rtp_daemon:$(TARGET_COPY_OUT_VENDOR)/bin/ims_rtp_daemon \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/imsdaemon:$(TARGET_COPY_OUT_VENDOR)/bin/imsdaemon \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.kernel.post_boot-cape.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.kernel.post_boot-cape.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.kernel.post_boot-diwali.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.kernel.post_boot-diwali.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.kernel.post_boot-taro.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.kernel.post_boot-taro.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.kernel.post_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.kernel.post_boot.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.qcom.sensors.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sensors.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.qcom.usb.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.usb.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.qti.kernel.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.kernel.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.qti.qcv.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.qcv.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/init.qti.write.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.write.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/irsc_util:$(TARGET_COPY_OUT_VENDOR)/bin/irsc_util \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/ks:$(TARGET_COPY_OUT_VENDOR)/bin/ks \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/loc_launcher:$(TARGET_COPY_OUT_VENDOR)/bin/loc_launcher \
@ -212,7 +206,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vendor.dpmd:$(TARGET_COPY_OUT_VENDOR)/bin/vendor.dpmd \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vendor.qti.hardware.soter@1.0-provision:$(TARGET_COPY_OUT_VENDOR)/bin/vendor.qti.hardware.soter@1.0-provision \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vendor.qti.qspmhal@1.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/vendor.qti.qspmhal@1.0-service \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vendor_modprobe.sh:$(TARGET_COPY_OUT_VENDOR)/bin/vendor_modprobe.sh \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vmmgr:$(TARGET_COPY_OUT_VENDOR)/bin/vmmgr \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/vppservice:$(TARGET_COPY_OUT_VENDOR)/bin/vppservice \
vendor/xiaomi/sm8450-common/proprietary/vendor/bin/wfdhdcphalservice:$(TARGET_COPY_OUT_VENDOR)/bin/wfdhdcphalservice \
@ -284,7 +277,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/dpmQmiMgr.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/dpmQmiMgr.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/hw/init.mi_thermald.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.mi_thermald.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/hw/init.qcom.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qcom.usb.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/hw/init.qti.kernel.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qti.kernel.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/ims_rtp_daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ims_rtp_daemon.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/imsdaemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/imsdaemon.rc \
vendor/xiaomi/sm8450-common/proprietary/vendor/etc/init/init.embmssl_server.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.embmssl_server.rc \