Skip to content
Permalink
Browse files

Scale frequencies of Tinker Board on boot

  • Loading branch information...
NEMS Linux
NEMS Linux committed Apr 12, 2019
1 parent 8ce356d commit d6aabc715a6de8050a40db36396d0e2203f761da
Showing with 18 additions and 4 deletions.
  1. +18 −4 build/160-asus-tinker-board
@@ -6,13 +6,27 @@ platform=$(/usr/local/share/nems/nems-scripts/info.sh platform)
if (( $platform == 100 )) || (( $platform == 101 )); then

# Lower the CPU frequency to reduce temperature and improve reliability
echo 1300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 1300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 1300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
# Find what's available in /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1200000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 1200000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 1200000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo conservative > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

# Do this every time I boot
addition="/root/nems/nems-admin/build/160-asus-tinker-board\n"
if ! grep -q "160-asus-tinker-board" /etc/rc.local; then
if grep -q "exit" /etc/rc.local; then
# This file contains an exit command, so make sure our new command comes before it
/bin/sed -i -- 's,exit,'"$addition"'exit,g' /etc/rc.local
else
# No exit command within the file, so just add it
echo "PLACEHERE" >> /etc/rc.local
/bin/sed -i -- 's,PLACEHERE,'"$addition"'exit 0,g' /etc/rc.local
fi
fi

fi

0 comments on commit d6aabc7

Please sign in to comment.
You can’t perform that action at this time.