Disclaimer

I am not responsible if your devices send you back in time, explodes, implodes, bricks or flies into space from the use of any software I put up.

Search

Monday, December 22, 2014

Overclocking TP-Link WDR4300

I know a lot people have been asking about overclocking the AR9344 MIPS74Kc.
An OpenWRT forumer pepe2k (his blog www.tech-blog.pl) created a Firmware Recovery uboot here (if you like his work please donate).
From my experience with the AR9344 SoC I know that maximum possible clockspeed for AR9344 varies a lot.
I have a unit which can do a maximum of 700MHZ and another unit which can do a maximum of 740MHZ, so for this share I only shared a bootloader copy clocked at 600MHZ, if you want to try higher value you have to built the bootloader yourself.
The reason why I chose 600MHZ is because a Mikrotik Router using the same AR9344 is also clocked at 600MHZ CPU 400MHZ RAM and 200MHZ AHB so it should be safe.

Another issue is that some AR9344 routers come with low grade RAM as a result when you perform memtester, a utility that read & write bit patterns to RAM, to detect RAM errors it will fail. The default RAM clock is 450MHZ but it seems to be too high for certain brands of RAM.

A solution to this is to decrease the RAM frequency of 400MHZ.

I have build a special openwrt image to unlock write access to uboot so you can write the uboot image to the uboot partition.
Please remember to flash the normal image after you are done to write-protect the uboot from any accidental writes.

I have 2 images for download here
  1. Uboot with 600MHZ Overclock 450MHZ RAM 225MHZ AHB for routers without low grade RAM
  2. Uboot with 600MHZ Overclock 400MHZ RAM 200MHZ AHB for routers without low grade RAM as a fix to units with memtest errors
Instruction on how to reflash the uboot on your Router here
If you do not feel confident please do not attempt it.

As for how to test for RAM error:
  1. Connect your Router to Internet
  2. ssh into the router
  3. opkg update
  4. opkg install memtester
  5. memtester 32M (to test 32MB of memory)
Good luck!

After you flash the bootloader there will be a failsafe page where you can upload Atheros Radio Test (ART) Partitions, Firmware Image and bootloader if you press and hold the reset button after 4 light flashes from power on.

23 comments:

Jonathan Lancett said...

Hi do you no if i can get my hands on files like this for the TP-Link TL-WDR3600?

Admin said...

It is all in the links.
You have to follow pepe2k guide to merging the uboot binaries with your uboot.

Jonathan Lancett said...

Hi i cant build the uboot binaries as i run windows and a screen reader. the software cant be used with a screen reader. Is there a way to get the files for the 3600 like you have posted up the ones for the 4300. I can flash things to my 3600 but not build them.

Admin said...

I never tested it before as I don't have WDR3600 but base on what I read from pepe2k, and the naming of the files, WDR3600 should be using the same uboot as WDR4300 which I uploaded.

Your original uboot contains 2 half.
1st half is initialization routine, and setting the clock.
2nd half is the MAC Address, WPS Code (which you need to keep).
To do this correctly overwrite the first half of your original uboot with the binary, then sysupgrade to a special openwrt which unlocks the write permission to uboot and overwrite your uboot with the merged version.
Instructions on the github of the uboot_mod.

Jonathan Lancett said...

Hi thanks i got it to work with the file you posted. I used the 400 mhz ram file as i don't no what ram my wrd3600 has. I loaded your openwrt for the wrd3600 and then flashed the u-boot and then flashed back to Gargoyle. It seems to of worked!

system type : Atheros AR9344 rev 2
machine : TP-LINK TL-WDR3600/4300/4310
processor : 0
cpu model : MIPS 74Kc V4.12
BogoMIPS : 299.82
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0ff8, 0x0ff8]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp dsp2
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

dmesg | grep

[ 0.000000] Linux version 3.10.49 (user@Linux) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #5 Thu Apr 30 14:38:47 NZST 2015
[ 0.000000] MyLoader: sysp=29cc4571, boardp=3e8b20a0, parts=1f2321dc
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 0001974c (MIPS 74Kc)
[ 0.000000] SoC: Atheros AR9344 rev 2
[ 0.000000] Clocks: CPU:600.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:40.000MHz


Is this OK

Admin said...

Looks good.
You don't actually have to know which RAM you have to determine whether you need to downclock the RAM.
Simply backup your settings, run memtester on the default clocks, if you get errors then you need to downclock the RAM.

Jonathan Lancett said...

