Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

2.1 U-BOOT Commands

U-BOOT provides a vast array of commands dedicated to interacting with peripherals, memory, file systems, and networking devices. Users can leverage these commands to read data from storage components, write payloads to target devices, configure hardware peripherals, and display critical system information. U-BOOT implements two distinct command line interpreter backends: a legacy simple command line interface and a Bourne-shell-compatible command line parser known as HUSH. Interaction with the user is managed dynamically through this text-based command shell.

U-BOOT commands are structurally categorized into system information, memory operations, flash storage manipulation, execution control, network utilities, environment variable overrides, file system abstraction support, special-purpose routines, advanced configuration commands, and miscellaneous helpers. The subsequent sections outline these functional sets systematically.

2.1.1 Information Commands

Information commands are utilized to query various system metrics and hardware parameters. These commands include:

  • bdinfo: Displays system board information.

  • coninfo: Displays console terminal interface statistics.

  • flinfo: Displays flash memory configuration and layout details.

  • iminfo: Displays the header block details of an uncompressed image file.

  • imls: Lists boot images found across storage blocks in flash memory.

  • fatinfo: Displays metadata and statistics of a FAT file system partition.

  • mii: Inspects and controls Ethernet Media Independent Interface (MII) and PHY registers.

  • help: Displays online interactive help summaries for all supported shell commands.

The following output shows the structural execution metrics returned by running the bdinfo command, where => represents the interactive U-BOOT command prompt.

=> 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

=>

the execution results of the help command are presented below:

=>help

? - alias for \'help\'

If a user wishes to query the specific usage and syntax parameters for a particular utility, they can execute help <command>. For example:

=> help run

run var [...]

- run the commands in the environment variable(s) 'var'

The usage structure and syntax options for the mii command are defined as follows:

  • mii device: Lists all registered Ethernet interface devices.

  • mii device <name>: Sets the active target device to <name>.

  • mii read <addr> <reg>: Reads the value of register <reg> from the Media Independent Interface (MII) PHY address <addr>.

  • mii write <addr> <reg> <data>: Writes the payload word <data> into the MII PHY address <addr> register <reg>.

2.1.2 Memory Commands

This class of commands is dedicated to volatile memory manipulation and includes the following operations:

  • base: Displays or configures the baseline address offset, which serves as a global reference offset for subsequent memory access commands.

  • crc32: Computes a 32-bit Cyclic Redundancy Check (CRC32) checksum over a memory buffer.

  • cmp: Performs a byte-by-byte comparison between two distinct memory regions.

  • cp: Executes a bulk memory copy operation from a source address to a destination buffer.

  • md: Displays (dumps) memory content in organized hex and ASCII views.

  • mm: Modifies memory contents interactively with automatic address auto-increment.

  • mtest: Performs a standard, non-destructive volatile memory stress test across a given range.

  • mw: Fills a specific memory boundary range with a fixed data pattern.

  • loop: Loops memory access infinitely across a given address envelope for hardware troubleshooting.

The usage conventions and execution results for the base and md utilities are presented below:

=> 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)......

=>

2.1.3 Flash Storage Commands

  • cp: Flash memory programming utility (copies chunks from RAM to flash configurations).

  • flinfo: Displays detailed flash sector layouts, banks, and hardware definitions.

  • erase: Erases explicit sectors or full ranges within flash storage arrays.

  • protect: Enables or disables hardware/software write-protection bits across flash memory blocks.

2.1.4 Execution Control Commands

  • autoscr: Executes standalone binary macro scripts from memory.

  • bootm: Boots a structured application or kernel system image resident in physical RAM.

  • bootelf: Executes a binary application image formatted as a standard Executable and Linkable Format (ELF) structure from memory.

  • bootvx: Boots a structured VxWorks operating system application image built as an ELF payload.

  • go: Jumps directly to a raw instruction address (addr) to start bare-metal execution sequences.

The standard execution syntax for the bootm command is defined as follows:

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.

2.1.5 Network Utilities

  • bootp: Leverages BOOTP/TFTP protocol interactions to fetch and boot a system image over the network.

  • cdp: Configures and processes the Cisco Discovery Protocol (CDP) topology metadata.

  • dhcp: Invokes the internal DHCP client routine to acquire a dynamic local IP address and poll global boot configuration vectors.

  • loadb: Loads a raw binary payload stream into memory using the serial console line via the Kermit protocol.

  • loads: Loads a text-based Motorola S-record firmware payload into target memory blocks via the serial line interface.

  • nfs: Restructures network storage calls to boot an operating system image using the Network File System (NFS) protocol layout.

  • ping: Transmits standard ICMP ECHO_REQUEST packets to network hosts to check end-to-end transport layer paths.

  • rarpboot: Combines RARP/TFTP server handshakes to pull and launch a system image over network environments.

  • tftpboot: Downloads and initializes a system image over network setups using the Trivial File Transfer Protocol (TFTP).

The configuration format for the bootp command is structured as follows:

bootp [loadAddress] [bootfilename]

The configuration format for pulling and booting software via the nfs client framework is structured as follows:

nfs [loadAddress] [host_ip_addr:bootfilename]

2.1.6 Environment Variable Commands

  • printenv: Displays the values of all currently defined environment variables.

  • saveenv: Writes the active environment variables from RAM to non-volatile storage.

  • askenv: Prompts the user via the standard input console to capture and assign a value to an environment variable.

  • setenv: Establishes a new environment variable or modifies/deletes an existing one.

  • run: Executes the command sequence or macro embedded within specified environment variables.

  • bootd: Initiates the default boot sequence, structurally equivalent to executing run bootcmd.

2.1.7 File System Support Commands

  • chpart: Changes the active target partition.

  • fsinfo: Displays fundamental metadata regarding the active file system type.

  • fsload: Loads a raw binary payload into memory from a generic supported file system.

  • ls: Lists the files and subdirectories resident within a specified path.

  • fatinfo: Displays low-level cluster and volume metadata for a FAT-formatted partition.

  • fatls: Lists the contents of a directory located on a FAT-formatted file system partition.

  • fatload: Loads a binary file from a DOS/FAT file system into physical memory.

  • nand: The NAND flash memory subsystem, encompassing an array of sub-commands for raw block operations.

  • reiserls: Lists the subdirectory layout and contents within a ReiserFS file system hierarchy.

  • reiserload: Loads a binary payload into memory from a ReiserFS file system.

2.1.8 Special-Purpose Commands

  • i2c: The I2C bus subsystem, providing tools to probe, read, and write to peripheral chips.

  • doc: Disk On Chip (DOC) storage subsystem interface routines.

  • dtt: Digital Thermometer and Thermostat telemetry subsystem.

  • eeprom: Subsystem for reading and writing to on-board EEPROM chips.

  • fpga: Subsystem designated for loading and configuring field-programmable gate array bitstreams.

  • ide: Integrated Drive Electronics (IDE) storage subsystem.

  • kgdb: Switches the system interface into Kernel GNU Debugger mode for low-level trapping.

  • diskboot: Initiates an operating system boot sequence from an attached IDE storage device.

  • icache: Enables or disables the processor's internal instruction cache (I-Cache).

  • dcache: Enables or disables the processor's internal data cache (D-Cache).

  • diag: Executes hardware board-level diagnostic monitoring sequences.

  • log: Manages and reviews device log configurations.

  • pci: Scans, displays, and modifies fields within the PCI configuration space layout.

  • regdump: Dumps the current hardware register states to the console interface.

  • usb: The Universal Serial Bus (USB) subsystem, managing bus enumeration and storage/peripheral access.

  • sspi: Synchronous Serial Peripheral Interface (SPI) configuration and transfer utility.

Each of the subsystems detailed above contains specific sub-commands for execution. Using the help utility alongside any subsystem name exposes its structural formatting and syntax.

2.1.9 Miscellaneous Commands

  • bmp: Manipulates and renders BMP format image data. For example:
    bmp info <image address> displays file metadata for a bitmap image resident at the designated memory address, whereas bmp display <image address> [x,y] renders the bitmap located at <image address> onto the screen starting at coordinates (x,y).

  • date: Displays or sets the current real-time clock (RTC) calendar date and system time.

  • echo: Outputs explicit text strings or expanded environment variable values directly to the active console terminal interface.

  • exit: Exits the execution context of the currently running macro script.

  • kbd: Scans and captures raw keyboard matrix input sequences.

  • in: Reads a data byte or word from a hardware I/O port address space.

  • out: Writes a data byte or word to a hardware I/O port address space.

  • reset: Triggers a full system hardware reset and cold reboot cycle.

  • sleep: Pauses the execution sequence of the command interpreter for a specified duration of seconds.

  • test: Evaluates conditional statement expressions for shell script control flows (minimal implementation).

  • version: Displays the current compilation release and build version string of the running U-BOOT binary.

  • wd: Probes, triggers, or configures the system hardware watchdog timer parameters.

  • ?: Acts as a direct structural alias for the help instruction.

Copyright © 2026 Guangzhou eSmart Information Technology Co., Ltd. All Rights Reserved.
All content in this book is copyrighted by the author. For personal learning and exchange only. Commercial use without authorization is strictly prohibited. Email:

✉ 3348194517@qq.com | hai616878@gmail.com