7.3.2 U-Boot Command Sets
U-Boot supports more than 60 standard command sets that enable more than 150
unique commands using
CFG_* macros. A command set is enabled in U-Boot
through the use of configuration setting (
CFG_*) macros. For a complete list from
a recent U-Boot snapshot, consult Appendix B, “U-Boot Configurable
Commands.” Here are just a few, to give you an idea of the capabilities available:
Command Set Commands
CFG_CMD_FLASH Flash memory commands
CFG_CMD_MEMORY Memory dump, fill, copy, compare, and so on
CFG_CMD_DHCP DHCP Support
CFG_CMD_PING Ping support
CFG_CMD_EXT2 EXT2 File system support
The following line of Listing 7-4 defines the commands enabled in a given
U-Boot configuration, as driven by the board-specific header file:
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_DHCP)
Instead of typing out each individual CFG_* macro in your own board-specific
configuration header, you can start from a default set of commands predefined in
the U-Boot source. The macro
CONFIG_CMD_DFL defines this default set of com-
mands.
CONFIG_CMD_DFL specifies a list of default U-Boot command sets such as
tftpboot (boot an image from a tftpserver), bootm (boot an image from memory),
memory utilities such as
md (display memory), and so on. To enable your specific
combination of commands, you can start with the default and add and subtract as
necessary. The example from Listing 7-4 adds the DHCP command set to the
default. You can subtract in a similar fashion:
#define CONFIG_COMMANDS (CONFIG_CMD_DFL & ~CFG_CMD_NFS)
Take a look at any board-configuration header file in .../include/
configs/ for examples.
7.3.3 Network Operations
Many bootloaders include support for Ethernet interfaces. In a development environment, this is a huge time saver. Loading even a modest kernel image over a serial
7.3 A Universal Bootloader: Das U-Boot 167