OpenWrt Forum Archive

Topic: U-Boot mod for routers with AR9331/AR9344

The content of this topic has been archived between 3 Apr 2015 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Boompje123 wrote:

Installed using those commands! Thank you, worked perfectly smile

You're welcome! smile

By the way, I want to inform that currently I'm working on major changes related to overclocking AP121 (AR9331) platform. They will allow you to make safe and trouble-free tests of available clocks settings, without need to access flash programmer in case of too high clocks.

I'm going to add some kind of recovery mode which allows to set default PLL dividers and CPU/RAM/AHB clocks during early board initialization. All you will need to do, to activate this mode, is to press and hold the reset (or any other dedicated) button during powering up the router. First results are very promising! smile

Stay tuned!

Hello pepe2k,

I looked at the first page and the git tree, but the could not find bins for WDR3600, are they available anywhere?

pepe2k wrote:
pupie wrote:

pepe2k,

Do you have any variables of FLASH SIZE defined in your code, so that I can compile you uboot for my hardware mod.

I want to replace factory 4M flash chip to 16M so that I have to re-compile your uboot code.

thanks.

The flash size is recognized based on JEDEC ID of the chip. If you use type which is supported, you don't need to change anything in code. The code which is responsible for flash identify is located in ar7240_flash.c file (board/ar7240/common/).

What type of device you are using?

BTW. Version for WDR3600/43x0 is almost done. I am making also version for AR9341 (MR3420v2, WR841v8 etc.).

*****************************************
*      U-Boot 1.1.4  (Jul  5 2013)      *
*****************************************

DB120 (AR9344) U-Boot for TL-WDR3600/43x0

DRAM:  128 MB
FLASH: Winbond W25Q128 (16 MB)

Eth initialization...

Press reset button for at least:
- 3 sec. to run web failsafe mode
- 5 sec. to run U-Boot console
- 7 sec. to run U-Boot netconsole

Reset button is pressed for:  6 

Button was pressed for 6 sec...
Starting U-Boot console...

uboot> 

I do have WDR3320 - AR9344-DC3A + AR9287 with 64M/4M FLASH but want to change it with 8M and put this U-BOOT instead.
No problem if something goes wrong it's okay ( I do have programmer and love to play with soldering gun), already dumped the original flash.

Please advice?

All best!

mveplus wrote:

I looked at the first page and the git tree, but the could not find bins for WDR3600, are they available anywhere?

Yes, I uploaded first release on last Monday: https://github.com/pepe2k/u-boot_mod/re … 2013-08-19

mveplus wrote:

I do have WDR3320 - AR9344-DC3A + AR9287 with 64M/4M FLASH but want to change it with 8M and put this U-BOOT instead.
No problem if something goes wrong it's okay ( I do have programmer and love to play with soldering gun), already dumped the original flash.

It definitely won't work... it should boot up, but your router uses different network chip (AR9344 has built-in 100 Mbps 5-ports ethernet switch), so it could hang on network initialization.

pepe2k wrote:
mveplus wrote:

I looked at the first page and the git tree, but the could not find bins for WDR3600, are they available anywhere?

Yes, I uploaded first release on last Monday: https://github.com/pepe2k/u-boot_mod/re … 2013-08-19

mveplus wrote:

I do have WDR3320 - AR9344-DC3A + AR9287 with 64M/4M FLASH but want to change it with 8M and put this U-BOOT instead.
No problem if something goes wrong it's okay ( I do have programmer and love to play with soldering gun), already dumped the original flash.

It definitely won't work... it should boot up, but your router uses different network chip (AR9344 has built-in 100 Mbps 5-ports ethernet switch), so it could hang on network initialization.


Thanks for the link, and yes you were right smile

*****************************************
*      U-Boot 1.1.4  (Aug 19 2013)      *
*****************************************

DB120 (AR9344) U-Boot for TL-WDR3600/43x0

DRAM:  64 MB
FLASH: Macronix MX25L64 (8 MB)

LED on during eth initialization...

## Error: negotiation timed out on ethernet port: 0
## Error: negotiation timed out on ethernet port: 1
## Error: negotiation timed out on ethernet port: 2
## Error: negotiation timed out on ethernet port: 3
## Error: negotiation timed out on ethernet port: 4
Hit any key to stop autobooting:  1 ..0 

