sm7325-common => sm6375-common

* All configs updated from fogos U1UG34M.23-82-2 build

Change-Id: I6750c454f2eeec53205c56f033c76443e93b44ed
This commit is contained in:
Anand S 2024-07-03 12:56:42 +05:30
parent 5dd69c17ba
commit 7a96a5062f
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
70 changed files with 1753 additions and 3360 deletions

0
rootdir/bin/init.class_main.sh Executable file → Normal file
View file

0
rootdir/bin/init.crda.sh Executable file → Normal file
View file

View file

@ -0,0 +1,240 @@
#=============================================================================
# Copyright (c) 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2012-2013, 2016-2020, 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 "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}
# Zram disk - 75% for < 2GB devices .
# For >2GB devices, size = 50% of RAM size. Limit the size to 4GB.
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 [ -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)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; 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
echo $ra_kb > $dm
done
}
function configure_memory_parameters() {
# Set Memory parameters.
# Set swappiness to 100 for all targets
echo 100 > /proc/sys/vm/swappiness
# Disable wsf for all 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
configure_zram_parameters
configure_read_ahead_kb_values
#Spawn 2 kswapd threads which can help in fast reclaiming of pages
echo 2 > /proc/sys/vm/kswapd_threads
}
# Core control parameters for silver
echo 0 0 0 0 1 1 > /sys/devices/system/cpu/cpu0/core_ctl/not_preferred
echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres
echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms
echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres
# Enable Core control for Silver
echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Disable Core control on gold
echo 0 > /sys/devices/system/cpu/cpu6/core_ctl/enable
# Setting b.L scheduler parameters
echo 65 > /proc/sys/kernel/sched_downmigrate
echo 71 > /proc/sys/kernel/sched_upmigrate
echo 85 > /proc/sys/kernel/sched_group_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 0 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
echo 0 > /proc/sys/kernel/sched_busy_hysteresis_enable_cpus
echo 5 > /proc/sys/kernel/sched_ravg_window_nr_ticks
# disable unfiltering
echo 20000000 > /proc/sys/kernel/sched_task_unfilter_period
# cpuset parameters
echo 0-5 > /dev/cpuset/background/cpus
echo 0-5 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
echo 1113600 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 576000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/up_rate_limit_us
echo 1228800 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_freq
echo 691200 > /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq
# Colocation V3 settings
echo 680000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/rtg_boost_freq
echo 51 > /proc/sys/kernel/sched_min_task_util_for_boost
echo 35 > /proc/sys/kernel/sched_min_task_util_for_colocation
# sched_load_boost as -6 is equivalent to target load as 85. It is per cpu tunable.
echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost
echo 85 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_load
# configure input boost settings
echo "0:1113600" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
# Enable bus-dcvs
for device in /sys/devices/platform/soc
do
for cpubw in $device/*cpu-cpu-ddr-bw/devfreq/*cpu-cpu-ddr-bw
do
cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
echo "bw_hwmon" > $cpubw/governor
echo "762 1144 1720 2086 2597 2929 3879 5161 5931 6881 7980" > $cpubw/bw_hwmon/mbps_zones
echo 4 > $cpubw/bw_hwmon/sample_ms
echo 68 > $cpubw/bw_hwmon/io_percent
echo 20 > $cpubw/bw_hwmon/hist_memory
echo 0 > $cpubw/bw_hwmon/hyst_length
echo 80 > $cpubw/bw_hwmon/down_thres
echo 0 > $cpubw/bw_hwmon/guard_band_mbps
echo 250 > $cpubw/bw_hwmon/up_scale
echo 1600 > $cpubw/bw_hwmon/idle_mbps
echo 40 > $cpubw/polling_interval
done
# configure compute settings for silver latfloor
for latfloor in $device/*cpu0-cpu*latfloor/devfreq/*cpu0-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure compute settings for gold latfloor
for latfloor in $device/*cpu6-cpu*latfloor/devfreq/*cpu6-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure mem_latency settings for DDR scaling
for memlat in $device/*lat/devfreq/*lat
do
cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
echo 8 > $memlat/polling_interval
echo 400 > $memlat/mem_latency/ratio_ceil
done
#Gold CPU6 L3 ratio ceil
for l3gold in $device/*cpu6-cpu-l3-lat/devfreq/*cpu6-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
#Gold CPU7 L3 ratio ceil
for l3gold in $device/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
done
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
configure_memory_parameters
setprop vendor.post_boot.parsed 1

View file

@ -0,0 +1,240 @@
#=============================================================================
# Copyright (c) 2020-2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2012-2013, 2016-2020, 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 "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}
# Zram disk - 75% for < 2GB devices .
# For >2GB devices, size = 50% of RAM size. Limit the size to 4GB.
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 [ -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)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; 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
echo $ra_kb > $dm
done
}
function configure_memory_parameters() {
# Set Memory parameters.
# Set swappiness to 100 for all targets
echo 100 > /proc/sys/vm/swappiness
# Disable wsf for all 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
configure_zram_parameters
configure_read_ahead_kb_values
#Spawn 2 kswapd threads which can help in fast reclaiming of pages
echo 2 > /proc/sys/vm/kswapd_threads
}
# Core control parameters for silver
echo 0 0 0 0 1 1 > /sys/devices/system/cpu/cpu0/core_ctl/not_preferred
echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres
echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms
echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres
# Enable Core control for Silver
echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Disable Core control on gold
echo 0 > /sys/devices/system/cpu/cpu6/core_ctl/enable
# Setting b.L scheduler parameters
echo 65 > /proc/sys/kernel/sched_downmigrate
echo 71 > /proc/sys/kernel/sched_upmigrate
echo 85 > /proc/sys/kernel/sched_group_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 0 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
echo 0 > /proc/sys/kernel/sched_busy_hysteresis_enable_cpus
echo 5 > /proc/sys/kernel/sched_ravg_window_nr_ticks
# disable unfiltering
echo 20000000 > /proc/sys/kernel/sched_task_unfilter_period
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-5 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
echo 1190400 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 576000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/up_rate_limit_us
echo 1248000 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_freq
echo 768000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq
# Colocation V3 settings
echo 680000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/rtg_boost_freq
echo 51 > /proc/sys/kernel/sched_min_task_util_for_boost
echo 35 > /proc/sys/kernel/sched_min_task_util_for_colocation
# sched_load_boost as -6 is equivalent to target load as 85. It is per cpu tunable.
echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost
echo 85 > /sys/devices/system/cpu/cpufreq/policy6/schedutil/hispeed_load
# configure input boost settings
echo "0:1190400" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
# Enable bus-dcvs
for device in /sys/devices/platform/soc
do
for cpubw in $device/*cpu-cpu-ddr-bw/devfreq/*cpu-cpu-ddr-bw
do
cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
echo "bw_hwmon" > $cpubw/governor
echo "1144 1720 2086 2929 3879 5931 6881 8137" > $cpubw/bw_hwmon/mbps_zones
echo 4 > $cpubw/bw_hwmon/sample_ms
echo 68 > $cpubw/bw_hwmon/io_percent
echo 20 > $cpubw/bw_hwmon/hist_memory
echo 0 > $cpubw/bw_hwmon/hyst_length
echo 80 > $cpubw/bw_hwmon/down_thres
echo 0 > $cpubw/bw_hwmon/guard_band_mbps
echo 250 > $cpubw/bw_hwmon/up_scale
echo 1600 > $cpubw/bw_hwmon/idle_mbps
echo 40 > $cpubw/polling_interval
done
# configure compute settings for silver latfloor
for latfloor in $device/*cpu0-cpu*latfloor/devfreq/*cpu0-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure compute settings for gold latfloor
for latfloor in $device/*cpu6-cpu*latfloor/devfreq/*cpu6-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure mem_latency settings for DDR scaling
for memlat in $device/*lat/devfreq/*lat
do
cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
echo 8 > $memlat/polling_interval
echo 400 > $memlat/mem_latency/ratio_ceil
done
#Gold CPU6 L3 ratio ceil
for l3gold in $device/*cpu6-cpu-l3-lat/devfreq/*cpu6-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
#Gold CPU7 L3 ratio ceil
for l3gold in $device/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
done
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
configure_memory_parameters
setprop vendor.post_boot.parsed 1

View file

@ -1,369 +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.
#=============================================================================
function configure_zram_parameters() {
# Moto yangbq2: Skip this if we are using zram from fstab.
using_zram_from_fstab=`getprop ro.boot.using_zram_from_fstab`
if [ "$using_zram_from_fstab" == "true" ]; then
return
fi
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)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; 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
echo $ra_kb > $dm
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.
#
configure_zram_parameters
configure_read_ahead_kb_values
echo 100 > /proc/sys/vm/swappiness
}
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/kernel/sched_upmigrate
echo 85 85 > /proc/sys/kernel/sched_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 85 > /proc/sys/kernel/sched_group_downmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 400000000 > /proc/sys/kernel/sched_coloc_downmigrate_ns
echo 39000000 39000000 39000000 39000000 39000000 39000000 39000000 5000000 > /proc/sys/kernel/sched_coloc_busy_hyst_cpu_ns
echo 240 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
echo 10 10 10 10 10 10 10 95 > /proc/sys/kernel/sched_coloc_busy_hyst_cpu_busy_pct
# set the threshold for low latency task boost feature which prioritize
# binder activity tasks
echo 325 > /proc/sys/kernel/walt_low_latency_task_threshold
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
if [ $rev == "1.0" ]; then
echo 1190400 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
else
echo 1209600 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
fi
echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl
# configure input boost settings
if [ $rev == "1.0" ]; then
echo "0:1382800" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
else
echo "0:1305600" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
fi
echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us
if [ $rev == "1.0" ]; then
echo 1497600 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
else
echo 1555200 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
fi
echo 1 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl
# configure governor settings for gold+ cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/up_rate_limit_us
if [ $rev == "1.0" ]; then
echo 1536000 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
else
echo 1670400 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
fi
echo 1 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl
# configure bus-dcvs
for device in /sys/devices/platform/soc
do
for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw
do
cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
echo "4577 7110 9155 12298 14236 15258" > $cpubw/bw_hwmon/mbps_zones
echo 4 > $cpubw/bw_hwmon/sample_ms
echo 80 > $cpubw/bw_hwmon/io_percent
echo 20 > $cpubw/bw_hwmon/hist_memory
echo 10 > $cpubw/bw_hwmon/hyst_length
echo 30 > $cpubw/bw_hwmon/down_thres
echo 0 > $cpubw/bw_hwmon/guard_band_mbps
echo 250 > $cpubw/bw_hwmon/up_scale
echo 1600 > $cpubw/bw_hwmon/idle_mbps
echo 12298 > $cpubw/max_freq
echo 40 > $cpubw/polling_interval
done
for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw
do
cat $llccbw/available_frequencies | cut -d " " -f 1 > $llccbw/min_freq
if [ ${ddr_type:4:2} == $ddr_type4 ]; then
echo "1720 2086 2929 3879 5931 6515 8136" > $llccbw/bw_hwmon/mbps_zones
elif [ ${ddr_type:4:2} == $ddr_type5 ]; then
echo "1720 2086 2929 3879 6515 7980 12191" > $llccbw/bw_hwmon/mbps_zones
fi
echo 4 > $llccbw/bw_hwmon/sample_ms
echo 80 > $llccbw/bw_hwmon/io_percent
echo 20 > $llccbw/bw_hwmon/hist_memory
echo 10 > $llccbw/bw_hwmon/hyst_length
echo 30 > $llccbw/bw_hwmon/down_thres
echo 0 > $llccbw/bw_hwmon/guard_band_mbps
echo 250 > $llccbw/bw_hwmon/up_scale
echo 1600 > $llccbw/bw_hwmon/idle_mbps
echo 6515 > $llccbw/max_freq
echo 40 > $llccbw/polling_interval
done
for l3bw in $device/*snoop-l3-bw/devfreq/*snoop-l3-bw
do
cat $l3bw/available_frequencies | cut -d " " -f 1 > $l3bw/min_freq
echo 4 > $l3bw/bw_hwmon/sample_ms
echo 10 > $l3bw/bw_hwmon/io_percent
echo 20 > $l3bw/bw_hwmon/hist_memory
echo 10 > $l3bw/bw_hwmon/hyst_length
echo 0 > $l3bw/bw_hwmon/down_thres
echo 0 > $l3bw/bw_hwmon/guard_band_mbps
echo 0 > $l3bw/bw_hwmon/up_scale
echo 1600 > $l3bw/bw_hwmon/idle_mbps
echo 9155 > $l3bw/max_freq
echo 40 > $l3bw/polling_interval
done
# configure mem_latency settings for LLCC and DDR scaling and qoslat
for memlat in $device/*lat/devfreq/*lat
do
cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
echo 8 > $memlat/polling_interval
echo 400 > $memlat/mem_latency/ratio_ceil
done
# configure compute settings for gold latfloor
for latfloor in $device/*cpu4-cpu*latfloor/devfreq/*cpu4-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure mem_latency settings for prime latfloor
for latfloor in $device/*cpu7-cpu*latfloor/devfreq/*cpu7-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
echo 25000 > $latfloor/mem_latency/ratio_ceil
done
# CPU4 L3 ratio ceil
for l3gold in $device/*cpu4-cpu-l3-lat/devfreq/*cpu4-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
done
# CPU5 L3 ratio ceil
for l3gold in $device/*cpu5-cpu-l3-lat/devfreq/*cpu5-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
done
# CPU6 L3 ratio ceil
for l3gold in $device/*cpu6-cpu-l3-lat/devfreq/*cpu6-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
done
# prime L3 ratio ceil
for l3prime in $device/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
do
echo 20000 > $l3prime/mem_latency/ratio_ceil
done
# qoslat ratio ceil
for qoslat in $device/*qoslat/devfreq/*qoslat
do
echo 50 > $qoslat/mem_latency/ratio_ceil
done
done
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
echo s2idle > /sys/power/mem_sleep
configure_memory_parameters
# 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,387 +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.
#=============================================================================
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)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; 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
echo $ra_kb > $dm
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
echo 100 > /proc/sys/vm/swappiness
# Disable wsf beacause we are using efk.
# wsf Range : 1..1000. So set to bare minimum value 1.
echo 1 > /proc/sys/vm/watermark_scale_factor
#Spawn 2 kswapd threads which can help in fast reclaiming of pages
echo 2 > /proc/sys/vm/kswapd_threads
}
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 71 95 > /proc/sys/kernel/sched_upmigrate
echo 65 85 > /proc/sys/kernel/sched_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 85 > /proc/sys/kernel/sched_group_downmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 0 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
echo 1171200 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl
# configure input boost settings
echo "0:1171200" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us
echo 1209000 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
echo 691200 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_load
echo -6 > /sys/devices/system/cpu/cpu4/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu5/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl
# configure governor settings for gold+ cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/up_rate_limit_us
echo 1267000 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
echo 806400 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_load
echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl
# colocation V3 settings
echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rtg_boost_freq
echo 51 > /proc/sys/kernel/sched_min_task_util_for_boost
echo 35 > /proc/sys/kernel/sched_min_task_util_for_colocation
echo 20000000 > /proc/sys/kernel/sched_task_unfilter_period
# Enable conservative pl
echo 1 > /proc/sys/kernel/sched_conservative_pl
# configure bus-dcvs
for device in /sys/devices/platform/soc
do
for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw
do
cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
echo "2288 4577 7110 9155 12298 14236 15258" > $cpubw/bw_hwmon/mbps_zones
echo 4 > $cpubw/bw_hwmon/sample_ms
echo 68 > $cpubw/bw_hwmon/io_percent
echo 20 > $cpubw/bw_hwmon/hist_memory
echo 0 > $cpubw/bw_hwmon/hyst_length
echo 80 > $cpubw/bw_hwmon/down_thres
echo 0 > $cpubw/bw_hwmon/guard_band_mbps
echo 250 > $cpubw/bw_hwmon/up_scale
echo 1600 > $cpubw/bw_hwmon/idle_mbps
echo 40 > $cpubw/polling_interval
done
for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw
do
cat $llccbw/available_frequencies | cut -d " " -f 1 > $llccbw/min_freq
if [ ${ddr_type:4:2} == $ddr_type4 ]; then
echo "1144 1720 2086 2929 3879 5931 6515 8136" > $llccbw/bw_hwmon/mbps_zones
elif [ ${ddr_type:4:2} == $ddr_type5 ]; then
echo "1144 1720 2086 2929 3879 5931 6515 7980 12191" > $llccbw/bw_hwmon/mbps_zones
fi
echo 4 > $llccbw/bw_hwmon/sample_ms
echo 68 > $llccbw/bw_hwmon/io_percent
echo 20 > $llccbw/bw_hwmon/hist_memory
echo 0 > $llccbw/bw_hwmon/hyst_length
echo 80 > $llccbw/bw_hwmon/down_thres
echo 0 > $llccbw/bw_hwmon/guard_band_mbps
echo 250 > $llccbw/bw_hwmon/up_scale
echo 1600 > $llccbw/bw_hwmon/idle_mbps
echo 48 > $llccbw/polling_interval
done
for l3bw in $device/*snoop-l3-bw/devfreq/*snoop-l3-bw
do
cat $l3bw/available_frequencies | cut -d " " -f 1 > $l3bw/min_freq
echo 4 > $l3bw/bw_hwmon/sample_ms
echo 10 > $l3bw/bw_hwmon/io_percent
echo 20 > $l3bw/bw_hwmon/hist_memory
echo 10 > $l3bw/bw_hwmon/hyst_length
echo 0 > $l3bw/bw_hwmon/down_thres
echo 0 > $l3bw/bw_hwmon/guard_band_mbps
echo 0 > $l3bw/bw_hwmon/up_scale
echo 1600 > $l3bw/bw_hwmon/idle_mbps
echo 9155 > $l3bw/max_freq
echo 40 > $l3bw/polling_interval
done
# configure mem_latency settings for LLCC and DDR scaling and qoslat
for memlat in $device/*lat/devfreq/*lat
do
cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
echo 8 > $memlat/polling_interval
echo 400 > $memlat/mem_latency/ratio_ceil
done
# configure compute settings for silver latfloor
for latfloor in $device/*cpu0-cpu*latfloor/devfreq/*cpu0-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure compute settings for gold latfloor
for latfloor in $device/*cpu4-cpu*latfloor/devfreq/*cpu4-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure mem_latency settings for prime latfloor
for latfloor in $device/*cpu7-cpu*latfloor/devfreq/*cpu7-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
echo 25000 > $latfloor/mem_latency/ratio_ceil
done
# CPU4 L3 ratio ceil
for l3gold in $device/*cpu4-cpu-l3-lat/devfreq/*cpu4-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
# CPU5 L3 ratio ceil
for l3gold in $device/*cpu5-cpu-l3-lat/devfreq/*cpu5-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
# CPU6 L3 ratio ceil
for l3gold in $device/*cpu6-cpu-l3-lat/devfreq/*cpu6-cpu-l3-lat
do
echo 4000 > $l3gold/mem_latency/ratio_ceil
echo 25000 > $l3gold/mem_latency/wb_filter_ratio
echo 60 > $l3gold/mem_latency/wb_pct_thres
done
# prime L3 ratio ceil
for l3prime in $device/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
do
echo 20000 > $l3prime/mem_latency/ratio_ceil
echo 25000 > $l3prime/mem_latency/wb_filter_ratio
echo 60 > $l3prime/mem_latency/wb_pct_thres
done
# qoslat ratio ceil
for qoslat in $device/*qoslat/devfreq/*qoslat
do
echo 50 > $qoslat/mem_latency/ratio_ceil
done
done
#Enable sleep and set s2idle as default suspend mode
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
echo s2idle > /sys/power/mem_sleep
configure_memory_parameters
# 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.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,364 +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.
#=============================================================================
function configure_zram_parameters() {
# Moto yangbq2: Skip this if we are using zram from fstab.
using_zram_from_fstab=`getprop ro.boot.using_zram_from_fstab`
if [ "$using_zram_from_fstab" == "true" ]; then
return
fi
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)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; 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
echo $ra_kb > $dm
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
echo 100 > /proc/sys/vm/swappiness
# Disable wsf beacause we are using efk.
# wsf Range : 1..1000. So set to bare minimum value 1.
echo 1 > /proc/sys/vm/watermark_scale_factor
#Spawn 2 kswapd threads which can help in fast reclaiming of pages
#yangbq2 change kswapd threads to one thread
echo 1 > /proc/sys/vm/kswapd_threads
#yangbq2 disable watermark boost
echo 0 > /proc/sys/vm/watermark_boost_factor
}
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
# Prefer CPU4 for isolation based on the thermal characteristics.
echo 1 0 0 > /sys/devices/system/cpu/cpu4/core_ctl/not_preferred
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 71 95 > /proc/sys/kernel/sched_upmigrate
echo 65 85 > /proc/sys/kernel/sched_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 85 > /proc/sys/kernel/sched_group_downmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 0 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
# cpuset parameters
echo 0-3 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
echo 1152000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl
# configure input boost settings
echo "0:1152000" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us
echo 1228800 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
echo 691200 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_load
echo -6 > /sys/devices/system/cpu/cpu4/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu5/sched_load_boost
echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl
# configure governor settings for gold+ cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/up_rate_limit_us
echo 1324800 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
echo 806400 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
echo 85 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_load
echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/rtg_boost_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl
# colocation V3 settings
echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rtg_boost_freq
echo 51 > /proc/sys/kernel/sched_min_task_util_for_boost
echo 35 > /proc/sys/kernel/sched_min_task_util_for_colocation
echo 20000000 > /proc/sys/kernel/sched_task_unfilter_period
# Enable conservative pl
echo 1 > /proc/sys/kernel/sched_conservative_pl
# configure RIMPS for L3 DCVS
for c0_rimps_l3 in /sys/devices/system/cpu/memlat/c0_memlat/cpu0-cpu-l3-lat
do
cat $c0_rimps_l3/available_frequencies | cut -d " " -f 1 > $c0_rimps_l3/min_freq
echo 400 > $c0_rimps_l3/ratio_ceil
echo 3 > $c0_rimps_l3/sample_ms
done
for c4_rimps_l3 in /sys/devices/system/cpu/memlat/c4_memlat/cpu4-cpu-l3-lat
do
cat $c4_rimps_l3/available_frequencies | cut -d " " -f 1 > $c4_rimps_l3/min_freq
echo 4000 > $c4_rimps_l3/ratio_ceil
echo 3 > $c4_rimps_l3/sample_ms
echo 60 > $c4_rimps_l3/l2wb_pct
echo 25000 > $c4_rimps_l3/l2wb_filter
done
for c7_rimps_l3 in /sys/devices/system/cpu/memlat/c7_memlat/cpu7-cpu-l3-lat
do
cat $c7_rimps_l3/available_frequencies | cut -d " " -f 1 > $c7_rimps_l3/min_freq
echo 20000 > $c7_rimps_l3/ratio_ceil
echo 3 > $c7_rimps_l3/sample_ms
echo 60 > $c7_rimps_l3/l2wb_pct
echo 25000 > $c7_rimps_l3/l2wb_filter
done
# configure bus-dcvs
for device in /sys/devices/platform/soc
do
for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw
do
cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
echo "2288 4577 7110 9155 12298 14236 15258" > $cpubw/bw_hwmon/mbps_zones
echo 4 > $cpubw/bw_hwmon/sample_ms
echo 68 > $cpubw/bw_hwmon/io_percent
echo 20 > $cpubw/bw_hwmon/hist_memory
echo 0 > $cpubw/bw_hwmon/hyst_length
echo 80 > $cpubw/bw_hwmon/down_thres
echo 0 > $cpubw/bw_hwmon/guard_band_mbps
echo 250 > $cpubw/bw_hwmon/up_scale
echo 1600 > $cpubw/bw_hwmon/idle_mbps
echo 40 > $cpubw/polling_interval
done
for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw
do
cat $llccbw/available_frequencies | cut -d " " -f 1 > $llccbw/min_freq
if [ ${ddr_type:4:2} == $ddr_type4 ]; then
echo "1144 1720 2086 2929 3879 5931 6515 8136" > $llccbw/bw_hwmon/mbps_zones
elif [ ${ddr_type:4:2} == $ddr_type5 ]; then
echo "1144 1720 2086 2929 3879 5931 6515 7980 12191" > $llccbw/bw_hwmon/mbps_zones
fi
echo 4 > $llccbw/bw_hwmon/sample_ms
echo 68 > $llccbw/bw_hwmon/io_percent
echo 20 > $llccbw/bw_hwmon/hist_memory
echo 0 > $llccbw/bw_hwmon/hyst_length
echo 80 > $llccbw/bw_hwmon/down_thres
echo 0 > $llccbw/bw_hwmon/guard_band_mbps
echo 250 > $llccbw/bw_hwmon/up_scale
echo 1600 > $llccbw/bw_hwmon/idle_mbps
echo 48 > $llccbw/polling_interval
done
for l3bw in $device/*snoop-l3-bw/devfreq/*snoop-l3-bw
do
cat $l3bw/available_frequencies | cut -d " " -f 1 > $l3bw/min_freq
echo 4 > $l3bw/bw_hwmon/sample_ms
echo 10 > $l3bw/bw_hwmon/io_percent
echo 20 > $l3bw/bw_hwmon/hist_memory
echo 10 > $l3bw/bw_hwmon/hyst_length
echo 0 > $l3bw/bw_hwmon/down_thres
echo 0 > $l3bw/bw_hwmon/guard_band_mbps
echo 0 > $l3bw/bw_hwmon/up_scale
echo 1600 > $l3bw/bw_hwmon/idle_mbps
echo 9155 > $l3bw/max_freq
echo 40 > $l3bw/polling_interval
done
# configure mem_latency settings for LLCC and DDR scaling and qoslat
for memlat in $device/*lat/devfreq/*lat
do
cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
echo 8 > $memlat/polling_interval
echo 400 > $memlat/mem_latency/ratio_ceil
done
# configure compute settings for silver latfloor
for latfloor in $device/*cpu0-cpu*latfloor/devfreq/*cpu0-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure compute settings for gold latfloor
for latfloor in $device/*cpu4-cpu*latfloor/devfreq/*cpu4-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
done
# configure mem_latency settings for prime latfloor
for latfloor in $device/*cpu7-cpu*latfloor/devfreq/*cpu7-cpu*latfloor
do
cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
echo 8 > $latfloor/polling_interval
echo 25000 > $latfloor/mem_latency/ratio_ceil
done
# qoslat ratio ceil
for qoslat in $device/*qoslat/devfreq/*qoslat
do
echo 50 > $qoslat/mem_latency/ratio_ceil
done
done
#Enable sleep and set s2idle as default suspend mode
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
echo s2idle > /sys/power/mem_sleep
configure_memory_parameters
setprop vendor.post_boot.parsed 1

63
rootdir/bin/init.kernel.post_boot.sh Executable file → Normal file
View file

@ -1,52 +1,49 @@
#=============================================================================
# Copyright (c) 2019-2021 Qualcomm Technologies, Inc.
# 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.
# Copyright (c) 2012-2013, 2016-2020, 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:
# 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.
# * 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.
# THIS SOFTWARE IS PROVIDED "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.
#=============================================================================
if [ -f /sys/devices/soc0/soc_id ]; then
platformid=`cat /sys/devices/soc0/soc_id`
if [ -f /sys/devices/soc0/chip_family ]; then
chipfamily=`cat /sys/devices/soc0/chip_family`
fi
case "$platformid" in
"415"|"439"|"456"|"501"|"502")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-lahaina.sh
case "$chipfamily" in
"0x73")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-holi.sh
;;
"450")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-shima.sh
;;
"475"|"499"|"487"|"488"|"498"|"497"|"515")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-yupik.sh
"0x7c")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-blair.sh
;;
*)
echo "***WARNING***: Invalid SoC ID\n\t No postboot settings applied!!\n"
echo "***WARNING***: Invalid chip family\n\t No postboot settings applied!!\n"
;;
esac

0
rootdir/bin/init.mmi.boot.sh Executable file → Normal file
View file

2
rootdir/bin/init.mmi.touch.sh Executable file → Normal file
View file

@ -58,7 +58,7 @@ debug()
notice()
{
echo "$*"
echo "$scriptname: $*" > /dev/kmsg
log -t "$scriptname" -p i "$*"
}
sanity_check()

2
rootdir/bin/init.oem.hw.sh Executable file → Normal file
View file

@ -181,7 +181,7 @@ debug()
notice()
{
echo "$*"
echo "$scriptname: $*" > /dev/kmsg
log -t "$scriptname" -p i "$*"
}
add_device_params()

0
rootdir/bin/init.qcom.class_core.sh Executable file → Normal file
View file

0
rootdir/bin/init.qcom.coex.sh Executable file → Normal file
View file

4
rootdir/bin/init.qcom.early_boot.sh Executable file → Normal file
View file

@ -372,10 +372,6 @@ case "$target" in
;;
518)
;;
*)
# default case is for bengal
setprop vendor.netflix.bsp_rev "Q6115-31409-1"
;;
esac
;;
"sdm710" | "msmpeafowl")

52
rootdir/bin/init.qcom.post_boot.sh Executable file → Normal file
View file

@ -1060,7 +1060,8 @@ else
# wsf Range : 1..1000 So set to bare minimum value 1.
echo 1 > /proc/sys/vm/watermark_scale_factor
configure_zram_parameters
# remove zram config here due to already configed in init.mmi
#configure_zram_parameters
configure_read_ahead_kb_values
@ -1093,6 +1094,13 @@ function start_hbtp()
fi
}
case "$target" in
"holi" )
echo 0-3 > /dev/cpuset/background/cpus
echo 1 > /sys/module/msm_show_resume_irq/parameters/debug_mask
;;
esac
case "$target" in
"msm7201a_ffa" | "msm7201a_surf" | "msm7627_ffa" | "msm7627_6x" | "msm7627a" | "msm7627_surf" | \
"qsd8250_surf" | "qsd8250_ffa" | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "qsd8650a_st1x")
@ -1101,6 +1109,36 @@ case "$target" in
;;
esac
# For Kodiak target for which cdsp is defective, we read remote cdsp status from fastrpc node
# and if its value is false we disable cdsp daemon by setting the cdsp disable propety to true
case "$target" in
"lahaina")
if [ -f /sys/devices/soc0/chip_family ]; then
chip_family_id=`cat /sys/devices/soc0/chip_family`
else
chip_family_id=-1
fi
echo "adsprpc : chip_family_id : $chip_faily_id" > /dev/kmsg
case "$chip_family_id" in
"0x76")
if [ -f /sys/devices/platform/soc/soc:qcom,msm_fastrpc/remote_cdsp_status ]; then
remote_cdsp_status=`cat /sys/devices/platform/soc/soc:qcom,msm_fastrpc/remote_cdsp_status`
else
remote_cdsp_status=-1
fi
echo "adsprpc : remote_cdsp_status : $remote_cdsp_status" > /dev/kmsg
if [ $remote_cdsp_status -eq 0 ]; then
setprop vendor.fastrpc.disable.cdsprpcd.daemon 1
echo "adsprpc : Disabled cdsp daemon" > /dev/kmsg
fi
esac
;;
esac
case "$target" in
"msm7201a_ffa" | "msm7201a_surf")
echo 500000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
@ -5282,14 +5320,11 @@ case "$target" in
echo 85 85 > /proc/sys/kernel/sched_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 10 > /proc/sys/kernel/sched_group_downmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
echo 0-3 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
@ -5378,8 +5413,12 @@ case "$target" in
echo 0 > $npubw/bw_hwmon/idle_mbps
echo 40 > $npubw/polling_interval
echo 0 > /sys/devices/virtual/npu/msm_npu/pwr
done
done
done
done
fi
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
# memlat specific settings are moved to seperate file under
# device/target specific folder
@ -5427,7 +5466,6 @@ case "$target" in
configure_automotive_sku_parameters
fi
fi
fi
;;
esac

0
rootdir/bin/init.qcom.sensors.sh Executable file → Normal file
View file

0
rootdir/bin/init.qcom.sh Executable file → Normal file
View file

0
rootdir/bin/init.qti.chg_policy.sh Executable file → Normal file
View file

0
rootdir/bin/init.qti.kernel.sh Executable file → Normal file
View file

0
rootdir/bin/init.qti.qcv.sh Executable file → Normal file
View file

0
rootdir/bin/vendor_modprobe.sh Executable file → Normal file
View file

View file

@ -1,27 +1,53 @@
# Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
system /system ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
system_ext /system_ext ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
product /product ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
vendor /vendor ext4 ro,discard wait,slotselect,avb,logical,first_stage_mount
/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard,data=ordered,barrier=1 wait,formattable,first_stage_mount,check
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,metadata_encryption=aes-256-xts:wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs
/devices/platform/soc/8804000.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto
/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt ext4 ro,nosuid,nodev,context=u:object_r:firmware_file:s0 wait,slotselect
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait
/dev/block/bootdevice/by-name/prodpersist /mnt/product/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait,formattable,nofail
/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware ext4 ro,nosuid,nodev,context=u:object_r:bt_firmware_file:s0 wait,slotselect
/devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/fsg /vendor/fsg ext4 ro,nosuid,nodev,context=u:object_r:fsg_file:s0 wait,slotselect
# Need to have this entry in here even though the mount point itself is no longer needed.
# The update_engine code looks for this entry in order to determine the boot device address
# and fails if it does not find it.
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/zram0 none swap defaults zramsize=50%
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
system /system ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
system_ext /system_ext ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
product /product ext4 ro,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
vendor /vendor ext4 ro,discard wait,slotselect,avb=vbmeta,logical,first_stage_mount
/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard,data=ordered,barrier=1 wait,check,formattable,first_stage_mount
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait
/dev/block/bootdevice/by-name/prodpersist /mnt/product/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait,formattable,nofail
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,sysfs_path=/sys/devices/platform/soc/4804000.ufshc,reservedsize=128M,checkpoint=fs
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/devices/platform/soc/4784000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto
/devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt ext4 ro,nosuid,nodev,context=u:object_r:firmware_file:s0 wait,slotselect
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect
/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware ext4 ro,nosuid,nodev,context=u:object_r:bt_firmware_file:s0 wait,slotselect
/dev/block/bootdevice/by-name/fsg /vendor/fsg ext4 ro,nosuid,nodev,context=u:object_r:fsg_file:s0 wait,slotselect
/dev/block/zram0 none swap defaults zramsize=75%

View file

@ -12,7 +12,7 @@ on moto-charger
start vendor.thermal-com
start system_suspend
# Enable only CPU core 0 to keep current drain to a minimum
# Enable only CPU core 0 to keep current drain to a minimum
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu1/online 0
@ -22,7 +22,7 @@ on moto-charger
write /sys/devices/system/cpu/cpu5/online 0
write /sys/devices/system/cpu/cpu6/online 0
write /sys/devices/system/cpu/cpu7/online 0
service vendor.thermal-com /vendor/bin/thermal-engine --minimode
class charger
user root

View file

@ -1,31 +1,43 @@
# Charge only mode configuration
import /vendor/etc/init/hw/init.mmi.charge_only.rc
on post-fs
# MOT_LED_CALIBRATION
chown camera camera /mnt/vendor/persist/camera/mot_ledcal
on property:ro.build.type=userdebug && property:ro.vendor.mot.gki.path=*
insmod /vendor/lib/modules/${ro.vendor.mot.gki.path}/watchdogtest.ko
on early-init
exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules exfat
on property:ro.boot.default_usb_mode=device && property:vendor.usb.controller=*
setprop sys.usb.controller ${vendor.usb.controller}
write /sys/class/udc/${vendor.usb.controller}/device/../mode peripheral
on early-init && property:ro.bootmode=mot-factory
insmod /vendor/lib/modules/moto_f_usbnet.ko
on early-boot
# Permission for Health Storage HAL
chown system system /sys/devices/platform/soc/1d84000.ufshc/manual_gc
chown system system /sys/devices/platform/soc/1d84000.ufshc/ufshid/trigger
chown system system /sys/devices/platform/soc/4804000.ufshc/manual_gc
chown system system /sys/devices/platform/soc/4804000.ufshc/ufshid/trigger
#sync power supply with healthd
wait /sys/class/power_supply/battery
wait /sys/class/power_supply/usb
on early-boot && property:ro.boot.bm_ulog_enabled=1
write /sys/module/bm_adsp_ulog/parameters/debug_enabled 1
on property:ro.build.type=userdebug
setprop persist.vendor.qg.log_level 1
#Enable qpnp-qg debug_mask
#QG_DEBUG_PON | QG_DEBUG_STATUS | QG_DEBUG_IRQ | QG_DEBUG_PM | QG_DEBUG_ESR
write /sys/kernel/debug/qgauge/debug_mask 0x8A9
#Enable mmi_smbcharger_iio debug
write /sys/module/mmi_smbcharger_iio/parameters/debug_enabled Y
on charger && property:ro.boot.bm_ulog_enabled=1
write /sys/module/bm_adsp_ulog/parameters/debug_enabled 1
on boot
# Set adaptive charging perms for HAL
chown system system /sys/module/qpnp_adaptive_charge/parameters/upper_limit
chown system system /sys/module/qpnp_adaptive_charge/parameters/lower_limit
on property:sys.boot_completed=1
write /sys/devices/platform/soc/soc:mmi,charger/state_sync 1
on post-fs && property:ro.vendor.build.motfactory=1
write /sys/devices/platform/soc/soc:mmi,charger/state_sync 1
wait /sys/class/power_supply/battery/device/factory_image_mode
write /sys/class/power_supply/battery/device/factory_image_mode 1
on property:vendor.boot_completed=1
start thermal-engine
on property:dev.bootcomplete=1
stop llkd-${ro.debuggable:-0}

View file

@ -8,6 +8,12 @@ on early-boot
write /sys/module/subsystem_restart/parameters/disable_restart_work 0x0
on init
chown system log /sys/fs/pstore/console-ramoops-0
chmod 0440 /sys/fs/pstore/console-ramoops-0
chown system log /sys/fs/pstore/annotate-ramoops-0
chmod 0640 /sys/fs/pstore/annotate-ramoops-0
chown system log /sys/fs/pstore/dmesg-ramoops-0
chmod 0640 /sys/fs/pstore/dmesg-ramoops-0
chown system log /proc/driver/mmi_annotate
chmod 0640 /proc/driver/mmi_annotate
@ -243,8 +249,8 @@ on post-fs-data
#Folder for hardware properties
mkdir /data/vendor/hardware_revisions 0755 system system
# Imager tuning data for camera subsystem
mkdir /data/vendor/misc/imager 0771 camera camera
# Imager tuning metadata for camera subsystem
mkdir /data/vendor/misc/imager/metadata 0771 camera camera
# NFC vendor data
mkdir /data/vendor/nfc 0770 nfc nfc
@ -364,6 +370,20 @@ service vendor.hal-fps-sh /vendor/bin/init.oem.fingerprint2.sh
group system
oneshot
service fpc_ident /vendor/bin/hw/fpc_ident
class late_start
user system
group system
oneshot
disabled
service egis_ident /vendor/bin/hw/egis_ident
class late_start
user system
group system
oneshot
disabled
service vendor.touch-dead-sh /vendor/bin/init.oem.hw.sh -f
class main
user root

View file

@ -24,9 +24,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import /vendor/etc/init/hw/init.target.rc
import /vendor/etc/init/hw/init.qcom.usb.rc
import /vendor/etc/init/hw/init.target.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
@ -72,7 +76,6 @@ on init
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
write /sys/kernel/icnss/wpss_boot 1
chmod 0660 /sys/fs/cgroup/memory/bg/tasks
on post-fs
@ -184,9 +187,7 @@ on boot
# bond0 used by FST Manager
chown wifi wifi /sys/class/net/bond0/bonding/queue_id
# Allow access to emmc rawdump block partition and dload sysfs node
chown root system /dev/block/bootdevice/by-name/rawdump
chmod 0660 /dev/block/bootdevice/by-name/rawdump
# Allow access to emmc 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
@ -233,7 +234,7 @@ on post-fs-data
# Create directory used by display clients
mkdir /data/vendor/display 0770 system graphics
# Change lm related dirs
mkdir /data/vendor/lm 0700 root root
@ -241,7 +242,7 @@ on post-fs-data
mkdir /data/vendor/pwr 0700 root root
# Create directory used by media clients
mkdir /data/vendor/media 0775 mediacodec media
mkdir /data/vendor/media 0770 mediacodec media
# Create /data/vendor/tzstorage directory for SFS listener
mkdir /data/vendor/tzstorage 0770 system system
@ -335,14 +336,14 @@ on post-fs-data
#Create FM dir for patchdownloader
mkdir /data/vendor/fm 0770 system system
chmod 0770 /data/vendor/fm
#Create PERFD deamon related dirs
mkdir /data/vendor/perfd 0770 root system
chmod 2770 /data/vendor/perfd
rm /data/vendor/perfd/default_values
mkdir /data/vendor/secure_element 0777 system system
#Create IOP deamon related dirs
mkdir /data/vendor/iop 0700 root system
@ -390,6 +391,13 @@ on post-fs-data
#Create dir for TUI
mkdir /data/vendor/tui 0700 system drmrpc
service iop /system/vendor/bin/iop
class main
user root
group root
disabled
socket iop seqpacket 0666 root system
on property:ro.vendor.hw.dualsim=true
setprop persist.vendor.radio.multisim.config dsds

View file

@ -29,6 +29,7 @@
# 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
mount debugfs debugfs /sys/kernel/debug
@ -81,9 +82,7 @@ on boot
# Set the default message loglevel to KERN_INFO
write /proc/sys/kernel/printk "4 6 1 7"
# Allow access to emmc rawdump block partition and dload sysfs node
chown root system /dev/block/bootdevice/by-name/rawdump
chmod 0660 /dev/block/bootdevice/by-name/rawdump
# 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

View file

@ -1,5 +1,5 @@
# Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@ -30,10 +30,10 @@
import /vendor/etc/init/hw/init.mmi.rc
import /vendor/etc/init/hw/init.qti.kernel.rc
on early-init
exec u:r:vendor_modprobe:s0 -- /vendor/bin/vendor_modprobe.sh
exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules q6_pdr_dlkm q6_notifier_dlkm snd_event_dlkm apr_dlkm adsp_loader_dlkm q6_dlkm native_dlkm pinctrl_wcd_dlkm pinctrl_lpi_dlkm swr_dlkm platform_dlkm hdmi_dlkm stub_dlkm wcd_core_dlkm wsa883x_dlkm bolero_cdc_dlkm wsa_macro_dlkm va_macro_dlkm rx_macro_dlkm tx_macro_dlkm bt_fm_slim wcd938x_dlkm wcd938x_slave_dlkm wcd937x_dlkm wcd937x_slave_dlkm swr_dmic_dlkm swr_haptics_dlkm machine_dlkm radio-i2c-rtc6226-qca cdsprm
exec_background u:r:vendor_modprobe:s0 -- /vendor/bin/vendor_modprobe.sh
exec_background u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules q6_pdr_dlkm q6_notifier_dlkm snd_event_dlkm apr_dlkm adsp_loader_dlkm q6_dlkm native_dlkm pinctrl_lpi_dlkm swr_dlkm platform_dlkm stub_dlkm wcd_core_dlkm wsa881x_analog_dlkm bolero_cdc_dlkm va_macro_dlkm rx_macro_dlkm tx_macro_dlkm bt_fm_slim wcd938x_dlkm wcd938x_slave_dlkm wcd937x_dlkm wcd937x_slave_dlkm machine_dlkm radio-i2c-rtc6226-qca cdsprm
exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qti.early_init.sh
write /proc/sys/kernel/sched_boost 1
wait /sys/devices/soc0/soc_id
@ -65,8 +65,6 @@ on init
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
chown system system /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
chmod 0660 /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
start logd
on early-fs
@ -74,17 +72,13 @@ on early-fs
on fs
start hwservicemanager
mkdir /mnt/vendor/spunvm 0660 system system
mount_all --early
chown root system /mnt/vendor/persist
chmod 0771 /mnt/vendor/persist
restorecon_recursive /mnt/vendor/persist
mkdir /mnt/vendor/persist/data 0700 system system
on fs && property:ro.boot.product.vendor.sku=lahaina
mkdir /mnt/vendor/spunvm 0660 system system
wait /dev/block/bootdevice/by-name/spunvm
mount vfat /dev/block/bootdevice/by-name/spunvm /mnt/vendor/spunvm rw noatime shortname=lower,uid=1000,gid=1000,dmask=007,fmask=007,context=u:object_r:vendor_spunvm_file:s0
mkdir /mnt/vendor/persist/wlan 0700 system system
chmod 0700 /mnt/vendor/persist/wlan
on post-fs
# set RLIMIT_MEMLOCK to 64MB
@ -95,8 +89,6 @@ on late-fs
on post-fs-data
mkdir /vendor/data/tombstones 0771 system system
# Enable WLAN cold boot calibration
write /sys/devices/platform/soc/b0000000.qcom,cnss-qca6490/fs_ready 1
on early-boot
start vendor.sensors
@ -106,36 +98,13 @@ on boot
# set default schedTune value for camera-daemon
write /dev/stune/camera-daemon/schedtune.prefer_idle 1
write /dev/stune/camera-daemon/schedtune.boost 0
chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_enable
chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_enable
chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
chown system /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_enable
chmod 0660 /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_enable
chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_event
chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_event
chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_event
chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_event
chown system /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_event
chmod 0660 /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_event
chown system /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_enable
chmod 0660 /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_enable
chown system /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_event
chmod 0660 /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_event
chown system /sys/devices/system/cpu/hyp_core_ctl/enable
chown system /sys/devices/system/cpu/hyp_core_ctl/hcc_min_freq
#USB controller configuration
setprop vendor.usb.rndis.func.name "gsi"
setprop vendor.usb.rmnet.func.name "gsi"
setprop vendor.usb.rmnet.inst.name "rmnet"
setprop vendor.usb.dpl.inst.name "dpl"
setprop vendor.usb.qdss.inst.name "qdss_mdm"
setprop vendor.usb.controller a600000.dwc3
#Load WLAN driver
exec_background u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules/ qca_cld3_wlan qca_cld3_qca6390
exec_background u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules/5.4-gki qca_cld3_wlan qca_cld3_qca6390
#Allow access to memory hotplug device attributes
chown system system /sys/kernel/mem-offline/anon_migrate
setprop vendor.usb.controller 4e00000.dwc3
on boot && property:persist.vendor.usb.controller.default=*
setprop vendor.usb.controller ${persist.vendor.usb.controller.default}
@ -147,7 +116,7 @@ on init && property:ro.boot.mode=charger
on charger
start vendor.power_off_alarm
setprop sys.usb.controller a600000.dwc3
setprop sys.usb.controller 4e00000.dwc3
setprop sys.usb.configfs 1
service vendor.lowi /vendor/bin/lowirpcd
@ -177,7 +146,7 @@ service vendor.per_proxy /vendor/bin/pm-proxy
#service vendor.mdm_helper /vendor/bin/mdm_helper
# class core
# group log system wakelock diag vendor_rfs
# group system wakelock
# disabled
service vendor.mdm_launcher /vendor/bin/sh /vendor/bin/init.mdm.sh
@ -189,16 +158,3 @@ on property:init.svc.vendor.per_mgr=running
on property:sys.shutdown.requested=*
stop vendor.per_proxy
#fan-controller
service fan_control_turn_on /vendor/bin/fan_control 1
class late_start
user root
disabled
oneshot
service fan_control_turn_off /vendor/bin/fan_control 0
class late_start
user root
disabled
oneshot

View file

@ -72,6 +72,7 @@ firmware_directories /vendor/firmware_mnt/image/
/dev/smd2 0660 bluetooth bluetooth
/dev/smd3 0660 bluetooth bluetooth
/dev/btpower 0660 bluetooth system
/dev/btfmslim 0660 bluetooth system
#permissions for pta
/dev/pta 0660 system system
@ -173,10 +174,15 @@ firmware_directories /vendor/firmware_mnt/image/
#qvr
/dev/qvr_external_sensor_ioctl 0660 system system
/sys/kernel/qvr_external_sensor/fd 0660 system system
/dev/bus/usb/* 0660 root usb
/dev/hidraw* 0660 root usb
#rawdump
/dev/block/platform/soc/*/by-name/rawdump 0660 root system
# Trustonic TEE device
/dev/mobicore 0600 system system
/dev/mobicore-user 0666 system system
# wlan
/dev/wcnss_wlan 0660 system system
/dev/wcnss_ctrl 0660 system system
@ -293,7 +299,6 @@ firmware_directories /vendor/firmware_mnt/image/
/sys/devices/virtual/input/input* enable_ps_sensor 0660 system input
/sys/devices/virtual/input/input* set_delay_ms 0660 system input
/sys/devices/virtual/input/input* do_flush 0660 system input
/dev/stmvl53l5 0660 system camera
# vm_bms
/dev/vm_bms 0660 system system
@ -381,6 +386,13 @@ firmware_directories /vendor/firmware_mnt/image/
# Kmsg device
/dev/kmsg 0620 root system
# I2C
/dev/i2c-* 0660 system system
# change permission for some capsensor nodes
/sys/class/sensors/Moto\ CapSense\ Ch* enable 0660 root input
/sys/class/sensors/Moto\ CapSense\ Ch* poll_delay 0660 root input
# LED class devices
/sys/class/leds/red delay_on 0640 system system
/sys/class/leds/red delay_off 0640 system system
@ -394,10 +406,6 @@ firmware_directories /vendor/firmware_mnt/image/
/sys/class/leds/blue delay_off 0640 system system
/sys/class/leds/blue breath 0640 system system
/sys/class/leds/blue trigger 0640 system system
/sys/class/leds/charging delay_on 0640 system system
/sys/class/leds/charging delay_off 0640 system system
/sys/class/leds/charging breath 0640 system system
/sys/class/leds/charging trigger 0640 system system
# NPU device
/dev/msm_npu 0644 system system
@ -510,9 +518,3 @@ firmware_directories /vendor/firmware_mnt/image/
# socinfo
/sys/devices/soc0 serial_number 0000 root root
# I2C
/dev/i2c-* 0660 system system
# NFC ST Driver permissions
/dev/st21nfc 0660 nfc nfc