Overclocking


 * 1) WORK IN PROGRESS, HELP IF YOU WANT

=Necessary links=

talk.maemo.org: Overclock the N900?

Kernels

talk.maemo.org: Compiling custom kernels for P1.1 (with fiasco-gen)


 * 1) ADD IMPORTANT POSTS FROM THE TOPICS

=Useful stuff=

Show current CPU frequency
echo $((`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`/1000)) MHz

Set maximum CPU frequency
From root terminal:

echo $((600*1000)) > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

Replace 600 with desired maximum frequency. The list of available frequencies on your device/kernel can be obtained with command:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

The values returned are in kHz (that means you have to divide them by 1000 or remove last three zeroes.

Analyzing time_in_state
This script generates readable output (percentage) of states used. It is designed for 5 available states. If you have 4 available frequencies (stock kernel) simply remove 7th line and lower "head -n 4" to "head -n 3" in 3rd line.

sum=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | awk '{SUM += $2} END {print SUM}'` sum2=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | head -n 4 | awk '{SUM += $2} END {print SUM}'` cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | head -n 1 | awk '{printf (($1/1000)" MHz: overall "); printf ("%.1f",($2 * 100)/"'"$sum"'"); printf ("'" %%, when not idle "'"); printf ("%.1f %\n",($2 * 100)/"'"$sum2"'")}' cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | head -n 2 | tail -n 1 | awk '{printf (($1/1000)" MHz: overall "); printf ("%.1f",($2 * 100)/"'"$sum"'"); printf ("'" %%, when not idle "'"); printf ("%.1f %\n",($2 * 100)/"'"$sum2"'")}' cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | head -n 3 | tail -n 1 | awk '{printf (($1/1000)" MHz: overall "); printf ("%.1f",($2 * 100)/"'"$sum"'"); printf ("'" %%, when not idle "'"); printf ("%.1f %\n",($2 * 100)/"'"$sum2"'")}' cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | head -n 4 | tail -n 1 | awk '{printf (($1/1000)" MHz: overall "); printf ("%.1f",($2 * 100)/"'"$sum"'"); printf ("'" %%, when not idle "'"); printf ("%.1f %\n",($2 * 100)/"'"$sum2"'")}' cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | tail -n 1 | awk '{printf (($1/1000)" MHz: overall "); printf ("%.1f %\n",($2 * 100)/"'"$sum"'")}'
 * 1) !/bin/sh

Output example:

800 MHz: overall 5.0 %, when not idle 70.0 % 550 MHz: overall 0.2 %, when not idle 2.0 % 500 MHz: overall 2.0 %, when not idle 25.0 % 250 MHz: overall 0.3 %, when not idle 3.0 % 125 MHz: overall 92.5 %