From fa72db9cdcb242cb46c8dfbdbb7d041d33f2ba19 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 12 May 2021 21:24:11 +0800 Subject: [PATCH] luci-app-cpufreq: fix tweak for ipq40xx/ipq806x Reported-by: AmadeusGhost Signed-off-by: Tianling Shen --- .../luci-app-cpufreq/root/etc/uci-defaults/cpufreq | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/lean/luci-app-cpufreq/root/etc/uci-defaults/cpufreq b/package/lean/luci-app-cpufreq/root/etc/uci-defaults/cpufreq index e6d572c7aa..4733a908a8 100755 --- a/package/lean/luci-app-cpufreq/root/etc/uci-defaults/cpufreq +++ b/package/lean/luci-app-cpufreq/root/etc/uci-defaults/cpufreq @@ -16,11 +16,17 @@ case "$DISTRIB_TARGET" in uci_write_config 0 ondemand 600000 1200000 10 50 ;; "ipq40xx") - uci_write_config 0 ondemand 300000 716000 10 50 + uci_write_config 0 ondemand 200000 896000 10 50 ;; "ipq806x") - uci_write_config 0 ondemand 600000 716000 10 50 - echo "$CPU_POLICYS" | grep -q "1" && uci_write_config 1 ondemand 600000 716000 10 50 + CPU_FREQS="$(cat '/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies')" + if echo "$CPU_FREQS" | grep -q "1725000"; then + CPU_MAX_FREQ="1725000" + else + CPU_MAX_FREQ="1400000" + fi + uci_write_config 0 ondemand 600000 $CPU_MAX_FREQ 10 50 + echo "$CPU_POLICYS" | grep -q "1" && uci_write_config 1 ondemand 600000 $CPU_MAX_FREQ 10 50 ;; "rockchip/armv8") if echo "$CPU_POLICYS" | grep -q "4"; then