Wednesday, June 30, 2010

Das U-Boot

Das U-Boot
U-Boot (which means “the submarine" in German) is a popular boot loader for ARM and PowerPC boards. This tools is maintained primarily by DENX Software is part of this company’s embedded Linux suite of products. This company contracts with hardware manufacturers to keep U-Boot up to date for their hardware, which means U-Boot is frequently the first boot loader ready for a large number of boards.

The sources are available via Git or using the FTP site. To download with Git, do the following:

$ cd ~
$ git clone git:// u-boot

If you want to use a specific release of the software, download via FTP and unpack the compressed tar file. Substitute the version number for

in the commands:

$ wget
$ tar xjf u-boot-.tar.bz2

After you download the sources, the building software works using the configure/build model. The project has configurations stored in theinclude/configs directory; to use the configuration, strip off the path, remove the training .h, and append _config to the remaining text. The include/configs
directory contains this file:


To configure a U-Boot build for this board, do the following:

$ make MPC8260ADS_config

The software works a little while and shows a confirmation message indicating that the project was configured. If you’re working with several boards, be sure to clear the environment between configurations by doing the following to empty the build directory of any leftovers that could cause errors:

$ make distclean

Using U-Boot
U-Boot works like other boot loaders in that you load a kernel into memory and then run that image. The image loaded into memory can be stored on a server running TFTP or on a flash partition. You configure IP information in U-Boot by setting environment variables to configure the board’s and TFTP server’s address. To set the board’s IP address to and the address of the TFTP server to, use the following commands:

=> setenv ipaddr
=> setenv serverip

The device is now configured so that it can communicate over the Ethernet adapter. To download a file from a TFTP server, use the tftpboot command

=> tftpboot 0x80000000 kernel

This loads the kernel into memory at the specified address and starts the booting process. The bootargs environment variable controls what kernel command-line parameters are sent during bootup. Setting bootargs works like setting the board’s IP address:

=> setenv bootargs root=/dev/mtd1 rootfstype=jffs2 init=theapp

To save the values of the environment variables, use the saveenv command. It writes the values of the current set of environment variables to flash so they’re present the next time U-Boot runs on the kboard.

No comments: