Revert "e3q: a"

This reverts commit ab37bd8d7e.
This commit is contained in:
David Wronek
2025-02-08 19:19:52 +01:00
parent ab37bd8d7e
commit 32dadb8ceb
36 changed files with 16758 additions and 867 deletions

View File

@@ -4,36 +4,193 @@
// SPDX-License-Identifier: Apache-2.0
//
// Init scripts
sh_binary {
name: "dcc_extension.sh",
src: "bin/dcc_extension.sh",
vendor: true,
}
sh_binary {
name: "hdm_status.sh",
src: "bin/hdm_status.sh",
vendor: true,
}
sh_binary {
name: "init.class_main.sh",
src: "bin/init.class_main.sh",
vendor: true,
}
sh_binary {
name: "init.crda.sh",
src: "bin/init.crda.sh",
vendor: true,
}
sh_binary {
name: "init.kernel.post_boot-cliffs.sh",
src: "bin/init.kernel.post_boot-cliffs.sh",
vendor: true,
}
sh_binary {
name: "init.kernel.post_boot-pineapple.sh",
src: "bin/init.kernel.post_boot-pineapple.sh",
vendor: true,
}
sh_binary {
name: "init.kernel.post_boot.sh",
src: "bin/init.kernel.post_boot.sh",
vendor: true,
}
sh_binary {
name: "init.mdm.sh",
src: "bin/init.mdm.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.class_core.sh",
src: "bin/init.qcom.class_core.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.coex.sh",
src: "bin/init.qcom.coex.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.early_boot.sh",
src: "bin/init.qcom.early_boot.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.efs.sync.sh",
src: "bin/init.qcom.efs.sync.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.post_boot.sh",
src: "bin/init.qcom.post_boot.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.sdio.sh",
src: "bin/init.qcom.sdio.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.sensors.sh",
src: "bin/init.qcom.sensors.sh",
vendor: true,
}
sh_binary {
name: "init.qcom.sh",
src: "bin/init.qcom.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.debug-cliffs.sh",
src: "bin/init.qti.kernel.debug-cliffs.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.debug-pineapple.sh",
src: "bin/init.qti.kernel.debug-pineapple.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.debug.sh",
src: "bin/init.qti.kernel.debug.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.early_debug-pineapple.sh",
src: "bin/init.qti.kernel.early_debug-pineapple.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.early_debug.sh",
src: "bin/init.qti.kernel.early_debug.sh",
vendor: true,
}
sh_binary {
name: "init.qti.kernel.sh",
src: "bin/init.qti.kernel.sh",
vendor: true,
}
sh_binary {
name: "init.qti.media.sh",
src: "bin/init.qti.media.sh",
vendor: true,
}
sh_binary {
name: "init.qti.qcv.sh",
src: "bin/init.qti.qcv.sh",
vendor: true,
}
sh_binary {
name: "init.qti.time.daemon.sh",
src: "bin/init.qti.time.daemon.sh",
vendor: true,
}
sh_binary {
name: "init.qti.write.sh",
src: "bin/init.qti.write.sh",
vendor: true,
}
sh_binary {
name: "init.vendor.sensordebug.sh",
src: "bin/init.vendor.sensordebug.sh",
vendor: true,
}
sh_binary {
name: "init.vendor.sensordebug.ssr_dump.sh",
src: "bin/init.vendor.sensordebug.ssr_dump.sh",
vendor: true,
}
sh_binary {
name: "qca6234-service.sh",
src: "bin/qca6234-service.sh",
vendor: true,
}
sh_binary {
name: "system_dlkm_modprobe.sh",
src: "bin/system_dlkm_modprobe.sh",
vendor: true,
}
sh_binary {
name: "vendor_modprobe.sh",
src: "bin/vendor_modprobe.sh",
vendor: true,
}
// Init configuration files
prebuilt_etc {
name: "init.e3q.rc",
@@ -42,6 +199,13 @@ prebuilt_etc {
vendor: true,
}
prebuilt_etc {
name: "init.qcom.factory.rc",
src: "etc/init.qcom.factory.rc",
sub_dir: "init/hw",
vendor: true,
}
prebuilt_etc {
name: "init.qcom.rc",
src: "etc/init.qcom.rc",
@@ -49,6 +213,34 @@ prebuilt_etc {
vendor: true,
}
prebuilt_etc {
name: "init.qti.kernel.rc",
src: "etc/init.qti.kernel.rc",
sub_dir: "init/hw",
vendor: true,
}
prebuilt_etc {
name: "init.qti.ss-ramdump.sh",
src: "etc/init.qti.ss-ramdump.sh",
sub_dir: "init/hw",
vendor: true,
}
prebuilt_etc {
name: "init.qti.ufs.rc",
src: "etc/init.qti.ufs.rc",
sub_dir: "init/hw",
vendor: true,
}
prebuilt_etc {
name: "init.qti.qcv.rc",
src: "etc/init.qti.qcv.rc",
sub_dir: "init",
vendor: true,
}
prebuilt_etc {
name: "init.samsung.bsp.rc",
src: "etc/init.samsung.bsp.rc",
@@ -70,6 +262,13 @@ prebuilt_etc {
vendor: true,
}
prebuilt_etc {
name: "init.samsung.factory.rc",
src: "etc/init.samsung.factory.rc",
sub_dir: "init/hw",
vendor: true,
}
prebuilt_etc {
name: "init.samsung.power.rc",
src: "etc/init.samsung.power.rc",

View File

@@ -0,0 +1,9 @@
#=============================================================================
# Copyright (c) 2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
extension()
{
}

58
rootdir/bin/hdm_status.sh Normal file
View File

@@ -0,0 +1,58 @@
#! /vendor/bin/sh
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <hdm_status value>"
exit
fi
count=0
policy=0
array=(1 2 4 8 16 32 64 128 256 512)
name_arry=(cam mmc usb wlan bt gps dis aud cpm sen)
hdm_status=$1
hdm_swblock_status=$(getprop "ro.vendor.hdm.supported.swblock")
echo "hdmstatus = $hdm_status"
echo "hdm supported swblock = $hdm_swblock_status"
HDM_STATUS_SPLIT=$(echo $hdm_status | tr "&|" "\n")
#get hdm policy from ro.boot.hdm_status
for split in $HDM_STATUS_SPLIT
do
count=$((($count + 1)%2))
if [ $count -eq 0 ]; then
split16="0x$split"
echo "split16 = $split16"
policy=$(($policy|$split16))
fi
done
echo "$policy"
hex=$(printf "0x%x" "$policy")
echo "$hex"
#setprop vendor.hdm.status "$hex"
#check sw block
swblock=$(($policy&$hdm_swblock_status))
swblockhex=$(printf "0x%x" "$swblock")
echo "swblockhex = $swblockhex"
setprop vendor.hdm.swblock.status "$swblockhex"
#start sw block
count=0
for isblock in ${array[@]}
do
if [ $(($isblock&$swblock)) -eq $isblock ]; then
echo "swblock enable = ${name_arry[$count]}"
swblockname=$(printf "vendor.hdm.internal.%s" "${name_arry[$count]}")
setprop $swblockname "boot"
fi
count=$(($count + 1))
done

35
rootdir/bin/init.crda.sh Normal file
View File

@@ -0,0 +1,35 @@
#! /vendor/bin/sh
# Copyright (c) 2012, 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.
#
country=`getprop wlan.crda.country`
# crda takes input in COUNTRY environment variable
if [ $country != "" ]
then
COUNTRY="$country" /system/bin/crda
fi

View File

@@ -0,0 +1,49 @@
#=============================================================================
# Copyright (c) 2022-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
rev=`cat /sys/devices/soc0/revision`
echo 4 > /proc/sys/kernel/printk
# Change console log level as per console config property
console_config=`getprop persist.vendor.console.silent.config`
case "$console_config" in
"1")
echo "Enable console config to $console_config"
echo 0 > /proc/sys/kernel/printk
;;
*)
echo "Enable console config to $console_config"
;;
esac
setprop vendor.post_boot.parsed 1

View File

@@ -0,0 +1,439 @@
#=============================================================================
# Copyright (c) 2022-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
rev=`cat /sys/devices/soc0/revision`
# Configure RT parameters:
# Long running RT task detection is confined to consolidated builds.
# Set RT throttle runtime to 50ms more than long running RT
# task detection time.
# Set RT throttle period to 100ms more than RT throttle runtime.
long_running_rt_task_ms=1200
sched_rt_runtime_ms=`expr $long_running_rt_task_ms + 50`
sched_rt_runtime_us=`expr $sched_rt_runtime_ms \* 1000`
sched_rt_period_ms=`expr $sched_rt_runtime_ms + 100`
sched_rt_period_us=`expr $sched_rt_period_ms \* 1000`
echo $sched_rt_period_us > /proc/sys/kernel/sched_rt_period_us
echo $sched_rt_runtime_us > /proc/sys/kernel/sched_rt_runtime_us
if [ -d /proc/sys/walt ]; then
# configure maximum frequency when CPUs are partially halted
echo 1190400 > /proc/sys/walt/sched_max_freq_partial_halt
# Core Control Paramters for Silvers
echo 0xFF > /sys/devices/system/cpu/cpu0/core_ctl/nrrun_cpu_mask
echo 0x00 > /sys/devices/system/cpu/cpu0/core_ctl/nrrun_cpu_misfit_mask
echo 0x00 > /sys/devices/system/cpu/cpu0/core_ctl/assist_cpu_mask
echo 0x00 > /sys/devices/system/cpu/cpu0/core_ctl/assist_cpu_misfit_mask
# Core control parameters for gold
echo 3 > /sys/devices/system/cpu/cpu2/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu2/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu2/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu2/core_ctl/offline_delay_ms
echo 3 > /sys/devices/system/cpu/cpu2/core_ctl/task_thres
echo 0 0 0 > /sys/devices/system/cpu/cpu2/core_ctl/not_preferred
echo 0xFC > /sys/devices/system/cpu/cpu2/core_ctl/nrrun_cpu_mask
echo 0x63 > /sys/devices/system/cpu/cpu2/core_ctl/nrrun_cpu_misfit_mask
echo 0x00 > /sys/devices/system/cpu/cpu2/core_ctl/assist_cpu_mask
echo 0x00 > /sys/devices/system/cpu/cpu2/core_ctl/assist_cpu_misfit_mask
# Core control parameters for titaniums
echo 0 > /sys/devices/system/cpu/cpu5/core_ctl/min_cpus
echo 2 > /sys/devices/system/cpu/cpu5/core_ctl/min_partial_cpus
echo 60 > /sys/devices/system/cpu/cpu5/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu5/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu5/core_ctl/offline_delay_ms
echo 2 > /sys/devices/system/cpu/cpu5/core_ctl/task_thres
echo 1 1 > /sys/devices/system/cpu/cpu5/core_ctl/not_preferred
echo 0xE0 > /sys/devices/system/cpu/cpu5/core_ctl/nrrun_cpu_mask
echo 0x00 > /sys/devices/system/cpu/cpu5/core_ctl/nrrun_cpu_misfit_mask
echo 0x1C > /sys/devices/system/cpu/cpu5/core_ctl/assist_cpu_mask
echo 0x03 > /sys/devices/system/cpu/cpu5/core_ctl/assist_cpu_misfit_mask
# 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
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/not_preferred
echo 0x80 > /sys/devices/system/cpu/cpu7/core_ctl/nrrun_cpu_mask
echo 0x7C > /sys/devices/system/cpu/cpu7/core_ctl/nrrun_cpu_misfit_mask
echo 0x7C > /sys/devices/system/cpu/cpu7/core_ctl/assist_cpu_mask
echo 0x03 > /sys/devices/system/cpu/cpu7/core_ctl/assist_cpu_misfit_mask
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
echo 0 > /sys/devices/system/cpu/cpu2/core_ctl/enable
echo 1 > /sys/devices/system/cpu/cpu5/core_ctl/enable
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/enable
# Configure Single Boost Thread
echo 0 > /proc/sys/walt/sched_sbt_delay_windows
echo 0x60 > /proc/sys/walt/sched_sbt_pause_cpus
# Setting b.L scheduler parameters
echo 95 95 95 > /proc/sys/walt/sched_upmigrate
echo 85 85 85 > /proc/sys/walt/sched_downmigrate
echo 80 > /proc/sys/walt/sched_group_downmigrate
echo 90 > /proc/sys/walt/sched_group_upmigrate
echo 1 > /proc/sys/walt/sched_walt_rotate_big_tasks
echo 400000000 > /proc/sys/walt/sched_coloc_downmigrate_ns
echo 16000000 16000000 16000000 16000000 16000000 16000000 16000000 5000000 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_ns
echo 248 > /proc/sys/walt/sched_coloc_busy_hysteresis_enable_cpus
echo 10 10 10 10 10 10 10 95 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_busy_pct
echo 8500000 8500000 8500000 8500000 8500000 8500000 8500000 2000000 > /proc/sys/walt/sched_util_busy_hyst_cpu_ns
echo 255 > /proc/sys/walt/sched_util_busy_hysteresis_enable_cpus
echo 1 1 1 1 1 1 1 15 > /proc/sys/walt/sched_util_busy_hyst_cpu_util
echo 40 > /proc/sys/walt/sched_cluster_util_thres_pct
echo 0 30 30 30 > /proc/sys/walt/sched_idle_enough_clust
echo 10 > /proc/sys/walt/sched_ed_boost
#Set early upmigrate tunables
freq_to_migrate=1248000
silver_fmax=`cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq`
silver_early_upmigrate=`expr 1024 \* $silver_fmax / $freq_to_migrate`
silver_early_downmigrate=`expr \( 1024 \* $silver_fmax \) / \( \( \( 10 \* $freq_to_migrate \) - $silver_fmax \) \/ 10 \)`
sched_upmigrate=`cat /proc/sys/walt/sched_upmigrate`
sched_downmigrate=`cat /proc/sys/walt/sched_downmigrate`
sched_upmigrate=${sched_upmigrate:0:2}
sched_downmigrate=${sched_downmigrate:0:2}
gold_early_upmigrate=`expr \( 1024 \* 100 \) \/ $sched_upmigrate`
gold_early_downmigrate=`expr \( 1024 \* 100 \) \/ $sched_downmigrate`
echo $silver_early_downmigrate $gold_early_downmigrate $gold_early_downmigrate > /proc/sys/walt/sched_early_downmigrate
echo $silver_early_upmigrate $gold_early_upmigrate $gold_early_upmigrate > /proc/sys/walt/sched_early_upmigrate
# Enable Gold CPUs for pipeline
echo 28 > /proc/sys/walt/sched_pipeline_cpus
# set the threshold for low latency task boost feature which prioritize
# binder activity tasks
echo 325 > /proc/sys/walt/walt_low_latency_task_threshold
# configure maximum frequency of silver cluster when load is not detected and ensure that
# other clusters' fmax remains uncapped by setting the frequency to S32_MAX
# enable smart fmax for silver
echo 1804800 2147483647 2147483647 2147483647 > /proc/sys/walt/sched_fmax_cap
# set c1dcvs parameter
chown system.system /sys/devices/system/cpu/c1dcvs/enable_c1dcvs
chmod 0660 /sys/devices/system/cpu/c1dcvs/enable_c1dcvs
chown system.system /sys/devices/system/cpu/c1dcvs/efreq_thresh
chmod 0660 /sys/devices/system/cpu/c1dcvs/efreq_thresh
echo 0 > /sys/devices/system/cpu/c1dcvs/enable_c1dcvs
echo 2 1400000 > /sys/devices/system/cpu/c1dcvs/efreq_thresh
echo 3 1400000 > /sys/devices/system/cpu/c1dcvs/efreq_thresh
echo 4 1400000 > /sys/devices/system/cpu/c1dcvs/efreq_thresh
echo 1 > /sys/devices/system/cpu/c1dcvs/enable_c1dcvs
# Turn off scheduler boost at the end
echo 0 > /proc/sys/walt/sched_boost
# configure input boost settings
if [ $rev == "1.0" ] || [ $rev == "1.1" ]; then
echo 0 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
else
echo 0 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq
fi
echo 0 > /proc/sys/walt/input_boost/input_boost_ms
echo "walt" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo "walt" > /sys/devices/system/cpu/cpufreq/policy2/scaling_governor
echo "walt" > /sys/devices/system/cpu/cpufreq/policy5/scaling_governor
echo "walt" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy2/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy2/walt/up_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy5/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy5/walt/up_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/down_rate_limit_us
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl
echo 1 > /sys/devices/system/cpu/cpufreq/policy2/walt/pl
echo 1 > /sys/devices/system/cpu/cpufreq/policy5/walt/pl
echo 1 > /sys/devices/system/cpu/cpufreq/policy7/walt/pl
echo 787200 > /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
echo 844800 > /sys/devices/system/cpu/cpufreq/policy2/walt/rtg_boost_freq
echo 844800 > /sys/devices/system/cpu/cpufreq/policy5/walt/rtg_boost_freq
echo 902400 > /sys/devices/system/cpu/cpufreq/policy7/walt/rtg_boost_freq
if [ $rev == "1.0" ] || [ $rev == "1.1" ]; then
echo 1344000 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy2/walt/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy5/walt/hispeed_freq
echo 1555200 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
else
echo 1344000 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy2/walt/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy5/walt/hispeed_freq
echo 1593600 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
fi
else
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy2/scaling_governor
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy5/scaling_governor
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 1 > /proc/sys/kernel/sched_pelt_multiplier
fi
if [ $rev == "1.0" ] || [ $rev == "1.1" ]; then
echo 556800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 576000 > /sys/devices/system/cpu/cpufreq/policy2/scaling_min_freq
echo 576000 > /sys/devices/system/cpu/cpufreq/policy5/scaling_min_freq
echo 729600 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
else
echo 556800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 614400 > /sys/devices/system/cpu/cpufreq/policy2/scaling_min_freq
echo 499200 > /sys/devices/system/cpu/cpufreq/policy5/scaling_min_freq
echo 672000 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
fi
# Reset the RT boost, which is 1024 (max) by default.
echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default
# disable min util condition for boost
echo 0 > /proc/sys/walt/sched_min_task_util_for_boost
echo 0 > /proc/sys/walt/sched_min_task_util_for_colocation
echo 0 > /proc/sys/walt/sched_min_task_util_for_uclamp
# cpuset parameters
echo 0-1 5-6 > /dev/cpuset/background/cpus
echo 0-1 5-6 > /dev/cpuset/system-background/cpus
# configure bus-dcvs
bus_dcvs="/sys/devices/system/cpu/bus_dcvs"
for device in $bus_dcvs/*
do
cat $device/hw_min_freq > $device/boost_freq
done
for ubwcpbw in $bus_dcvs/UBWCP/*bwmon-ubwcp
do
echo "5931 7980 10437 16113" > $ubwcpbw/mbps_zones
echo 4 > $ubwcpbw/sample_ms
echo 80 > $ubwcpbw/io_percent
echo 20 > $ubwcpbw/hist_memory
echo 5 > $ubwcpbw/hyst_length
echo 1 > $ubwcpbw/idle_length
echo 30 > $ubwcpbw/down_thres
echo 0 > $ubwcpbw/guard_band_mbps
echo 250 > $ubwcpbw/up_scale
echo 1600 > $ubwcpbw/idle_mbps
echo 710000 > $ubwcpbw/max_freq
echo 40 > $ubwcpbw/window_ms
done
for llccbw in $bus_dcvs/LLCC/*bwmon-llcc
do
echo "4577 7110 9155 12298 14236 16265" > $llccbw/mbps_zones
echo 4 > $llccbw/sample_ms
echo 80 > $llccbw/io_percent
echo 20 > $llccbw/hist_memory
echo 5 > $llccbw/hyst_length
echo 1 > $llccbw/idle_length
echo 30 > $llccbw/down_thres
echo 0 > $llccbw/guard_band_mbps
echo 250 > $llccbw/up_scale
echo 1600 > $llccbw/idle_mbps
echo 806000 > $llccbw/max_freq
echo 40 > $llccbw/window_ms
done
for ddrbw in $bus_dcvs/DDR/*bwmon-ddr
do
echo "2086 5931 7980 10437 12157 14060 16113" > $ddrbw/mbps_zones
echo 4 > $ddrbw/sample_ms
echo 80 > $ddrbw/io_percent
echo 20 > $ddrbw/hist_memory
echo 5 > $ddrbw/hyst_length
echo 1 > $ddrbw/idle_length
echo 30 > $ddrbw/down_thres
echo 0 > $ddrbw/guard_band_mbps
echo 250 > $ddrbw/up_scale
echo 1600 > $ddrbw/idle_mbps
echo 2736000 > $ddrbw/max_freq
echo 40 > $ddrbw/window_ms
done
for latfloor in $bus_dcvs/*/*latfloor
do
echo 25000 > $latfloor/ipm_ceil
done
for l3gold in $bus_dcvs/L3/*gold
do
echo 4000 > $l3gold/ipm_ceil
done
for l3prime in $bus_dcvs/L3/*prime
do
echo 20000 > $l3prime/ipm_ceil
done
for qosgold in $bus_dcvs/DDRQOS/*gold
do
echo 50 > $qosgold/ipm_ceil
done
for qosprime in $bus_dcvs/DDRQOS/*prime
do
echo 100 > $qosprime/ipm_ceil
done
for ddrprime in $bus_dcvs/DDR/*prime
do
echo 25 > $ddrprime/freq_scale_pct
echo 1500 > $ddrprime/freq_scale_floor_mhz
echo 2726 > $ddrprime/freq_scale_ceil_mhz
done
# Permission for video hint
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/pl
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/pl
echo s2idle > /sys/power/mem_sleep
echo N > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled
model_name=`getprop ro.product.device`
if [ $model_name == "b6q" ]; then
echo 608 > /sys/devices/system/cpu/cpufreq/policy0/walt/target_load_thresh
echo 837 > /sys/devices/system/cpu/cpufreq/policy2/walt/target_load_thresh
echo 891 > /sys/devices/system/cpu/cpufreq/policy5/walt/target_load_thresh
echo 806 > /sys/devices/system/cpu/cpufreq/policy7/walt/target_load_thresh
echo 15000 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
echo 15000 > /sys/devices/system/cpu/cpufreq/policy2/walt/up_rate_limit_us
echo 15000 > /sys/devices/system/cpu/cpufreq/policy5/walt/up_rate_limit_us
echo 15000 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
echo 1344000 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_delay_freq
echo 2572800 > /sys/devices/system/cpu/cpufreq/policy2/walt/up_delay_freq
echo 2572800 > /sys/devices/system/cpu/cpufreq/policy5/walt/up_delay_freq
echo 2630400 > /sys/devices/system/cpu/cpufreq/policy7/walt/up_delay_freq
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl
echo 1 > /proc/sys/walt/sched_conservative_pl
echo 50 85 85 > /proc/sys/walt/sched_downmigrate
echo 59 95 95 > /proc/sys/walt/sched_upmigrate
echo 20 > /dev/cpuctl/background/cpu.uclamp.max
echo 1804800 2707200 2707200 2147483647 > /proc/sys/walt/sched_fmax_cap
echo 51 > /proc/sys/walt/sched_min_task_util_for_boost
echo 51 > /proc/sys/walt/sched_min_task_util_for_uclamp
echo 35 > /proc/sys/walt/sched_min_task_util_for_colocation
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/up_delay_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/up_delay_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/target_load_thresh
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/target_load_thresh
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
chmod 0664 /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy2/walt/up_delay_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy2/walt/up_delay_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy2/walt/target_load_thresh
chmod 0660 /sys/devices/system/cpu/cpufreq/policy2/walt/target_load_thresh
chown root.system /sys/devices/system/cpu/cpufreq/policy2/walt/up_rate_limit_us
chmod 0660 /sys/devices/system/cpu/cpufreq/policy2/walt/up_rate_limit_us
chown root.system /sys/devices/system/cpu/cpufreq/policy5/walt/up_delay_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy5/walt/up_delay_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy5/walt/target_load_thresh
chmod 0660 /sys/devices/system/cpu/cpufreq/policy5/walt/target_load_thresh
chown root.system /sys/devices/system/cpu/cpufreq/policy5/walt/up_rate_limit_us
chmod 0660 /sys/devices/system/cpu/cpufreq/policy5/walt/up_rate_limit_us
chown root.system /sys/devices/system/cpu/cpufreq/policy7/walt/up_delay_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/policy7/walt/up_delay_freq
chown root.system /sys/devices/system/cpu/cpufreq/policy7/walt/target_load_thresh
chmod 0660 /sys/devices/system/cpu/cpufreq/policy7/walt/target_load_thresh
chown root.system /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
chmod 0660 /sys/devices/system/cpu/cpufreq/policy7/walt/up_rate_limit_us
chown root.system /sys/devices/system/cpu/cpufreq/policy0/walt/pl
chmod 0660 /sys/devices/system/cpu/cpufreq/policy0/walt/pl
chown root.system /dev/cpuctl/background/cpu.uclamp.max
chmod 0660 /dev/cpuctl/background/cpu.uclamp.max
fi
# Enable dynamic prefetcher
if [ $model_name == "b6q" ] || [ $model_name == "q6q" ] || [ $model_name == "q6aq" ]; then
chown root.system /sys/devices/system/cpu/dynpf/enable_dynpf
chmod 0660 /sys/devices/system/cpu/dynpf/enable_dynpf
echo 1 > /sys/devices/system/cpu/dynpf/enable_dynpf
fi
echo 4 > /proc/sys/kernel/printk
# SED data dump
factory=`getprop ro.factory.factory_binary`
if [ "$factory" == "factory" ] && [ ! -e /data/local/tmp/SED_DDR_DATA_* ]; then
ap_serial=`getprop ro.boot.ap_serial`
soc_model=`getprop ro.soc.model`
dram_info=`getprop ro.boot.dram_info`
sed_dump_file=/data/local/tmp/SED_DDR_DATA_$soc_model'_'$dram_info'_'$ap_serial.BIN
dd if=/dev/block/bootdevice/by-name/ddr of=$sed_dump_file bs=1024 count=256
chown shell:shell $sed_dump_file
chmod 755 $sed_dump_file
fi
# Change console log level as per console config property
console_config=`getprop persist.vendor.console.silent.config`
case "$console_config" in
"1")
echo "Enable console config to $console_config"
echo 0 > /proc/sys/kernel/printk
;;
*)
echo "Enable console config to $console_config"
;;
esac
setprop vendor.post_boot.parsed 1

View File

@@ -0,0 +1,215 @@
#=============================================================================
# Copyright (c) 2019-2023 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`
let RamSizeGB="( $MemTotal / 1048576 ) + 1"
diskSizeUnit=M
# Zram disk - 75%
let zRamSizeMB="( $RamSizeGB * 1024 ) * 3 / 4"
# use MB avoid 32 bit overflow
if [ $zRamSizeMB -gt 6144 ]; then
let zRamSizeMB=6144
fi
# And enable lz4 zram compression for Go targets.
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
}
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
echo "pasr-enabled"
fi
}
function configure_read_ahead_kb_values() {
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
dmpts=$(ls /sys/block/*/queue/read_ahead_kb | grep -e dm -e mmc -e sd)
# dmpts holds below read_ahead_kb nodes if exists:
# /sys/block/dm-0/queue/read_ahead_kb to /sys/block/dm-10/queue/read_ahead_kb
# /sys/block/sda/queue/read_ahead_kb to /sys/block/sdh/queue/read_ahead_kb
# Set 128 for <= 4GB &
# set 512 for >= 5GB targets.
if [ $MemTotal -le 4194304 ]; then
ra_kb=128
else
ra_kb=512
fi
if [ -f /sys/block/mmcblk0/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0/bdi/read_ahead_kb
fi
if [ -f /sys/block/mmcblk0rpmb/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb
fi
for dm in $dmpts; do
if [ `cat $(dirname $dm)/../removable` -eq 0 ]; then
echo $ra_kb > $dm
fi
done
}
function configure_memory_parameters() {
# Set Memory parameters.
#
# Set per_process_reclaim tuning parameters
# All targets will use vmpressure range 50-70,
# All targets will use 512 pages swap size.
#
# Set Low memory killer minfree parameters
# 32 bit Non-Go, all memory configurations will use 15K series
# 32 bit Go, all memory configurations will use uLMK + Memcg
# 64 bit will use Google default LMK series.
#
# Set ALMK parameters (usually above the highest minfree values)
# vmpressure_file_min threshold is always set slightly higher
# than LMK minfree's last bin value for all targets. It is calculated as
# vmpressure_file_min = (last bin - second last bin ) + last bin
#
# Set allocstall_threshold to 0 for all targets.
#
#configure_zram_parameters
configure_read_ahead_kb_values
#echo 100 > /proc/sys/vm/swappiness
# Disable periodic kcompactd wakeups. We do not use THP, so having many
# huge pages is not as necessary.
echo 0 > /proc/sys/vm/compaction_proactiveness
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
let RamSizeGB="( $MemTotal / 1048576 ) + 1"
have_pasr=$(verify_pasr_support)
if [ -z $have_pasr ]; then
## Goal is to allow all allocations to use THP whilst minimizing allocaiton delays
# Allow all eligibe page faults to use THP
echo always > /sys/kernel/mm/transparent_hugepage/enabled
# Prevent page faults on THP-elgible VMAs from causing reclaim or compaction
echo never > /sys/kernel/mm/transparent_hugepage/defrag
## Goal is to make khugepaged as inert as possible using the below settings
# Prevent khugepaged from doing reclaim or compaction
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
# Minimize the number of pages that khugepaged will scan
echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan
# Maximize the amount of time that khugepaged is asleep for
echo 4294967295 > /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs
echo 4294967295 > /sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs
# Restrict khugepaged promotions as much as possible. Only allow khugepaged to promote
# if all pages in a VMA are (1) not invalid PTEs, (2) not swapped out PTEs, (3) not
# shared PTEs.
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_swap
echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_shared
else
# Do not enable THP is PASR is enabled
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
# Set the min_free_kbytes to standard kernel value
if [ $RamSizeGB -ge 8 ]; then
echo 11584 > /proc/sys/vm/min_free_kbytes
elif [ $RamSizeGB -ge 4 ]; then
echo 8192 > /proc/sys/vm/min_free_kbytes
elif [ $RamSizeGB -ge 2 ]; then
echo 5792 > /proc/sys/vm/min_free_kbytes
else
echo 4096 > /proc/sys/vm/min_free_kbytes
fi
#Set per-app max kgsl reclaim limit and per shrinker call limit
if [ -f /sys/class/kgsl/kgsl/page_reclaim_per_call ]; then
echo 38400 > /sys/class/kgsl/kgsl/page_reclaim_per_call
fi
# if [ -f /sys/class/kgsl/kgsl/max_reclaim_limit ]; then
# echo 51200 > /sys/class/kgsl/kgsl/max_reclaim_limit
# fi
}
configure_memory_parameters
if [ -f /sys/devices/soc0/soc_id ]; then
platformid=`cat /sys/devices/soc0/soc_id`
fi
case "$platformid" in
"557"|"577")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-pineapple.sh
;;
"614"|"632")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-cliffs.sh
;;
*)
echo "***WARNING***: Invalid SoC ID\n\t No postboot settings applied!!\n"
;;
esac

View File

@@ -0,0 +1,216 @@
#!/vendor/bin/sh
# Copyright (c) 2012-2013, 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.
#
# Set platform variables
target=`getprop ro.board.platform`
if [ -f /sys/devices/soc0/hw_platform ]; then
soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
else
soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
fi
if [ -f /sys/devices/soc0/soc_id ]; then
soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
else
soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
fi
if [ -f /sys/devices/soc0/platform_version ]; then
soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null
else
soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
fi
# Dynamic Memory Managment (DMM) provides a sys file system to the userspace
# that can be used to plug in/out memory that has been configured as unstable.
# This unstable memory can be in Active or In-Active State.
# Each of which the userspace can request by writing to a sys file.
#
# ro.dev.dmm = 1; Indicates that DMM is enabled in the Android User Space. This
# property is set in the Android system properties file.
#
# If ro.dev.dmm.dpd.start_address is set here then the target has a memory
# configuration that supports DynamicMemoryManagement.
init_DMM()
{
block=-1
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm8960")
;;
*)
return
;;
esac
mem="/sys/devices/system/memory"
op=`cat $mem/movable_start_bytes`
case "$op" in
"0")
log -p i -t DMM DMM Disabled. movable_start_bytes not set: $op
;;
"$mem/movable_start_bytes: No such file or directory ")
log -p i -t DMM DMM Disabled. movable_start_bytes does not exist: $op
;;
*)
log -p i -t DMM DMM available. movable_start_bytes at $op
movable_start_bytes=0x`cat $mem/movable_start_bytes`
block_size_bytes=0x`cat $mem/block_size_bytes`
block=$((#${movable_start_bytes}/${block_size_bytes}))
chown -h system.system $mem/memory$block/state
chown -h system.system $mem/probe
chown -h system.system $mem/active
chown -h system.system $mem/remove
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
echo $movable_start_bytes > $mem/probe
case "$?" in
"0")
log -p i -t DMM $movable_start_bytes to physical hotplug succeeded.
;;
*)
log -p e -t DMM $movable_start_bytes to physical hotplug failed.
return
;;
esac
echo online > $mem/memory$block/state
case "$?" in
"0")
log -p i -t DMM \'echo online\' to logical hotplug succeeded.
;;
*)
log -p e -t DMM \'echo online\' to logical hotplug failed.
return
;;
esac
;;
esac
setprop ro.dev.dmm.dpd.start_address $movable_start_bytes
setprop ro.dev.dmm.dpd.block $block
;;
esac
case "$target" in
"msm8960")
return
;;
esac
# For 7X30 targets:
# ro.dev.dmm.dpd.start_address is set when the target has a 2x256Mb memory
# configuration. This is also used to indicate that the target is capable of
# setting EBI-1 to Deep Power Down or Self Refresh.
op=`cat $mem/low_power_memory_start_bytes`
case "$op" in
"0")
log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes not set:$op
;;
"$mem/low_power_memory_start_bytes No such file or directory ")
log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes does not exist:$op
;;
*)
log -p i -t DMM Self-Refresh-Only available. low_power_memory_start_bytes at $op
;;
esac
}
#
# For controlling console and shell on console on 8960 - perist.serial.enable 8960
# On other target use default ro.debuggable property.
#
serial=`getprop persist.serial.enable`
dserial=`getprop ro.debuggable`
case "$target" in
"msm8960")
case "$serial" in
"0")
echo 0 > /sys/devices/platform/msm_serial_hsl.0/console
;;
"1")
echo 1 > /sys/devices/platform/msm_serial_hsl.0/console
start console
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
;;
"msm8610" | "msm8974" | "msm8226")
case "$serial" in
"0")
echo 0 > /sys/devices/f991f000.serial/console
;;
"1")
echo 1 > /sys/devices/f991f000.serial/console
start console
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
insmod /system/lib/modules/ss_mfcinit.ko
insmod /system/lib/modules/ss_vencoder.ko
insmod /system/lib/modules/ss_vdecoder.ko
chmod -h 0666 /dev/ss_mfc_reg
chmod -h 0666 /dev/ss_vdec
chmod -h 0666 /dev/ss_venc
init_DMM
;;
"msm8960")
init_DMM
;;
esac

View File

@@ -0,0 +1,115 @@
#! /vendor/bin/sh
# Copyright (c) 2009-2010, 2012, 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.
LOG_TAG="qcom-bt-wlan-coex"
LOG_NAME="${0}:"
coex_pid=""
ath_wlan_supported=`getprop wlan.driver.ath`
loge ()
{
/system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
}
logi ()
{
/system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
}
failed ()
{
loge "$1: exit code $2"
exit $2
}
start_coex ()
{
case "$ath_wlan_supported" in
"2")
echo "ATH WLAN Chip ID AR6004 is enabled"
/system/bin/abtfilt -d -z -n -m -a -w wlan0 &
;;
"1")
echo "ATH WLAN Chip ID is enabled"
# Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
/system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
;;
"0")
echo "WCN WLAN Chip ID is enabled"
# Must have -o turned on to avoid daemon (otherwise we cannot get pid)
/system/bin/btwlancoex -o $opt_flags &
;;
*)
echo "NO WLAN Chip ID is enabled, so enabling ATH as default"
# Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
/system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
;;
esac
coex_pid=$!
logi "start_coex: pid = $coex_pid"
}
kill_coex ()
{
logi "kill_coex: pid = $coex_pid"
kill -TERM $coex_pid
# this shell doesn't exit now -- wait returns for normal exit
}
# mimic coex options parsing -- maybe a waste of effort
USAGE="${0} [-o] [-c] [-r] [-i] [-h]"
while getopts "ocrih" f
do
case $f in
o | c | r | i | h) opt_flags="$opt_flags -$f" ;;
\?) echo $USAGE; exit 1;;
esac
done
# init does SIGTERM on ctl.stop for service
trap "kill_coex" TERM INT
#Selectively start coex module
target=`getprop ro.board.platform`
if [ "$target" == "msm8960" ] && [ "$ath_wlan_supported" != "2" ]; then
logi "btwlancoex/abtfilt is not needed"
else
# Build settings may not produce the coex executable
if ls /system/bin/btwlancoex || ls /system/bin/abtfilt
then
start_coex
wait $coex_pid
logi "Coex stopped"
else
logi "btwlancoex/abtfilt not available"
fi
fi
exit 0

View File

@@ -0,0 +1,35 @@
#! /vendor/bin/sh
# Copyright (c) 2012, 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.
#
#
PATH=/system/bin:$PATH
export PATH
cat /sys/devices/platform/rs300000a7.65536/force_sync
cat /sys/devices/platform/rs300100a7.65536/force_sync

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

@@ -4660,6 +4660,8 @@ case "$target" in
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
fi
echo N > /sys/module/lpm_levels/parameters/sleep_disabled
# Starting io prefetcher service
start iop
# Set Memory parameters
configure_memory_parameters
@@ -5422,6 +5424,7 @@ case "$target" in
echo 5 > /proc/sys/kernel/sched_spill_nr_run
echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill
echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker
start iop
# disable thermal bcl hotplug to switch governor
echo 0 > /sys/module/msm_thermal/core_control/enabled

View File

@@ -0,0 +1,78 @@
#! /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

View File

@@ -0,0 +1,33 @@
#!/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 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 to start sensors for SSC enabled platforms
#
cp /vendor/etc/sensors/scripts/* /data/vendor/sensors/scripts/
chmod a+rw /data/vendor/sensors/scripts/*

View File

@@ -0,0 +1,200 @@
#!/vendor/bin/sh
# Copyright (c) 2012-2018, 2020-2021 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.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
# Set platform variables
soc_hwplatform=`cat /sys/devices/soc0/hw_platform 2> /dev/null`
soc_machine=`cat /sys/devices/soc0/machine 2> /dev/null`
soc_machine=${soc_machine:0:2}
soc_id=`cat /sys/devices/soc0/soc_id 2> /dev/null`
#
# Check ESOC for external modem
#
# Note: currently only a single MDM/SDX is supported
#
esoc_name=`cat /sys/bus/esoc/devices/esoc0/esoc_name 2> /dev/null`
target=`getprop ro.board.platform`
#
# Override USB default composition
#
if [ "$(getprop ro.build.type)" != "user" ]; then
# If USB persist config not set, set default configuration
if [ "$(getprop persist.vendor.usb.config)" == "" ]; then
if [ "$esoc_name" != "" ]; then
setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb
else
case "$(getprop ro.baseband)" in
"apq")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$soc_hwplatform" in
"Dragon" | "SBC")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$soc_machine" in
"SA")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$target" in
"msm8996")
setprop persist.vendor.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb
;;
"msm8909")
setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
"msm8937")
if [ -d /config/usb_gadget ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
else
case "$soc_id" in
"313" | "320")
setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb
;;
*)
setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
esac
fi
;;
"msm8953")
if [ -d /config/usb_gadget ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
else
setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb
fi
;;
"msm8998" | "sdm660" | "apq8098_latv")
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,adb
;;
"sdm845" | "sdm710")
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
;;
"msmnile" | "sm6150" | "trinket" | "lito" | "atoll" | "bengal" | "lahaina" | "holi" | \
"taro" | "kalama" | "pineapple" | "blair")
setprop persist.vendor.usb.config diag,adb
# setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,qdss,adb
;;
"gen4")
setprop persist.vendor.usb.config adb
;;
*)
setprop persist.vendor.usb.config diag,adb
;;
esac
;;
esac
;;
esac
;;
esac
fi
fi
else # for user build let persist.sys.usb.config dictate the default composition
setprop persist.vendor.usb.config ""
fi
# This check is needed for GKI 1.0 targets where QDSS is not available
if [ "$(getprop persist.vendor.usb.config)" == "diag,serial_cdev,rmnet,dpl,qdss,adb" -a \
! -d /config/usb_gadget/g1/functions/qdss.qdss ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
fi
# Start peripheral mode on primary USB controllers for Automotive platforms
case "$soc_machine" in
"SA")
if [ -f /sys/bus/platform/devices/a600000.ssusb/mode ]; then
default_mode=`cat /sys/bus/platform/devices/a600000.ssusb/mode`
case "$default_mode" in
"none")
echo peripheral > /sys/bus/platform/devices/a600000.ssusb/mode
;;
esac
fi
;;
esac
# check configfs is mounted or not
if [ -d /config/usb_gadget ]; then
machine_type=`cat /sys/devices/soc0/machine`
# Chip ID & serial are used for unique MSM identification in Product String
# If not present, then omit them instead of using 0x00000000
msm_chipid=`cat /sys/devices/soc0/nproduct_id`;
if [ "$msm_chipid" != "" ]; then
msm_chipid_hex=`printf _CID:%04X $msm_chipid`
fi
msm_serial=`cat /sys/devices/soc0/serial_number`;
if [ "$msm_serial" != "" ]; then
msm_serial_hex=`printf _SN:%08X $msm_serial`
fi
setprop vendor.usb.product_string "$machine_type-$soc_hwplatform$msm_chipid_hex$msm_serial_hex"
# ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy
serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber 2> /dev/null`
if [ "$serialnumber" == "" ]; then
serialno=1234567
echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber
fi
setprop vendor.usb.configfs 1
fi
#
# Initialize RNDIS Diag option. If unset, set it to 'none'.
#
diag_extra=`getprop persist.vendor.usb.config.extra`
if [ "$diag_extra" == "" ]; then
setprop persist.vendor.usb.config.extra none
fi
# enable rps cpus on msm8937 target
setprop vendor.usb.rps_mask 0
case "$soc_id" in
"294" | "295" | "353" | "354")
setprop vendor.usb.rps_mask 40
;;
esac
#
# Initialize UVC conifguration.
#
if [ -d /config/usb_gadget/g1/functions/uvc.0 ]; then
setprop vendor.usb.uvc.function.init 1
fi

View File

@@ -0,0 +1,31 @@
#=============================================================================
# Copyright (c) 2020-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2014-2017, 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.
#=============================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
#=============================================================================
# Copyright (c) 2020-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2014-2017, 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
"557"|"577")
/vendor/bin/sh /vendor/bin/init.qti.kernel.debug-pineapple.sh
;;
"614"|"632")
/vendor/bin/sh /vendor/bin/init.qti.kernel.debug-cliffs.sh
;;
*)
echo "***WARNING***: Invalid chip family\n\t skipping debug script!!\n"
;;
esac

View File

@@ -0,0 +1,206 @@
#=============================================================================
# Copyright (c) 2022-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2014-2017, 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.
#=============================================================================
enable_sched_events()
{
local instance=/sys/kernel/tracing
echo > $instance/trace
echo > $instance/set_event
# timer
echo 1 > $instance/events/timer/timer_expire_entry/enable
echo 1 > $instance/events/timer/timer_expire_exit/enable
echo 1 > $instance/events/timer/hrtimer_cancel/enable
echo 1 > $instance/events/timer/hrtimer_expire_entry/enable
echo 1 > $instance/events/timer/hrtimer_expire_exit/enable
echo 1 > $instance/events/timer/hrtimer_init/enable
echo 1 > $instance/events/timer/hrtimer_start/enable
#enble FTRACE for softirq events
echo 1 > $instance/events/irq/enable
#enble FTRACE for Workqueue events
echo 1 > $instance/events/workqueue/enable
# sched
#echo 1 > $instance/events/sched/sched_cpu_hotplug/enable
echo 1 > $instance/events/sched/sched_migrate_task/enable
echo 1 > $instance/events/sched/sched_pi_setprio/enable
echo 1 > $instance/events/sched/sched_switch/enable
echo 1 > $instance/events/sched/sched_wakeup/enable
echo 1 > $instance/events/sched/sched_wakeup_new/enable
echo 1 > $instance/events/schedwalt/halt_cpus/enable
echo 1 > $instance/events/schedwalt/halt_cpus_start/enable
# hot-plug
echo 1 > $instance/events/cpuhp/enable
echo 1 > $instance/events/power/cpu_frequency/enable
echo 1 > $instance/tracing_on
}
enable_rproc_events()
{
local instance=/sys/kernel/tracing/instances/rproc_qcom
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
# enable rproc events as soon as available
/vendor/bin/init.qti.write.sh $instance/events/rproc_qcom/enable 1
echo 1 > $instance/tracing_on
}
# Suspend events are also noisy when going into suspend/resume
enable_suspend_events()
{
local instance=/sys/kernel/tracing/instances/suspend
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
echo 1 > $instance/events/power/suspend_resume/enable
echo 1 > $instance/events/power/device_pm_callback_start/enable
echo 1 > $instance/events/power/device_pm_callback_end/enable
echo 1 > $instance/tracing_on
}
enable_clock_reg_events()
{
local instance=/sys/kernel/tracing/instances/clock_reg
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
# clock
echo 1 > $instance/events/clk/enable
echo 1 > $instance/events/clk_qcom/enable
# interconnect
echo 1 > $instance/events/interconnect/enable
# regulator
echo 1 > $instance/events/regulator/enable
# rpmh
echo 1 > $instance/events/rpmh/enable
echo 1 > $instance/tracing_on
}
enable_memory_events()
{
local instance=/sys/kernel/tracing/instances/memory
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
#memory pressure events/oom
#echo 1 > $instance/events/psi/psi_event/enable
#echo 1 > $instance/events/psi/psi_window_vmstat/enable
echo 1 > $instance/events/arm_smmu/enable
echo 1 > $instance/tracing_on
}
# binder tracing can be noisy
enable_binder_events()
{
local instance=/sys/kernel/tracing/instances/binder
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
echo 1 > $instance/events/binder/enable
echo 1 > $instance/tracing_on
}
enable_rwmmio_events()
{
if [ ! -d /sys/kernel/tracing/events/rwmmio ]
then
return
fi
local instance=/sys/kernel/tracing/instances/rwmmio
mkdir $instance
echo > $instance/trace
echo > $instance/set_event
echo 1 > $instance/events/rwmmio/rwmmio_read/enable
echo 1 > $instance/events/rwmmio/rwmmio_write/enable
echo 1 > $instance/tracing_on
}
find_build_type()
{
linux_banner=`cat /proc/version`
if [[ "$linux_banner" == *"-consolidate"* ]]
then
debug_build=true
fi
}
debug_build=false
enable_tracing_events()
{
# bail out if its perf config
find_build_type
if [ "$debug_build" = false ]
then
return
fi
# bail out if ftrace events aren't present
if [ ! -d /sys/kernel/tracing/events ] ; then
return
fi
enable_sched_events
enable_rproc_events
enable_suspend_events
enable_binder_events
enable_clock_reg_events
enable_memory_events
enable_rwmmio_events
}
enable_tracing_events

View File

@@ -0,0 +1,45 @@
#=============================================================================
# Copyright (c) 2022-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2014-2017, 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
"557"|"577"|"614"|"632")
/vendor/bin/sh /vendor/bin/init.qti.kernel.early_debug-pineapple.sh
;;
*)
echo "***WARNING***: Invalid SoC ID\n\t Not running early debug scripts!!\n"
;;
esac

View File

@@ -0,0 +1,40 @@
#! /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.
#=============================================================================
start_msm_irqbalance()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_msm_irqbalance

View File

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

View File

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

View File

@@ -0,0 +1,386 @@
#
# Copyright (c) 2009-2016, 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.
#
# Define fastmmi
service fastmmi /system_ext/bin/mmi
user root
group root
disabled
service vendor.mmid /vendor/bin/mmid
user root
group root
disabled
service mmi_diag /system_ext/bin/mmi_diag
class main
user root
group root oem_2901
disabled
on property:vendor.sys.boot_mode=ffbm && property:ro.build.type=userdebug
write ${persist.vendor.mmi.misc_dev_path} "ffbm-01"
on property:vendor.sys.boot_mode=ffbm && property:ro.build.type=eng
write ${persist.vendor.mmi.misc_dev_path} "ffbm-01"
on property:vendor.sys.boot_mode=qmmi && property:ro.build.type=userdebug
write ${persist.vendor.mmi.misc_dev_path} "qmmi"
on property:vendor.sys.boot_mode=qmmi && property:ro.build.type=eng
write ${persist.vendor.mmi.misc_dev_path} "qmmi"
on property:vendor.sys.boot_mode=normal && property:ro.build.type=userdebug
write ${persist.vendor.mmi.misc_dev_path} "normal"
on property:vendor.sys.boot_mode=normal && property:ro.build.type=eng
write ${persist.vendor.mmi.misc_dev_path} "normal"
# Creating a scratch storage on /data for factory testing.
on factory-fs && property:ro.bootmode=ffbm-00 && property:ro.build.type=userdebug
mount tmpfs tmpfs /data
on factory-fs && property:ro.bootmode=ffbm-00 && property:ro.build.type=eng
mount tmpfs tmpfs /data
on factory-fs && property:ro.bootmode=ffbm-01 && property:ro.build.type=userdebug
mount tmpfs tmpfs /data
on factory-fs && property:ro.bootmode=ffbm-01 && property:ro.build.type=eng
mount tmpfs tmpfs /data
# aligned the usb port with system standard, otherwise if only diag be added
# Then in QMMI mode, the whole Andoid be booted, but due to the ro.bootmode is
# not normal/unknow, then when it apply the default funcs, it will turn to MTP
# which cause the diag/Wwan/modem port all be lost in qmmi mode. Details:
# UsbDeviceManager.java---->getDefaultFunctions and trySetEnabledFunctions
on property:persist.vendor.usb.config=*
setprop persist.sys.usb.qmmi.func ${persist.vendor.usb.config}
on mmi && property:ro.bootmode=ffbm-00
# ========================================================
# This is FFBM only settings.
# ========================================================
#mkdir for factory data files.
mkdir /mnt/vendor/persist/FTM_AP 0750 system system
start fastmmi
# start qcom-post-boot to set the misc partition path property value
start qcom-post-boot
start mmi_diag
on mmi && property:ro.bootmode=ffbm-01
# ========================================================
# This is FFBM only settings.
# ========================================================
#mkdir for factory data files.
mkdir /mnt/vendor/persist/FTM_AP 0750 system system
start fastmmi
## start qcom-post-boot to set the misc partition path property value
start qcom-post-boot
start mmi_diag
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-00 && property:ro.build.type=userdebug
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-00 && property:ro.build.type=eng
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-01 && property:ro.build.type=userdebug
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-01 && property:ro.build.type=eng
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-02 && property:ro.build.type=userdebug
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-02 && property:ro.build.type=eng
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=qmmi && property:ro.build.type=userdebug
setprop sys.usb.config ${persist.vendor.usb.config}
on property:persist.vendor.usb.config=* && property:ro.bootmode=qmmi && property:ro.build.type=eng
setprop sys.usb.config ${persist.vendor.usb.config}
on ffbm
trigger early-fs
trigger factory-fs
trigger fs
trigger post-fs
# Mount fstab in init.{$device}.rc by mount_all with '--late' parameter
# to only mount entries with 'latemount'. This is needed if '--early' is
# specified in the previous mount_all command on the fs stage.
# With /system mounted and properties form /system + /factory available,
# some services can be started.
trigger late-fs
# Now we can mount /data. File encryption requires keymaster to decrypt
# /data, which in turn can only be loaded when system properties are present.
trigger post-fs-data
# Now we can start zygote for devices with file based encryption
trigger zygote-start
# Load persist properties and override properties (if enabled) from /data.
trigger load_persist_props_action
# Remove a file to wake up anything waiting for firmware.
trigger firmware_mounts_complete
trigger early-boot
trigger boot
trigger mmi
# ========================================================
# Start for audio TC
# ========================================================
service vendor.audio_tc53 /vendor/bin/mm-audio-ftm -tc 53
user audio
group audio
disabled
oneshot
service vendor.audio_tc1 /vendor/bin/mm-audio-ftm -tc 1
user audio
group audio
disabled
oneshot
service vendor.audio_tc2 /vendor/bin/mm-audio-ftm -tc 2
user audio
group audio
disabled
oneshot
service vendor.audio_tc3 /vendor/bin/mm-audio-ftm -tc 3
user audio
group audio
disabled
oneshot
service vendor.audio_tc4 /vendor/bin/mm-audio-ftm -tc 4
user audio
group audio
disabled
oneshot
service vendor.audio_tc5 /vendor/bin/mm-audio-ftm -tc 5
user audio
group audio
disabled
oneshot
service vendor.audio_tc51 /vendor/bin/mm-audio-ftm -tc 51
user audio
group audio
disabled
oneshot
service vendor.audio_tc56 /vendor/bin/mm-audio-ftm -tc 56
user audio
group audio
disabled
oneshot
service vendor.audio_tc222 /vendor/bin/mm-audio-ftm -tc 222
user audio
group audio
disabled
oneshot
service vendor.audio_tc225 /vendor/bin/mm-audio-ftm -tc 225
user audio
group audio
disabled
oneshot
service vendor.audio_tc228 /vendor/bin/mm-audio-ftm -tc 228
user audio
group audio
disabled
oneshot
service vendor.audio_tc229 /vendor/bin/mm-audio-ftm -tc 229
user audio
group audio
disabled
oneshot
service vendor.audio_tc230 /vendor/bin/mm-audio-ftm -tc 230
user audio
group audio
disabled
oneshot
service vendor.audio_tc246 /vendor/bin/mm-audio-ftm -tc 246
user audio
group audio
disabled
oneshot
service vendor.audio_tc247 /vendor/bin/mm-audio-ftm -tc 247
user audio
group audio
disabled
oneshot
service vendor.audio_tc250 /vendor/bin/mm-audio-ftm -tc 250
user audio
group audio
disabled
oneshot
service vendor.audio_tc251 /vendor/bin/mm-audio-ftm -tc 251
user audio
group audio
disabled
oneshot
service vendor.audio_tc252 /vendor/bin/mm-audio-ftm -tc 252
user audio
group audio
disabled
oneshot
service vendor.audio_tc253 /vendor/bin/mm-audio-ftm -tc 253
user audio
group audio
disabled
oneshot
service vendor.audio_tc333 /vendor/bin/mm-audio-ftm -tc 333
user audio
group audio
disabled
oneshot
service vendor.audio_tc334 /vendor/bin/mm-audio-ftm -tc 334
user audio
group audio
disabled
oneshot
service vendor.audio_tc335 /vendor/bin/mm-audio-ftm -tc 335
user audio
group audio
disabled
oneshot
service vendor.audio_tc336 /vendor/bin/mm-audio-ftm -tc 336
user audio
group audio
disabled
oneshot
service vendor.audio_tc337 /vendor/bin/mm-audio-ftm -tc 337
user audio
group audio
disabled
oneshot
service vendor.audio_tc338 /vendor/bin/mm-audio-ftm -tc 338
user audio
group audio
disabled
oneshot
service vendor.audio_tc11 /vendor/bin/mm-audio-ftm -tc 11 -file /data/vendor/audio/ftm_headset_mic_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc16 /vendor/bin/mm-audio-ftm -tc 16 -file /data/vendor/audio/ftm_mic1_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc17 /vendor/bin/mm-audio-ftm -tc 17 -file /data/vendor/audio/ftm_mic2_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc18 /vendor/bin/mm-audio-ftm -tc 18 -file /data/vendor/audio/ftm_mic3_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc19 /vendor/bin/mm-audio-ftm -tc 19 -file /data/vendor/audio/ftm_mic4_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc20 /vendor/bin/mm-audio-ftm -tc 20 -file /data/vendor/audio/ftm_mic5_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc21 /vendor/bin/mm-audio-ftm -tc 21 -file /data/vendor/audio/ftm_mic6_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc101 /vendor/bin/mm-audio-ftm -tc 101 -file /data/vendor/audio/ftm_mic1_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc102 /vendor/bin/mm-audio-ftm -tc 102 -file /data/vendor/audio/ftm_mic2_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc103 /vendor/bin/mm-audio-ftm -tc 103 -file /data/vendor/audio/ftm_mic3_record.wav
user audio
group audio
disabled
oneshot
service vendor.audio_tc104 /vendor/bin/mm-audio-ftm -tc 104 -file /data/vendor/audio/ftm_mic4_record.wav
user audio
group audio
disabled
oneshot
# ========================================================
# End for audio TC
# ========================================================

View File

@@ -277,6 +277,12 @@ on post-fs-data
# Create directory used by display clients
mkdir /data/vendor/display 0770 system graphics
# Change lm related dirs
mkdir /data/vendor/lm 0700 root root
# Create directory used by powermodule
mkdir /data/vendor/pwr 0700 root root
# Create directory used by media clients
mkdir /data/vendor/media 0770 mediacodec media
@@ -377,10 +383,18 @@ on post-fs-data
mkdir /data/vendor/fm 0770 system system
chmod 0770 /data/vendor/fm
#Create PERFD deamon related dirs
mkdir /data/vendor/perfd 0770 root system
chmod 2770 /data/vendor/perfd
rm /data/vendor/perfd/default_values
mkdir /data/vendor/secure_element 0777 system system
mkdir /data/vendor/nfc 0770 nfc nfc
#Create IOP deamon related dirs
mkdir /data/vendor/iop 0700 root system
# Mark the copy complete flag to not completed
write /data/vendor/radio/copy_complete 0
chown radio radio /data/vendor/radio/copy_complete
@@ -432,6 +446,25 @@ service nqnfcinfo /system/vendor/bin/nqnfcinfo
user system
oneshot
service iop /system/vendor/bin/iop
class main
user root
group root
disabled
socket iop seqpacket 0666 root system
service qcomsysd /system/vendor/bin/qcom-system-daemon
class main
user root
group root diag oem_2901
disabled
on property:persist.vendor.qcomsysd.enabled=1
enable qcomsysd
on property:persist.vendor.qcomsysd.enabled=0
stop qcomsysd
service vendor.ssr_setup /system/vendor/bin/ssr_setup
oneshot
disabled

2791
rootdir/etc/init.qcom.usb.rc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
#=============================================================================
# Copyright (c) 2019-2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
import /vendor/etc/init/hw/init.qti.kernel.test.rc
on early-init
# Set the console loglevel to < KERN_WARN
# Set the default message loglevel to KERN_INFO
write /proc/sys/kernel/printk "4 6 1 7"
exec_start gki.modprobe
# wait for system modules to be loaded first before loading vendor modules
wait_for_prop odm.system.all.modules.ready 1
start vendor.modprobe
# Mount tracefs in /sys/kernel/tracing as CONFIG_DEBUG_FS might be
# disabled and /sys/kernel/debug/tracing might not be available
mount tracefs tracefs /sys/kernel/tracing
chmod 0755 /sys/kernel/tracing
chown root system /dev/kmsg
chmod 0620 /dev/kmsg
write /proc/sys/kernel/sched_boost 1
write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
on post-fs
wait_for_prop vendor.all.modules.ready 1
# Create cgroup mount point for memory
mkdir /sys/fs/cgroup/memory/bg 0750 root system
write /sys/fs/cgroup/memory/bg/memory.swappiness 140
write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/bg/tasks
chmod 0660 /sys/fs/cgroup/memory/bg/tasks
# update scheduler tunables
write /dev/cpuctl/foreground/cpu.uclamp.sched_boost_no_override 1
write /dev/cpuctl/top-app/cpu.uclamp.sched_boost_no_override 1
write /dev/cpuctl/background/cpu.uclamp.colocate 0
write /dev/cpuctl/foreground/cpu.uclamp.colocate 0
write /dev/cpuctl/top-app/cpu.uclamp.colocate 1
# set aggressive read ahead for dm-0 and dm-1 during boot up
write /sys/block/dm-0/queue/read_ahead_kb 2048
write /sys/block/dm-1/queue/read_ahead_kb 2048
write /sys/block/dm-2/queue/read_ahead_kb 2048
on early-boot
# Allow subsystem (modem etc) debugging
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_adsp/boot 1
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_cdsp/boot 1
exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/devices/virtual/cvp/cvp/boot 1
on boot
# Allow access to dload sysfs node
chown root system /sys/kernel/dload/emmc_dload
chmod 0660 /sys/kernel/dload/emmc_dload
chown root system /dev/block/bootdevice/by-name/ramdump
chmod 0660 /dev/block/bootdevice/by-name/ramdump
chown root system /sys/kernel/dload/dload_mode
chmod 0660 /sys/kernel/dload/dload_mode
# set the io-scheduler to bfq on all eMMC and SD devices
write /sys/class/block/mmcblk0/queue/scheduler bfq
write /sys/class/block/mmcblk1/queue/scheduler bfq
# update io-scheduler tunables
write /sys/class/block/mmcblk0/queue/iosched/slice_idle 0
write /sys/class/block/mmcblk1/queue/iosched/slice_idle 0
# Allow access to memory hotplug device attributes
chown system system /sys/kernel/mem-offline/anon_migrate
on post-fs-data
# Create directory used for dump collection
mkdir /data/vendor/ssrdump 0770 root system
on property:persist.sys.ssr.enable_debug=*
write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug}
on property:persist.sys.mba_boot_timeout=*
write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout}
on property:persist.sys.modem_auth_timeout=*
write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${persist.sys.modem_auth_timeout}
on property:persist.sys.pil_proxy_timeout=*
write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout}
on property:persist.vendor.ssr.enable_ramdumps=1
write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
on property:persist.vendor.ssr.enable_ramdumps=0
write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
on property:persist.vendor.sys.rawdump_copy=1
write /sys/kernel/dload/emmc_dload 1
on property:persist.vendor.sys.rawdump_copy=0
write /sys/kernel/dload/emmc_dload 0
service kernel-boot /vendor/bin/sh /vendor/bin/init.qti.kernel.sh
class core
user root
group root
disabled
oneshot
service kernel-post-boot /vendor/bin/sh /vendor/bin/init.kernel.post_boot.sh
class core
user root
group root system wakelock graphics
disabled
oneshot
on property:sys.boot_completed=1
write /dev/kmsg "Boot completed "
#Reset read ahead for dm-0, dm-1 and dm-2 to 512kb
write /sys/block/dm-0/queue/read_ahead_kb 512
write /sys/block/dm-1/queue/read_ahead_kb 512
write /sys/block/dm-2/queue/read_ahead_kb 512
write /proc/sys/vm/page-cluster 0
start kernel-boot
start kernel-post-boot
on charger
start kernel-post-boot
service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
class core
user root
group root
disabled
service gki.modprobe /vendor/bin/system_dlkm_modprobe.sh
class main
user root
group root system
disabled
stdio_to_kmsg
seclabel u:r:vendor_modprobe:s0
oneshot
service vendor.modprobe /vendor/bin/vendor_modprobe.sh
class main
user root
group root system
disabled
stdio_to_kmsg
seclabel u:r:vendor_modprobe:s0
oneshot

View File

@@ -0,0 +1,52 @@
# Copyright (c) 2019-2024, 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.
#
#
on early-init
on init
on late-init
on post-fs
on late-fs
on post-fs-data
on boot
on shutdown
# service definition
# on property triggers
on early-boot && property:ro.binary.type=factory
umount /product/vm-system

View File

@@ -114,6 +114,3 @@ service factory_ssc /vendor/bin/factory.ssc
on property:sys.boot_completed=1
setprop ro.factory.sensor.delay.init 1
# Enable PowerHAL hint processing
setprop vendor.powerhal.init 1

View File

@@ -143,6 +143,8 @@ on post-fs && property:ro.boot.factory.interposer=0
start vendor.qvirtservice
on late-fs
wait_for_prop hwservicemanager.ready true
#exec_start wait_for_keymaster
mount_all /vendor/etc/fstab.qcom --late
on post-fs-data
@@ -271,16 +273,3 @@ service fan_control_turn_off /vendor/bin/fan_service 0
user root
disabled
oneshot
service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service
override
class hal
user audioserver
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct oem_2901 wakelock oem_2912
capabilities BLOCK_SUSPEND SYS_NICE
# setting RLIMIT_RTPRIO allows binder RT priority inheritance
rlimit rtprio 10 10
ioprio rt 4
task_profiles ProcessCapacityHigh HighPerformance
onrestart restart audioserver