U-Boot

U-Boot is a typical free software project ▶ License: GPLv2 (same as Linux) ▶ Freely available at http://www.denx.de/wiki/U-Boot ▶ Documentation available at http://www.denx.de/wiki/U-Boot/Documentation ▶ The latest development source code is available in a Git repository: http://git.denx.de/?p=u-boot.git;a=summary ▶ Development and discussions happen around an open mailing-list http://lists.denx.de/pipermail/u-boot/ ▶ Since the end of 2008, it follows a fixed-interval release schedule. Every three months, a new version is released. Versions are named YYYY.MM.

configuration

▶ Get the source code from the website, and uncompress it ▶ The configs/ directory contains one configuration file for each supported board ▶It defines the CPU type, the peripherals and their configuration, the memory mapping, the U- Boot features that should be compiled in, etc. ▶Note: U-Boot is migrating from board configuration defined in header files (include/configs/) to defconfig like in the Linux kernel (configs/) ▶ Not all boards have been converted to the new configuration system. ▶ Older U-Boot releases provided by hardware vendors may not yet use this new configuration system.

compiling

▶ U-Boot must be configured before being compiled ▶ make BOARDNAME_defconfig ▶ Where BOARDNAME is the name of a configuration, as visible in the configs/ directory. ▶ You can then run make menuconfig to further customize U-Boot's configuration! ▶ Make sure that the cross-compiler is available in PATH ▶ Compile U-Boot, by specifying the cross-compiler prefix. Example, if your cross-compiler executable is arm-linux-gcc: make CROSS_COMPILE=arm-linux- ▶ The main result is a u-boot.bin file, which is the U-Boot image. Depending on your specific platform, there may be other specialized images: u-boot.img, u-boot.kwb, MLO, etc.

Installing

U-Boot must usually be installed in flash memory to be executed by the hardware. Depending on the hardware, the installation of U-Boot is done in a different way: ▶ The CPU provides some kind of specific boot monitor with which you can communicate through serial port or USB using a specific protocol ▶ The CPU boots first on removable media (MMC) before booting from fixed media (NAND). In this case, boot from MMC to reflash a new version ▶ U-Boot is already installed, and can be used to flash a new version of U-Boot. However, be careful: if the new version of U-Boot doesn't work, the board is unusable ▶ The board provides a JTAG interface, which allows to write to the flash memory remotely, without any system running on the board. It also allows to rescue a board if the bootloader doesn't work.

U-boot prompt

commands

Environment variables

▶ U-Boot can be configured through environment variables ▶Some specific environment variables affect the behavior of the different commands ▶Custom environment variables can be added, and used in scripts ▶ Environment variables are loaded from flash to RAM at U-Boot startup, can be modified and saved back to flash for persistence ▶ There is a dedicated location in flash (or in MMC storage) to store the U-Boot environment, defined in the board configuration file

Transferring files to the target

▶ U-Boot is mostly used to load and boot a kernel image, but it also allows to change the kernel image and the root filesystem stored in flash. Files must be exchanged between the target and the ▶ development workstation. This is possible:

▶Through the network if the target has an Ethernet connection, and U-Boot contains a driver for the Ethernet chip. This is the fastest and most efficient solution. ▶Through a USB key, if U-Boot supports the USB controller of your platform ▶Through a SD or microSD card, if U-Boot supports the MMC controller of your platform ▶Through the serial port

TFTP

▶Network transfer from the development workstation to U-Boot on the target takes place through TFTP ▶Trivial File Transfer Protocol ▶Somewhat similar to FTP, but without authentication and overUDP

▶ A TFTP server is needed on the development workstation ▶ sudo apt-get install tftpd-hpa ▶ All files in /var/lib/tftpboot are then visible through TFTP ▶ A TFTP client is available in the tftp-hpa package, for testing

▶ A TFTP client is integrated into U-Boot ▶ Configure the ipaddr and serverip environment variables ▶ Use tftp

to load a file

results matching ""

    No results matching ""