Getting help on u-boot command usage

     To many, U-BOOT is just a secondary bootloader, a means of loading kernel and handing over the execution to it.
In a way it is correct, the main function of U-BOOT (Universal BOOTloader) is to bring the kernel into RAM and hand over the execution to it. But what many of us don't know is that UBOOT is capable of many more things than just loading and executing the kernel.

     U-BOOT is an open source, multi platform bootloader. U-BOOT supports interactive commands, environment variables, command scripting and booting from external media.

      What U-BOOT actually does is that it configures different hardware blocks on the board and brings them out of reset into a sane state. It can load  and start an OS automatically (auto-boot) or, alternatively, it allows the user to run commands to start the OS. The subset of default commands that are part of u-boot also provide capability to the user to perform memory, network, flash operations, and more prior to OS boot-up.

      Following is a snap of the commands available on the U-BOOT prompt which I have on my custom board :

u-boot # ?
?       - alias for 'help'
askenv  - get environment variables from stdin
autoscr - run script from memory
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bringuptest
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - invoke DHCP client to obtain IP/boot params
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor version

NOTE: You can get the same list of commands by typing "help" instead of "?" on the u-boot prompt.

      This is just an example of the commands. The u-boot u have may have more/less than these commands. This generally depends on what functions you may need to perform on the u-boot prompt or how compact u-boot image u may need due to the memory constraints on your flash memory.

     To get detailed information about usage of any command and wat it does just type the following on the u-boot prompt :

u-boot # help <command_name>
eg. :-

u-boot # help cp
cp [.b, .w, .l] source target count
    - copy memory

u-boot # help nand
nand info                  - show available NAND devices
nand device [dev]     - show or set current device
nand read[.jffs2]     - addr off|partition size
nand write[.jffs2]    - addr off|partiton size - read/write `size' bytes starting
    at offset `off' to/from memory address `addr'
nand erase [clean] [off size] - erase `size' bytes from
    offset `off' (entire device if not specified)
nand bad - show bad blocks
nand dump[.oob] off - dump page
nand scrub - really clean NAND erasing bad blocks (UNSAFE)
nand markbad off - mark bad block at offset (UNSAFE)
nand biterr off - make a bit error at offset (UNSAFE)
nand lock [tight] [status] - bring nand to lock state or display locked pages
nand unlock [offset] [size] - unlock section

      This way you can check out every command that your u-boot offers and try different things on u-boot.

Happy ubooting ...

No comments:

Post a Comment