Change CPU Clock speed
- brad
- Posts: 31
- Joined: Tue Jan 06, 2015 5:19 am
Change CPU Clock speed
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.
- brad
- Posts: 31
- Joined: Tue Jan 06, 2015 5:19 am
Re: Change CPU Clock speed
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:
This for 180Mhz 1/2*360=180:
this for 12Mhz 1/30*360
this for 360Mhz
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
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
- brad
- Posts: 31
- Joined: Tue Jan 06, 2015 5:19 am
Re: Change CPU Clock speed
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.
I just put this in the /etc/rc.local and after boot the cpu goes into auto clock speed mode.![Wink ;)](./images/smilies/icon_e_wink.gif)
- 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.
![Wink ;)](./images/smilies/icon_e_wink.gif)
- augin
- Posts: 3
- Joined: Wed Sep 09, 2015 12:00 pm
- Vonger
- Posts: 901
- Joined: Sun Oct 19, 2014 6:00 am
- l4chsalter
- Posts: 7
- Joined: Tue Jan 27, 2015 7:21 pm
- Location: Hamburg, Germany
Re: Change CPU Clock speed
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:
But how did you come up with the second part:
Thanks in advance
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
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: Change CPU Clock speed
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%
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%
- brad
- Posts: 31
- Joined: Tue Jan 06, 2015 5:19 am
- l4chsalter
- Posts: 7
- Joined: Tue Jan 27, 2015 7:21 pm
- Location: Hamburg, Germany
Re: Change CPU Clock speed
Thx noblepepper for detailed explanation
Now that i know it, it seems obvious![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Now that i know it, it seems obvious
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
- MMMo
- Posts: 1
- Joined: Tue Dec 10, 2019 10:19 pm
Re: Change CPU Clock speed
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:
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
Who is online
Users browsing this forum: No registered users and 2 guests