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

Menion wrote:

I see... thanks!
After your reply I went through the entire README and in the section "other" (I would suggest to better rename this section and write somewhere clearly that the server ip address is 192.168.1.2) I read:[...]

I will make Wiki and describe it better as soon as I have some free time, I have just returned from my holidays.

Menion wrote:

Could you please help me in how use the reset button? I mean: router off, power up while holding the reset button for the above duration, till I get the netconsole output?

Power up, then press and hold button (you can power up with button pressed, but that will also set default/safe clocks). There will be one LED blink during network initialization and just after that you will see all LEDs blinking ~once per second. Hold the button for at least 7 blinks (excluding one blink during network initialization) and then try to access U-Boot CLI over netconsole.

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

Thank you very much Pepe

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

Hi Pepe
I have tried, it works now
I have flashed the uboot embedded in the ready BB image tagged as 2014-11-19 release on a WDR3600 and a couple of TL841N V8.
Following refers to the WDR3600
The LED sequence is a little bit different, what I see is:

1) All led on for about one second, eccept the 5Ghz wireless
2) Power, star and 2.4Gh wireless led on
3) Led of the connected switch port turn on for one second
4) Led off
5) Start of operwrt/lede (if I press here the reset button I can enter failsafe)

If at stage 2 I press and keep pressed the reset button, something happens, the star and 2.4Ghz led blink at 1 sec for 6 time (7 including the first power on), the power and connected switch port turn on, I'm in uboot now, netconsole works, but httpd server must be started manually
I wanted to upgrade uboot, but I'm little doubious about the uboot_upg env script:

uboot_addr=0x9F000000
uboot_name=uboot.bin
uboot_size=0x10000
uboot_upg=if ping $serverip; then tftp $loadaddr $uboot_name && if itest.l $filesize == $uboot_size; then erase $uboot_addr +$filesize && cp.b $loadaddr $uboot_addr $filesize && echo OK!; else echo ERROR! Wrong file size!; fi; else ERROR! Server not reachable!; fi
firmware_addr=0x9F020000

The expected uboot size is set to 64kb, but the images on your server are of 123kb. I know the in the image, only the first 64kb are occupied by uboot, then there are the writable env variables and the last 5kb of the 128kb are the ART sector, but with this 123kb image I guess the script will fail, right?

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

Menion wrote:

I have flashed the uboot embedded in the ready BB image tagged as 2014-11-19 release on a WDR3600 and a couple of TL841N V8.[...]

It's really, really old version, without writable environment support and 64 KB image limit on TP-Link devices.

Menion wrote:

Following refers to the WDR3600
The LED sequence is a little bit different, what I see is:[...]

That's normal, I don't control LEDs connected directly to external Ethernet switch chip on WDR3600 and WDR4300.

Menion wrote:

The expected uboot size is set to 64kb, but the images on your server are of 123kb. I know the in the image, only the first 64kb are occupied by uboot, then there are the writable env variables and the last 5kb of the 128kb are the ART sector, but with this 123kb image I guess the script will fail, right?

If you still have there my BB image, you can upload new U-Boot image and use the same script.

But... there is some bug with clocking on AR9344 (https://github.com/pepe2k/u-boot_mod/issues/128), so it would be better to wait for fix as it hurts main time clock on the router.

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

Hi Pepe
Ok I'll wait. So I have to skip the uboot_upg script in this uboot version, right?
I perfectly understand the procedure to manually update uboot within uboot itself, so dump 128kb (0x20000) from flash, offset 0x0, to ram (normally 0x80800000), tftpboot the new uboot image to the same ram location, in order to merge the last 5kb of the old flash content with the new uboot, and then erase the 128kb of flash and write the, merged, 128kb of data from ram to flash.
But just a question: is it working with this old uboot version? Or some more adaptation are needed?
Bye

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

Menion wrote:

So I have to skip the uboot_upg script in this uboot version, right?

Yes, it won't allow you to use image bigger than 64 KB.

Menion wrote:

I perfectly understand the procedure to manually update uboot within uboot itself, so dump 128kb (0x20000) from flash, offset 0x0, to ram (normally 0x80800000), tftpboot the new uboot image to the same ram location, in order to merge the last 5kb of the old flash content with the new uboot, and then erase the 128kb of flash and write the, merged, 128kb of data from ram to flash.

Exactly!

Menion wrote:

But just a question: is it working with this old uboot version? Or some more adaptation are needed?

Yes, it will work.

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

Last question: since it will involve several steps, is it safe to do so in netconsole? I mean, safe as it can be upgrade the bootloader, I just want to avoid that some operation (erase, flash) could interfere with the networking

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

Menion wrote:

Last question: since it will involve several steps, is it safe to do so in netconsole? I mean, safe as it can be upgrade the bootloader, I just want to avoid that some operation (erase, flash) could interfere with the networking

Honestly, I haven't tested this approach, but I don't see any reason why it might cause this kind of problems.

609 (edited by Deoptim 2017-04-09 20:19:37)

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

New Datasheet for QCA9558:
https://github.com/Deoptim/atheros/raw/ … ermark.pdf

Also new datasheet for QCA9531 has version 2.0:
https://github.com/Deoptim/atheros/raw/ … ermark.pdf

610 (edited by AnteLo 2017-06-03 07:37:47)

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

http://i64.tinypic.com/j0csjp.png
I get this when I try to install it on my WR842N v3 router
Did I done something wrong???

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

https://forum.openwrt.org/viewtopic.php?id=33205  That guy modded u-boot 1.3.0 to make it work with atheros SOCs. I wonder if it could be done to QCA SOC routers as well, I understand newest u-boot takes too much space on flash, but 1.3.0 would probably fit.

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

user5077 wrote:

https://forum.openwrt.org/viewtopic.php?id=33205  That guy modded u-boot 1.3.0 to make it work with atheros SOCs. I wonder if it could be done to QCA SOC routers as well, I understand newest u-boot takes too much space on flash, but 1.3.0 would probably fit.

Basic support for QC/A WiSoC is already in mainline U-Boot: http://git.denx.de/?p=u-boot.git;a=tree … d3;hb=HEAD

613 (edited by jongerenchaos Yesterday 13:17:46)

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

I installed the version u-boot_mod__tp-link_tl-wdr3600__20170510__git_master-0c183583.bin on my TP-link router.

After this i'll try to install/test a SOPHOS uimage version (with the same hardware) to this device.
File info:
AP15.uimage: u-boot legacy uImage, MIPS OpenWrt Linux-3.18.11, Linux/MIPS, OS Kernel Image (gzip), 6880877 bytes, Tue Feb 21 11:46:07 2017, Load Address: 0x80060000, Entry Point: 0x80060000, Header CRC: 0x78E832C4, Data CRC: 0x3DD99FCA

When i try to boot this image i get:
u-boot> bootm
Booting image from 0x80800000...

   Image name:    MIPS OpenWrt Linux-3.18.11
   Build date:    2017-02-21 09:40:42 UTC
   Architecture:  MIPS
   OS/image type: Linux Kernel
   Compression:   unknown
   Data size:     6.8 MB (7132205 bytes)
   Load address:  0x80060000
   Entry point:   0x80060000

   Header CRC...  OK!
   Data CRC...    skipped

Stopping network... OK!
## Error: unsupported compression type 'unknown'!

So i think there is no gzip compiled in the uboot source. Is that this issue and can you resolve this?

614

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

jongerenchaos wrote:

I installed the version u-boot_mod__tp-link_tl-wdr3600__20170510__git_master-0c183583.bin on my TP-link router.

After this i'll try to install/test a SOPHOS uimage version (with the same hardware) to this device.
File info:
AP15.uimage: u-boot legacy uImage, MIPS OpenWrt Linux-3.18.11, Linux/MIPS, OS Kernel Image (gzip), 6880877 bytes, Tue Feb 21 11:46:07 2017, Load Address: 0x80060000, Entry Point: 0x80060000, Header CRC: 0x78E832C4, Data CRC: 0x3DD99FCA

What is SOPHOS?

jongerenchaos wrote:

So i think there is no gzip compiled in the uboot source.

Exactly.

jongerenchaos wrote:

Is that this issue and can you resolve this?

https://github.com/pepe2k/u-boot_mod/issues