nx: allow bootloader-passed oc

- Update uscript to check oc, max cpu and gpu freqs
- Update init to poke node to allow max scaling

Perf mode on perfmgr already allows full kernel scaling, so this
will just allow that to rise to max.

A better impl later may involve editing the json to have higher
game profiles etc, but for now this is more than fine.

Change-Id: I669fa523944dc0a99c2c9d6a6360593ee0a4bd8c
This commit is contained in:
tmakin authored and Nolen Johnson committed 2025-04-01 20:52:22 +00:00
1 parent 43b4abc90c
commit 43d30991c7
2 files changed
+24

No files matched your search

+17
View File
@@ -20,6 +20,7 @@ test -n ${touch_skip_tuning} || setenv touch_skip_tuning 0
test -n ${bt_ertm_disable} || setenv bt_ertm_disable 0
test -n ${wifi_disable_vht80} || setenv wifi_disable_vht80 0
test -n ${alarms_disable} || setenv alarms_disable 0
test -n ${oc} || setenv oc 0
# Built-in IMU.
test -n ${acc_cal_off_x} || setenv acc_cal_off_x 0x0
@@ -356,6 +357,22 @@ if test ${t210b01} = 1 -a ${gpu_dvfsc} = 1; then
fi
fi
# Allow overclocking.
if test ${oc} = 1; then
echoe "CPU OC enabled"
setenv bootargs_extra ${bootargs_extra} "androidboot.oc=1"
fi
if test -n ${max_cpu_freq}; then
echoe "Max CPU freq applied: ${max_cpu_freq} KHz"
fdt set /cpufreq/cpu-scaling-data max-frequency <${max_cpu_freq}>
fi
if test -n ${max_gpu_freq}; then
echoe "Max GPU freq applied: ${max_gpu_freq} KHz"
fdt set /dvfs nvidia,gpu-max-freq-khz <${max_gpu_freq}>
fi
# Limit GPU clock.
if test ${t210b01} = 1 -a ${limit_gpu_clk} = 1; then
if test ${sku} != 2; then
+7
View File
@@ -35,8 +35,15 @@ on post-fs-data
chmod 0666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0664 /sys/kernel/tegra_cpufreq/overclock
chown system system /sys/kernel/tegra_cpufreq/overclock
chown system system /sys/bus/platform/devices/tegradc.0/enable
# enable oc only if passed from bootloader (no userspace toggle)
on property:vold.post_fs_data_done=1 && property:ro.boot.oc=1
write /sys/kernel/tegra_cpufreq/overclock 1
on boot
write /sys/devices/system/cpu/cpufreq/schedutil/up_rate_limit_us 500
write /sys/module/input_cfboost/parameters/boost_gpu 460800