Booting image at: 0x9F020000

   Image name:   TP-LINK Technologies ver. 1.0
   Image type:   MIPS Linux Kernel Image (lzma compressed)
   Data size:    773115 Bytes = 755 kB
   Load address: 0x80002000
   Entry point:  0x80194920

Uncompressing kernel image... OK!
Starting kernel...

Booting Atheros AR934x
.
.
HANG UP HERE....

...

RESTART.... 

*****************************************
*      U-Boot 1.1.4  (Aug 19 2013)      *
*****************************************

DB120 (AR9344) U-Boot for TL-WDR3600/43x0

DRAM:  64 MB
FLASH: Macronix MX25L64 (8 MB)

LED on during eth initialization...

## Error: negotiation timed out on ethernet port: 0
## Error: negotiation timed out on ethernet port: 1
## Error: negotiation timed out on ethernet port: 2
## Error: negotiation timed out on ethernet port: 3
## Error: negotiation timed out on ethernet port: 4
Press reset button for at least:
- 3 sec. to run web failsafe mode
- 5 sec. to run U-Boot console
- 7 sec. to run U-Boot netconsole

Reset button is pressed for:  0 ... 1 ... 2 ... 3 ... 4 

Button was pressed for 4 sec...
HTTP server is starting for firmware update...

Ethernet mode (duplex/speed): 1/1000 Mbps
HTTP server is starting at IP: 192.168.1.1
HTTP server is ready! 

Regards,

Good day. Need you help.
I may developer board as http://item.taobao.com/item.htm?spm=0.0 … 6612265015
and source codes for him.
Where to write of the parameters that are needed to create a u-boot?
Or may I send for you file.c and file.patch and you add u-boot for this devices?

(Last edited by shaman1010 on 22 Aug 2013, 02:12)

shaman1010 wrote:

Good day. Need you help.
I may developer board as http://item.taobao.com/item.htm?spm=0.0 … 6612265015
and source codes for him.
Where to write of the parameters that are needed to create a u-boot?
Or may I send for you file.c and file.patch and you add u-boot for this devices?

Please, take a look at these files:
https://github.com/pepe2k/u-boot_mod/bl … r/Makefile
https://github.com/pepe2k/u-boot_mod/bl … t/Makefile
https://github.com/pepe2k/u-boot_mod/bl … gs/ap121.h

This board (Elink EL-M150) is very similar to D-Link DIR-505 (AR9331 + 64 MB RAM DDR2).

Do you want to prepare version for module or for module on development board (like this one: http://item.taobao.com/item.htm?spm=201 … 5332812868)? Do you have original sources and flash dump? Does it use compressed version of U-Boot, environment in separate flash sector?

pepe2k wrote:

Do you want to prepare version for module or for module on development board (like this one: http://item.taobao.com/item.htm?spm=201 … 5332812868)?

Yes.

pepe2k wrote:

Do you have original sources and flash dump?

Yes. Sources trunk + 3 files for this board (file.c, file.patch, file.mk)

pepe2k wrote:

Does it use compressed version of U-Boot, environment in separate flash sector?

How to watch?
Original u-boot in modules - it's modified u-boot from tplink 703.
Size uboot - 64k + size with MAC and other - 64k
Start firmware - 0x9F020000

shaman1010 wrote:
pepe2k wrote:

Do you want to prepare version for module or for module on development board (like this one: http://item.taobao.com/item.htm?spm=201 … 5332812868)?

Yes.

OK, but it's not answer for my question smile

Do you have only module OR module soldered on one of the additional development board OR module on your custom-made board?

My U-Boot modification isn't universal, it needs some configuration for LEDs, GPIOs etc. So, if you want version for your custom-made/dedicated board (which won't be generally available), I won't add support for it.

shaman1010 wrote:

Yes. Sources trunk + 3 files for this board (file.c, file.patch, file.mk)

U-Boot sources trunk, OpenWrt trunk or what? Could you send me these files?

shaman1010 wrote:

Original u-boot in modules - it's modified u-boot from tplink 703.
Size uboot - 64k + size with MAC and other - 64k
Start firmware - 0x9F020000

So it's mostly WR703N clone, except memory type (WR703N has DDR, your module DDR2 - in U-Boot sources there are some differences for initializing DDR and DDR2 memory types).

pepe2k wrote:

Do you have only module OR module soldered on one of the additional development board OR module on your custom-made board?

I have is Full DevModule, as
http://item.taobao.com/item.htm?spm=201 … 6635049261

pepe2k wrote:

U-Boot sources trunk, OpenWrt trunk or what? Could you send me these files?

openwrt-trunk-r35902 and 3 custom files for module.

pepe2k wrote:
shaman1010 wrote:

Original u-boot in modules - it's modified u-boot from tplink 703.
Size uboot - 64k + size with MAC and other - 64k
Start firmware - 0x9F020000

So it's mostly WR703N clone, except memory type (WR703N has DDR, your module DDR2 - in U-Boot sources there are some differences for initializing DDR and DDR2 memory types).

Perhaps, but in modules 512mbit RAM and 128mbit SPI (29Q128)

p.s. Sorry, but I can not see your e-mail...

(Last edited by shaman1010 on 22 Aug 2013, 16:47)

shaman1010 wrote:

Perhaps, but in modules 512mbit RAM and 128mbit SPI (29Q128)

It doesn't matter. 512 Mbit = 64 MB and 128 Mbit = 16 MB. And for sure, there is a Winbond W25Q128, not W29Q128.

shaman1010 wrote:

openwrt-trunk-r35902 and 3 custom files for module.

So, you have only OpenWrt sources and probably patch(es) for them, not U-Boot sources. It's not the same.

Since I do not have access to this device (version with full development module costs ~95 USD on Aliexpress!), I can't help you. This device isn't (or won't be) very popular, I suppose.

(Last edited by pepe2k on 22 Aug 2013, 16:51)

pepe2k wrote:

It doesn't matter. 512 Mbit = 64 MB and 128 Mbit = 16 MB. And for sure, there is a Winbond W25Q128, not W29Q128.

SPI - W25Q128 I was wrong

512mbits - it is RAM


pepe2k wrote:

So, you have only OpenWrt sources and probably patch(es) for them, not U-Boot sources. It's not the same.

Revised again - there is uboot-gpl.tar.gz - it's source for my uboot. But more than 90 MB.

pepe2k wrote:

This device isn't (or won't be) very popular, I suppose.

But only module - around $20. Interesting price, taking into number of available GPIO.

(Last edited by shaman1010 on 22 Aug 2013, 18:31)

This uboot (from Jun 19 2013) doesn't seem to be able to load stock firmware kernel on mr3020 (f/w mr3020nv1_en_3_14_2_up(120817).bin or mr3020nv1_en_3_15_2_up_boot(130326).bin).

Is this expected?

rambler wrote:

This uboot (from Jun 19 2013) doesn't seem to be able to load stock firmware kernel on mr3020 (f/w mr3020nv1_en_3_14_2_up(120817).bin or mr3020nv1_en_3_15_2_up_boot(130326).bin).

Is this expected?

No, but I got some information about similar problems with OFW for WR720Nv3. Please, download new version from GitHub: https://github.com/pepe2k/u-boot_mod/releases. It was tested with OpenWrt and OFW.

Excellent – new version from github (Aug 19) now boots everything fine on mr3020.

Nice work!

Out of curiosity, what was the problem with it not booting stock FW previously?

rambler wrote:

Out of curiosity, what was the problem with it not booting stock FW previously?

I'm not exactly sure smile

I thought, that it was a problem related with linker script or toolchain, but now I'm not sure.

Excellent – new version from github (Aug 19) now boots everything fine on mr3020.

I was a bit overoptimistic: it boots correctly the stock FW mr3020nv1_en_3_14_2_up(120817).bin, but NOT the latest mr3020nv1_en_3_15_2_up_boot(130326).bin. Of course, this last firmware comes with a new version of uboot, so one may argue that the new FW requires a new bootloader. However, the new tp-link bootloader *boots correctly OpenWRT*. Weird, isn’t it?

I wouldn’t bother much about the latest tpl f/w upgrade, except that this behavior suggests there’s some weird (and probably hard to find) bug in your code.

Edit: just for the record, I have 64M RAM on these boards, instead of the default 32M. Cannot imagine that this is the reason, but then again, who knows...

(Last edited by rambler on 28 Aug 2013, 18:45)

have you tried also booting the lastest fw with the "old" tplink uboot?

nebbia88 wrote:

have you tried also booting the lastest fw with the "old" tplink uboot?

Just tried. Boots fine.

Edit: just to be clear, I tried with U-Boot 1.1.4 (Mar 20 2012 - 11:37:59), NOT with the GPL one from 2011. I don't have the damn thing and don't know where to find it, except to build one, which I don't have the guts to do.

(Last edited by rambler on 28 Aug 2013, 20:19)

rambler wrote:

I was a bit overoptimistic: it boots correctly the stock FW mr3020nv1_en_3_14_2_up(120817).bin, but NOT the latest mr3020nv1_en_3_15_2_up_boot(130326).bin.

I've just checked and I can confirm this. It seems that new version from GitHub doesn't boot kernel from OFW: mr3020nv1_en_3_14_2_up(120817).bin.

rambler wrote:

Of course, this last firmware comes with a new version of uboot, so one may argue that the new FW requires a new bootloader. However, the new tp-link bootloader *boots correctly OpenWRT*. Weird, isn’t it?

What is definitely weird, I can see that the kernel from OFW hangs at the very beginning, not the U-Boot.

All my versions also boot OpenWrt correctly - I'm still using WR703N with first release of my modification and I have changed OpenWrt versions on it dozen of times, without any problems. I haven't got also any reports about problems with OpenWrt booting on any of my modification versions.

rambler wrote:

I wouldn’t bother much about the latest tpl f/w upgrade, except that this behavior suggests there’s some weird (and probably hard to find) bug in your code.

In my code, in U-Boot 1.1.4 code or in TP-Link OFW code, who knows? I will try to find a solution after my holidays.

rambler wrote:

Edit: just for the record, I have 64M RAM on these boards, instead of the default 32M. Cannot imagine that this is the reason, but then again, who knows...

RAM size isn't the reason.

nebbia88 wrote:

have you tried also booting the lastest fw with the "old" tplink uboot?

I have just checked, it boots without any problems.

pepe2k wrote:

You should make a lot of stability test if you want to use this platform on these frequencies... especially, you should run RAM (for example memtester)

memtester checks RAM, which is free after booting the OS. OpenWRT takes almost 20MB
It would be great to be able to run a test from the U-Boot, checking almost the entire volume. smile

walt wrote:

memtester checks RAM, which is free after booting the OS. OpenWRT takes almost 20MB
It would be great to be able to run a test from the U-Boot, checking almost the entire volume. smile

You don't need to test the entire memory. There is an option to test RAM in U-Boot - take a look at "mtest" command, but it also doesn't test entire RAM.

...
- CFG_MEMTEST_START, CFG_MEMTEST_END:
        Begin and End addresses of the area used by the
        simple memory test.

- CFG_ALT_MEMTEST:
        Enable an alternate, more extensive memory test.

- CFG_MEMTEST_SCRATCH:
        Scratch address used by the alternate memory test
        You only need to set this if address zero isn't writeable
...

...
/*
* Perform a memory test. A more complete alternative test can be
* configured using CFG_ALT_MEMTEST. The complete test loops until
* interrupted by ctrl-c or by a failure of one of the sub-tests.
*/
...

https://github.com/pepe2k/u-boot_mod/bl … /cmd_mem.c

Command must be set in config file for your platform, for example:

/*
* Select the more full-featured memory test
*/
#define CFG_ALT_MEMTEST

https://github.com/pepe2k/u-boot_mod/bl … gs/db12x.h

(Last edited by Dioptimizer on 13 Sep 2013, 23:26)

pepe2k wrote:

There is an option to test RAM in U-Boot - take a look at "mtest" command, but it also doesn't test entire RAM.

TNX,
I clear problem with buggy RAM of my MR3420 v2.1
Looking forward the y-Boot for SOC9341
smile

Tolyan wrote:

pepe2k
add support TL-WR743ND V2
foto - http://www.ex.ua/get/75673383
uboot = TL-WR741ND V4 http://www.ex.ua/get/75673104
flash with u-boot for updates via the web interface of the router- http://www.ex.ua/get/75673104

It's the same hardware like in WR740Nv4, so... there is already a support for it.

Tolyan wrote:

question.
You can change the way you connect through a U-Boot NetConsole?
Eg through telnet(TCP/IP). So much more practical.

Telnet is an application layer protocol. The NetConsole in U-Boot is not a protocol. It is simple encapsulation of the console in/out streams in UDP packets, not more. IMHO, adding a telnet server for U-Boot (using uIP stack) isn't a good idea - it won't worth the effort.