sm8650-common: Import init.kernel.post_boot-pineapple.sh on tree

Remove left over oplus changes.

Change-Id: I569e3d745c75bad17bb0dda2cc01f438dabe9a9c
This commit is contained in:
chandu078
2025-07-23 16:30:42 +05:30
committed by madmax7896
parent 0518212ac5
commit e7a3ce7f66
8 changed files with 89 additions and 59 deletions

View File

@@ -200,6 +200,7 @@ PRODUCT_PACKAGES += \
fstab.qcom \
fstab.qcom.vendor_ramdisk \
init.class_main.sh \
init.kernel.post_boot-pineapple.sh \
init.kernel.post_boot-pineapple_default_2_3_2_1.sh \
init.oplus.rc \
init.overlayfs.rc \

View File

@@ -82,6 +82,12 @@ sh_binary {
vendor: true,
}
sh_binary {
name: "init.kernel.post_boot-pineapple.sh",
src: "init.kernel.post_boot-pineapple.sh",
vendor: true,
}
sh_binary {
name: "init.kernel.post_boot-pineapple_default_2_3_2_1.sh",
src: "init.kernel.post_boot-pineapple_default_2_3_2_1.sh",

View File

@@ -0,0 +1,72 @@
#=============================================================================
# Copyright (c) 2023 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
get_num_logical_cores_in_physical_cluster()
{
i=0
logical_cores=(0 0 0 0 0 0)
if [ -f /sys/devices/system/cpu/cpu0/topology/cluster_id ] ; then
physical_cluster="cluster_id"
else
physical_cluster="physical_package_id"
fi
for i in `ls -d /sys/devices/system/cpu/cpufreq/policy[0-9]*`
do
if [ -e $i ] ; then
num_cores=$(cat $i/related_cpus | wc -w)
first_cpu=$(echo "$i" | sed 's/[^0-9]*//g')
cluster_id=$(cat /sys/devices/system/cpu/cpu$first_cpu/topology/$physical_cluster)
logical_cores[cluster_id]=$num_cores
fi
done
cpu_topology=""
j=0
physical_cluster_count=$1
while [[ $j -lt $physical_cluster_count ]]; do
cpu_topology+=${logical_cores[$j]}
if [ $j -lt $physical_cluster_count-1 ]; then
cpu_topology+="_"
fi
j=$((j+1))
done
echo $cpu_topology
}
#Implementing this mechanism to jump to powersave governor if the script is not running
#as it would be an indication for devs for debug purposes.
fallback_setting()
{
governor="powersave"
for i in `ls -d /sys/devices/system/cpu/cpufreq/policy[0-9]*`
do
if [ -f $i/scaling_governor ] ; then
echo $governor > $i/scaling_governor
fi
done
}
#because the next action to execute the init.kernel.post_boo-pineapple_xxxx.sh maybe failed,so we
#set the correct sleep mode here
echo s2idle > /sys/power/mem_sleep
variant=$(get_num_logical_cores_in_physical_cluster "$1")
echo "CPU topology: ${variant}"
case "$variant" in
"2_3_2_1")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-pineapple_default_2_3_2_1.sh
;;
"2_3_1_1")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-pineapple_2_3_1_1.sh
;;
"2_3_2_0")
/vendor/bin/sh /vendor/bin/init.kernel.post_boot-pineapple_2_3_2_0.sh
;;
*)
echo "***WARNING***: Postboot script not present for the variant ${variant}"
fallback_setting
;;
esac

View File

@@ -189,33 +189,6 @@ if [ -d /proc/sys/walt ]; then
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy5/walt/hispeed_freq
echo 1593600 > /sys/devices/system/cpu/cpufreq/policy7/walt/hispeed_freq
fi
# switch to schedutil gov after walt gov parameter setting, for proper switch back to walt gov
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 1000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy2/schedutil/down_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy2/schedutil/up_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy5/schedutil/down_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy5/schedutil/up_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/down_rate_limit_us
echo 1000 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/up_rate_limit_us
if [ $rev == "1.0" ] || [ $rev == "1.1" ]; then
echo 1344000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy2/schedutil/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy5/schedutil/hispeed_freq
echo 1420800 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
else
echo 1344000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy2/schedutil/hispeed_freq
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy5/schedutil/hispeed_freq
echo 1478400 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
fi
else
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy2/scaling_governor

View File

@@ -47,8 +47,10 @@ function configure_zram_parameters() {
let zRamSizeMB=6144
fi
# use lz4 on all targets
echo lz4 > /sys/block/zram0/comp_algorithm
# 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
@@ -109,16 +111,8 @@ function configure_read_ahead_kb_values() {
echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb
fi
for dm in $dmpts; do
dm_dev=`echo $dm |cut -d/ -f4`
if [ "$dm_dev" = "" ]; then
is_erofs=""
else
is_erofs=`mount |grep erofs |grep "${dm_dev} "`
fi
if [ "$is_erofs" = "" ]; then
if [ `cat $(dirname $dm)/../removable` -eq 0 ]; then
echo $ra_kb > $dm
else
echo 128 > $dm
fi
done
}
@@ -145,9 +139,7 @@ function configure_memory_parameters() {
configure_zram_parameters
configure_read_ahead_kb_values
# Enable ZRAM on boot_complete
echo 0 > /proc/sys/vm/page-cluster 0
echo 60 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/swappiness
# Disable periodic kcompactd wakeups. We do not use THP, so having many
# huge pages is not as necessary.
@@ -189,11 +181,6 @@ function configure_memory_parameters() {
echo 4096 > /proc/sys/vm/min_free_kbytes
fi
# configure boost pool
if [ $RamSizeGB -ge 10 ]; then
echo 128000 > /proc/boost_pool/camera_pages
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

View File

@@ -607,7 +607,9 @@ function configure_zram_parameters() {
let zRamSizeMB=4096
fi
echo lz4 > /sys/block/zram0/comp_algorithm
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
@@ -815,8 +817,7 @@ else
# Set allocstall_threshold to 0 for all targets.
# Set swappiness to 100 for all targets
echo 0 > /sys/module/vmpressure/parameters/allocstall_threshold
echo 0 > /proc/sys/vm/page-cluster
echo 60 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/swappiness
# Disable wsf for all targets beacause we are using efk.
# wsf Range : 1..1000 So set to bare minimum value 1.

View File

@@ -108,19 +108,10 @@ on boot
# Allow access to memory hotplug device attributes
chown system system /sys/kernel/mem-offline/anon_migrate
#ifdef CONFIG_OPLUS_OMRG
write /dev/cpuset/display/cpus 2-6
#endif
on post-fs-data
# Create directory used for dump collection
mkdir /data/vendor/ssrdump 0770 root system
#ifdef CONFIG_OPLUS_OMRG
chown system system /sys/devices/platform/soc/soc:oplus-omrg/oplus-omrg0/ruler_enable
#endif
on property:persist.sys.ssr.enable_debug=*
write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug}

View File

@@ -998,7 +998,6 @@ vendor/lib64/libqtiidentitycredential.so
# Kernel
vendor/bin/init.kernel.post_boot-memory.sh
vendor/bin/init.kernel.post_boot-pineapple.sh
vendor/bin/init.kernel.post_boot-pineapple_2_3_1_1.sh
vendor/bin/init.kernel.post_boot-pineapple_2_3_2_0.sh
vendor/bin/init.qcom.class_core.sh