Downclocking WRT54GS v1.0 to 100Mhz

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
s3gm3nt
DD-WRT Novice


Joined: 23 May 2017
Posts: 5

PostPosted: Tue May 23, 2017 12:57    Post subject: Downclocking WRT54GS v1.0 to 100Mhz Reply with quote
Hi Guys,

Is it possible to downclock the WRT54GS v1.0 (With BCM4712 rev 1) to 100 Mhz?

I used NVRAM to set it but apparently router ignore my changes.

I used value 100 in nvram like:

nvram set clkfreq=100 (I also do the commit), also tried stuff like clkfreq=166,166,166 to see if at all it works.

When I use numbers like 166 in the web router status interface dd-wrt shows the CPU clock as N/A and when I put it something like 100 or 200 it always shows CPU clock 200 MHz.

Why is that?

What is the minimum clock speed I can have in WRT54GS. I am doing some research experiment and really do not use the router at all. I just want to achieve minimum clock speed.


This page in dd-wrt wiki: https://www.dd-wrt.com/wiki/index.php/Overclocking_BCM_47xx_CPU%27s explain that we must use specific values for nvram command. But I could not find one for BCM4712. From the same page we can see that CPU can go as low as 66 Mhz, but I do not know how to achieve that.
Sponsor
MDA400
DD-WRT User


Joined: 10 Jan 2015
Posts: 270
Location: Minnesota

PostPosted: Tue May 23, 2017 15:15    Post subject: Reply with quote
If you apply the underclock and commit it, it needs to have nvram reboot in the command list as well.

If you telnet into the router, you can use the nvram get clkfreq command to see if it applied the underclock.

Might just be a firmware specific issue where it only reports the stock frequency that is expected (and possibly higher).
But the nvram get clkfreq command would let you know for sure.

_________________
LATEST DD-WRT FW IS LOCATED HERE: https://dd-wrt.com/support/other-downloads/?path=betas%2F
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Tue May 23, 2017 16:31    Post subject: Re: Downclocking WRT54GS v1.0 to 100Mhz Reply with quote
s3gm3nt wrote:
Is it possible to downclock the WRT54GS v1.0 (With BCM4712 rev 1) to 100 Mhz?
[...]
When I use numbers like 166 in the web router status interface dd-wrt shows the CPU clock as N/A and when I put it something like 100 or 200 it always shows CPU clock 200 MHz.
TD;DR The minimum speed you can set is clkfreq=120,60

You can't rely on the clkfreq setting (incl after a reboot). It may not recognize certain settings, and some SoC's can even soft brick the router if it doesn't match. The GUI may not work right either if it doesn't recognize the value; and I know it doesn't for the GSv1.x.

This is because it uses a different structure table for the allowed values. See the TomatoUSB forum link in this post to find out. To determine actual speed, run these:
    dmesg | grep -ie hz -e cpu -e process -e freq -e mips
    cat /proc/cpuinfo
You can reference the BogoMIPS parameter for relative changes; but note the number may not match your exact Hz for MIPS SoC's. For a WRT54* it should be close (as noted in my old TomatoUSB post), but sometimes it reports ~ 1/2 the actual speed.

_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
s3gm3nt
DD-WRT Novice


Joined: 23 May 2017
Posts: 5

PostPosted: Wed May 24, 2017 14:21    Post subject: Reply with quote
Thank you for the responses.

I used the following commands:

Code:
nvram set clkfreq=120,60
nvram commit
reboot


I also did :
Code:
nvram set clkfreq=120,60
nvram commit
nvram reboot
reboot



In both of the cases it did not work, the WRT54GS return 200 again for both nvram get clkfreq and dmesg and /proc/cpuinfo (not exactly 200 but 199...)

So it looks like that 120,60 is not also correct value, however, I found that value 192,96 is working and then it changed the clock to 192. also dmesg and cpuinfo showed the change. The question is why I can not go lower e.g. 120?

My WRT54GS serial number is:
CGN10D75xxxxxx

What I am missing here? Why nvram does not accept the 120,60 and maintains the previous speed.
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Wed May 24, 2017 15:11    Post subject: Reply with quote
s3gm3nt wrote:
In both of the cases it did not work, the WRT54GS return 200 again for both nvram get clkfreq and dmesg and /proc/cpuinfo (not exactly 200 but 199...)

So it looks like that 120,60 is not also correct value, however, I found that value 192,96 is working and then it changed the clock to 192. also dmesg and cpuinfo showed the change. The question is why I can not go lower e.g. 120?

My WRT54GS serial number is:
CGN10D75xxxxxx

What I am missing here? Why nvram does not accept the 120,60 and maintains the previous speed.
The CFE can disallow certain speeds too, even if the SoC table supports them.

Ah I see, my GSv1 used the type2 n4m table, and I think was a CGN0. However, your CGN1 must use type4, since out of the three type tables, "192,96" is only valid for type4. Apparently the CFE doesn't allow 120,60 though. Only other possibility is "150,75", but it may well be blocked too. Good luck. Smile
Code:
static n4m_table_t BCMINITDATA(type4_table)[] = {
{ 120000000, 60000000, 0, 0x0009, 0x11020009, 0x01030203, 0x11020009, 0x04000009, 11, 0x0aaa0555 },
{ 150000000, 75000000, 0, 0x0009, 0x11050002, 0x01030203, 0x11050002, 0x04000005, 11, 0x0aaa0555 },
{ 192000000, 96000000, 0, 0x0702, 0x04000011, 0x11030011, 0x04000011, 0x04000003, 11, 0x0aaa0555 },
{ 198000000, 99000000, 0, 0x0603, 0x11020005, 0x11030011, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
{ 200000000, 100000000, 0, 0x0009, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 11, 0x0aaa0555 },

_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
s3gm3nt
DD-WRT Novice


Joined: 23 May 2017
Posts: 5

PostPosted: Thu May 25, 2017 0:39    Post subject: Reply with quote
So now the question is how to modify the CFE to force it to let me underclock the CPU to 120 Mhz?

Update:
Ok, disassembling a sample CFE.bin (generated from http://lonewolf.hacker-nin.com/wrt/cfe/cfe.php?model=s10 ), I can see :

Code:
seg000:1069 aClkfreq200     db 'clkfreq=200',0
seg000:1075 aSdram_init0x00 db 'sdram_init=0x0008',0
seg000:1087 aSdram_config0x db 'sdram_config=0x0022',0
seg000:109B                 db  73h ; s
seg000:109C aDram_refresh0x db 'dram_refresh=0x0000',0
seg000:10B0                 db  73h ; s
seg000:10B1 aDram_ncdl0x0   db 'dram_ncdl=0x0',0

Thus (clkfreq=200',0), I guess the only thing I must do is to patch the binary with 120,60 and then write it to the device.

Anyone knows how to overwrite the existing CFE? Does it have integrity check for CFE.bin?

Also, Can I also enable DRAM selfrefresh? What are the values?
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Thu May 25, 2017 2:33    Post subject: Reply with quote
s3gm3nt wrote:
Thus (clkfreq=200',0), I guess the only thing I must do is to patch the binary with 120,60 and then write it to the device.
That may only be related to the action after a reset...did you try '150,75'?
_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
s3gm3nt
DD-WRT Novice


Joined: 23 May 2017
Posts: 5

PostPosted: Mon May 29, 2017 14:44    Post subject: Weird Reply with quote
Weird,
I patched the CFE and rewrite it but it ignored the write operation too.
I also tried 150,75 There is no fucking luck
Really, what should I do?
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Tue May 30, 2017 13:24    Post subject: Re: Downclocking WRT54GS v1.0 to 100Mhz Reply with quote
s3gm3nt wrote:

Is it possible to downclock the WRT54GS v1.0 (With BCM4712 rev 1) to 100 Mhz?


No, it is not possible.
CPU clk fq is based on tables for the pll oscillator and the lowest table value is 192,96 for 4712.

_________________
Kernel panic: Aiee, killing interrupt handler!
s3gm3nt
DD-WRT Novice


Joined: 23 May 2017
Posts: 5

PostPosted: Tue May 30, 2017 15:09    Post subject: Reply with quote
Alright, So it is physically not possible.

But is there any router out there which let me underclock it to 100 Mhz? Any brand? Old/New does not matter.
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Tue May 30, 2017 19:41    Post subject: Reply with quote
s3gm3nt wrote:
But is there any router out there which let me underclock it to 100 Mhz? Any brand? Old/New does not matter.
The WRT54G v1.x ran at 125 MHz stock. And maybe it could underclock from there.
_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum