• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Dreamplug source command  (Read 1619 times)
Full Member

Karma: 8
Posts: 167

View Profile WWW
« on: July 10, 2011, 02:40:39 AM »

The Dreamplug u-Boot has support for the "source" command.
This command executes a set of u-boot commands that are in memory (somewhere). Coupled with the tftp, loadb or loady commands, the source command provides much of the missing openocd functionality.
With the source command you can set up your u-boot environment easily and reliably or you can use 'source' to initate test boot sequences without having to rewrite the SPI flash.
'source' seems to be a better way of setting the environment than 'fw_setenv' or pasting commands into a console.

The only thing you cannot do is reflash a completely bricked (no u-Boot) Dreamplug.

As a by-product of 'source' I tested out the loadb and loady commands and they both work well as a means to load u-Boot commands over the serial console. It is worth noting that kermit takes a while to load uboot.kwb over the console.

To make loadable commands they need to be "mkimage"d e.g.
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d myscript.infile -n 'script comment' myscript.scr

If we assume that the mkimage generated file is available to your TFTP server, it can be loaded and executed as:
Marvell >> tftp 0x100000 myscript.scr; source 0x100000

or you can use loadb or loady in place of tftp.

This is a handy way to test boot sequences  or provide auto updates of the u-Boot environment.

e.g. sample u-Boot
setenv tftpsrc 'tftp 0x100000 myscript.scr'
setenv runtfptsrc 'source 0x100000'

setenv bootcmd 'run tftpsrc runftpsrc; run x_bootcmd'

So, if the script exists (and the tftp server is running) the script runs. The script in turn can setup x_bootcmd to do whatever you need (or x_bootcmd just does what is already defined).


Pages: [1]
Jump to: