[SmilePlug] U-Boot erase from NAND - Reflashing from UART

Discussion about U-Boot and the kernel.

[SmilePlug] U-Boot erase from NAND - Reflashing from UART

Postby user037 » Fri Mar 27, 2015 7:18 pm

Hello,

I unfortunately erased the NAND region containing the U-Boot code of my SmilePlug. Right now, when I'm tying to boot my device I have the following sequence :
$this->bbcode_second_pass_code('', 'BootROM 1.08
Booting from NAND flash
BootROM: Bad header at offset 00100000
BootROM: Bad header at offset 00104000
BootROM: Bad header at offset 00108000
BootROM: Bad header at offset 0010C000
...')

I know that SmilePlug architecture is quiet similar to Mirabox and I read on two very interesting blog (http://1wt.eu/articles/mirabox-vs-guruplug/ and https://github.com/psanford/mirabox) that it is possible to reflash an U-Boot image directly from UART.

Thanks to these blogs, I learnt that to it is possible to upload (through uart) an U-Boot image and boot on it. To do so, you have to send some magic bytes during the boot process then send a specific bootloader image. Some guys from free-electrons.com developed a tool called kwboot to do so. basically you just have to give it your U-boot image and will do the magic :
$this->bbcode_second_pass_code('', './kwboot -b u-boot-uart1.bin -t /dev/ttyUSB0')

However, you could not send directly a standard U-Boot image because the first byte of the image indicates the boot device (which is nand by default). We couldn't change it easily due to an image checksum. Moreover, as we are trying to upload a more than 64K byte image we need to deal with the "DDR3 Training Sequence" which need to be adjusted in order to receive our data.

Once again the guys from free-electrons.com came up with a wonderful tool called kwbimage which is able to manage "DDR3 Training Sequence" and compute valid checksum for a bootloader image. Unfortunately, this tool has been design for their bootloader (Barebox) and despite my attempt I wasn't able to create a valid U-Boot image.

As you can see, I'm pretty stuck with my bricked device...

On the SmilePlug webpage of archlinuxarm.org we can download a standard U-Boot image (http://archlinuxarm.org/builder/mira/uboot.bin). I tried kwbimage to add the "DDR3 Training Sequence" and manage checksum but my SmilePlug still refuse to boot an the image (it send the image on the ramdisk, pass the DD3 sequence, and then just stop).

Do you have any idea how I could solve my problem and get a booting U-Boot image ?

I thought about recompiling an U-Boot image in order to patch it, but I couldn't find the source code of the archlinuxarm uboot.bin. I tried the u-boot official repository but I doesn't seems to support Armada 370 SoC ... Do you have any idea how to recompile uboot for my device ?


Thank you so much for your help !
user037
 
Posts: 1
Joined: Fri Mar 27, 2015 6:36 pm

Re: [SmilePlug] U-Boot erase from NAND - Reflashing from UAR

Postby lharmon » Tue Apr 07, 2015 3:32 pm

Been there, done that.

I also bricked a SMILE plug. I had to send it back to Global scale and they re-soldered on a new nand flash. They did not have a method of recovery!!

Subsequently, after entering into an agreement with GTI and gaining access to Marvell's "extranet" I was able to recover a corrupted nand flash using Marvell's Xtreme debugger (XDB) and their Blackwell jtag debugger.

The basic idea is to get u-boot (usually a different / UART version) running out of ram then use it to save the normal uboot image in Nand flash. In my case I read the normal uboot file from a USB drive.

Unfortunately I was never able to get the UART updater working.
lharmon
 
Posts: 46
Joined: Fri Apr 19, 2013 7:30 pm


Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 4 guests