Skip to content

Commit

Permalink
Scale frequencies of Tinker Board on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Apr 12, 2019
1 parent 8ce356d commit d6aabc7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions build/160-asus-tinker-board
Expand Up @@ -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.