mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* how to copy barebox to flash?
@ 2013-09-25 16:13 Allen Kennedy Jr.
  2013-09-25 19:55 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Allen Kennedy Jr. @ 2013-09-25 16:13 UTC (permalink / raw)
  To: barebox

All,
  How do I copy barebox to flash?
I have a flash device setup:
     `---- imx_nand
          `---- nand0
               `---- 0x00000000-0x0fffffff: /dev/nand0
               `---- 0x00000000-0x0001ffff: /dev/bootstrapper
               `---- 0x00020000-0x0005ffff: /dev/barebox
               `---- 0x00060000-0x0009ffff: /dev/env_raw
               `---- 0x00100000-0x005fffff: /dev/kernel

I used JTAG to load barebox into memory at 0xa0000000

I just can't figure out how to copy it to flash... There is no DD command...
I tried this:
cp 0xa0000000 /dev/barebox 0x4000
got :
cp: target `0x4000' is not a directory

Seems barebox changed what 'cp' is from the old u-boot way.
and the nand command only does bad block handling...

barebox-update seems to be a candidate, but the docs don't make sense
on how to use.
Also I was thinking something like md > /dev/nand, but the output of
MD is user readable.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to copy barebox to flash?
  2013-09-25 16:13 how to copy barebox to flash? Allen Kennedy Jr.
@ 2013-09-25 19:55 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2013-09-25 19:55 UTC (permalink / raw)
  To: Allen Kennedy Jr.; +Cc: barebox

Hi Allen,

On Wed, Sep 25, 2013 at 11:13:47AM -0500, Allen Kennedy Jr. wrote:
> All,
>   How do I copy barebox to flash?
> I have a flash device setup:
>      `---- imx_nand
>           `---- nand0
>                `---- 0x00000000-0x0fffffff: /dev/nand0
>                `---- 0x00000000-0x0001ffff: /dev/bootstrapper
>                `---- 0x00020000-0x0005ffff: /dev/barebox
>                `---- 0x00060000-0x0009ffff: /dev/env_raw
>                `---- 0x00100000-0x005fffff: /dev/kernel
> 
> I used JTAG to load barebox into memory at 0xa0000000
> 
> I just can't figure out how to copy it to flash... There is no DD command...
> I tried this:
> cp 0xa0000000 /dev/barebox 0x4000
> got :
> cp: target `0x4000' is not a directory

What you're looking for is the memcpy command. It has options to copy
memory to/from files. You need something like:

memcpy -d /dev/barebox 0xa0000000 0 512k

replace 512k with whatever filesize is appropriate.

See 'help memcpy' or http://wiki.barebox.org/doku.php?id=commands:memcpy
for more information.

> 
> Seems barebox changed what 'cp' is from the old u-boot way.
> and the nand command only does bad block handling...
> 
> barebox-update seems to be a candidate, but the docs don't make sense
> on how to use.

Yes, that's the correct command, but it needs board support to be
implemented. With the correct board support the update would go down to:

barebox_update /mnt/tftp/barebox.bin

(It needs a file though, you would have to generate this with memcpy if
you want to use it together with a raw memory image.)

> Also I was thinking something like md > /dev/nand, but the output of
> MD is user readable.

Unfortunately the barebox shell is not capable of doing output redirection.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-25 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25 16:13 how to copy barebox to flash? Allen Kennedy Jr.
2013-09-25 19:55 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox