7

I'm using this ARM9 SAM9G25 embedded system, that when switched on, is only online for a few seconds and because I want to speed up the whole process, I'd like to check the CPU frequency, and set it to max. speed.

The Linux 2.6.39 kernel is generated here with Buildroot 2013.10. When googeling around it in the end always leads to the "CPU frequency scaling" option, but that's not what I'm looking for. I believe there has to be some kind of a statically value for the CPU, so that e.g.: the kernel tells a 1 GHz CPU to operate at max. 100 MHz.

Can anyone point me in the right direction? Thanks for the support.

8

You will have to check what is the governor you are using. This guy will pretty much influence your clock change depending on the demand the processor is having. Probably the governor you need is:

  • Performance: scaling_min_freq and scaling_max_freq will be set to the max.

To change your processor frequency governor: cpupower frequency-set -g performance. It is implicit that you have such governor installed.

The values of scaling that you have access are tied with the processor you are using and the functions implemented on your processor clock driver(powernow-k8, powernow-k10, p4-clockmod...). With the command cpufreq-info from the cpufrequtils you will be able to retrieve more information about your processor like, what are the hard limits of clock it support, what are the frequency steps, what is the frequency range allowed and the loaded governor.

If you want to monitor your actual clock: watch grep \"cpu MHz\" /proc/cpuinfo

There are another intersting information about this subject and its related parts like sysfs and commands on the following pages:

  • thanks very much for that detailed answer. I forgot to mention that the change of the CPU freq. should affect (or mainly affect) the boot time. If I got that right, I could change the speed with a governor from userspace, but actually should be at a particular value from the very beginning of the kernel boot, so this doesn't seem like the solution. Isn't there some kind of a variable for it ? – user3085931 Mar 19 '14 at 11:33
  • 2
    In the second link provided by @nwildner it says that "The configuration file for cpupower is located in /etc/default/cpupower. This configuration file is read by a bash script in /usr/lib/systemd/scripts/cpupower which is activated by systemd with cpupower.service. You may want to enable cpupower.service to start at boot." So you can use this setting to enable it at boot. Note that I would be very surprised that you would gain any significant speed boost by changing this setting. The major performance hog at boot is the disk speed, not the CPU (which is usually waiting for the data). – Huygens Mar 19 '14 at 11:58
  • Other "tunnables" are the size of your initrd/initramdisk, and what are the services started at the boot time. Tunning those would be more effective than looking at the cpu frequency on those early stages ;) – user34720 Mar 19 '14 at 12:16
  • is this really the only way to change the frequency ? Then what happens if you disable the CPU Freq. scaling in the linux menuconfig ? – user3085931 Mar 20 '14 at 7:49
  • It will run your cpu at full speed always. Some motherboards have options/tweaks to disable this feature too, and your operating system will see only the max clock as a "usable" speed ;) – user34720 Mar 20 '14 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.