nitroshift wrote:My router's u-boot is corrupt, it doesn't load but I found a way to transfer it from a Linux machine, however, the tool needs a .kwb image, .bin errors out while transferring. Got a u-boot file for a different armada xp box (mirabox, taken from here: http://1wt.eu/articles/mirabox-vs-guruplug/ that gets transferred fine but doesn't boot (obviously).
I'm starting to understand the problem now. That URL is the key. The writeup is excellent, but there are a few critical bits missing (like how he identified the header of the DDR initialization image).
nitroshift wrote:PS. On the other hand, if you could dump your router's u-boot image in .kwb format, that would be really helpful in reviving my router.
Here's what's going on:
The uboot bin image taken from Mamba works, but it's not really a u-boot image. This image (and consequently, what is running on every WRT1900ac) is actually the output of the 'doimage' utility described in that writeup. This image is marvell specific binary with a DDR init module and uboot embedded inside of it.
The kwb format is neither here nor there. What needs to be done is to:
a) study the doimage code to understand the marvell binary format (so one can correctly extract the embedded images)
b) extract the ddr init image from our uboot bin
c) extract uboot image from our uboot bin
d) patch ddr init image to output on something other than the serial interface (this is described in the writeup)
e) build a recovery image using the extracted and patched images with doimage (doimage -T uart ...)
One can build the doimage tool by grabbing u-boot code. Just go ahead and grab a copy of uboot. Specific version doesn't seem to matter too much, but a marvell specific branch is here http://git.denx.de/?p=u-boot/u-boot-mar … ;a=summary. Then, look at the readup again, and follow the instructions for obtaining and applying that patch so you can get a copy of the doimage code. After doing that, go into the uboot checkout, run make menuconfig and make sure the "sandbox" arch is selected. Save changes. Run make tools. Doimage should be built now. At this point, you'll have to read through the doimage code to understand the format of our uboot image. Once you can confirm the init images contained within our uboot image, extract them and use doimage to build your recovery image. It should be noted that the ddr init will probably have to be patched to not output to the serial console, unfortunately, I do not know where the output should go.
I was able to find the start of the ddr image last night, unfortunately, I did not have a good enough understanding of the code to find the start and end positions of each init image.
Also, I have no reason to believe that Marvell would see this, but I just want to vent some frustrations in a public place.
WTF IS UP WITH YOUR CODE MARVELL? The only exception seems to be the linux kernel (because they won't let you commit trash). All the code of yours that I seem to find are:
1. crazy hackjobs
2. have 20kb of nonsensical license headers (either default to the most permissive one, or select the one that applies to the project)
3. contained within gigantic, braindead patches that seem to be inevitably rejected (with good reason) and are scattered across the internet.
Where is your GPL page? You could keep all your crazy patches there. I'm really starting to believe you're maintaining GPL compliance in the most antagonistic way possible.
Thank goodness for the free electrons people.