Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Configuring/Building U-Boot for OMAP-L137

From Texas Instruments Wiki
Jump to: navigation, search


The purpose of this page is to instruct users on how to configure various U-Boot options such as enabling USB.


Unpack the U-Boot package

If you are using MontaVista Linux based SDK, then the U-Boot package can be found in the /home/<useracct>/OMAPL137_arm_1_00_00_07/REL_LSP_02_20_00_05/PSP_02_20_00_05/board_utilities directory of the SDK software installation. The package name is u-boot-#.#.#.tar.gz where # is the version number of U-Boot. Untar the U-Boot package with the command

host $ tar xzf u-boot-#.#.#.tar.gz

If you are using DaVinci GIT based SDK, then use your Linux host to extract source files for building U-Boot from the src/u-boot/u-boot-#.#.#.#.tar.gz tarball from the OMAP-L138 Linux PSP package, which is located in the DaVinci-PSP-SDK-#.#.#.# directory under the main SDK installation directory. Use the tar command to extract the sources.
Note: Patches from the uboot-patches-#.#.#.#.tar.gz file have already been applied to U-Boot. This is the list of patches which have been developed on top of the base version. You can find information about the base U-Boot version from the release notes accompanying the PSP release.

Configuring U-Boot (MontaVista Linux based SDK)

The U-Boot build options are specified in the include file include/configs/da8xx_evm.h, which is in the U-Boot source tree. You can change the build options by editing this file. You will need to rebuild U-Boot for these configuration changes to take effect.

Enabling SPI Flash

To enable U-Boot to support SPI flash you will need to define the CFG_USE_SPIFLASH variable. When this flag is defined, U-Boot supports the SPI flash part on the OMAP-L137 EVM DSK board. The environment variables are stored on SPI flash as well as the Linux kernel. This option is switched on by default.

If this value is not defined in the da8xx_evm.h file you will need to add the following line to enable SPI flash.


Changing the Environment Size

The environment variable size configuration is defined by the CFG_ENV_SIZE variable in the da8xx_evm.h file. You can change this variable for your system to affect how much space in flash is used for the U-Boot environment variables.

Changing the Environment Offset

The environment variable offset configuration is defined by the CFG_ENV_OFFSET variable in the da8xx_evm.h file. You can change this variable for your system to affect where the U-Boot environment variables are stored in flash.

MMC/SD support

The U-boot code and provided with the SDK installation completely supports the MMC/SD card boot process, thus not requiring any configuration.

USB Storage Support

U-Boot includes support for loading file from USB mass storage devices into memory. This section explains how to configure U-Boot to enable USB and mass storage support in U-Boot and the U-Boot commands used for initializing and loading file from mass storage devices connected to the USB 2.0 port on the EVM.

Enabling Support

Two macros must be defined in the include/configs/da8xx_evm.h file to enable support for USB and MSC modules. You can compile U-Boot after enabling the following macros:

NOTE: The provided U-Boot source code already contains these two options enabled.

  • CONFIG_USB_DA8XX - This macro enables the host controller and USB host modules in U-Boot.
  • CONFIG_USB_STORAGE - This macro enables the USB MSC module in U-Boot.

These macros should be defined in the "U-Boot general configuration" section as shown below.

/* U-Boot general configuration */

USB Commands

  1. usb reset - This command initiates the USB enumeration process to identify all the devices connected to the USB 2.0 port. U-Boot support devices directly connected to the USB port or via high/full speed hubs. After the command executes, the number of USB devices found on the bus and the numer of storage devices detected is displayed.
  2. usb start - This command is equivalent to usb reset.
  3. fatload usb dev[:part] address filename - This command loads a file from a mass storage device. For the dev parameter you should specify the number of the storage device found on the USB bus by the usb reset command. The usb storage devices are numbered sequentially from zero onwards. For part specify the partition number on the mass storage device (if you have one). For address specify the starting address in memory where the file has to be loaded. For filename specify the file to be loaded from the mass storage device. For example, the following command loads the Linux kernel imae from USB storage device 0 partition 1 to SDRAM.
    EVM # fatload usb 0:1 0xc0700000 uImage
  4. fatls usb dev[:part][directory] - This command lists the files on a USB mass storage device. The dev and part parameters are the same as for the fatload command. For the optional directory parameter you can specify the directory from which the contents should be listed. For example, the following command lists the contents of the first partition on the first USB storage device.
    EVM # fatls usb 0:1
  5. usb tree - This command displays a tree of all USB devices enumerated during the usb reset command execution.
  6. usb info - The command displays device information for all USB devices enumerated during the usb reset command execution.
  7. usb read addr startblock numblocks' - This command reads the contents of the logical sectors in the mass storage device to memory.
  8. usb stop - This command disables the USB module and the USB PHY.

Configuring U-Boot (DaVinci GIT based SDK)

  1. Go to the u-boot directory created when you extracted the files.
  2. The U-Boot build options are specified in the include file include/configs/da830_evm.h, which is in the U-Boot source tree.
  3. To change build options, edit this file and re-build the U-Boot binary. You can modify the following build options:
    • CONFIG_ENV_SIZE Configures the environment variable size.
    • CONFIG_ENV_OFFSET Configures the environment variable offset.
    • Choice of Flash supported. Note: Only one of these Flash options should be defined at a time. Defining more than one Flash option results in a compilation error when you build U-Boot.
      • CONFIG_USE_SPIFLASH If this flag is defined, U-Boot supports the SPI flash on the OMAP-L137 EVM DSK board. The environment variables are stored on the SPI flash. This option is switched on by default.
      • CONFIG_SYS_USE_NAND If this flag is defined, U-Boot supports U-Boot NAND flash access using the OMAP-L137 SoC. Environment variables are also stored on the NAND flash.

Building U-Boot (MontaVista Linux based SDK)

After you have configured U-Boot as described above you can now build the U-Boot binary image to be used to boot the system. Use the following commands to do so:

host $ make distclean
host $ make da830_omapl137_config
host $ make

You may notice warnings about "warning: target CPU does not support interworking". These are OK. You can disable these warnings by editing the cpu/arm926ejs/ file and adding "-mno-thumb-interwork" to the PLATFORM_CPPFLAGS variable.

When the compile is done the resulting U-Boot file will be created in the same directory and called u-boot.bin

Building U-Boot (DaVinci GIT based SDK)

  • Run the following commands on your Linux host to build U-Boot. The steps below assume that the CodeSourcery tools are already present in your $PATH variable. Information on how to add the tools to your $PATH can be obtained form the Getting Started Guide for the CodeSourcery tools.
host$ make distclean CROSS_COMPILE=arm-none-linux-gnueabi-
host$ make da830_omapl137_evm_config CROSS_COMPILE=arm-none-linux-gnueabi-
host$ make all CROSS_COMPILE=arm-none-linux-gnueabi-
  • The compiled u-boot.bin file will be created in the same directory.