Page 1 of 2

Change CPU Clock speed

Posted: Tue Jan 06, 2015 5:21 am
by brad
How do you set the CPU clock speed in openwrt before compile the image? I don't have a need for 400Mhz and want to clock it down to reduce power and heat.

Re: Change CPU Clock speed

Posted: Sat Aug 22, 2015 12:02 pm
by brad
I just thought I should answer my own question. You can reduce the CPU down to 12Mhz - which is the lowest. Have a try, it wont hurt anything and changes back to normal on power cycle.

This is for 36Mhz cpu clock (1/0xA)*360=36:
Code: Select all
mmio 0x1000003c 0x03040a01


This for 180Mhz 1/2*360=180:
Code: Select all
mmio 0x1000003c 0x03040201


this for 12Mhz 1/30*360
Code: Select all
mmio 0x1000003c 0x03041e01


this for 360Mhz
Code: Select all
mmio 0x1000003c 0x03040101


These definitely make a difference to the speed. If you make a loop that counts you can see the difference..

running CPU at 100%, ethernet plugged in, and wifi off, I get these results with 5v input:
360Mhz: 200mA
180Mhz: 170mA
90Mhz: 160mA
45Mhz: 160mA
36Mhz: 155mA
12Mhz: 150mA

Re: Change CPU Clock speed

Posted: Wed Sep 02, 2015 9:50 am
by brad
Just an update, I've been reading the 5350 docs a bit more and noticed the auto CPU scaler. It also works. Thus giving max CPU speed when needed, but reducing heat and power consumption when doing nothing.

Code: Select all
mmio 0x10000044 0x80020133


I just put this in the /etc/rc.local and after boot the cpu goes into auto clock speed mode. ;)

Re: Change CPU Clock speed

Posted: Wed Sep 09, 2015 12:17 pm
by augin
Hi! How to install MMIO util?

Re: Change CPU Clock speed

Posted: Tue Sep 15, 2015 8:32 am
by Vonger
Please read my blog http://vonger.cn/?p=1880

Re: Change CPU Clock speed

Posted: Mon Sep 28, 2015 8:40 pm
by l4chsalter
Hi Guys,

i just had a look at the RT5350 Datasheet but unfortunatly i don't get how you obtained the adresses for the mmio command. Maybe you can explain that a little?
For example for the CPU Clock Auto Dynamic Control on page 29: i get the Register Description base is at 0x1000_0000 and that CPU_CLK_AUTO_CFG has a offset of 0x0044. Therefore the first part:

Code: Select all
mmio 0x10000044


But how did you come up with the second part:
Code: Select all
0x80020133


Thanks in advance

Re: Change CPU Clock speed

Posted: Tue Sep 29, 2015 12:21 pm
by noblepepper
You use the bit table to put together a number (in binary) for the parameter values you want, the hex representation is just to make it easier for humans to interpret.

Working backwards -

Hex -
0x80020133 =

Binary -
10000000000000100000000100110011 =

Parameters -
CPU AUTO CLK EN = 1 = Enable
CLK ADJ STEP = 00010 = 2
UTL PERIOD = 0001 = 1
UTL HI MARK = 11 = 87.5%
UTL LO MARK = 11 = 50%

Re: Change CPU Clock speed

Posted: Tue Sep 29, 2015 2:40 pm
by brad
Thanks nobelpepper. Saved me the time. :D

Re: Change CPU Clock speed

Posted: Tue Sep 29, 2015 6:17 pm
by l4chsalter
Thx noblepepper for detailed explanation

Now that i know it, it seems obvious :D

Re: Change CPU Clock speed

Posted: Tue Dec 10, 2019 10:34 pm
by MMMo
Could anybody give a more detailed explanation on how to enable mmio.
I WinSCPed downloaded mems file in to bin folder, and made it executable (chmod +x mems). After running mmio command its still says its not found:
Code: Select all
-ash: mmio: not found