Freescale LITE5200BUBPG User Guide

Freescale Semiconductor
Quick Reference
U-Boot Quick Reference
for the Lite5200B Development Platform
by: Jonathan Wang
Infotainment, Multimedia, and Telematics Division
LITE5200BUBPG
Rev. 0, 5/2006

1 Overview

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.
Contents
1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Attribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 List of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
© Freescale Semiconductor, Inc., 2006. All rights reserved.
Attribution

2 Attribution

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.
This document is derived from the DENX™ U-Boot User Manuals. (Copyright © 2001-2006 by Wolfgang Denk, DENX Software Engineering.)
The manual can be found at:
http://www.denx.de/wiki/DULG/Manual

3Disclaimer

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

4 List of Commands

4.1 AUTOSCR

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.
For example, consider the following text file:
echo echo Network Configuration: echo ---------------------­echo Target: printenv ipaddr hostname echo echo Server: printenv serverip rootpath echo
Convert the text file into a U-Boot script image using the mkimage command as follows:
bash$ mkimage -A ppc -O linux -T script -C none -a 0 -e 0 \ > -n "autoscr example script" \ > -d /tftpboot/TQM860L/example.script /tftpboot/TQM860L/example.img Image Name: autoscr example script Created: Mon Apr 8 01:15:02 2002 Image Type: PowerPC Linux Script (uncompressed) Data Size: 157 Bytes = 0.15 kB = 0.00 MB Load Address: 0x00000000 Entry Point: 0x00000000 Contents: Image 0: 149 Bytes = 0 kB = 0 MB
Load and execute this script image in U-Boot:
=> tftp 100000 /tftpboot/TQM860L/example.img
ARP broadcast 1 TFTP from server 10.0.0.2; our IP address is 10.0.0.99 Filename '/tftpboot/TQM860L/example.img'. Load address: 0x100000 Loading: # done Bytes transferred = 221 (dd hex)
=> autoscr 100000
## Executing script at 00100000
Network Configuration:
---------------------­Target:
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor 3
List of Commands
ipaddr=10.0.0.99 hostname=tqm
Server: serverip=10.0.0.2 rootpath=/opt/hardhat/devkit/ppc/8xx/target

4.2 BASE

Print or set address offset:
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:
=> base Base Address: 0x00000000 => md 0 c
00000000: feffffff 00000000 7cbd2b78 7cdc3378 ........|.+x|.3x
00000010: 3cfb3b78 3b000000 7c0002e4 39000000 <.;x;...|...9... 00000020: 7d1043a6 3d000400 7918c3a6 3d00c000 }.C.=...y...=... => base 40000000 Base Address: 0x40000000 => md 0 c 40000000: 27051956 50504342 6f6f7420 312e312e '..VPPCBoot 1.1. 40000010: 3520284d 61722032 31203230 3032202d 5 (Mar 21 2002 -
40000020: 2031393a 35353a30 34290000 00000000 19:55:04)......
=>

4.3 BDINFO

Print board info structure:
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.
=> bdinfo memstart = 0x00000000 memsize = 0x04000000 flashstart = 0x40000000 flashsize = 0x00800000 flashoffset = 0x00030000 sramstart = 0x00000000 sramsize = 0x00000000 immr_base = 0xFFF00000 bootflags = 0x00000001 intfreq = 50 MHz busfreq = 50 MHz ethaddr = 00:D0:93:00:28:81 IP addr = 0.0.0.0 baudrate = 115200 bps =>
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor4
List of Commands

4.4 BMP

Manipulate bmp image data:
bmp info <imageAddr> - display image info bmp display <imageAddr> [x y] - display image at x,y

4.5 BOOTD

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.6 BOOTM

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 Semiconductor 5
List of Commands

4.7 BOOTP

Boot image via network using bootp/tftp protocol:
bootp [loadAddress] [bootfilename]

4.8 CMP

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.
00100000: 27051956 50ff4342 6f6f7420 312e312e '..VP.CBoot 1.1. 00100010: 3520284d 61722032 31203230 3032202d 5 (Mar 21 2002 -
00100020: 2031393a 35353a30 34290000 00000000 19:55:04)......
40000000: 27051956 50504342 6f6f7420 312e312e '..VPPCBoot 1.1. 40000010: 3520284d 61722032 31203230 3032202d 5 (Mar 21 2002 -
40000020: 2031393a 35353a30 34290000 00000000 19:55:04)......
=> cmp 100000 40000000 400
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.9 CONINFO

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.10 CP

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.
setenv ldlx tftp 1000000 /tftpboot/uImage setenv ldfs tftp 1000000 / tftpboot/fsimg setenv uplx run ldlx \; erase ffe00000 ffefffff \; cp.b 1000000 ffe00000 \$\(filesize\) setenv upfs run ldfs \; erase ff05000 ffdfffff \; cp.b 1000000 ffe00000 \$\(filesize\) setenv bootdelay 2 saveenv

4.11 CRC32

Checksum calculation:
5crc32 address count [addr]
- compute CRC32 checksum [save at addr] => crc 100004 3FC CRC32 for 00100004 ... 001003ff ==> d433b05b =>
The crc32 command (short: crc) can be used to calculate a CRC32 checksum over a range of memory:
=> crc 100004 3FC CRC32 for 00100004 ... 001003ff ==> d433b05b =>
When used with 3 arguments, the command stores the calculated checksum at the given address:
=> crc 100004 3FC 100000 CRC32 for 00100004 ... 001003ff ==> d433b05b => md 100000 4
00100000: d433b05b ec3827e4 3cb0bacf 00093cf5 .3.[.8'.<.....<.
=>
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor 7
List of Commands
As you can see, the CRC32 checksum was not only printed, but also stored at address 0x100000.

4.12 DCACHE

Enable or disable data cache:
dcache [on, off]
- enable or disable data (writethrough) cache

4.13 DHCP

Invoke dhcp client to obtain ip/boot params.

4.14 DISKBOOT

Boot from ide device.
diskboot loadAddr dev:part

4.15 ECHO

Echo args to console:
echo [args..] - echo args to console; \c suppresses newline
The echo command echoes the arguments to the console:
=> echo The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog. =>

4.16 EEPROM

Eeprom sub-system:
eeprom read addr off cnt eeprom write addr off cnt
- read/write `cnt' bytes at EEPROM offset `off

4.17 ERASE

Erase flash memory:
reset - No help available.
erase start end
- erase FLASH from addr 'start' to addr 'end' erase N:SF[-SL]
- erase sectors SF-SL in FLASH bank # N erase bank N
- erase FLASH bank # N erase all
- erase all FLASH banks
U-Boot Quick Reference, Rev. 0
Freescale Semiconductor8
Loading...
+ 16 hidden pages