uboot readme 3

Monitor Commands - Overview:
============================
命令
go      - start application at address 'addr'
run     - run commands in an environment variable
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
tftpboot- boot image via network using TFTP protocol
               and env variables "ipaddr" and "serverip"
               (and eventually "gatewayip")

rarpboot- boot image via network using RARP/TFTP protocol
diskboot- boot from IDE devicebootd   - boot default, i.e., run 'bootcmd'
loads   - load S-Record file over serial line
loadb   - load binary file over serial line (kermit mode)
md      - memory display
mm      - memory modify (auto-incrementing)
nm      - memory modify (constant address)
mw      - memory write (fill)
cp      - memory copy
cmp     - memory compare
crc32   - checksum calculation
imd     - i2c memory display
imm     - i2c memory modify (auto-incrementing)
inm     - i2c memory modify (constant address)
imw     - i2c memory write (fill)
icrc32  - i2c checksum calculation
iprobe  - probe to discover valid I2C chip addresses
iloop   - infinite loop on address range
isdram  - print SDRAM configuration information
sspi    - SPI utility commands
base    - print or set address offset
printenv- print environment variables
setenv  - set environment variables

saveenv - save environment variables to persistent storage
protect - enable or disable FLASH write protection
erase   - erase FLASH memory
flinfo  - print FLASH memory information
bdinfo  - print Board Info structure
iminfo  - print header information for application image
coninfo - print console devices and informations
ide     - IDE sub-system
loop    - infinite loop on address range
loopw   - infinite write loop on address range
mtest   - simple RAM test
icache  - enable or disable instruction cache
dcache  - enable or disable data cache
reset   - Perform RESET of the CPU
echo    - echo args to console
version - print monitor version
help    - print online help
?       - alias for 'help'

 

Monitor Commands - Detailed Description:
========================================
命令描述

For now: just type "help <command>".

Environment Variables:
======================

U-Boot supports user configuration using Environment Variables which
can be made persistent by saving to Flash memory.

Environment Variables are set using "setenv", printed using
"printenv", and saved to Flash using "saveenv". Using "setenv"
without a value can be used to delete a variable from the
environment. As long as you don't save the environment you are
working with an in-memory copy. In case the Flash area containing the
environment is erased by accident, a default environment is provided.

Some configuration options can be set using Environment Variables:

  baudrate      - see CONFIG_BAUDRATE
  bootdelay     - see CONFIG_BOOTDELAY
  bootcmd       - see CONFIG_BOOTCOMMAND

  bootargs      - Boot arguments when booting an RTOS image
  bootfile      - Name of the image to load with TFTP
  autoload      - if set to "no" (any string beginning with 'n'),
                  "bootp" will just load perform a lookup of the
                  configuration from the BOOTP server, but not try to
                  load any image using TFTP
  autostart     - if set to "yes", an image loaded using the "bootp",
                  "rarpboot", "tftpboot" or "diskboot" commands will
                  be automatically started (by internally calling
                  "bootm")
                  If set to "no", a standalone image passed to the
                  "bootm" command will be copied to the load address
                  (and eventually uncompressed), but NOT be started.
                  This can be used to load and uncompress arbitrary
                  data.
  i2cfast       - (PPC405GP|PPC405EP only)
                  if set to 'y' configures Linux I2C driver for fast

ipaddr        - IP address; needed for tftpboot command

  loadaddr      - Default load address for commands like "bootp",
                  "rarpboot", "tftpboot", "loadb" or "diskboot"

  loads_echo    - see CONFIG_LOADS_ECHO

  serverip      - TFTP server IP address; needed for tftpboot command

  bootretry     - see CONFIG_BOOT_RETRY_TIME

  bootdelaykey  - see CONFIG_AUTOBOOT_DELAY_STR

  bootstopkey   - see CONFIG_AUTOBOOT_STOP_STR

  ethprime      - When CONFIG_NET_MULTI is enabled controls which
                  interface is used first.

  ethact        - When CONFIG_NET_MULTI is enabled controls which
                  interface is currently active. For example you
                  can do the following
netretry     - When set to "no" each network operation will
                  either succeed or fail without retrying.
                  When set to "once" the network operation will
                  fail when all the available network interfaces
                  are tried once without success.
                  Useful on scripts which control the retry operation
                  themselves.

  tftpsrcport   - If this is set, the value is used for TFTP's
                  UDP source port.

  tftpdstport   - If this is set, the value is used for TFTP's UDP
                  destination port instead of the Well Know Port 69.

   vlan         - When set to a value < 4095 the traffic over
                  ethernet is encapsulated/received over 802.1q
                  VLAN tagged frames.

 

Command Line Parsing:
=====================
命令行解析
There are two different command line parsers available with U-Boot:
the old "simple" one, and the much more powerful "hush" shell:

Old, simple command line parser:
--------------------------------

- supports environment variables (through setenv / saveenv commands)
- several commands on one line, separated by ';'
- variable substitution using "... ${name} ..." syntax
- special characters ('$', ';') can be escaped by prefixing with '\',
  for example:
        setenv bootcmd bootm \${address}
- You can also escape text by enclosing in single apostrophes, for example:
        setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'

 

Hush shell:
-----------
- similar to Bourne shell, with control structures like
  if...then...else...fi, for...do...done; while...do...done,
  until...do...done, ...
- supports environment ("global") variables (through setenv / saveenv
  commands) and local shell variables (through standard shell syntax
  "name=value"); only environment variables can be used with "run"
  command

 

Image Formats:
==============
镜像格式
The "boot" commands of this monitor operate on "image" files which
can be basicly anything, preceeded by a special header; see the
definitions in include/image.h for details; basicly, the header
defines the following image properties:

* Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
  4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
  LynxOS, pSOS, QNX, RTEMS, ARTOS;
  Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
* Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
  IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
  Currently supported: ARM, AVR32, Intel x86, MIPS, NIOS, PowerPC).
* Compression Type (uncompressed, gzip, bzip2)
* Load Address
* Entry Point
* Image Name
* Image Timestamp

The header is marked by a special Magic Number, and both the header
and the data portions of the image are secured against corruption by
CRC32 checksums.

 

Linux Support:
==============
Although U-Boot should support any OS or standalone application
easily, the main focus has always been on Linux during the design of
U-Boot.

U-Boot includes many features that so far have been part of some
special "boot loader" code within the Linux kernel. Also, any
"initrd" images to be used are no longer part of one big Linux image;
instead, kernel and "initrd" are separate images. This implementation
serves several purposes:

- the same features can be used for other OS or standalone
  applications (for instance: using compressed images to reduce the
  Flash memory footprint)

- it becomes much easier to port new Linux kernel versions because
  lots of low-level, hardware dependent stuff are done by U-Boot

- the same Linux kernel image can now be used with different "initrd"
  images; of course this also means that different kernel images can
  be run with the same "initrd". This makes testing easier (you don't
  have to build a new "zImage.initrd" Linux image when you just
  change a file in your "initrd"). Also, a field-upgrade of the
  software is easier now.

 

Porting Linux to U-Boot based systems:
---------------------------------------
U-Boot cannot save you from doing all the necessary modifications to
configure the Linux device drivers for use with your target hardware
(no, we don't intend to provide a full virtual machine interface to
Linux :-).

But now you can ignore ALL boot loader code (in arch/ppc/mbxboot).
Just make sure your machine specific header file (for instance
include/asm-ppc/tqm8xx.h) includes the same definition of the Board
Information structure as we define in include/u-boot.h, and make
sure that your definition of IMAP_ADDR uses the same value as your
U-Boot configuration in CFG_IMMR.

 

onfiguring the Linux kernel:
-----------------------------

No specific requirements for U-Boot. Make sure you have some root
device (initial ramdisk, NFS) for your target system.

 


Building a Linux Image:
-----------------------

With U-Boot, "normal" build targets like "zImage" or "bzImage" are
not used. If you use recent kernel source, a new build target
"uImage" will exist which automatically builds an image usable by
U-Boot. Most older kernels also have support for a "pImage" target,
which was introduced for our predecessor project PPCBoot and uses a
100% compatible format.

Example:

        make TQM850L_config
        make oldconfig
        make dep
        make uImage

The "uImage" build target uses a special tool (in 'tools/mkimage') to
encapsulate a compressed Linux kernel image with header  information,
CRC32 checksum etc. for use with U-Boot. This is what we are doing:

* build a standard "vmlinux" kernel image (in ELF binary format):

* convert the kernel into a raw binary image:

        ${CROSS_COMPILE}-objcopy -O binary \
                                 -R .note -R .comment \
                                 -S vmlinux linux.bin

* compress the binary image:

        gzip -9 linux.bin

* package compressed binary image for U-Boot:

        mkimage -A ppc -O linux -T kernel -C gzip \
                -a 0 -e 0 -n "Linux Kernel Image" \
                -d linux.bin.gz uImage

 

...

 

Coding Standards:
-----------------

编码标准:

posted on 2013-08-14 07:01  kwingmei  阅读(275)  评论(0编辑  收藏  举报

导航