e3q: Initial commit

This commit is contained in:
David Wronek
2024-10-19 09:55:36 +02:00
commit 1ed321552e
88 changed files with 34339 additions and 0 deletions

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

View File

@@ -0,0 +1,104 @@
#! /vendor/bin/sh
# Copyright (c) 2013-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 ril-daemon only for targets on which radio is present
#
baseband=`getprop ro.baseband`
sgltecsfb=`getprop persist.vendor.radio.sglte_csfb`
datamode=`getprop persist.vendor.data.mode`
low_ram=`getprop ro.config.low_ram`
case "$baseband" in
"apq" | "sda" | "qcs" )
setprop ro.vendor.radio.noril yes
stop vendor.ril-daemon
stop vendor.qcrild
stop vendor.qcrild2
stop vendor.qcrild3
esac
case "$baseband" in
"msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6")
start vendor.qcrild
case "$baseband" in
"svlte2a" | "csfb")
start qmiproxy
;;
"sglte" | "sglte2" )
if [ "x$sgltecsfb" != "xtrue" ]; then
start qmiproxy
else
setprop persist.vendor.radio.voice.modem.index 0
fi
;;
esac
multisim=`getprop persist.radio.multisim.config`
if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then
start vendor.qcrild2
elif [ "$multisim" = "tsts" ]; then
start vendor.qcrild2
start vendor.qcrild3
fi
case "$datamode" in
"tethered")
# This daemon was also disabled in sm8450 as a qualcomm tethering interface.
# start vendor.dataqti
if [ "$low_ram" != "true" ]; then
start vendor.dataadpl
fi
;;
"concurrent")
# This daemon was also disabled in sm8450 as a qualcomm tethering interface.
# start vendor.dataqti
if [ "$low_ram" != "true" ]; then
start vendor.dataadpl
fi
;;
*)
;;
esac
esac
#
# Allow persistent faking of bms
# User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity
#
fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity`
case "$fake_batt_capacity" in
"") ;; #Do nothing here
* )
echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity
;;
esac

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

34
rootdir/bin/init.mdm.sh Normal file
View File

@@ -0,0 +1,34 @@
#! /vendor/bin/sh
# Copyright (c) 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 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.
#
baseband=`getprop ro.baseband`
if [ "$baseband" = "mdm" ] || [ "$baseband" = "mdm2" ]; then
start vendor.mdm_helper
fi

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,505 @@
#! /vendor/bin/sh
# Copyright (c) 2012-2013,2016,2018-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.
#
export PATH=/vendor/bin
# Set platform variables
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
if [ -f /sys/class/drm/card0-DSI-1/modes ]; then
echo "detect" > /sys/class/drm/card0-DSI-1/status
mode_file=/sys/class/drm/card0-DSI-1/modes
while read line; do
fb_width=${line%%x*};
break;
done < $mode_file
elif [ -f /sys/class/graphics/fb0/virtual_size ]; then
res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null
fb_width=${res%,*}
fi
log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'"
#For drm based display driver
vbfile=/sys/module/drm/parameters/vblankoffdelay
if [ -w $vbfile ]; then
echo -1 > $vbfile
else
log -t DRM_BOOT -p w "file: '$vbfile' or perms doesn't exist"
fi
function set_density_by_fb() {
#put default density based on width
if [ -z $fb_width ]; then
setprop vendor.display.lcd_density 320
else
if [ $fb_width -ge 1600 ]; then
setprop vendor.display.lcd_density 640
elif [ $fb_width -ge 1440 ]; then
setprop vendor.display.lcd_density 560
elif [ $fb_width -ge 1080 ]; then
setprop vendor.display.lcd_density 480
elif [ $fb_width -ge 720 ]; then
setprop vendor.display.lcd_density 320 #for 720X1280 resolution
elif [ $fb_width -ge 480 ]; then
setprop vendor.display.lcd_density 240 #for 480X854 QRD resolution
else
setprop vendor.display.lcd_density 160
fi
fi
}
target=`getprop ro.board.platform`
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
case "$soc_hwplatform" in
"FFA" | "SVLTE_FFA")
# linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that
# the UI keyboard works fine.
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
"Fluid")
setprop vendor.display.lcd_density 240
setprop qcom.bt.dev_power_class 2
;;
*)
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
esac
;;
"sm6150")
case "$soc_hwplatform" in
"ADP")
setprop vendor.display.lcd_density 160
;;
esac
case "$soc_hwid" in
365|366)
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null
setprop vendor.media.target.version 1
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target.version 2
fi
;;
355|369|377|384)
setprop vendor.chre.enabled 0
;;
*)
esac
;;
"msm8660")
case "$soc_hwplatform" in
"Fluid")
setprop vendor.display.lcd_density 240
;;
"Dragon")
setprop ro.sound.alsa "WM8903"
;;
esac
;;
"msm8960")
# lcd density is write-once. Hence the separate switch case
case "$soc_hwplatform" in
"Liquid")
if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku
setprop ro.sf.hwrotation 90
fi
setprop vendor.display.lcd_density 160
;;
"MTP")
setprop vendor.display.lcd_density 240
;;
*)
case "$soc_hwid" in
"109")
setprop vendor.display.lcd_density 160
;;
*)
setprop vendor.display.lcd_density 240
;;
esac
;;
esac
#Set up composition type based on the target
case "$soc_hwid" in
87)
#8960
setprop debug.composition.type dyn
;;
153|154|155|156|157|138)
#8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB
setprop debug.composition.type c2d
;;
*)
esac
;;
"msm8974")
case "$soc_hwplatform" in
"Liquid")
setprop vendor.display.lcd_density 160
# Liquid do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop ro.hw.nav_keys 0
;;
"Dragon")
setprop vendor.display.lcd_density 240
;;
*)
setprop vendor.display.lcd_density 320
;;
esac
;;
"msm8226")
case "$soc_hwplatform" in
*)
setprop vendor.display.lcd_density 320
;;
esac
;;
"msm8610" | "apq8084" | "mpq8092")
case "$soc_hwplatform" in
*)
setprop vendor.display.lcd_density 240
;;
esac
;;
"apq8084")
case "$soc_hwplatform" in
"Liquid")
setprop vendor.display.lcd_density 320
# Liquid do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop ro.hw.nav_keys 0
;;
"SBC")
setprop vendor.display.lcd_density 200
# SBC do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop qemu.hw.mainkeys 0
;;
*)
setprop vendor.display.lcd_density 480
;;
esac
;;
"msm8996")
case "$soc_hwplatform" in
"Dragon")
setprop vendor.display.lcd_density 240
setprop qemu.hw.mainkeys 0
;;
"ADP")
setprop vendor.display.lcd_density 160
setprop qemu.hw.mainkeys 0
;;
"SBC")
setprop vendor.display.lcd_density 240
setprop qemu.hw.mainkeys 0
;;
*)
setprop vendor.display.lcd_density 560
;;
esac
;;
"msm8937" | "msm8940")
# Set vendor.opengles.version based on chip id.
# MSM8937 and MSM8940 variants supports OpenGLES 3.1
# 196608 is decimal for 0x30000 to report version 3.0
# 196609 is decimal for 0x30001 to report version 3.1
# 196610 is decimal for 0x30002 to report version 3.2
case "$soc_hwid" in
294|295|296|297|298|313|353|354|363|364)
setprop vendor.opengles.version 196610
if [ $soc_hwid = 354 ]
then
setprop vendor.media.target.version 1
log -t BOOT -p i "SDM429 early_boot prop set for: HwID '$soc_hwid'"
fi
;;
303|307|308|309|320)
# Vulkan is not supported for 8917 variants
setprop vendor.opengles.version 196608
setprop persist.graphics.vulkan.disable true
;;
*)
setprop vendor.opengles.version 196608
;;
esac
;;
"msm8909")
case "$soc_hwplatform" in
*)
setprop persist.graphics.vulkan.disable true
;;
esac
;;
"msm8998" | "apq8098_latv")
case "$soc_hwplatform" in
*)
setprop vendor.display.lcd_density 560
;;
esac
;;
"sdm845")
case "$soc_hwplatform" in
*)
if [ $fb_width -le 1600 ]; then
setprop vendor.display.lcd_density 560
else
setprop vendor.display.lcd_density 640
fi
;;
esac
;;
"msmnile")
case "$soc_hwplatform" in
*)
if [ $fb_width -le 1600 ]; then
setprop vendor.display.lcd_density 560
else
setprop vendor.display.lcd_density 640
fi
;;
esac
;;
"kona")
case "$soc_hwplatform" in
*)
setprop vendor.media.target_variant "_kona"
if [ $fb_width -le 1600 ]; then
setprop vendor.display.lcd_density 560
else
setprop vendor.display.lcd_density 640
fi
;;
esac
;;
"lito")
case "$soc_hwid" in
400|440)
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target.version 1
fi
;;
434|459)
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null
setprop vendor.media.target.version 2
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target.version 3
fi
;;
esac
;;
"bengal")
case "$soc_hwid" in
441)
setprop vendor.fastrpc.disable.cdsprpcd.daemon 1
setprop vendor.gralloc.disable_ubwc 1
# 196609 is decimal for 0x30001 to report version 3.1
setprop vendor.opengles.version 196609
;;
471)
#scuba APQ
setprop vendor.gralloc.disable_ubwc 1
;;
esac
;;
"sdm710" | "msmpeafowl")
case "$soc_hwplatform" in
*)
if [ $fb_width -le 1600 ]; then
setprop vendor.display.lcd_density 560
else
setprop vendor.display.lcd_density 640
fi
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target.version 1
fi
;;
esac
;;
"msm8953")
cap_ver = 1
if [ -e "/sys/devices/platform/soc/1d00000.qcom,vidc/capability_version" ]; then
cap_ver=`cat /sys/devices/platform/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null
else
cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null
fi
if [ $cap_ver -eq 1 ]; then
setprop vendor.media.target.version 1
fi
;;
#Set property to differentiate SDM660 & SDM455
#SOC ID for SDM455 is 385
"sdm660")
case "$soc_hwplatform" in
*)
if [ $fb_width -le 1600 ]; then
setprop vendor.display.lcd_density 560
else
setprop vendor.display.lcd_density 640
fi
if [ $soc_hwid -eq 385 ]; then
setprop vendor.media.target.version 1
fi
;;
esac
;;
"holi")
setprop vendor.media.target_variant "_holi"
;;
esac
baseband=`getprop ro.baseband`
#enable atfwd daemon all targets except sda, apq, qcs
case "$baseband" in
"apq" | "sda" | "qcs" )
setprop persist.vendor.radio.atfwd.start false;;
*)
setprop persist.vendor.radio.atfwd.start true;;
esac
#set default lcd density
#Since lcd density has read only
#property, it will not overwrite previous set
#property if any target is setting forcefully.
set_density_by_fb
# set Lilliput LCD density for ADP
product=`getprop ro.board.platform`
case "$product" in
"msmnile_au")
setprop vendor.display.lcd_density 160
echo 902400000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/min_freq
echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/max_freq
echo 902400000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/min_freq
echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/max_freq
;;
*)
;;
esac
case "$product" in
"sm6150_au")
setprop vendor.display.lcd_density 160
;;
*)
;;
esac
case "$product" in
"sdmshrike_au")
setprop vendor.display.lcd_density 160
;;
*)
;;
esac
case "$product" in
"msmnile_gvmq")
setprop vendor.display.lcd_density 160
;;
*)
;;
esac
# Setup display nodes & permissions
# HDMI can be fb1 or fb2
# Loop through the sysfs nodes and determine
# the HDMI(dtv panel)
function set_perms() {
#Usage set_perms <filename> <ownership> <permission>
chown -h $2 $1
chmod $3 $1
}
# check for the type of driver FB or DRM
fb_driver=/sys/class/graphics/fb0
if [ -e "$fb_driver" ]
then
# check for mdp caps
file=/sys/class/graphics/fb0/mdp/caps
if [ -f "$file" ]
then
setprop vendor.gralloc.disable_ubwc 1
cat $file | while read line; do
case "$line" in
*"ubwc"*)
setprop vendor.gralloc.enable_fb_ubwc 1
setprop vendor.gralloc.disable_ubwc 0
esac
done
fi
else
set_perms /sys/devices/virtual/hdcp/msm_hdcp/min_level_change system.graphics 0660
fi
# allow system_graphics group to access pmic secure_mode node
set_perms /sys/class/lcd_bias/secure_mode system.graphics 0660
set_perms /sys/class/leds/wled/secure_mode system.graphics 0660
boot_reason=`cat /proc/sys/kernel/boot_reason`
reboot_reason=`getprop ro.boot.alarmboot`
if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then
setprop ro.vendor.alarm_boot true
else
setprop ro.vendor.alarm_boot false
fi
# copy GPU frequencies to vendor property
if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null
setprop vendor.gpu.available_frequencies "$gpu_freq"
fi

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

File diff suppressed because it is too large Load Diff

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/*

517
rootdir/bin/init.qcom.sh Normal file
View File

@@ -0,0 +1,517 @@
#! /vendor/bin/sh
# 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.
#
target=`getprop ro.board.platform`
low_ram=`getprop ro.config.low_ram`
if [ -f /sys/devices/soc0/soc_id ]; then
platformid=`cat /sys/devices/soc0/soc_id`
else
platformid=`cat /sys/devices/system/soc/soc0/id`
fi
start_battery_monitor()
{
if ls /sys/bus/spmi/devices/qpnp-bms-*/fcc_data ; then
chown -h root.system /sys/module/pm8921_bms/parameters/*
chown -h root.system /sys/module/qpnp_bms/parameters/*
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_data
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_temp
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_chgcyl
chmod 0660 /sys/module/qpnp_bms/parameters/*
chmod 0660 /sys/module/pm8921_bms/parameters/*
mkdir -p /data/bms
chown -h root.system /data/bms
chmod 0770 /data/bms
start battery_monitor
fi
}
start_charger_monitor()
{
if ls /sys/module/qpnp_charger/parameters/charger_monitor; then
chown -h root.system /sys/module/qpnp_charger/parameters/*
chown -h root.system /sys/class/power_supply/battery/input_current_max
chown -h root.system /sys/class/power_supply/battery/input_current_trim
chown -h root.system /sys/class/power_supply/battery/input_current_settled
chown -h root.system /sys/class/power_supply/battery/voltage_min
chmod 0664 /sys/class/power_supply/battery/input_current_max
chmod 0664 /sys/class/power_supply/battery/input_current_trim
chmod 0664 /sys/class/power_supply/battery/input_current_settled
chmod 0664 /sys/class/power_supply/battery/voltage_min
chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor
start charger_monitor
fi
}
start_vm_bms()
{
if [ -e /dev/vm_bms ]; then
chown -h root.system /sys/class/power_supply/bms/current_now
chown -h root.system /sys/class/power_supply/bms/voltage_ocv
chmod 0664 /sys/class/power_supply/bms/current_now
chmod 0664 /sys/class/power_supply/bms/voltage_ocv
start vm_bms
fi
}
start_msm_irqbalance_8939()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
case "$platformid" in
"239" | "293" | "294" | "295" | "304" | "338" | "313" | "353" | "354")
start vendor.msm_irqbalance;;
"349" | "350" )
start vendor.msm_irqbal_lb;;
esac
fi
}
start_msm_irqbalance_msmnile()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_msm_irqbalance_kona()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_msm_irqbalance_lito()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_msm_irqbalance_atoll()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_msm_irqbalance660()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
case "$platformid" in
"317" | "321" | "324" | "325" | "326" | "336" | "345" | "346" | "360" | "393")
start vendor.msm_irqbalance;;
"318" | "327" | "385")
start vendor.msm_irqbl_sdm630;;
esac
fi
}
start_msm_irqbalance()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
baseband=`getprop ro.baseband`
echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra_defrtr
case "$baseband" in
"svlte2a")
start bridgemgrd
;;
esac
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
if [ -f /sys/devices/soc0/hw_platform ]; then
value=`cat /sys/devices/soc0/hw_platform`
else
value=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$value" in
"Fluid")
start profiler_daemon;;
esac
;;
"msm8660" )
if [ -f /sys/devices/soc0/hw_platform ]; then
platformvalue=`cat /sys/devices/soc0/hw_platform`
else
platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
esac
;;
"msm8960")
case "$baseband" in
"msm")
start_battery_monitor;;
esac
if [ -f /sys/devices/soc0/hw_platform ]; then
platformvalue=`cat /sys/devices/soc0/hw_platform`
else
platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
;;
"msm8974")
platformvalue=`cat /sys/devices/soc0/hw_platform`
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
case "$baseband" in
"msm")
start_battery_monitor
;;
esac
start_charger_monitor
;;
"sdm660")
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"317" | "324" | "325" | "326" | "318" | "327" )
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
start_msm_irqbalance660
;;
"apq8084")
platformvalue=`cat /sys/devices/soc0/hw_platform`
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
;;
"msm8226")
start_charger_monitor
;;
"msm8610")
start_charger_monitor
;;
"msm8916")
start_vm_bms
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/platform_subtype_id ]; then
platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$soc_id" in
"239")
case "$hw_platform" in
"Surf")
case "$platform_subtype_id" in
"1")
setprop qemu.hw.mainkeys 0
;;
esac
;;
"MTP")
case "$platform_subtype_id" in
"3")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
esac
;;
"msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845" | "sdm710" | "qcs605" | "sm6150" | "trinket" | "bengal")
start_msm_irqbalance
;;
"msm8996")
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$hw_platform" in
"MTP" | "CDP")
#Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership.
for count in 0 1 2 3 4 5 6 7 8 9 10
do
dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count
if [ -d "$dir" ]; then
chmod 0660 $dir/secure_touch_enable
chmod 0440 $dir/secure_touch
chown system.drmrpc $dir/secure_touch_enable
chown system.drmrpc $dir/secure_touch
break
fi
done
;;
esac
;;
"msm8909")
start_vm_bms
;;
"msmnile")
start_msm_irqbalance_msmnile
;;
"kona")
start_msm_irqbalance_kona
;;
"lito")
start_msm_irqbalance_lito
;;
"atoll")
start_msm_irqbalance_atoll
;;
"msm8937")
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
if [ "$low_ram" != "true" ]; then
case "$soc_id" in
"294" | "295" | "303" | "307" | "308" | "309" | "313" | "320" | "353" | "354" | "363" | "364")
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
fi
;;
"msm8953")
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"293" | "304" | "338" | "351" | "349" | "350" )
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
"sdm710")
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"336" | "337" | "347" | "360" | "393" )
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
esac
#
# Make modem config folder and copy firmware config to that folder for RIL
#
if [ -f /data/vendor/modem_config/ver_info.txt ]; then
prev_version_info=`cat /data/vendor/modem_config/ver_info.txt`
else
prev_version_info=""
fi
cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt`
if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
# add W for group recursively before delete
chmod g+w -R /data/vendor/modem_config/*
rm -rf /data/vendor/modem_config/*
# preserve the read only mode for all subdir and files
cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config
cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/
cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/
# the group must be root, otherwise this script could not add "W" for group recursively
chown -hR radio.root /data/vendor/modem_config/*
fi
chmod g-w /data/vendor/modem_config
setprop ro.vendor.ril.mbn_copy_completed 1
#check build variant for printk logging
#current default minimum boot-time-default
buildvariant=`getprop ro.build.type`
case "$buildvariant" in
"userdebug" | "eng")
#set default loglevel to KERN_INFO
echo "6 6 1 7" > /proc/sys/kernel/printk
;;
*)
#set default loglevel to KERN_WARNING
echo "4 4 1 4" > /proc/sys/kernel/printk
;;
esac
#add permission for block_size, mem_type, mem_size nodes to collect diag over QDSS by ODL
#application by "oem_2902" group
chown -h root.oem_2902 /sys/devices/platform/soc/10048000.tmc/coresight-tmc-etr/block_size
chmod 660 /sys/devices/platform/soc/10048000.tmc/coresight-tmc-etr/block_size
chown -h root.oem_2902 /sys/devices/platform/soc/10048000.tmc/coresight-tmc-etr/buffer_size
chmod 660 /sys/devices/platform/soc/10048000.tmc/coresight-tmc-etr/buffer_size
chmod 660 /sys/devices/platform/soc/10048000.tmc/coresight-tmc-etr/out_mode
chown -h root.oem_2902 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/block_size
chmod 660 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/block_size
chown -h root.oem_2902 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/buffer_size
chmod 660 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/buffer_size
chmod 660 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/out_mode
chmod 660 /sys/devices/platform/soc/1004f000.tmc/coresight-tmc-etr1/enable_sink
chmod 660 /sys/devices/platform/soc/soc:modem_diag/coresight-modem-diag/enable_source
chown -h root.oem_2902 /sys/bus/coresight/reset_source_sink
chmod 660 /sys/bus/coresight/reset_source_sink
# qcom case
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etf/curr_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etf/enable_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr/curr_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr/enable_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr/out_mode
chown -h system.system /sys/bus/coresight/devices/coresight-tpiu/curr_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tpiu/out_mode
chown -h system.system /sys/bus/coresight/devices/coresight-stm/enable
chown -h system.system /sys/bus/coresight/devices/coresight-stm/enable_source
chown -h system.system /sys/bus/coresight/devices/coresight-hwevent/enable
chown -h system.system /sys/bus/coresight/devices/coresight-stm/hwevent_enable
chown -h system.system /sys/bus/coresight/devices/coresight-hwevent/setreg
chown -h system.system /sys/bus/coresight/devices/coresight-swao-csr/timestamp
chown -h system.system /sys/bus/coresight/devices/coresight-modem-diag/enable_source
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr1/enable_sink
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr1/out_mode
chown -h system.system /sys/bus/coresight/devices/coresight-tmc-etr1/curr_sink
# qcom case 05386569
mkdir /config/stp-policy/coresight-stm:p_ost.policy
chmod 660 /config/stp-policy/coresight-stm:p_ost.policy
mkdir /config/stp-policy/coresight-stm:p_ost.policy/default
chmod 660 /config/stp-policy/coresight-stm:p_ost.policy/default
echo 0x10 > /sys/bus/coresight/devices/coresight-stm/traceid
# disable ftrace log on coresight stm buffer
case "$buildvariant" in
"eng")
echo 0 > /sys/bus/coresight/devices/coresight-stm/port_enable
echo 0x10000003 > /sys/bus/coresight/devices/coresight-stm/port_select
echo 0xffffffff > /sys/bus/coresight/devices/coresight-stm/port_enable
;;
esac

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,166 @@
#!/vendor/bin/sh
# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
# Copyright (c) 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.
#
#
target=`getprop ro.board.platform`
if [ -f /sys/devices/soc0/soc_id ]; then
soc_hwid=`cat /sys/devices/soc0/soc_id`
else
soc_hwid=`cat /sys/devices/system/soc/soc0/id`
fi
case "$target" in
"pineapple")
#SOC ID for Pineapple is 557
case "$soc_hwid" in
557)
setprop vendor.display.enable_fb_scaling 0
setprop vendor.gralloc.use_dma_buf_heaps 1
setprop vendor.display.target.version 4
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_allow_idle_fallback 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_rotator_ui 1
setprop vendor.display.enable_spec_fence 1
setprop vendor.display.thermal.version 1
setprop vendor.display.enable_rc_support 1
setprop vendor.display.enable_latch_media_content 1
setprop vendor.display.enable_inline_writeback 0
setprop vendor.display.timed_render_enable 1
setprop vendor.gralloc.hw_supports_ubwcp 0
;;
esac
;;
"kalama")
#SOC ID for Kalama is 519
case "$soc_hwid" in
519)
setprop vendor.display.enable_fb_scaling 0
setprop vendor.display.target.version 4
setprop vendor.gralloc.use_dma_buf_heaps 1
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_allow_idle_fallback 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_rotator_ui 1
setprop vendor.display.enable_spec_fence 0
setprop vendor.display.thermal.version 1
setprop vendor.display.enable_rc_support 1
setprop vendor.display.enable_latch_media_content 1
setprop vendor.display.enable_inline_writeback 1
setprop vendor.display.timed_render_enable 1
setprop debug.sf.disable_client_composition_cache 0
setprop vendor.gralloc.hw_supports_ubwcp 0
;;
esac
;;
"taro")
#Set property to differentiate Waipio
#SOC ID for Waipio is 457
#SOC ID for Cape MSM is 530
#SOC ID for Cape APQ is 531
#SOC ID for Cape 4g is 540
case "$soc_hwid" in
457)
setprop vendor.gralloc.use_dma_buf_heaps 1
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_allow_idle_fallback 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_rotator_ui 1
setprop vendor.display.enable_spec_fence 0
setprop vendor.display.thermal.version 1
setprop vendor.display.enable_rc_support 1
setprop vendor.display.target.version 3
setprop vendor.display.enable_fb_scaling 0
setprop vendor.display.disable_cwb_idle_fallback 1
;;
530|531|540)
setprop vendor.gralloc.use_dma_buf_heaps 1
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_allow_idle_fallback 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_rotator_ui 1
setprop vendor.display.enable_spec_fence 0
setprop vendor.display.thermal.version 1
setprop vendor.display.enable_rc_support 1
setprop vendor.display.target.version 2
setprop vendor.display.enable_qsync_idle 1
setprop vendor.display.disable_cwb_idle_fallback 1
;;
506|547)
# Set property for Diwali
# SOC ID for Diwali is 506
setprop vendor.gralloc.use_dma_buf_heaps 1
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_allow_idle_fallback 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_rotator_ui 1
setprop vendor.display.enable_spec_fence 0
setprop vendor.display.thermal.version 1
setprop vendor.display.enable_rc_support 1
setprop vendor.display.target.version 2
setprop vendor.display.enable_qsync_idle 1
;;
esac
;;
"lahaina")
#Set property to differentiate Lahaina & Shima
#SOC ID for Lahaina is 415, Lahaina P is 439, Lahaina-ATP is 456
case "$soc_hwid" in
415|439|456)
# Set property for lahaina
setprop vendor.display.target.version 1
setprop vendor.display.enable_posted_start_dyn 2
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_allow_idle_fallback 1
;;
450)
# Set property for shima
setprop vendor.display.target.version 2
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
setprop vendor.display.enable_posted_start_dyn 1
setprop vendor.display.enable_qsync_idle 1
setprop vendor.display.enable_allow_idle_fallback 1
;;
475)
# Set property for Yupik
setprop vendor.display.enable_posted_start_dyn 2
;;
esac
;;
"holi")
# Set property for holi
setprop vendor.display.target.version 2
setprop vendor.display.disable_offline_rotator 0
setprop vendor.display.disable_rotator_ubwc 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 0
setprop vendor.display.enable_posted_start_dyn 1
setprop vendor.display.enable_allow_idle_fallback 1
;;
esac

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,108 @@
#! /vendor/bin/sh
#==============================================================================
# init.qti.media.sh
#
# Copyright (c) 2020-2022, Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# Copyright (c) 2020, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# 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.
#===============================================================================
build_codename=`getprop vendor.media.system.build_codename`
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
target=`getprop ro.board.platform`
case "$target" in
"anorak")
setprop vendor.mm.target.enable.qcom_parser 0
setprop vendor.media.target_variant "_anorak"
;;
"kalama")
setprop vendor.mm.target.enable.qcom_parser 0
setprop vendor.media.target_variant "_kalama"
;;
"pineapple")
setprop vendor.mm.target.enable.qcom_parser 0
case "$soc_hwid" in
614|632)
setprop vendor.media.target_variant "_cliffs_v0"
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target_variant "_cliffs_v1"
fi
;;
*)
setprop vendor.media.target_variant "_pineapple"
if [ $build_codename -le "14" ]; then
setprop vendor.netflix.bsp_rev "Q8650-37577-1"
fi
;;
esac
;;
"taro")
setprop vendor.mm.target.enable.qcom_parser 1040479
case "$soc_hwid" in
530|531|540)
setprop vendor.media.target_variant "_cape"
;;
*)
setprop vendor.media.target_variant "_taro"
;;
esac
;;
"lahaina")
case "$soc_hwid" in
450)
setprop vendor.media.target_variant "_shima_v3"
setprop vendor.netflix.bsp_rev ""
sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
if [ $sku_ver -eq 1 ]; then
setprop vendor.media.target_variant "_shima_v1"
elif [ $sku_ver -eq 2 ]; then
setprop vendor.media.target_variant "_shima_v2"
fi
;;
*)
setprop vendor.media.target_variant "_lahaina"
setprop vendor.netflix.bsp_rev "Q875-32408-1"
;;
esac
;;
"holi")
setprop vendor.media.target_variant "_holi"
;;
"msmnile")
setprop vendor.media.target_variant "_msmnile"
;;
esac

View File

@@ -0,0 +1,88 @@
#! /vendor/bin/sh
#=============================================================================
# Copyright (c) 2020, 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
soc_id=`cat /sys/devices/soc0/soc_id` 2> /dev/null
# Store soc_id in ro.vendor.qti.soc_id
setprop ro.vendor.qti.soc_id $soc_id
# For chipsets in QCV family, convert soc_id to soc_name
# and store it in ro.vendor.qti.soc_name.
if [ "$soc_id" -eq 618 ]; then
setprop ro.vendor.qti.soc_name sun
setprop ro.vendor.qti.soc_model SM8750
setprop ro.vendor.media_performance_class 34
elif [ "$soc_id" -eq 507 ] || [ "$soc_id" -eq 565 ]; then
setprop ro.vendor.qti.soc_name blair
setprop ro.vendor.qti.soc_model SM6375
elif [ "$soc_id" -eq 578 ]; then
setprop ro.vendor.qti.soc_name blair
setprop ro.vendor.qti.soc_model SM4375
elif [ "$soc_id" -eq 454 ]; then
setprop ro.vendor.qti.soc_name holi
setprop ro.vendor.qti.soc_model SM4350
elif [ "$soc_id" -eq 472 ]; then
setprop ro.vendor.qti.soc_name holi
setprop ro.vendor.qti.soc_model SM6325
elif [ "$soc_id" -eq 557 ] || [ "$soc_id" -eq 577 ]; then
setprop ro.vendor.qti.soc_name pineapple
setprop ro.vendor.qti.soc_model SM8650
# setprop ro.vendor.media_performance_class 34
elif [ "$soc_id" -eq 632 ]; then
setprop ro.vendor.qti.soc_name cliffs
setprop ro.vendor.qti.soc_model SM7675
elif [ "$soc_id" -eq 614 ]; then
setprop ro.vendor.qti.soc_name cliffs
setprop ro.vendor.qti.soc_model SM8635
elif [ "$soc_id" -eq 519 ] || [ "$soc_id" -eq 536 ] || [ "$soc_id" -eq 600 ] || [ "$soc_id" -eq 601 ]; then
setprop ro.vendor.qti.soc_name kalama
setprop ro.vendor.qti.soc_model SM8550
setprop ro.vendor.media_performance_class 33
elif [ "$soc_id" -eq 608 ]; then
setprop ro.vendor.qti.soc_name crow
setprop ro.vendor.qti.soc_model SM7550
elif [ "$soc_id" -eq 457 ] || [ "$soc_id" -eq 482 ] || [ "$soc_id" -eq 552 ]; then
setprop ro.vendor.qti.soc_name taro
setprop ro.vendor.qti.soc_model SM8450
setprop ro.vendor.media_performance_class 31
elif [ "$soc_id" -eq 537 ] || [ "$soc_id" -eq 583 ]; then
setprop ro.vendor.qti.soc_name parrot
setprop ro.vendor.qti.soc_model SM6450
elif [ "$soc_id" -eq 613 ]; then
setprop ro.vendor.qti.soc_name parrot
setprop ro.vendor.qti.soc_model SM7435
elif [ "$soc_id" -eq 568 ] || [ "$soc_id" -eq 602 ]; then
setprop ro.vendor.qti.soc_name ravelin
setprop ro.vendor.qti.soc_model SM4450
elif [ "$soc_id" -eq 581 ]; then
setprop ro.vendor.qti.soc_name ravelin
setprop ro.vendor.qti.soc_model QCM4490
elif [ "$soc_id" -eq 582 ]; then
setprop ro.vendor.qti.soc_name ravelin
setprop ro.vendor.qti.soc_model QCS4490
elif [ "$soc_id" -eq 506 ] || [ "$soc_id" -eq 547 ] || [ "$soc_id" -eq 564 ]; then
setprop ro.vendor.qti.soc_name diwali
setprop ro.vendor.qti.soc_model SM7450
elif [ "$soc_id" -eq 591 ]; then
setprop ro.vendor.qti.soc_name ukee
setprop ro.vendor.qti.soc_model SM7475
elif [ "$soc_id" -eq 530 ] || [ "$soc_id" -eq 531 ] || [ "$soc_id" -eq 540 ]; then
setprop ro.vendor.qti.soc_name cape
setprop ro.vendor.qti.soc_model SM8475
setprop ro.vendor.media_performance_class 31
elif [ "$soc_id" -eq 415 ] || [ "$soc_id" -eq 439 ] || [ "$soc_id" -eq 456 ] ||
[ "$soc_id" -eq 501 ] || [ "$soc_id" -eq 502 ]; then
setprop ro.vendor.qti.soc_name lahaina
setprop ro.vendor.qti.soc_model SM8350
elif [ "$soc_id" -eq 450 ]; then
setprop ro.vendor.qti.soc_name shima
setprop ro.vendor.qti.soc_model SM7350
elif [ "$soc_id" -eq 475 ] || [ "$soc_id" -eq 499 ] || [ "$soc_id" -eq 497 ] ||
[ "$soc_id" -eq 498 ] || [ "$soc_id" -eq 515 ]; then
setprop ro.vendor.qti.soc_name yupik
setprop ro.vendor.qti.soc_model SM7325
fi

View File

@@ -0,0 +1,23 @@
#! /vendor/bin/sh
LOG_HEAD="[time-services]"
current_time=$(date +%s)
echo "${LOG_HEAD} current time : ${current_time}" > /dev/kmsg
# if time-service initialization is required
if [ "$1" != "1" ]; then
#FIXME : date cmd could return 0 without broadcasting SET_TIME intent, the time diff b/w old & new must be enough
new_time=$((current_time+5))
date -s @${new_time}
ret=$?
# echo "${LOG_HEAD} date return code : ${ret} " > /dev/kmsg
if [ "$ret" -ne 0 ]; then
echo "${LOG_HEAD} failed to exec date cmd : ${current_time} to ${new_time} with ${ret}" > /dev/kmsg
echo c > /proc/sysrq-trigger #it's not working due to selinux
exit 1
else
echo "${LOG_HEAD} initialized : ${current_time} to ${new_time}" > /dev/kmsg
fi
setprop persist.vendor.time_services.init 1
fi

View File

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

View File

@@ -0,0 +1,54 @@
#!/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
#
echo "SensorDebug"
if [ ! -d /data/vendor/log/sensordebug ] ; then
mkdir /data/vendor/log/sensordebug
touch /data/vendor/log/sensordebug/.nomedia
chown system.system /data/vendor/log/sensordebug
fi
if [ ! -d /data/vendor/log/sensordebug/persist ] ; then
mkdir /data/vendor/log/sensordebug/persist
chown system.system /data/vendor/log/sensordebug/persist
else
rm -rf /data/vendor/log/sensordebug/persist/*
fi
cp -rf /mnt/vendor/persist/sensors/ /data/vendor/log/sensordebug/persist
chown -R system.system /data/vendor/log/sensordebug/persist
if [ -f /data/vendor/log/sensordebug/qrtr_5 ] ; then
rm -rf /data/vendor/log/sensordebug/qrtr_5
fi
cat /dev/ipc_logging/qrtr_5 >> /data/vendor/log/sensordebug/qrtr_5
chown -R system.system /data/vendor/log/sensordebug/qrtr_5

View File

@@ -0,0 +1,117 @@
#!/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
#
echo "Sensor SSR Dump"
param=$1
echo "param: $param"
index=0
adsp_path="none"
adsp_str="adsp"
if [[ "$param" == "start" || "$param" == "stop" ]]; then
COUNT_CMD='ls -l /sys/class/remoteproc | grep ^l | wc -l'
count=$(eval $COUNT_CMD)
echo "count: $count"
for file in /sys/class/remoteproc/*
do
local_path=$file"/name"
echo "$local_path:$local_path"
name=$(eval cat $local_path)
echo "name:$name"
if [[ "$name" == *"$adsp_str"* ]]; then
echo "found~!! index: $index"
adsp_path=$file
break
fi
((index++))
done
if [ "$param" == "start" ]; then
echo "start"
if [ "$adsp_path" != "none" ]; then
echo "adsp_path:$adsp_path"
SSR_DUMP_CMD=""
ENABLE_RAMDUMPS_CMD='getprop persist.vendor.ssr.enable_ramdumps'
enable_ramdumps=$(eval $ENABLE_RAMDUMPS_CMD)
echo "enable_ramdumps:$enable_ramdumps"
if [ "$enable_ramdumps" == "0" ]; then
SSR_DUMP_CMD+="setprop persist.vendor.ssr.enable_ramdumps 1 &"
fi
RESTART_LEVEL_CMD='getprop persist.vendor.ssr.restart_level'
restart_level=$(eval $RESTART_LEVEL_CMD)
echo "restart_level:$restart_level"
if [ "$restart_level" == "ALL_ENABLE" ]; then
set_val="$restart_level"
elif [ "$restart_level" == "ALL_DISABLE" ]; then
set_val="adsp"
elif [ -n "$restart_level" ];then
if [[ "$restart_level" == *adsp* ]]; then
set_val="$restart_level"
else
set_val="$restart_level adsp"
fi
else
set_val="adsp"
fi
SSR_DUMP_CMD+="echo enabled > $adsp_path/recovery &"
SSR_DUMP_CMD+="echo enabled > $adsp_path/coredump &"
SSR_DUMP_CMD+="setprop persist.vendor.ssr.restart_level '$set_val'"
echo "SSR_DUMP_CMD:$SSR_DUMP_CMD"
eval $SSR_DUMP_CMD
fi
fi
if [ "$param" == "stop" ]; then
echo "stop"
if [ "$adsp_path" != "none" ]; then
echo "adsp_path:$adsp_path"
SSR_DUMP_CMD="setprop persist.vendor.ssr.enable_ramdumps 0 &"
SSR_DUMP_CMD+="echo 0 > /sys/module/qcom_ramdump/parameters/enable_dump_collection &"
SSR_DUMP_CMD+="echo disabled > $adsp_path/recovery &"
SSR_DUMP_CMD+="echo disabled > $adsp_path/coredump &"
SSR_DUMP_CMD+="setprop persist.vendor.ssr.restart_level ALL_DISABLE"
eval $SSR_DUMP_CMD
fi
fi
fi
if [ "$param" == "complete" ]; then
chown root:system /data/vendor/ramdump/remoteproc-adsp.elf
INTENT_CMD="am broadcast -a com.sec.android.ISSUE_TRACKER_ACTION "
INTENT_CMD+="--ei ERRCODE -126 "
INTENT_CMD+="--es ERRNAME \"Sensor Silent dump\" "
INTENT_CMD+="--es ERRPKG \"Sensor ADSP\" "
INTENT_CMD+="--es ERRMSG \"Sensor SSR Dump after SSR\" "
INTENT_CMD+="--es EXTLOG \"/data/vendor/ramdump/remoteproc-adsp.elf\""
echo "$INTENT_CMD" && eval "$INTENT_CMD"
fi

View File

@@ -0,0 +1,12 @@
#!/vendor/bin/sh
if ! applypatch --check EMMC:/dev/block/bootdevice/by-name/recovery$(getprop ro.boot.slot_suffix):110034944:fb67367b173f54e3bc51d601d18084bca70ad952; then
applypatch \
--patch /vendor/recovery-from-boot.p \
--source EMMC:/dev/block/bootdevice/by-name/boot$(getprop ro.boot.slot_suffix):100663296:6bae827ab03d5a9c73d764a2bed3c454358ebd45 \
--target EMMC:/dev/block/bootdevice/by-name/recovery$(getprop ro.boot.slot_suffix):110034944:fb67367b173f54e3bc51d601d18084bca70ad952 && \
(log -t install_recovery "Installing new recovery image: succeeded" && setprop vendor.ota.recovery.status 200) || \
(log -t install_recovery "Installing new recovery image: failed" && setprop vendor.ota.recovery.status 454)
else
log -t install_recovery "Recovery image already installed" && setprop vendor.ota.recovery.status 200
fi

View File

@@ -0,0 +1,87 @@
#! /vendor/bin/sh
# Copyright (c) 2010-2014, 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.
# Check whether device is plugged on the HSIC bus
# Currently HSIC bus will be the first index
PATH=/sbin:/system/sbin:/system/bin:/system/xbin
export PATH
deviceprop=`getprop ro.baseband`
boardprop=`getprop ro.board.platform`
if [ -e /sys/bus/platform/drivers/msm_hsic_host ]; then
if [ ! -L /sys/bus/usb/devices/1-1 ]; then
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/bind
chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/unbind
chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/bind
chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
wlanchip=""
if [ "$deviceprop" == "apq" ] && [ "$boardprop" == "msm8974" ]; then
wlanchip="AR6004-USB"
fi
# force ar6004 is ar6004_wlan.conf existed.
if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
fi
echo "The WLAN Chip ID is $wlanchip"
if [ "$wlanchip" == "AR6004-USB" ]; then
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
setprop wlan.driver.ath 2
setprop vendor.bluetooth.soc ath3k
setprop wlan.driver.name /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko
setprop wlan.supp.template /system/etc/wifi/wpa_supplicant_ath6kl.conf
btsoc="ath3k"
elif [ "$wlanchip" == "AR6004-SDIO" ]; then
setprop wlan.driver.ath 2
setprop vendor.bluetooth.soc ath3k
setprop wlan.driver.name /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko
setprop wlan.supp.template /system/etc/wifi/wpa_supplicant_ath6kl.conf
btsoc="ath3k"
# Chown polling nodes as needed from UI running on system server
chmod -h 0200 /sys/devices/msm_sdcc.1/polling
chmod -h 0200 /sys/devices/msm_sdcc.2/polling
chmod -h 0200 /sys/devices/msm_sdcc.3/polling
chmod -h 0200 /sys/devices/msm_sdcc.4/polling
chown -h system.system /sys/devices/msm_sdcc.1/polling
chown -h system.system /sys/devices/msm_sdcc.2/polling
chown -h system.system /sys/devices/msm_sdcc.3/polling
chown -h system.system /sys/devices/msm_sdcc.4/polling
fi

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