Hi thanks for your help i have flashed the u-boot for 450 ram and all is fine here. memtester shows no errors.
Wen messing about tho i found out that my WD mynet n750 has the same cpu at 560 MHZ but the ram is running at 480 and AHB:240.000MHz
It's a shame i cant get a u-boot for it to. it's a good router and you can find them for cheep on ebay. payed just £15 for mine.

Jonathan Lancett said...
This comment has been removed by the author.
Jonathan Lancett said...

More u-boots for wdr3600 and 4300 here:
https://github.com/gwlim/Openwrt_Firmware/tree/master/TP-Link_TL-WDR3500-3600-43XX-WM4350R/TP-Link_TL-WDR3500-3600-43XX-WM4350R_Overclock_Section

Jonathan Lancett said...

Hi is there any u-boots with overclocked DDR or AHB?

Admin said...

I can make 1 but if you router cr@ps out on you it is on you.

Jonathan Lancett said...

Hi yes pleas and if my router craps out than that's ok lol i was thinking about 680 480 240

Admin said...

Added the overclock uboot you requested, if it cr@ps on you it is not my fault.

Daniel Schmidt said...

Hi,

Great work!

How can I compile my own overclocked U-Boot for WDR3600?

pepe2k still says in his FAQ, that only Atheros AR9331 SoC is supported for overclocking, how did you compile these U-Boot versions?


Thanks!

Admin said...

In here:
#if !defined(CONFIG_AP123)
/* refdiv nint nfrac */
li t4, ((0x8 << 27) | (112 << 18) | 0);// cpu freq = (40 MHz refclk/refdiv 8) * Nint
li t5, ((0x8 << 27) | (90 << 18) | 0); // ddr freq = (40 MHz refclk/refdiv 8) * Nint
j 2f
nop
1:
li t4, ((0x5 << 27) | (112 << 18) | 0);// cpu freq = (25 MHz refclk/refdiv 5) * Nint
li t5, ((0x5 << 27) | (90 << 18) | 0); // ddr freq = (25 MHz refclk/refdiv 5) * Nint
j 2f
nop
#else /* defined(CONFIG_AP123) */
/* refdiv nint nfrac */
li t4, ((0x8 << 27) | (107 << 18) | 0);// cpu freq = (40 MHz refclk/refdiv 8) * Nint
li t5, ((0x8 << 27) | (160 << 18) | 0);// ddr freq = (40 MHz refclk/refdiv 8) * Nint
j 2f
nop
1:
li t4, ((0x5 << 27) | (107 << 18) | 0);// cpu freq = (25 MHz refclk/refdiv 5) * Nint
li t5, ((0x5 << 27) | (160 << 18) | 0);// ddr freq = (25 MHz refclk/refdiv 5) * Nint
j 2f
nop
#endif /* !defined(CONFIG_AP123)

Jonathan Lancett said...

Hi tryed out the uboot_for_tp-link_tl-wdr3600-43x0_680_480_240.bin you made for me and all is good thanks.
I wated to post to chek stability.

Admin said...

Great!

Unknown said...

Thank you for these images. I risked the 680/450/225 for my 4300 and it seems to work fine (it has been stable the whole day, including ~1h of memtester).

What can you usually expect when you hit the wall? Do you still have a chance to recover the board on it's own legs (reflash u-boot in "safe mode") or are JTAG / external flash writer the only way from there?

Ar the clocks applied before or after you have a chance to boot the u-boot failsafe instead of OpenWRT?

Admin said...

It depends on the Degree of Overclock
If you experience occasional crash/reboot during heavy load, dial it back a little.
If you experience memtest failure/crash, dial it back.
Never do extreme values but do it gradually, eventually you can feel the wall.
If you overclock too much you will not get pass the uboot, if you overclock too much slightly you can activate uboot recovery page.
The heavier complexity of the machine state the more it is likely to crash when you overclock too much.

Admin said...

Try some heavy torrents which will tax the router heavily if you want to make sure it is production stable.

Anirudh Acharya said...
This comment has been removed by the author.
Anirudh Acharya said...

Thanks! I just flashed 720/450/225 and I see memtester errors. However, CPU has been rock solid in the past hour, running memtester, stress with >95% CPU usage. Trying out 720/400/200 now for WDR3600. By any chance, could you help make an image for 720/425/225 - just downclocking the memory a bit? I know I'm reviving an old thread and any help would be appreciated!

Anirudh Acharya said...

Just wanted to let you know that I found one of your old threads at openwrt: https://forum.openwrt.org/viewtopic.php?id=57191

I've edited the uboot with a hex editor in the location as explained in the thread. One thing I noticed is that DDR and AHB are coupled and cannot be clocked differently. The DDR PLL shown there also controls AHB.

Thanks!