This manual is a Quick Reference for U-Boot commands
on the Lite5200B Development Platform. Each
command overview gives a description, directions for
usage, and an execution example.
A list of U-Boot commands can be accessed while in the
U-Boot prompt. Type help for a complete listing of
available commands for the development platform.
This manual is excerpted from the Denx UBOOT manual as described below. Primarily it has been made
specific to the Lite5200B board and has been reformatted. It is subject to GPL copyright restrictions as
described below and at the URL given below. You have the freedom to distribute copies of this document
in any format or to create a derivative work of it and distribute it provided that you:
•Distribute this document or the derivative work at no charge at all. It is not permitted to sell this
document or the derivative work or to include it into any package or distribution that is not freely
available to everybody.
•Send your derivative work (in the most suitable format such as sgml) to the author.
•License the derivative work with this same license or use GPL.
•Include a copyright notice and at least a pointer to the license used.
•Give due credit to previous authors and major contributors.
Use the information in this document at your own risk. Freescale disavows any potential liability for the
contents of this document. Use of the concepts, examples, and/or other content of this document is entirely
at your own risk. All copyrights are owned by their owners, unless specifically noted otherwise. Use of a
term in this document should not be regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as endorsements.
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor2
List of Commands
4List of Commands
4.1AUTOSCR
Run script from memory:
autoscr [addr] - run script starting at addr - A valid autoscr header must be present
The autoscr command allows “shell” scripts to run under U-Boot. To create a U-Boot script image,
commands are written to a text file. Then the mkimage tool [of a suitable compiler] is used to convert this
text file into a U-Boot image using the image type script. This image can be loaded like any other image
file. Autoscr runs the commands in this image.
base - print address offset for memory commands
base off - set address offset for memory commands to 'off'
Use the base command (short: ba) to print or set a "base address" used as an address offset for all memory
commands; the default value of the base address is 0, so all addresses you enter are used unmodified.
However, when you repeatedly have to access a certain memory region (like the internal memory of some
embedded PowerPC processors) it can be very convenient to set the base address to the start of this area
and then use only the offsets:
The bdinfo command (short: bdi) prints the information that U-Boot passes about the board such as
memory addresses and sizes, clock frequencies, MAC address, etc. This type of information is generally
passed to the Linux kernel.
bmp info <imageAddr> - display image info
bmp display <imageAddr> [x y] - display image at x,y
4.5BOOTD
Boot default, i.e., run 'bootcmd'.
The bootd (short: boot) executes the default boot command, i.e. what happens when you don't interrupt
the initial countdown. This is a synonym for the run bootcmd command.
4.6BOOTM
Boot application image from memory:
bootm [addr [arg ...]] - boot application image stored in memory passing arguments 'arg
...'; when booting a Linux kernel,‘arg' can be the address of an initrd image
The bootm command is used to start operating system images. From the image header it gets information
about the type of the operating system, the file compression method used (if any), the load and entry point
addresses, etc. The command will then load the image to the required memory address, uncompressing it
on the fly if necessary. Depending on the OS it will pass the required boot arguments and start the OS at
it's entry point. The first argument to bootm is the memory address (in RAM, ROM or flash memory)
where the image is stored, followed by optional arguments that depend on the OS.
For Linux, exactly one optional argument can be passed. If it is present, it is interpreted as the start address
of a initrd ramdisk image (in RAM, ROM or flash memory). In this case the bootm command consists of
three steps: first the Linux kernel image is uncompressed and copied into RAM, then the ramdisk image
is loaded to RAM, and finally control is passed to the Linux kernel, passing information about the location
and size of the ramdisk image.
To boot a Linux kernel image without a initrd ramdisk image, the following command can be used:
=> bootm $(kernel_addr)
If a ramdisk image is used, type:
=> bootm $(kernel_addr) $(ramdisk_addr)
Both examples imply that the variables used are set to correct addresses for a kernel and a initrd ramdisk
image.
When booting images that have been loaded to RAM (for instance using TFTP download) you have to be
careful that the locations where the (compressed) images were stored do not overlap with the memory
needed to load the uncompressed kernel. For instance, if you load a ramdisk image at a location in low
memory, it may be overwritten when the Linux kernel gets loaded. This will cause undefined system
crashes.
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor5
List of Commands
4.7BOOTP
Boot image via network using bootp/tftp protocol:
bootp [loadAddress] [bootfilename]
4.8CMP
Memory compare:
cmp [.b, .w, .l] addr1 addr2 (count)
The cmp command tests of the contents of two memory areas and determines whether or not the contents
of the two memory areas are identical or not. The command will either test the whole area as specified by
the 3rd (count) argument or stop at the first difference if the count argument is not specified.
The following example demonstrates comparing the memory ranges 0x100000 - 0x10002F to 0x400000 0x40002F. The contents of the two memory ranges are shown below.
word at 0x00100004 (0x50ff4342) != word at 0x40000004 (0x50504342)
Total of 1 word were the same
=>
Like most memory commands the cmp command accesses the memory in different sizes: 32 bit (long
word), 16 bit (word) or 8 bit (byte) data. If invoked just as cmp the default size (32 bit or long words) is
used; the same can be selected explicitly by typing cmp.l instead. To access memory as 16 bit (word data),
use the variant cmp.w; to access memory as 8 bit (byte data) use cmp.b. Please note that the count
argument specifies the number of data items to process, i.e. the number of long words or words or bytes to
compare.
4.9CONINFO
Print console devices and information.
The coninfo command (short: conin) displays information about the available console I/O devices.
=> conin
List of available devices:
serial 80000003 SIO stdin stdout stderr
=>
The output contains the device name, flags, and the current usage. For example, the output “serial
80000003 SIO stdin stdout stderr” means that the serial device is a system device (flag 'S') which
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor6
List of Commands
provides input (flag 'I') and output (flag 'O') functionality and is currently assigned to the 3 standard I/O
streams stdin, stdout, and stderr.
4.10CP
Memory copy:
cp [.b, .w, .l] source target count
- copy memory
The memory copy command copies data in memory, starting at the “source” address to the “target”
address. The “count” field specifies then number of bytes, words or long words to be copied depending
upon the extension field of the cp command. If a “.b” extension is used, the count field specifies the
number of bytes. Likewise, if a “.w” or “.l” extension is used, the count field respectively specifies the
number of words or long words.
The cp command is used as a FLASH programming command.
The cp command can copy data from one memory element to another memory element. The source can
be RAM/ROM/FLASH/EPROM or any other type of memory. The destination or target memory is usually
RAM; however the target memory can also be FLASH or other type of programmable, non-volatile
memory. If the destination for the data is FLASH or other type of programmable, non-volatile memory,
the U-Boot monitor program will determine the type of memory used as the destination and choose the
appropriate programming algorithm.
The following is a typical sequence to program FLASH memory on the Media5200 Board using U-Boot.