[PATCH v3 0/4] mvebu: Add network support for Armada 370/XP

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Nov 11 12:35:59 PST 2014


Hi Ezequiel,

On Tue, Nov 11, 2014 at 11:25:40AM -0300, Ezequiel Garcia wrote:
> On 11/11/2014 06:06 AM, Uwe Kleine-König wrote:
> >>>
> >>> Do you have a command line for me? I used
> >>>
> >>> 	scripts/kwboot -b images/barebox-netgear-rn104-uart.img /dev/ttyUSB0
> >>>
> >>> which took much longer than I expected (didn't time it, but I'd say in
> >>> the several minutes range). And I didn't know what to do then. Ctrl-C
> >>> and then connecting microcom was wrong. Adding -t to the command line
> >>> above, too.
> > Any hints on how kwboot is used? It loads the binary into RAM and runs
> > it from there, right? I timed my above command and it took 38m28.225s
> > for my image (341304 bytes).
> > 
> 
> This is how I use kwboot:
> 
> 1. Boot your board (with stock U-Boot and Linux) and extract the bootloader.
>    According to my notes, I just grabbed a couple megabytes:
> 
>    $ dd if=/dev/mtd0 of=/mtd0.dump bs=1M count=2
> 
>    I guess you can grab the entire bootloader partition (if you have one).
> 
> 2. Run kwbimage tool and dump the output to the appropriate board directory:
> 
>   $ ./scripts/kwbimage -x -i /srv/nfs/mtd0.dump -o arch/arm/boards/plathome-openblocks-ax3/
> 
>   Fix the produced kwbimage.cfg to boot from UART (actually, I think it's not needed):
> 
>   diff --git a/arch/arm/boards/plathome-openblocks-ax3/kwbimage.cfg b/arch/arm/boards/plathome-openblocks-ax3/kwbimage.cfg
>   index 219c2ec..fd6c0df 100644
>   --- a/arch/arm/boards/plathome-openblocks-ax3/kwbimage.cfg
>   +++ b/arch/arm/boards/plathome-openblocks-ax3/kwbimage.cfg
>   @@ -1,5 +1,5 @@
>    VERSION 1
>   -BOOT_FROM spi
>   +BOOT_FROM uart
>    DESTADDR 00600000
>    EXECADDR 006b0000
>    NAND_BLKSZ 00000000
My kwbimage looks similar:

	VERSION 1
	BOOT_FROM nand
	DESTADDR 00600000
	EXECADDR 006a0000
	NAND_BLKSZ 00020000
	NAND_BADBLK_LOCATION 01
	BINARY arch/arm/boards/netgear-rn104/binary.0 0000005b 00000068
	PAYLOAD ./payload

The other kwbimage.cfg files don't have a "PAYLOAD" line though, but if
I read the source correctly this shouldn't a problem.

BTW, is this binary.0 expected to be located in the source or the build
directory for oot-building? I would expect to provide it in the source
tree, but it's not picked up from there.
 
> 3. Make your barebox
> 
>   $ make
> 
> 4. Run kwboot and have fun!
> 
>   $ ./scripts/kwboot -b images/barebox-plathome-openblocks-ax3.img -t -B 115200 /dev/ttyUSB0
With the patch I just sent, kwboot doesn't take 30+ minutes anymore, but
dies when an error occurs. (Unfortunately this happens 100% reproducibly
with two different USB-to-RS232 adapters.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the barebox mailing list