sm8250-common -> sm7325-common
This commit is contained in:
parent
5404d41486
commit
95b667c5b9
74 changed files with 4210 additions and 3942 deletions
|
|
@ -1,30 +0,0 @@
|
|||
#!/vendor/bin/sh
|
||||
|
||||
debug=$(getprop ro.boot.gbdebug 2> /dev/null)
|
||||
bootmode=$(getprop ro.bootmode 2> /dev/null)
|
||||
|
||||
# If androidboot.gbdebug is set on command line, skip inserting
|
||||
# the pre-installed modules.
|
||||
if [ "$debug" == "1" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
insmod /vendor/lib/modules/greybus.ko
|
||||
|
||||
# Only support PTP and BATTERY in charge-only mode
|
||||
if [ "$bootmode" == "charger" ]; then
|
||||
insmod /vendor/lib/modules/gb-mods.ko
|
||||
insmod /vendor/lib/modules/gb-battery.ko
|
||||
insmod /vendor/lib/modules/gb-ptp.ko
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
gbmods="/vendor/lib/modules/gb-*"
|
||||
for mod in $gbmods
|
||||
do
|
||||
insmod $mod
|
||||
done
|
||||
|
||||
insmod /vendor/lib/modules/v4l2-hal.ko
|
||||
start vendor.mods_camd
|
||||
365
rootdir/bin/init.kernel.post_boot-lahaina.sh
Executable file
365
rootdir/bin/init.kernel.post_boot-lahaina.sh
Executable file
|
|
@ -0,0 +1,365 @@
|
|||
#=============================================================================
|
||||
# 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.
|
||||
#
|
||||
|
||||
configure_zram_parameters
|
||||
configure_read_ahead_kb_values
|
||||
echo 0 > /proc/sys/vm/page-cluster
|
||||
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
|
||||
388
rootdir/bin/init.kernel.post_boot-shima.sh
Executable file
388
rootdir/bin/init.kernel.post_boot-shima.sh
Executable file
|
|
@ -0,0 +1,388 @@
|
|||
#=============================================================================
|
||||
# Copyright (c) 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.
|
||||
#=============================================================================
|
||||
|
||||
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 0 > /proc/sys/vm/page-cluster
|
||||
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
|
||||
364
rootdir/bin/init.kernel.post_boot-yupik.sh
Executable file
364
rootdir/bin/init.kernel.post_boot-yupik.sh
Executable file
|
|
@ -0,0 +1,364 @@
|
|||
#=============================================================================
|
||||
# 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
|
||||
52
rootdir/bin/init.kernel.post_boot.sh
Executable file
52
rootdir/bin/init.kernel.post_boot.sh
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
#=============================================================================
|
||||
# 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.
|
||||
#=============================================================================
|
||||
|
||||
if [ -f /sys/devices/soc0/soc_id ]; then
|
||||
platformid=`cat /sys/devices/soc0/soc_id`
|
||||
fi
|
||||
|
||||
case "$platformid" in
|
||||
"415"|"439"|"456"|"501"|"502")
|
||||
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-lahaina.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
|
||||
;;
|
||||
*)
|
||||
echo "***WARNING***: Invalid SoC ID\n\t No postboot settings applied!!\n"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
#!/vendor/bin/sh
|
||||
scriptname=${0##*/}
|
||||
dbg_on=1
|
||||
debug()
|
||||
{
|
||||
[ $dbg_on ] && echo "Debug: $*"
|
||||
}
|
||||
|
||||
notice()
|
||||
{
|
||||
echo "$*"
|
||||
log -t "$scriptname" -p i "$*"
|
||||
}
|
||||
|
||||
error_and_leave()
|
||||
{
|
||||
local err_msg
|
||||
local err_code=$1
|
||||
case $err_code in
|
||||
1) err_msg="Error: No response";;
|
||||
2) err_msg="Error: Skip to overwrite xtalk and offset data in factory mode";;
|
||||
3) err_msg="Error: Calibration data file $2 does not exist";;
|
||||
4) err_msg="Error: Calibration sysfs path $2 does not show up";;
|
||||
esac
|
||||
notice "$err_msg"
|
||||
exit $err_code
|
||||
}
|
||||
|
||||
# Change laser sysfs file ownership
|
||||
laser_class_path=/sys/devices/virtual/laser
|
||||
laser_product_string=$(ls $laser_class_path)
|
||||
laser_product_path=$laser_class_path/$laser_product_string
|
||||
for laser_file in $laser_product_path/*; do
|
||||
if [ -f "$laser_file" ]; then
|
||||
chown root:system $laser_file
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d $laser_product_path ]; then
|
||||
error_and_leave 4 "'$laser_product_path'"
|
||||
fi
|
||||
|
||||
# Change laser input sysfs file ownership
|
||||
laser_input_root=/sys/devices/virtual/input
|
||||
laser_input_list=$(ls $laser_input_root)
|
||||
for laser_input_dir in $laser_input_list; do
|
||||
if [ -f "$laser_input_root/$laser_input_dir/calibration_data" ]; then
|
||||
laser_calib_file=$laser_input_root/$laser_input_dir/calibration_data
|
||||
chown root:system $laser_calib_file
|
||||
fi
|
||||
if [ -f "$laser_input_root/$laser_input_dir/xtalk" ]; then
|
||||
laser_xtalk_file=$laser_input_root/$laser_input_dir/xtalk
|
||||
chown root:system $laser_xtalk_file
|
||||
fi
|
||||
if [ -f "$laser_input_root/$laser_input_dir/offset" ]; then
|
||||
laser_offset_file=$laser_input_root/$laser_input_dir/offset
|
||||
chown root:system $laser_offset_file
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$laser_calib_file" ]; then
|
||||
laser_calib_file=$laser_product_path/calibration_data
|
||||
fi
|
||||
if [ -z "$laser_xtalk_file" ]; then
|
||||
laser_xtalk_file=$laser_product_path/xtalk
|
||||
fi
|
||||
if [ -z "$laser_offset_file" ]; then
|
||||
laser_offset_file=$laser_product_path/offset
|
||||
fi
|
||||
|
||||
# Load calibration data
|
||||
calib_data_file=/mnt/vendor/persist/camera/focus/cal_data
|
||||
if [ -f $calib_data_file ]; then
|
||||
chown root:vendor_tcmd $calib_data_file
|
||||
chmod 660 $calib_data_file
|
||||
if [ -z "$laser_calib_file" ]; then
|
||||
error_and_leave 4 "'$laser_calib_file'"
|
||||
else
|
||||
cat $calib_data_file > $laser_calib_file
|
||||
notice "laser calibration data updating complete"
|
||||
fi
|
||||
else
|
||||
notice "laser calib_data_file '$calib_data_file' does not exist"
|
||||
fi
|
||||
|
||||
bootmode=$(getprop ro.bootmode 2> /dev/null)
|
||||
if [ $bootmode != "mot-factory" ]; then
|
||||
# Enable smudge mode
|
||||
echo 1 > $laser_product_path/smudge_correction_mode
|
||||
notice "laser smudge mode enabled"
|
||||
fi
|
||||
|
|
@ -30,6 +30,8 @@ firmware_path=/vendor/firmware
|
|||
param_path=/data/vendor/param/touch
|
||||
factory_property=ro.vendor.build.motfactory
|
||||
bootmode_property=ro.bootmode
|
||||
touch_firmware_property=ro.vendor.touch.fw_version
|
||||
touch_vendor_property=ro.vendor.touch.supplier_vendor
|
||||
let dec_cfg_id_boot=0
|
||||
let dec_cfg_id_latest=0
|
||||
# Whether to search for TP firmware in the parameter path
|
||||
|
|
@ -56,7 +58,7 @@ debug()
|
|||
notice()
|
||||
{
|
||||
echo "$*"
|
||||
log -t "$scriptname" -p i "$*"
|
||||
echo "$scriptname: $*" > /dev/kmsg
|
||||
}
|
||||
|
||||
sanity_check()
|
||||
|
|
@ -376,6 +378,8 @@ query_panel_info()
|
|||
read_panel_property "controller_drv_ver"
|
||||
panel_ver=${property#${property%?}}
|
||||
debug "panel supplier: $supplier, ver $panel_ver"
|
||||
setprop $touch_vendor_property "$supplier-$touch_vendor"
|
||||
notice "touch_vendor_property = $touch_vendor_property, $supplier-$touch_vendor"
|
||||
else
|
||||
debug "driver does not report panel supplier"
|
||||
fi
|
||||
|
|
@ -588,6 +592,9 @@ process_touch_instance()
|
|||
notice "property [$touch_status_prop] set to [`getprop $touch_status_prop`]"
|
||||
notice "Handling touch ID [$touch_instance] permissions"
|
||||
fi
|
||||
read_touch_property buildid
|
||||
setprop $touch_firmware_property ${property}
|
||||
notice "Touch firmware property is $touch_firmware_property"
|
||||
setup_permissions
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ debug()
|
|||
notice()
|
||||
{
|
||||
echo "$*"
|
||||
log -t "$scriptname" -p i "$*"
|
||||
echo "$scriptname: $*" > /dev/kmsg
|
||||
}
|
||||
|
||||
add_device_params()
|
||||
|
|
|
|||
|
|
@ -538,14 +538,6 @@ fi
|
|||
|
||||
# copy GPU frequencies to vendor property
|
||||
if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then
|
||||
# Remove turbo freq from prop
|
||||
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies | sed 's/905000000 //g'` 2> /dev/null
|
||||
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null
|
||||
setprop vendor.gpu.available_frequencies "$gpu_freq"
|
||||
fi
|
||||
|
||||
# GPU turbo
|
||||
gpu_max_freq=`cat /sys/class/kgsl/kgsl-3d0/devfreq/max_freq` 2> /dev/null
|
||||
if [ ${gpu_max_freq} == '905000000' ]; then
|
||||
setprop vendor.gpu.turbo_supported 1
|
||||
setprop vendor.gpu.turbo_enabled 0
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -803,12 +803,6 @@ KernelVersionA=${KernelVersionStr:0:1}
|
|||
KernelVersionB=${KernelVersionS%.*}
|
||||
|
||||
function configure_zram_parameters() {
|
||||
# Moto huangzq2: 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}
|
||||
|
||||
|
|
@ -931,16 +925,15 @@ function configure_memory_parameters() {
|
|||
# Set allocstall_threshold to 0 for all targets.
|
||||
#
|
||||
|
||||
BoardPlatform=`getprop ro.board.platform`
|
||||
ProductName=`getprop ro.product.name`
|
||||
low_ram=`getprop ro.config.low_ram`
|
||||
|
||||
if [ "$BoardPlatform" == "msmnile" ] || [ "$BoardPlatform" == "kona" ] || [ "$BoardPlatform" == "lito" ] || [ "$BoardPlatform" == "sdmshrike_au" ]; then
|
||||
if [ "$ProductName" == "msmnile" ] || [ "$ProductName" == "kona" ] || [ "$ProductName" == "sdmshrike_au" ]; then
|
||||
# Enable ZRAM
|
||||
configure_zram_parameters
|
||||
configure_read_ahead_kb_values
|
||||
# Moto huangzq2: Remove duplicate configs as we already set it in init.mmi.rc
|
||||
#echo 0 > /proc/sys/vm/page-cluster
|
||||
#echo 100 > /proc/sys/vm/swappiness
|
||||
echo 0 > /proc/sys/vm/page-cluster
|
||||
echo 100 > /proc/sys/vm/swappiness
|
||||
else
|
||||
arch_type=`uname -m`
|
||||
|
||||
|
|
@ -986,7 +979,7 @@ else
|
|||
else
|
||||
# Set LMK series, vmpressure_file_min for 32 bit non-go targets.
|
||||
# Disable Core Control, enable KLMK for non-go 8909.
|
||||
if [ "$BoardPlatform" == "msm8909" ]; then
|
||||
if [ "$ProductName" == "msm8909" ]; then
|
||||
disable_core_ctl
|
||||
echo 1 > /sys/module/lowmemorykiller/parameters/enable_lmk
|
||||
fi
|
||||
|
|
@ -2160,8 +2153,8 @@ case "$target" in
|
|||
echo 1 > /sys/devices/system/cpu/cpu7/online
|
||||
|
||||
#Disable CPU retention modes for 32bit builds
|
||||
BoardPlatform=`getprop ro.board.platform`
|
||||
if [ "$BoardPlatform" == "msm8952_32" ] || [ "$BoardPlatform" == "msm8952_32_LMT" ]; then
|
||||
ProductName=`getprop ro.product.name`
|
||||
if [ "$ProductName" == "msm8952_32" ] || [ "$ProductName" == "msm8952_32_LMT" ]; then
|
||||
echo N > /sys/module/lpm_levels/system/a72/cpu4/retention/idle_enabled
|
||||
echo N > /sys/module/lpm_levels/system/a72/cpu5/retention/idle_enabled
|
||||
echo N > /sys/module/lpm_levels/system/a72/cpu6/retention/idle_enabled
|
||||
|
|
@ -3802,7 +3795,6 @@ case "$target" in
|
|||
echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
|
||||
echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres
|
||||
echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms
|
||||
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
|
||||
|
||||
# Disable Core control on gold, prime
|
||||
echo 0 > /sys/devices/system/cpu/cpu6/core_ctl/enable
|
||||
|
|
@ -3951,12 +3943,7 @@ case "$target" in
|
|||
setprop vendor.dcvs.prop 1
|
||||
|
||||
# cpuset parameters
|
||||
# Enable corectrl on needed targets
|
||||
if [ "$corectl_enable" == "true" ]; then
|
||||
echo 0-3 > /dev/cpuset/background/cpus
|
||||
else
|
||||
echo 0-5 > /dev/cpuset/background/cpus
|
||||
fi
|
||||
echo 0-5 > /dev/cpuset/background/cpus
|
||||
echo 0-5 > /dev/cpuset/system-background/cpus
|
||||
|
||||
# Turn off scheduler boost at the end
|
||||
|
|
@ -3972,13 +3959,7 @@ case "$target" in
|
|||
"434" | "459" )
|
||||
|
||||
# Core control parameters on silver
|
||||
corectl_enable=`getprop ro.vendor.config.corectl`
|
||||
# Enable corectrl on needed targets
|
||||
if [ "$corectl_enable" == "true" ]; then
|
||||
echo 0 0 0 0 1 1 > /sys/devices/system/cpu/cpu0/core_ctl/not_preferred
|
||||
else
|
||||
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
|
||||
fi
|
||||
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
|
||||
|
|
@ -4108,12 +4089,6 @@ case "$target" in
|
|||
# device/target specific folder
|
||||
setprop vendor.dcvs.prop 1
|
||||
|
||||
# moto add by yangbq2, set wsf value as 1
|
||||
# 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
|
||||
# moto end
|
||||
|
||||
# cpuset parameters
|
||||
echo 0-5 > /dev/cpuset/background/cpus
|
||||
echo 0-5 > /dev/cpuset/system-background/cpus
|
||||
|
|
@ -4125,14 +4100,6 @@ case "$target" in
|
|||
echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
|
||||
;;
|
||||
esac
|
||||
|
||||
# Log kernel wake-up source
|
||||
echo 1 > /sys/module/msm_show_resume_irq/parameters/debug_mask
|
||||
|
||||
# Log kernel enabled clock before suspend
|
||||
if [ -f /sys/kernel/debug/clk/debug_suspend ]; then
|
||||
echo 1 > /sys/kernel/debug/clk/debug_suspend
|
||||
fi
|
||||
esac
|
||||
|
||||
case "$target" in
|
||||
|
|
@ -5585,9 +5552,8 @@ case "$target" in
|
|||
echo 400000000 > /proc/sys/kernel/sched_coloc_downmigrate_ns
|
||||
|
||||
# cpuset parameters
|
||||
# Use parameters in init.target.rc
|
||||
#echo 0-3 > /dev/cpuset/background/cpus
|
||||
#echo 0-3 > /dev/cpuset/system-background/cpus
|
||||
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
|
||||
|
|
@ -5709,9 +5675,6 @@ case "$target" in
|
|||
setprop vendor.dcvs.prop 1
|
||||
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
|
||||
configure_memory_parameters
|
||||
|
||||
# Log kernel wake-up source
|
||||
echo 1 > /sys/module/msm_show_resume_irq/parameters/debug_mask
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
#! /vendor/bin/sh
|
||||
|
||||
# Copyright (c) 2010, 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.
|
||||
#
|
||||
|
||||
# For successful WLAN card detection, WLAN needs SDIO polling turned on.
|
||||
# This script can be used to turn on/off SDIO polling on appropriate
|
||||
# SDIO slot on the MSM target (e.g. slot 3 on 7x30 surf).
|
||||
|
||||
arg=$1
|
||||
target=`getprop ro.board.platform`
|
||||
|
||||
case "$target" in
|
||||
"msm7627_6x")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.1/polling
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
|
||||
;;
|
||||
|
||||
"msm7627_ffa")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
|
||||
;;
|
||||
|
||||
"msm7627_surf")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.1/polling
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
|
||||
;;
|
||||
|
||||
"msm7627a")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
|
||||
;;
|
||||
|
||||
"msm7630_surf")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
|
||||
;;
|
||||
|
||||
"msm7630_1x")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
|
||||
;;
|
||||
|
||||
"msm7630_fusion")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
|
||||
;;
|
||||
|
||||
"msm8660")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.4/polling
|
||||
;;
|
||||
|
||||
"msm8660_csfb")
|
||||
echo 1 > /sys/devices/platform/msm_sdcc.4/polling
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
#! /vendor/bin/sh
|
||||
|
||||
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
#!/vendor/bin/sh
|
||||
# Copyright (c) 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:
|
||||
|
|
@ -9,7 +8,7 @@
|
|||
# * 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 Linux Foundation nor
|
||||
# * 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.
|
||||
|
|
@ -27,8 +26,8 @@
|
|||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
baseband=`getprop ro.baseband`
|
||||
if [ "$baseband" = "mdm" ] || [ "$baseband" = "mdm2" ]; then
|
||||
start vendor.mdm_helper
|
||||
fi
|
||||
|
||||
#
|
||||
# Function to start sensors for SSC enabled platforms
|
||||
#
|
||||
cp /vendor/etc/sensors/scripts/* /data/vendor/sensors/scripts/
|
||||
chmod a+rw /data/vendor/sensors/scripts/*
|
||||
48
rootdir/bin/init.qti.chg_policy.sh
Executable file
48
rootdir/bin/init.qti.chg_policy.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#! /vendor/bin/sh
|
||||
|
||||
#
|
||||
# Copyright (c) 2019-2021 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
# Copyright (c) 2019 The Linux Foundation. All rights reserved.
|
||||
#
|
||||
|
||||
export PATH=/vendor/bin
|
||||
|
||||
soc_id=`getprop ro.vendor.qti.soc_id`
|
||||
if [ "$soc_id" -eq 415 ] || [ "$soc_id" -eq 439 ] || [ "$soc_id" -eq 450 ] || [ "$soc_id" -eq 475 ] || [ "$soc_id" -eq 515 ]; then
|
||||
setprop persist.vendor.hvdcp_opti.start 2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$soc_id" -eq 441 ] || [ "$soc_id" -eq 471 ]; then
|
||||
#Scuba does not support usb-pd or charge pumps
|
||||
find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system
|
||||
else
|
||||
find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/charge_pump_master/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/pc_port/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/dc/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/power_supply/parallel/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/usbpd/usbpd0/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/qc-vdm/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/charge_pump/ -type f -maxdepth 1 | xargs chown system.system
|
||||
find /sys/class/qcom-battery/ -type f -maxdepth 1 | xargs chown system.system
|
||||
|
||||
for i in 0 1 2 3 4 5 6 7 8 9
|
||||
do
|
||||
devname=`cat /sys/bus/iio/devices/iio:device$i/name`
|
||||
if [[ "$devname" == *smb* ]] || [[ "$devname" == *qg* ]] || [[ "$devname" == *div2_cp* ]]; then
|
||||
find /sys/bus/iio/devices/iio:device$i/ -type f -maxdepth 1 | xargs chown system.system
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
setprop persist.vendor.hvdcp_opti.start 1
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
#! /vendor/bin/sh
|
||||
#
|
||||
# Copyright (c) 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.
|
||||
#
|
||||
for device in /sys/devices/platform/soc
|
||||
do
|
||||
for memlat in $device/*qcom,devfreq-l3/*cpu*-lat/devfreq/*cpu*-lat
|
||||
do
|
||||
echo "mem_latency" > $memlat/governor
|
||||
echo 8 > $memlat/polling_interval
|
||||
echo 400 > $memlat/mem_latency/ratio_ceil
|
||||
done
|
||||
|
||||
#Enable mem_latency governor for LLCC and DDR scaling
|
||||
for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat
|
||||
do
|
||||
echo "mem_latency" > $memlat/governor
|
||||
echo 8 > $memlat/polling_interval
|
||||
echo 400 > $memlat/mem_latency/ratio_ceil
|
||||
done
|
||||
|
||||
#Enable compute governor for gold latfloor
|
||||
for latfloor in $device/*cpu-ddr-latfloor*/devfreq/*cpu-ddr-latfloor*
|
||||
do
|
||||
echo "compute" > $latfloor/governor
|
||||
echo 8 > $latfloor/polling_interval
|
||||
done
|
||||
|
||||
for qoslat in $device/*qoslat/devfreq/*qoslat
|
||||
do
|
||||
echo "mem_latency" > $qoslat/governor
|
||||
echo 10 > $qoslat/polling_interval
|
||||
echo 50 > $qoslat/mem_latency/ratio_ceil
|
||||
done
|
||||
|
||||
for l3cdsp in $device/*qcom,devfreq-l3/*cdsp-l3-lat/devfreq/*cdsp-l3-lat
|
||||
do
|
||||
echo "cdspl3" > $l3cdsp/governor
|
||||
done
|
||||
|
||||
#Gold L3 ratio ceil
|
||||
for l3gold in $device/*qcom,devfreq-l3/*cpu4-cpu-l3-lat/devfreq/*cpu4-cpu-l3-lat
|
||||
do
|
||||
echo 4000 > $l3gold/mem_latency/ratio_ceil
|
||||
done
|
||||
|
||||
#Prime L3 ratio ceil
|
||||
for l3prime in $device/*qcom,devfreq-l3/*cpu7-cpu-l3-lat/devfreq/*cpu7-cpu-l3-lat
|
||||
do
|
||||
echo 20000 > $l3prime/mem_latency/ratio_ceil
|
||||
done
|
||||
done;
|
||||
56
rootdir/bin/init.qti.kernel.sh
Executable file
56
rootdir/bin/init.qti.kernel.sh
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#! /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"
|
||||
|
||||
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 true
|
||||
fi
|
||||
}
|
||||
|
||||
start_msm_irqbalance()
|
||||
{
|
||||
if [ -f /vendor/bin/msm_irqbalance ]; then
|
||||
start vendor.msm_irqbalance
|
||||
fi
|
||||
}
|
||||
start_msm_irqbalance
|
||||
verify_pasr_support
|
||||
|
|
@ -2,7 +2,11 @@
|
|||
#==============================================================================
|
||||
# init.qti.media.sh
|
||||
#
|
||||
# Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2020-2021, Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
# Copyright (c) 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
|
||||
|
|
@ -36,26 +40,61 @@ else
|
|||
soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
|
||||
fi
|
||||
|
||||
target_qssi=`getprop vendor.media.target.qssi`
|
||||
target=`getprop ro.board.platform`
|
||||
build_codename=`getprop vendor.media.system.build_codename`
|
||||
case "$target" in
|
||||
"bengal")
|
||||
case "$soc_hwid" in
|
||||
441|471|473|474)
|
||||
setprop vendor.media.target.version 2
|
||||
sku_ver=`cat /sys/devices/platform/soc/5a00000.qcom,vidc1/sku_version` 2> /dev/null
|
||||
if [ $sku_ver -eq 1 ]; then
|
||||
setprop vendor.media.target.version 3
|
||||
fi
|
||||
;;
|
||||
518)
|
||||
setprop vendor.media.target.version 3
|
||||
;;
|
||||
*)
|
||||
sku_ver=`cat /sys/devices/platform/soc/5a00000.qcom,vidc/sku_version` 2> /dev/null
|
||||
if [ $sku_ver -eq 1 ]; then
|
||||
setprop vendor.media.target.version 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"lahaina")
|
||||
case "$soc_hwid" in
|
||||
475|515)
|
||||
setprop vendor.media.target_variant "_yupik_v0"
|
||||
setprop vendor.netflix.bsp_rev "Q7325-SPY-33758-1"
|
||||
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
|
||||
if [ $sku_ver -eq 1 ]; then
|
||||
setprop vendor.media.target_variant "_yupik_v1"
|
||||
fi
|
||||
;;
|
||||
450)
|
||||
setprop vendor.media.target_variant "_shima_v3"
|
||||
if [ $build_codename -eq "11" ]; then
|
||||
setprop vendor.netflix.bsp_rev "Q875-32774-1"
|
||||
fi
|
||||
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
|
||||
if [ $sku_ver -eq 1 ]; then
|
||||
setprop vendor.media.target_variant "_shima_v1"
|
||||
elif [ $sku_ver -eq 2 ]; then
|
||||
setprop vendor.media.target_variant "_shima_v2"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if [ $target_qssi == "true" ]; then
|
||||
setprop vendor.media.target_variant "_lahaina_vendor"
|
||||
else
|
||||
setprop vendor.media.target_variant "_lahaina"
|
||||
fi
|
||||
if [ $build_codename -eq "11" ]; then
|
||||
setprop vendor.netflix.bsp_rev "Q875-32408-1"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"holi")
|
||||
case "$soc_hwid" in
|
||||
507)
|
||||
setprop vendor.media.target_variant "_blair"
|
||||
;;
|
||||
454|472)
|
||||
setprop vendor.media.target_variant "_holi"
|
||||
if [ $build_codename -eq "11" ]; then
|
||||
setprop vendor.netflix.bsp_rev "Q4350-32962-1"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"msmnile")
|
||||
setprop vendor.media.target_variant "_msmnile"
|
||||
;;
|
||||
"sm6150")
|
||||
setprop vendor.media.target_variant "_sm6150"
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
38
rootdir/bin/vendor_modprobe.sh
Executable file
38
rootdir/bin/vendor_modprobe.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#! /vendor/bin/sh
|
||||
#=============================================================================
|
||||
# Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#=============================================================================
|
||||
|
||||
#default to /vendor/lib/modules
|
||||
MODULES_PATH="/vendor/lib/modules/"
|
||||
GKI_MOD_PATH="/vendor/lib/modules/5.4-gki"
|
||||
|
||||
MODPROBE="/vendor/bin/modprobe"
|
||||
MODULES=`${MODPROBE} -d ${MODULES_PATH} -l`
|
||||
|
||||
# Find the first non-blacklisted module and try
|
||||
# inserting it. If insertion fails the module is not
|
||||
# compatible with the current kernel. Change the modules
|
||||
# directory to gki.
|
||||
for MODULE in ${MODULES}; do
|
||||
cat ${MODULES_PATH}/modules.blocklist | grep $MODULE
|
||||
if [ $? -ne 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
${MODPROBE} -a -b -d ${MODULES_PATH} ${MODULE}
|
||||
if [ $? -ne 0 ];then
|
||||
MODULES_PATH=$GKI_MOD_PATH
|
||||
MODULES=`${MODPROBE} -d ${MODULES_PATH} -l`
|
||||
fi
|
||||
|
||||
# Iterate over module list and modprobe them in background.
|
||||
for MODULE in ${MODULES}; do
|
||||
${MODPROBE} -a -b -d ${MODULES_PATH} ${MODULE} &
|
||||
done
|
||||
|
||||
# Wait until all the modprobes are finished
|
||||
wait
|
||||
|
|
@ -1,10 +1,4 @@
|
|||
on charger
|
||||
stop vendor.sensors
|
||||
chown radio wakelock /sys/power/wake_lock
|
||||
chmod 0660 /sys/power/wake_lock
|
||||
chown radio wakelock /sys/power/wake_unlock
|
||||
chmod 0660 /sys/power/wake_unlock
|
||||
|
||||
start vendor.thermal-com
|
||||
start system_suspend
|
||||
|
||||
|
|
@ -19,10 +13,6 @@ on charger
|
|||
write /sys/devices/system/cpu/cpu6/online 0
|
||||
write /sys/devices/system/cpu/cpu7/online 0
|
||||
|
||||
# Allow system to sleep when in COM
|
||||
write /sys/module/lpm_levels/parameters/sleep_disabled 0
|
||||
write /proc/sys/kernel/sched_boost 0
|
||||
|
||||
service vendor.thermal-com /vendor/bin/thermal-engine --minimode
|
||||
class charger
|
||||
user root
|
||||
|
|
|
|||
|
|
@ -3,11 +3,25 @@ import /vendor/etc/init/hw/init.mmi.charge_only.rc
|
|||
|
||||
on post-fs
|
||||
# MOT_LED_CALIBRATION
|
||||
chown camera /mnt/vendor/persist/camera/mot_ledcal
|
||||
chown camera camera /mnt/vendor/persist/camera/mot_ledcal
|
||||
|
||||
on early-init
|
||||
exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules exfat
|
||||
|
||||
#Enable qpnp_smbcharger_mmi debug
|
||||
write /sys/module/qpnp_smbcharger_mmi/parameters/debug_enabled Y
|
||||
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
|
||||
|
||||
#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 charger && property:ro.boot.bm_ulog_enabled=1
|
||||
write /sys/module/bm_adsp_ulog/parameters/debug_enabled 1
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
write /sys/devices/platform/soc/soc:mmi,charger/state_sync 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2009-2012, 2014-2021, The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2009-2012, 2014-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:
|
||||
|
|
@ -240,7 +240,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
|
||||
|
|
@ -689,23 +689,6 @@ on property:vendor.opengles.version=*
|
|||
on property:vendor.gpu.available_frequencies=*
|
||||
setprop ro.vendor.gpu.available_frequencies ${vendor.gpu.available_frequencies}
|
||||
|
||||
# huangzq2: GPU trubo
|
||||
on property:vendor.gpu.turbo_enabled=1
|
||||
setprop vendor.thermal.mode perf
|
||||
stop thermal-engine
|
||||
start thermal-engine
|
||||
|
||||
on property:vendor.gpu.turbo_enabled=0
|
||||
setprop vendor.thermal.mode normal
|
||||
stop thermal-engine
|
||||
start thermal-engine
|
||||
|
||||
on property:vendor.gpu.turbo_supported=1 && property:vendor.gpu.turbo_enabled=1
|
||||
write /sys/class/kgsl/kgsl-3d0/max_pwrlevel 0
|
||||
|
||||
on property:vendor.gpu.turbo_supported=1 && property:vendor.gpu.turbo_enabled=0
|
||||
write /sys/class/kgsl/kgsl-3d0/max_pwrlevel 1
|
||||
|
||||
service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service
|
||||
override
|
||||
class hal
|
||||
|
|
|
|||
174
rootdir/etc/init/hw/init.qti.kernel.rc
Normal file
174
rootdir/etc/init/hw/init.qti.kernel.rc
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
#=============================================================================
|
||||
# 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.
|
||||
#=============================================================================
|
||||
|
||||
on early-init
|
||||
mount debugfs debugfs /sys/kernel/debug
|
||||
chmod 0755 /sys/kernel/debug
|
||||
|
||||
# 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
|
||||
# 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
|
||||
chmod 0755 /sys/kernel/debug/tracing
|
||||
|
||||
# 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
|
||||
write /sys/kernel/boot_adsp/boot 1
|
||||
write /sys/kernel/boot_cdsp/boot 1
|
||||
write /sys/kernel/boot_slpi/boot 1
|
||||
write /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 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
|
||||
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/sda/queue/scheduler bfq
|
||||
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/sda/queue/iosched/slice_idle 0
|
||||
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 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
|
||||
write /proc/sys/vm/page-cluster 0
|
||||
start kernel-boot
|
||||
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
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
# Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2019-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
|
||||
|
|
@ -29,20 +29,42 @@
|
|||
#
|
||||
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/modprobe -a -d /vendor/lib/modules audio_q6_pdr audio_q6_notifier audio_snd_event audio_apr audio_adsp_loader audio_q6 audio_native audio_usf audio_pinctrl_wcd audio_pinctrl_lpi audio_swr audio_platform audio_hdmi audio_stub audio_wcd_core audio_wsa881x audio_bolero_cdc audio_wsa_macro audio_va_macro audio_rx_macro audio_tx_macro audio_wcd938x audio_wcd938x_slave audio_machine_kona
|
||||
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
|
||||
write /proc/sys/kernel/sched_boost 1
|
||||
wait /sys/devices/soc0/soc_id
|
||||
|
||||
on init
|
||||
write /dev/stune/foreground/schedtune.sched_boost_no_override 1
|
||||
write /dev/stune/top-app/schedtune.sched_boost_no_override 1
|
||||
write /dev/stune/schedtune.colocate 0
|
||||
write /dev/stune/background/schedtune.colocate 0
|
||||
write /dev/stune/system-background/schedtune.colocate 0
|
||||
write /dev/stune/foreground/schedtune.colocate 0
|
||||
write /dev/stune/top-app/schedtune.colocate 1
|
||||
wait /dev/block/platform/soc/1d84000.ufshc
|
||||
symlink /dev/block/platform/soc/1d84000.ufshc /dev/block/bootdevice
|
||||
# Scheduler uclamp
|
||||
mkdir /dev/cpuctl/foreground
|
||||
mkdir /dev/cpuctl/background
|
||||
mkdir /dev/cpuctl/top-app
|
||||
mkdir /dev/cpuctl/rt
|
||||
chown system system /dev/cpuctl
|
||||
chown system system /dev/cpuctl/foreground
|
||||
chown system system /dev/cpuctl/background
|
||||
chown system system /dev/cpuctl/top-app
|
||||
chown system system /dev/cpuctl/rt
|
||||
chown system system /dev/cpuctl/tasks
|
||||
chown system system /dev/cpuctl/foreground/tasks
|
||||
chown system system /dev/cpuctl/background/tasks
|
||||
chown system system /dev/cpuctl/top-app/tasks
|
||||
chown system system /dev/cpuctl/rt/tasks
|
||||
chmod 0664 /dev/cpuctl/tasks
|
||||
chmod 0664 /dev/cpuctl/foreground/tasks
|
||||
chmod 0664 /dev/cpuctl/background/tasks
|
||||
chmod 0664 /dev/cpuctl/top-app/tasks
|
||||
chmod 0664 /dev/cpuctl/rt/tasks
|
||||
write /dev/cpuctl/foreground/cpu.rt_runtime_us 950000
|
||||
write /dev/cpuctl/background/cpu.rt_runtime_us 950000
|
||||
write /dev/cpuctl/top-app/cpu.rt_runtime_us 950000
|
||||
write /dev/cpuctl/rt/cpu.rt_runtime_us 950000
|
||||
|
||||
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
|
||||
|
|
@ -53,70 +75,89 @@ on early-fs
|
|||
on fs
|
||||
start hwservicemanager
|
||||
mkdir /mnt/vendor/spunvm 0660 system system
|
||||
mount_all /vendor/etc/fstab.qcom --early
|
||||
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
|
||||
|
||||
on post-fs
|
||||
# set RLIMIT_MEMLOCK to 64MB
|
||||
setrlimit 8 67108864 67108864
|
||||
write /dev/ipa 1
|
||||
|
||||
on late-fs
|
||||
wait_for_prop hwservicemanager.ready true
|
||||
exec_start wait_for_keymaster
|
||||
mount_all /vendor/etc/fstab.qcom --late
|
||||
#exec_start wait_for_keymaster
|
||||
mount_all --late
|
||||
|
||||
on post-fs-data
|
||||
mkdir /vendor/data/tombstones 0771 system system
|
||||
# Enable WLAN cold boot calibration
|
||||
write /sys/devices/platform/soc/b0000000.qcom,cnss-qca6390/fs_ready 1
|
||||
write /sys/devices/platform/soc/b0000000.qcom,cnss-qca6490/fs_ready 1
|
||||
|
||||
# Motorola: disable vendor.sensors by default and move the start to init.qcom.rc
|
||||
# Disabling by default will ensure that we do not start vendor.sensors in
|
||||
# Charge-Only-Mode
|
||||
#on early-boot
|
||||
# start vendor.sensors
|
||||
on early-boot
|
||||
start vendor.sensors
|
||||
|
||||
on boot
|
||||
# CPUset policy is "spread" for foreground/top, "pack" for background/system
|
||||
# Cores 0-3 are silver, 4-6 are gold, 7 is gold+
|
||||
# Keep 1 reserved for top (gold+)
|
||||
# Keep 1 for system/background (silver)
|
||||
write /dev/cpuset/top-app/cpus 0-7
|
||||
write /dev/cpuset/foreground/cpus 1-6
|
||||
write /dev/cpuset/background/cpus 0-3
|
||||
write /dev/cpuset/system-background/cpus 0-3
|
||||
write /dev/cpuset/audio-app/cpus 1-2
|
||||
# Add a cpuset for the camera daemon
|
||||
# We want all cores for camera
|
||||
mkdir /dev/cpuset/camera-daemon
|
||||
write /dev/cpuset/camera-daemon/cpus 0-3
|
||||
write /dev/cpuset/camera-daemon/cpus 0-7
|
||||
write /dev/cpuset/camera-daemon/mems 0
|
||||
chown cameraserver cameraserver /dev/cpuset/camera-daemon
|
||||
chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
|
||||
chmod 0660 /dev/cpuset/camera-daemon/tasks
|
||||
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"
|
||||
setprop vendor.usb.qdss.inst.name "qdss_mdm"
|
||||
setprop vendor.usb.controller a600000.dwc3
|
||||
# Load all wlan drivers
|
||||
exec_background u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules/ qca_cld3_qca6390 qca_cld3_qca6490
|
||||
#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
|
||||
|
||||
on boot && property:persist.vendor.usb.controller.default=*
|
||||
setprop vendor.usb.controller ${persist.vendor.usb.controller.default}
|
||||
|
||||
on init && property:ro.boot.mode=charger
|
||||
mount_all /vendor/etc/charger_fw_fstab.qti --early
|
||||
write /sys/kernel/boot_adsp/boot 1
|
||||
wait /sys/class/power_supply/battery
|
||||
|
||||
on charger
|
||||
start vendor.power_off_alarm
|
||||
setprop sys.usb.controller a600000.dwc3
|
||||
setprop sys.usb.configfs 1
|
||||
|
||||
service vendor.lowi /vendor/bin/sscrpcd
|
||||
service vendor.lowi /vendor/bin/lowirpcd
|
||||
class core
|
||||
user system
|
||||
group system wakelock
|
||||
|
|
@ -126,7 +167,7 @@ service vendor.lowi /vendor/bin/sscrpcd
|
|||
service vendor.pd_mapper /vendor/bin/pd-mapper
|
||||
class core
|
||||
user system
|
||||
group system
|
||||
group system log diag
|
||||
|
||||
#Peripheral manager
|
||||
service vendor.per_mgr /vendor/bin/pm-service
|
||||
|
|
@ -141,10 +182,10 @@ service vendor.per_proxy /vendor/bin/pm-proxy
|
|||
group system
|
||||
disabled
|
||||
|
||||
service vendor.mdm_helper /vendor/bin/mdm_helper
|
||||
class core
|
||||
group log system wakelock diag vendor_rfs
|
||||
disabled
|
||||
#service vendor.mdm_helper /vendor/bin/mdm_helper
|
||||
# class core
|
||||
# group log system wakelock diag vendor_rfs
|
||||
# disabled
|
||||
|
||||
service vendor.mdm_launcher /vendor/bin/sh /vendor/bin/init.mdm.sh
|
||||
class core
|
||||
|
|
@ -156,12 +197,15 @@ on property:init.svc.vendor.per_mgr=running
|
|||
on property:sys.shutdown.requested=*
|
||||
stop vendor.per_proxy
|
||||
|
||||
service dcvs-sh /vendor/bin/init.qti.dcvs.sh
|
||||
#fan-controller
|
||||
service fan_control_turn_on /vendor/bin/fan_control 1
|
||||
class late_start
|
||||
user root
|
||||
group root system
|
||||
disabled
|
||||
oneshot
|
||||
|
||||
on property:vendor.dcvs.prop=1
|
||||
start dcvs-sh
|
||||
service fan_control_turn_off /vendor/bin/fan_control 0
|
||||
class late_start
|
||||
user root
|
||||
disabled
|
||||
oneshot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue