diff --git a/bootfiles/android_boot.txt b/bootfiles/android_boot.txt index 9059bef..73713d5 100644 --- a/bootfiles/android_boot.txt +++ b/bootfiles/android_boot.txt @@ -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 diff --git a/initfiles/init.nx.rc b/initfiles/init.nx.rc index 59730b8..954ffad 100644 --- a/initfiles/init.nx.rc +++ b/initfiles/init.nx.rc @@ -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