mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-29 11:32:30 +00:00
Its now mandatory field to have in patch header with latest oe-core [1] [1] https://git.openembedded.org/openembedded-core/commit/?id=b7fb91c797ab37a029b8dd1eb7277a7468bc97ed Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
235 lines
8.9 KiB
Diff
235 lines
8.9 KiB
Diff
From dae2c99a22f25ed54e4eed69ca26066bdf88e8c2 Mon Sep 17 00:00:00 2001
|
|
From: Ilies CHERGUI <ichergui@nvidia.com>
|
|
Date: Fri, 3 Nov 2023 23:44:46 +0000
|
|
Subject: [PATCH] Drop bc usage and remove symlink creation functions
|
|
|
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
|
Signed-off-by: Ilies CHERGUI <ichergui@nvidia.com>
|
|
|
|
Upstream-Status: Pending
|
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
|
---
|
|
etc/systemd/nvpower.sh | 164 ++++-------------------------------------
|
|
1 file changed, 13 insertions(+), 151 deletions(-)
|
|
|
|
Index: tegra-nvpower-36.3.0-20240424200557/etc/systemd/nvpower.sh
|
|
===================================================================
|
|
--- tegra-nvpower-36.3.0-20240424200557.orig/etc/systemd/nvpower.sh
|
|
+++ tegra-nvpower-36.3.0-20240424200557/etc/systemd/nvpower.sh
|
|
@@ -142,145 +142,6 @@ function set_power_state_perm()
|
|
fi
|
|
}
|
|
|
|
-function create_nvpmodel_symlink()
|
|
-{
|
|
- conf_file=""
|
|
- # create /etc/nvpmodel.conf symlink
|
|
- if [ ! -e "/etc/nvpmodel.conf" ]; then
|
|
- if [ "${SOCFAMILY}" = "tegra194" ]; then
|
|
- if [ "${machine}" = "e3900" ]; then
|
|
- if [ -d "/sys/devices/gpu.0" ] &&
|
|
- [ -d "/sys/devices/17000000.gv11b" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_e3900_iGPU.conf"
|
|
- else
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_e3900_dGPU.conf"
|
|
- fi
|
|
- elif [ "${machine}" = "p2972-0006" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_8gb.conf"
|
|
- elif [ "${machine}" = "p3668" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_p3668.conf"
|
|
- elif [ "${machine}" = "p3668-emul" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_p3668_emul.conf"
|
|
- elif [ "${machine}" = "jetson-xavier-industrial" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194_agxi.conf"
|
|
- else
|
|
- conf_file="/etc/nvpmodel/nvpmodel_t194.conf"
|
|
- fi
|
|
- elif [ "${SOCFAMILY}" = "tegra234" ]; then
|
|
- if [ "${machine}" = "p3701-0000-as-p3767-0000" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0000.conf"
|
|
- elif [ "${machine}" = "p3701-0000-as-p3767-0001" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0001.conf"
|
|
- elif [ "${machine}" = "p3701-0000-as-p3767-0003" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0003.conf"
|
|
- elif [ "${machine}" = "p3701-0000-as-p3767-0004" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0004.conf"
|
|
- elif [ "${machine}" = "p3701-0000-as-pxxxx" ] || \
|
|
- [ "${machine}" = "e2421-1099-as-pxxxx" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_pxxxx.conf"
|
|
- elif [ "${machine}" = "p3701-0002" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0002.conf"
|
|
- elif [ "${machine}" = "p3701-0000-as-p3701-0004" ] || \
|
|
- [ "${machine}" = "p3701-0004" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0004.conf"
|
|
- elif [ "${machine}" = "p3701-0008-safety" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0008_3740_0002_safety.conf"
|
|
- elif [ "${machine}" = "p3701-0008" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0008.conf"
|
|
- if [ "${cvb}" = "p3740-0002-c01" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0008_3740_0002.conf"
|
|
- fi
|
|
- elif [ "${machine}" = "p3767-0000" ] || \
|
|
- [ "${machine}" = "p3767-0002" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0000.conf"
|
|
- elif [ "${machine}" = "p3767-0000-as-p3767-0001" ] || \
|
|
- [ "${machine}" = "p3767-0001" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0001.conf"
|
|
- elif [ "${machine}" = "p3767-0003" ] || \
|
|
- [ "${machine}" = "p3767-0005" ] || \
|
|
- [ "${machine}" = "p3767-0000-as-p3767-0003" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0003.conf"
|
|
- elif [ "${machine}" = "p3767-0004" ] || \
|
|
- [ "${machine}" = "p3767-0000-as-p3767-0004" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0004.conf"
|
|
- elif [ "${machine}" = "taylor-high" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0000_taylor_high.conf"
|
|
- elif [ "${machine}" = "taylor-low" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3767_0000_taylor_low.conf"
|
|
- else
|
|
- conf_file="/etc/nvpmodel/nvpmodel_p3701_0000.conf"
|
|
- fi
|
|
- elif [ "${SOCFAMILY}" = "tegra239" ]; then
|
|
- if [ "${machine}" = "e2423" ]; then
|
|
- conf_file="/etc/nvpmodel/nvpmodel_e2423.conf"
|
|
- fi
|
|
- fi
|
|
-
|
|
- if [ "${conf_file}" != "" ]; then
|
|
- if [ -e "${conf_file}" ]; then
|
|
- ln -sf "${conf_file}" /etc/nvpmodel.conf
|
|
- else
|
|
- echo "${SCRIPT_NAME} - WARNING: file ${conf_file} not found!"
|
|
- fi
|
|
- fi
|
|
- fi
|
|
-}
|
|
-
|
|
-function create_nvfancontrol_symlink()
|
|
-{
|
|
- conf_file=""
|
|
- if [ ! -e "/etc/nvfancontrol.conf" ]; then
|
|
- if [ "${SOCFAMILY}" = "tegra194" ]; then
|
|
- if [ "${machine}" = "e3900" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_e3900.conf"
|
|
- elif [ "${machine}" = "p3668" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3668.conf"
|
|
- else
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p2888.conf"
|
|
- fi
|
|
- fi
|
|
-
|
|
- if [ "${SOCFAMILY}" = "tegra234" ]; then
|
|
- if [[ "${machine}" =~ "p3701" ]]; then
|
|
- # Use p3701_0000 as default fan settings for p3701 series
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3701_0000.conf"
|
|
- if [ "${machine}" = "p3701-0008" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3701_0008.conf"
|
|
- fi
|
|
- elif [[ "${machine}" =~ "p3767" ]] ||
|
|
- [ "${machine}" = "taylor-high" ] || [ "${machine}" = "taylor-low" ]; then
|
|
- # All p3767 series share the same fan settings
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3767_0000.conf"
|
|
- else
|
|
- # Use p3701_0000 as default fan settings for other tegra234 platforms
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3701_0000.conf"
|
|
- fi
|
|
-
|
|
- if [ "${cvb}" = "p3711-0000" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3711_0000.conf"
|
|
- elif [ "${cvb}" = "p3740-0002-b01" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3740_0002_b01.conf"
|
|
- elif [ "${cvb}" = "p3740-0002-c01" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_p3740_0002_c01.conf"
|
|
- fi
|
|
- fi
|
|
-
|
|
- if [ "${SOCFAMILY}" = "tegra239" ]; then
|
|
- if [ "${machine}" = "e2423" ]; then
|
|
- conf_file="/etc/nvpower/nvfancontrol/nvfancontrol_e2423.conf"
|
|
- fi
|
|
- fi
|
|
-
|
|
- if [ "${conf_file}" != "" ]; then
|
|
- if [ -e "${conf_file}" ]; then
|
|
- ln -sf "${conf_file}" /etc/nvfancontrol.conf
|
|
- else
|
|
- echo "${SCRIPT_NAME} - WARNING: file ${conf_file} not found!"
|
|
- fi
|
|
- fi
|
|
- fi
|
|
-}
|
|
-
|
|
# CPU hotplug helper function that turns on/off the CPU cores in the specified range
|
|
# * Parameters:
|
|
# * ${1}: desired online status (0 for offline, 1 for online)
|
|
@@ -341,13 +202,8 @@ function set_cpufreq_governor()
|
|
desired_cpufreq_gov="performance"
|
|
|
|
if [ ${IS_SAFETY_PLATFORM} -eq 0 ]; then
|
|
- # Enable SCHEDUTIL governor for all SoC's except T194 in Kstable.
|
|
- if [ "${SOCFAMILY}" = "tegra194" ] &&
|
|
- [ "$(echo "${KERNEL_VERSION} >= 6.0" | bc)" -eq 1 ]; then
|
|
- :
|
|
- else
|
|
- desired_cpufreq_gov="schedutil"
|
|
- fi
|
|
+ # Enable SCHEDUTIL governor for all SoC's
|
|
+ desired_cpufreq_gov="schedutil"
|
|
fi
|
|
|
|
if [ -e "${CPUFREQ_AVAIL_GOVS}" ]; then
|
|
@@ -448,7 +304,7 @@ function set_devfreq_governor()
|
|
if [ ${IS_SAFETY_PLATFORM} -ne 0 ]; then
|
|
desired_devfreq_gov="performance"
|
|
else
|
|
- if [ "$(echo "${KERNEL_VERSION} == 5.15" | bc)" -eq 1 ]; then
|
|
+ if [ "${KERNEL_VERSION}" = "5.15" ]; then
|
|
desired_devfreq_gov="tegra_wmark"
|
|
fi
|
|
fi
|
|
@@ -487,10 +343,10 @@ function lock_emc_frequency()
|
|
|
|
# Set EMC_FREQ to max for Kernel version >= 5.15
|
|
# and when the Interconnect support is missing
|
|
- if [ "$(echo "${KERNEL_VERSION} >= 5.15" | bc)" -eq 1 ]; then
|
|
+ if [ "${KERNEL_VERSION}" = "5.15" ]; then
|
|
if [ -e "${EMC_MAX_RATE}" ] && [ -e "${EMC_RATE}" ]; then
|
|
- AVG_BW=$(grep "Memory Controller" ${ICC_NODE} | head -1 | awk -F ' ' '{print $3}')
|
|
- PEAK_BW=$(grep "Memory Controller" ${ICC_NODE}| head -1 | awk -F ' ' '{print $4}')
|
|
+ AVG_BW=$(grep "Memory Controller" ${ICC_NODE} | head -n 1 | awk -F ' ' '{print $3}')
|
|
+ PEAK_BW=$(grep "Memory Controller" ${ICC_NODE}| head -n 1 | awk -F ' ' '{print $4}')
|
|
|
|
if [[ -z "${AVG_BW}" && -z "${PEAK_BW}" ]] ||
|
|
[[ "${AVG_BW}" = "0" && "${PEAK_BW}" = "0" ]]; then
|
|
@@ -701,10 +557,12 @@ function setup_actmon()
|
|
debugfs_actmon="/sys/kernel/debug/tegra-host1x/actmon"
|
|
|
|
# Actmon settings should be the same across engines
|
|
- tee ${debugfs_actmon}/*/sample_period 1>/dev/null <<< 1500
|
|
- tee ${debugfs_actmon}/*/module0/consec_upper_num 1>/dev/null <<< 7
|
|
- tee ${debugfs_actmon}/*/module0/consec_lower_num 1>/dev/null <<< 7
|
|
- tee ${debugfs_actmon}/*/module0/k 1>/dev/null <<< 2
|
|
+ for engine in ${debugfs_actmon}/*; do
|
|
+ echo 1500 > $engine/sample_period
|
|
+ echo 7 > $engine/module0/consec_upper_num
|
|
+ echo 7 > $engine/module0/consec_lower_num
|
|
+ echo 2 > $engine/module0/k
|
|
+ done
|
|
}
|
|
|
|
SOCFAMILY=""
|
|
@@ -713,8 +571,6 @@ KERNEL_VERSION=$(uname -r | cut -d '.' -
|
|
set_socfamily
|
|
set_safety_flag
|
|
set_power_state_perm
|
|
-create_nvpmodel_symlink
|
|
-create_nvfancontrol_symlink
|
|
cpu_hotplug
|
|
set_cpufreq_governor
|
|
set_cpu_floor_freq
|
|
@@ -725,3 +581,4 @@ validate_nvpmodel_conf
|
|
setup_hwmon
|
|
setup_tmp451
|
|
setup_actmon
|
|
+exit 0
|