GSG: Building Software Components for OMAP-L1/AM1x

From Texas Instruments Wiki
Jump to: navigation, search

^ Up to main Getting Started Guide for OMAP-L1 Table of Contents

Rebuilding the Linux kernel

The rebuild the Linux kernel, follow the steps below.

Preparing your Environment

  1. If you have not already done so, install the CodeSourcery tools on your Linux host. For additional documentation on installing the CodeSourcery tools, please visit the CodeSourcery website.
  2. If U-Boot is not built yet, build U-Boot first, as building Linux Kernel requires mkimage utility, which gets built along with U-Boot. Refer to Rebuilding U-Boot for steps to build U-Boot. Once built, mkimage will be present under the tools folder of U-Boot source (/home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/u-boot/uboot-xx.xx.xx.xx/tools). Ensure that this path is added to the $PATH variable by adding the following
host$ export PATH=home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/u-boot/uboot-xx.xx.xx.xx/tools:$PATH

to the ~/.bashrc file. You can then source the ~/.bashrc file with the following command

host$ source ~/.bashrc
  1. Use your Linux host to extract source files for building the target Linux kernel from the src/kernel/linux-#.#.#.#.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 (/home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/kernel for default path installation). Use the tar command to extract the sources.
host$ tar zxf linux-#.#.#.#.tar.gz

NOTE
Patches from the kernel-patches-#.#.#.#.tar.gz file have already been applied on Linux Kernel. This is the list of patches which have been developed on top of the base Linux kernel version. You can find information about the base Linux kernel version from the release notes accompanying the PSP release.

  1. Change directory (cd command) to the top-level directory of the Linux kernel source files obtained in the previous step.
host$ cd linux-xx.xx.xx.xx

Basic Configuration of the Kernel

Based on what chip and development board you are using, you will need to configure the kernel for different options. Most of these setings are build into the Make file provided by TI, and you can switch between builds using some simple make options.

  1. Clean your installation of previous build settings
host$ make distclean ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
  1. Configure the kernel according to the default configuration provided. 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 da850_omapl138_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
host$ make da830_omapl137_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
  1. Modify the kernel options you would like to run. This may take some planning, but the default settings are a good place to start. For more information on these settings, look further down the page at Driver configuration in the Linux kernel or see detaile instructions for | a different processors root file system]. there are two menu configs that are commmon to run:
host$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
(or)
host$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- xconfig

Building uImage

Run the following command to build the kernel image:

host$ make uImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

The compiled uImage is copied into the arch/arm/boot directory under the kernel tree.

Once the kernel has been compiled, if you are using tftp boot, use the following commands to copy the uImage to a place where U-Boot can use TFTP to download it to the EVM. These commands assume you are using the default TFTP root area, which is /tftpboot. If you use another TFTP root location, please change /tftpboot to your own TFTP root location:

host$ cp arch/arm/boot/uImage /tftpboot

Note
If the uImage build fails with a similar message as follows:

"mkimage" command not found - U-Boot images will not be built

it could be that the path to the u-boot uImage script has not been added to the command search path. Include the path "{u-boot source path}/tools" to your PATH environment variable.

Building Modules

To build all features configured as modules (M), issue the following command:

host$ make modules ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Installing modules to Target File System

To install the compiled modules into the target root file system, issue the following command:

host$ make modules_install INSTALL_MOD_PATH=<root fs path> ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

where the <root fs path> is the path of your target root file system on the host machine (/home/user/workdir/filesys for example).


See Loading Linux Kernel Modules for more information on using kernel modules after you build them.

Driver configuration in the Linux kernel

This section describes the procedure to configure the kernel to support various drivers.


Once you base configuration is set, you can use menu based configurations to change details about your kernel's build.

host$  make menuconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Note that some of the menu options which are required to be deselected here (selection box empty) may not appear at all because the internal checks which render the option invalid. In this case, it is safe to assume that the options have been automatically disabled.

USB 2.0

USB2.0 interface is build into the default config in Dual Role mode meaning it can either be a Host or Device (OTG is not supported) automatically without need for user intervention. In the Dual Role mode support for MSC application is available in Host mode while RNDIS/CDC gadget application is available in Device mode by default. User can choose to change the application/mode supported by following the below steps if needed.

WARNING
When removing the support for USB2.0 from the kernel please ensure that "CPPI support" under "System Type--> TI DaVinci Implementations" is also disabled.

Configuring for Host

Device Drivers --->

    USB support --->
        <*> Support for Host-side USB
        --- Miscellaneous USB options
        [*] USB device filesystem
        --- USB Host Controller Drivers
        <*> Inventra USB Highspeed Dual Role Controller Support
        --- DA830/OMAP-L137 USB support
            Driver Mode (USB Host) --->
                (X) USB Host

(please see Inventra HDRC USB Controller for more details on the underlying driver)

When required to support HID devices (mouse, keyboard etc), choose the following

Device Drivers --->
	Input device support --->
		<*> Mouse interface
		[*] Keyboards --->
			<*> AT keyboard

	HID Devices --->
		<*> USB Human Interface Device(full HID) support

When required to support MSC devices (pen drive etc), choose the following

Device Drivers --->
	SCSI device support --->
		--- SCSI device support
		[*] legacy /proc/scsi/support
		--- SCSI support type (disk, tape, CD-ROM)
		<*> SCSI disk support
	USB support --->
		<*> USB Mass Storage support
		

 When required to support UVC, UAC class (Webcam, Speakers, Microphone etc.) choose the following

Device Drivers --->
	Multimedia support --->
		Video capture adapters --->
			V4L USB devices --->
				<*> USB Video Class (UVC)
				[*] UVC input events device support
	Sound card support --->
		Advanced Linux Sound Architecture --->
			USB sound devices --->
				<*> USB Audio/MIDI driver
				

Configuring for Gadget

	Device Drivers --->
    		USB support --->
        		< > Support for Host-side USB
        		<*> Inventra Highspeed Dual Role Controller (TI, ...)
				(*)USB Peripheral (gadget stack)
         

When required to support Ethernet gadget choose the following

	Device Drivers --->       
		USB support --->
			USB Gadget Support --->
				<*> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support)) 
        	    		[*]     RNDIS support (EXPERIMENTAL)

When required to support File backed storage gadget, choose the following

	Device Drivers --->
		USB support --->
			USB Gadget Support --->
   				<M> USB Gadget Drivers
            			<M> File-backed Storage Gadget
				[*] File-backed Storage Gadget testing version (NEW)

Please make sure that Inventra HDRC is selected as USB peripheral controller which will appear only when "USB Peripheral (gadget stack)" is selected in driver mode as shown below so after selecting Gadget Support go back to driver mode option to select "USB Peripheral (gadget stack)" and then come back again to select Inventra HDRC as USB peripheral controller.

--- USB Gadget Support          
      [ ]   Debugging messages (DEVELOPMENT) (NEW) 
      [ ]   Debugging information files (DEVELOPMENT) (NEW) 
      [ ]   Debugging information files in debugfs (DEVELOPMENT) (NEW) 
      (2)   Maximum VBUS Power usage (2-500 mA) (NEW)         
          USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...))  --->

USB 1.1

	Device Drivers --->
		USB support --->
			<*> Support for Host-side USB
			--- Miscellaneous USB options
			[*] USB device filesystem
			--- USB Host Controller Drivers
			<*>   OHCI HCD support

To support MSC, HID, UVC, UAC applications over USB 1.1 interface refer to USB2.0 procedures for the same.

Audio

Device Drivers --->
    <*> Sound card support --->
        <*> Advanced Linux Sound Architecture --->
            <*> ALSA for SoC audio support --->
                <*> SoC Audio for the TI DAVINCI chip 

For OMAP-L138 (or DA850, AM18xx) EVM board:

                <*> SoC Audio support for DA850/OMAP-L138/AM18xx EVM

For OMAP-L137 (or DA830, AM17xx) EVM board:

                <*> SoC Audio support for DA830/OMAP-L137/AM17xx EVM

Graphical LCD

Device Drivers --->
         Graphics support  --->
             <*> Support for frame buffer devices --->
             <*> DA8xx/OMAP-L1xx/AM1xxx Framebuffer support 

When using OMAP-L137 (or DA830, AM17xx) EVM:

System Type --->
         TI DaVinci Implementations  --->
             Select DA830/OMAP-L137/AM17xx UI board peripheral (LCD) ---> 

Character LCD

Device Drivers --->
         Graphics support  --->
             <*> Support for frame buffer devices --->
                < > DA8xx/OMAP-L1xx/AM1xxx Framebuffer support
         <*> Parallel port support  ---> 
         [*] Staging drivers  --->
             [ ]   Exclude Staging drivers from being built
             <*>       Parallel port LCD/Keypad Panel support
             (0)       Default parallel port number (0=LPT1)
             (3)       Default panel profile (0-5, 0=custom)
             [ ]       Change LCD initialization message ?
             -*-       DA8XX/OMAP-L1/AM1xxx Dummy Parallel Port 
System Type --->
        TI DaVinci Implementations  --->
Select peripherals connected to expander on UI board (Character LCD) --->

NAND

Device Drivers --->

    < > MMC/SD/SDIO card support  ---> 

    <*> Memory Technology Device (MTD)  support --->
        [*]   MTD partitioning support
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        <*>   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
        <*>   NAND Device Support ---> 
            <*> Support NAND on DaVinci SoC

WARNING
Please disable MMC support when NAND has to be used. They are pin multiplexed and NAND will not work when MMC is enabled.

NOR

Note: NOR flash is supported only on OMAP-L138 (or DA850, AM18xx) EVM

For Linux versions before 3.x:

Device Drivers --->

    < > MMC/SD/SDIO card support  ---> 

    <*> Memory Technology Device (MTD)  support --->
        [*]   MTD partitioning support
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        <*>   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
              RAM/ROM/Flash chip drivers ---> 
                 <*> Detect flash chips by Common Flash Interface (CFI) probe
                 <*> Support for Intel/Sharp flash chips
              Mapping drivers for chip access --->
                 <*> TI DaVinci board mappings

For Linux v3.x:

Device Drivers --->

    < > MMC/SD/SDIO card support  ---> 

    <*> Memory Technology Device (MTD)  support --->
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        <*>   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
              RAM/ROM/Flash chip drivers ---> 
                 <*> Detect flash chips by Common Flash Interface (CFI) probe
                 <*> Support for Intel/Sharp flash chips
              Mapping drivers for chip access --->
                 <*> Flash device in physical memory map

WARNING
Please disable MMC support when NOR has to be used. They are pin multiplexed and NOR will not work when MMC is enabled.

SPI

Device Drivers --->

        [*] SPI support  ---> 
            <*>     SPI controller driver for DaVinci SoC

        <*> Memory Technology Device (MTD) support  --->
        [*]   MTD partitioning support
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        <*>   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
              Self-contained MTD device drivers  --->
                  <*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)
                  [*]   Use FAST_READ OPCode allowing SPI CLK <= 50MHz

MMC/SD

Device Drivers --->

    <*>MMC/SD/SDIO card support  ---> 
        <*>   MMC block device driver
        <*>   TI DAVINCI Multimedia Card Interface support 

RTC

Device Drivers --->

    <*> Real Time Clock  ---> 
        <*>   TI OMAP1

SATA

	Device Drivers --->
		<*> Serial ATA (prod) and Parallel ATA (experimental) drivers --->
			[*] SATA Port Multiplier support
			<*> AHCI SATA support
	

McBSP

System Type --->
	TI DaVinci Implementations --->
                [*] DaVinci McBSP (serial API) support
                      [ ]   Support for McBSP instance 0
                      [*]   Support for McBSP instance 1  

WARNING
Note: Since the McBSP peripheral has a kernel API based driver, menuconfig options are present under System Type. If sound driver is selected in menuconfig then McBSP cannot be configured. They are mutually exclusive.

eCAP

         Device Drivers --->
                 <*> PWM Support --->
                    <*> eCAP PWM Support   

eHRPWM

         Device Drivers --->
                  <*> PWM Support --->
                   <*> eHRPWM Support 

Power Management

CPUFreq

CPU Power Management  --->
	[*] CPU Frequency scaling 
		<*>   'userspace' cpufreq policy governor
		Default CPUFreq governor (userspace)  ---> 
			(X) usespace 
Device Drivers  --->
	Multifunction device drivers  --->       
		<*> TPS6507x Power Management / Touch Screen chips
	[*] Voltage and Current Regulator Support  --->
		<*>   TI TPS6507X Power regulators

CPUIdle

CPU Power Management  --->
	[*] CPU idle PM support

Suspend-to-RAM

Power management options  --->
	 [*] Power Management support
	 [*] Suspend to RAM and standby 

Ethernet

[*] Networking support  --->
	Networking options  --->
		[*] TCP/IP networking 
		[*]   IP: kernel level autoconfiguration
		[*]     IP: DHCP support
Device Drivers --->
		[*] Network device support  --->
		[*]   Ethernet (10 or 100Mbit)  --->
			<*>   Generic Media Independent Interface device support
			<*>   TI DaVinci EMAC Support

Using the RMII PHY on OMAP-L138 (or DA850, AM18xx) UI card

System Type --->
	TI DaVinci Implementations --->
		[*] Use RMII Ethernet PHY on DA850/OMAP-L138 EVM
Device Drivers --->
        -*- GPIO Support  --->
                <*>   PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports  

WARNING
Note: When using RMII PHY, MII ethernet PHY will not be functional. Do not plug in ethernet cables to both the PHYs.

VPIF

System Type  --->
        TI DaVinci Implementations  --->
                [*] TI DA850/OMAP-L138/AM18xx Reference Platform
                       Select peripherals connected to expander on UI board (Video Port Interface)  --->

Device Drivers --->
    <*> Multimedia support  --->
            <*>   Video For Linux
                [*]   Video capture adapters  --->
                        <*>  DaVinci Video VPIF Display
                        <*>  DaVinci Video VPIF Capture
                        -*-  DaVinci VPIF Driver
                [ ]   Autoselect pertinent encoders/decoders and other helper chips
                      Encoders/decoders and other helper chips  --->  
                        <*> Texas Instruments TVP514x video decoder
                        -*- THS7303 Video Amplifier
                        -*- ADV7343 video encoder

Note: To run the vpif examples add the following to your bootargs

vpif_capture.ch0_bufsize=831488 vpif_display.ch2_bufsize=831488

WARNING
Please disable the graphical LCD frame buffer driver and the character LCD driver when VPIF display has to be used. They are pin multiplexed and VPIF display will not work when LCD is enabled.

Device Drivers --->
         Graphics support  --->
             < > DA8xx/OMAP-L1xx/AM1xxx Framebuffer support 

Touchscreen

TSC2004

TSC2004 touchscreen controller is found on DA830 (or OMAP-L137, AM17xx) EVM when using new UI cards

Device Drivers --->
        Input device support  --->
                [*]   Touchscreens  --->   
                        <*>   TSC2004 based touchscreens

TPS65070

TPS65070 touchscreen controller is found on DA850 (or OMAP-L138, AM18xx) EVM

Device Drivers --->
	Multifunction device drivers  --->       
		<*> TPS6507x Power Management / Touch Screen chips
        Input device support  --->
                [*]   Touchscreens  --->   
                        <*>   TPS6507x based touchscreens         

Rebuilding U-Boot

Follow these steps to rebuild U-Boot:

  1. If you have not already done so, install the CodeSourcery tools on your Linux host. For documentation on installing the CodeSourcery tools, please visit the CodeSourcery website.
  2. 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.
  3. Go to the u-boot directory created when you extracted the files.
  4. Run the following commands on your Linux host to build U-Boot. Note: 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 da850evm_config CROSS_COMPILE=arm-none-linux-gnueabi- 
host$ make da830evm_config CROSS_COMPILE=arm-none-linux-gnueabi-
host$ make all CROSS_COMPILE=arm-none-linux-gnueabi-
  1. The compiled u-boot.bin file will be created in the same directory.
  2. To change the default options, the EVM configuration file needs to be edited.
    • for OMAP-L138 (or DA850, AM18xx) EVM are specified in the include file include/configs/da850evm.h
    • for OMAP-L137 (or DA830, AM17xx) EVM are specified in the include file include/configs/da830evm.h

To change U-Boot environment area location or size:

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:

Configuring U-Boot to enable peripherals

Enabling RMII

  1. define the macro CONFIG_DRIVER_TI_EMAC_USE_RMII in include/configs/da850evm.h file.
  2. undef the macro CONFIG_MII in include/configs/da850evm.h file.

Enabling NAND

  1. define the macro CONFIG_USE_NAND in include/configs/da850evm.h file.
  2. undef the macro CONFIG_USE_SPIFLASH in include/configs/da850evm.h file.

Rebuilding the ARM Side User Boot Loader

Use your Linux host to extract the ARM UBL code src/boot-strap/armubl-#.#.#.#.tar.gz tarball (for 03.20.xx.xx releases) or src/boot-strap/flash-utils-#.#.#.#.tar.gz tarball (for 03.21.xx.xx releases) from the 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. If the extracted files are not accessible from your Microsoft Windows host, copy all the extracted files to a location that is accessible.

NOTE
By default, the ARM UBL configures the SoC to work at 300MHz, 1.2V operating point. Changing the Operating Point describes the procedure to change the default operating point.

For OMAP-L138 (or DA850, AM18xx)

For 03.20.xx.xx.releases:

When using CCStudiov3.3:

  1. Start CCStudio v3.3.
  2. From the menus, choose Project->Open.
  3. Browse to the extracted ARM UBL source and open the ubl-omapl1x8.pjt project.
    • To build for SPI Flash, select the "Config" option as BOOT_SPI in CCStudio window.
    • To build for NOR Flash, select the "Config" option as BOOT_NOR in CCStudio window.
    • To build for NAND Flash, select the "Config" option as BOOT_NAND in CCStudio window.
    • To build for MMC/SD boot, select the "Config" option as BOOT_SDMMC in CCStudio window.

NOTE
DA850/OMAP-L138/AM18xx does not support MMC/SD boot mode, but UBL can read U-Boot from SD card and boot it.

  1. From the menus, choose Project->Build. When the build is complete:
    • The executable ELF binary (ubl-xxx.out) file is generated in the Project Root directory (<armubl-install-dir>\ccsv3.3\)
  2. Proceed to convert the UBL object file obtained above to AIS format file suitable for flashing.

When using CCStudiov4:

  1. Start CCStudiov4.
  2. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project. Browse to ccsv4/omap-l1x8 directory inside the extracted ARM UBL source and select it.
    • To build for SPI Flash, select the "Configuration" option as BOOT_SPI in Project->Properties menu.
    • To build for NOR Flash, select the "Configuration" option as BOOT_NOR in Project->Properties menu.
    • To build for NAND Flash, select the "Configuration" option as BOOT_NAND in Project->Properties menu.
    • To build for MMC/SD boot, select the "Configuration" option as BOOT_SDMMC in Project->Properties menu.
  3. From the menus, choose Project->Build Project
  4. When build is complete:
    • The executable ELF binary (ubl-xxx.out) file is generated in the Project Root directory (<armubl-install-dir>\ccsv4\omapl1x8\)
  5. Proceed to convert the UBL object file obtained above to AIS format file suitable for flashing.

For 03.21.xx.xx releases:

When using CCStudiov5:

  1. Start CCStudiov5.
  2. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project. Browse to OMAP-L1x8 directory inside the extracted ARM UBL source and select it.
    • To build for SPI Flash, select the UBL_SPI_MEM in the Discovered Projects.
    • To build for NOR Flash, select the UBL_NOR in the Discovered Projects.
    • To build for NAND Flash, select the UBL_NAND in the Discovered Projects.
    • To build for MMC/SD boot, select the UBL_SDMMC in the Discovered Projects.
  3. Select the required platform (AM1808, OMAP-L138 or INTDEV0), Project->Build Configurations ->Set Active.
  4. From the menus, choose Project->Build Project
  5. When build is complete:
    • The AIS format file for SPI Boot mode is generated in the Project Root directory (OMAP-L138\CCS\UBL_ARM\UBL_SPI_MEM\).
    • The AIS format file for NAND Boot mode is generated in the Project Root directorty(OMAP-L138\CCS\UBL_ARM\UBL_NAND\).
    • The AIS format file for SD/MMC Boot mode is generated in the Project Root directorty(OMAP-L138\CCS\UBL_ARM\UBL_SD_MMC\).
    • The NOR Boot mode UBL ELF (OMAP-L138\CCS\UBL_ARM\ubl_xxx_NOR.out) executable has to be converted to AIS format with the AIS file format generator. Follow the NOR FLASH conversion step to convert to AIS format.


When using Cygwin or Linux Host:

  1. For a particular platform, the extracted package will consist of a 'Common' directory and a '<PlatformName>' directory.
  2. Enter into the '<PlatformName>/GNU' directory.
     cd '<PlatformName>/GNU'
  3. If you wish to rebuild everything, simply run 'make' at this point.
  4. When build is complete:
    • The binary files (ubl_OMAPL138_xxx.bin),suitable for flashing is created in the directory (<flash-utils-install-dir>\OMAP-L138\GNU\ubl).
    • The serial flasher (sfh_OMAP-L138.exe) which can be used for flashing NAND, NOR and SPI is created in the directory (<flash-utils-install-dir>\OMAP-L138\GNU).
  5. If you wish to clean-up already built components, run 'make clean' from the path you wish to clean.


Generating ARM AIS File For OMAP-L138 (or DA850, AM18xx)

  1. Obtain the AIS file format generator tool described in the Bootloader Application Report document.
  2. Use the tool as shown below to obtain AIS format files ready to be flashed into NAND/SPI/NOR flash.

    For NAND Flash:
    NandAis.jpg

    For SPI Flash:
    SpiAis.jpg

    For NOR Flash:
    NorAis.jpg
    Note: Before generating the AIS image for NOR, make sure that Flash Data Width is set to 16 bit in AIS file format generator's "Flash" tab.

For OMAP-L137 (or DA830, AM17xx)

When using CCStudiov3.3:

  1. Start CCStudio v3.3.
  2. From the menus, choose Project->Open.
  3. Browse to the extracted ARM UBL source and open the ubl-omapl1x7.pjt project.
    • To build for SPI Flash, select the "Config" option as BOOT_SPI in CCStudio window.
    • To build for NAND Flash, select the "Config" option as BOOT_NAND in CCStudio window.
  4. From the menus, choose Project->Build. When the build is complete:
    • The Intel hex format binary (ubl-xxx.bin) file is generated in the Project Root directory.
    • The executable ELF binary (ubl-xxx.out) file is generated in the Project Root directory.
    • The Project Root directory is <armubl-install-dir>\ccsv3.3\
  5. The files generated by the build procedure, have to be flashed.
    • In case of DSP BOOT devices like OMAP-L137 or DA830, the Intel hex format binary file is suitable for flashing.
    • In case of ARM BOOT devices like AM17xx, proceed to convert the executable ELF binary obtained above to AIS format file suitable for flashing.

When using CCStudiov4:

  1. Start CCStudiov4.
  2. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project. Browse to ccsv4/omap-l1x7 directory inside the extracted ARM UBL source and select it.
    • To build for SPI Flash, select the "Configuration" option as BOOT_SPI in Project->Properties menu.
    • To build for NAND Flash, select the "Configuration" option as BOOT_NAND in Project->Properties menu.
  3. From the menus, choose Project->Build Project.
  4. When build is complete
    • The Intel hex format binary (ubl-xxx.bin) file is generated in the Project Root directory.
    • The executable ELF binary (ubl-xxx.out) file is generated in the Project Root directory.
    • The Project Root directory is <armubl-install-dir>\ccsv4\omapl1x7\
  5. The files generated by the build procedure, have to be flashed.
    • In case of DSP BOOT devices like OMAP-L137 or DA830, the Intel hex format binary file is suitable for flashing.
    • In case of ARM BOOT devices like AM17xx, proceed to convert the executable ELF binary obtained above to AIS format file suitable for flashing.

Generating ARM AIS File For AM17xx

  1. Obtain the AIS file format generator tool described in the Bootloader Application Report document.
  2. Use the tool as shown below to obtain AIS format files ready to be flashed into NAND/SPI flash.

    For NAND Flash:
    NandAisOMAPL137.png

    For SPI Flash:
    SpiAisOMAPL137.png

Rebuilding DSP Side User Boot Loader

For the DSP boot devices OMAP-L137 and DA830, DSP UBL is required to wake up the ARM during the boot process.

When using CCStudiov3.3:

  1. Use your Linux host to extract the DSP UBL code from the src/boot-strap/dspubl-#.#.#.#.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.
  2. If the extracted files are not accessable from your Microsoft Windows host, copy all the extracted files to a location that is accessable.
  3. Start CCStudio v3.3.
  4. From the menus, choose Project->Open. Browse to the extracted DSP UBL source and open the ubl-omapl1x7.pjt project.
  5. By default, the project builds DSP UBL for NAND flash. To build for SPI Flash, select the "Config" option as BOOT_SPI in CCStudio window.
  6. From the menus, choose Project->Build. When the build is complete for SPI flash, the build places ubl-spi.out in the spi directory under the top level directory. Similarly, the build for NAND flash places the ubl-nand.out in the nand directory.

CCStudiov4 specific steps to build the DSP side User Boot Loader:

  1. Extract the DSP UBL code from the src/boot-strap/dspubl-MM.mm.pp.bb.tar.gz file in PSP installation.
  2. Start CCStudiov4. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project. Browse to the extracted DSP UBL source and select the root directory where the ccsv4 project resides. By default, the project builds DSP UBL for NAND flash. To build for SPI Flash, select the "Configuration" option as BOOT_SPI in Project->Properties menu.
  3. From the menus, choose Project->Build Project. When build is complete for SPI flash, the build places ubl-spi.out in spi directory under the top level directory. Similarly, the build for NAND flash places the ubl-nand.out in nand directory.

Once the .out file is obtained using CCStudiov3.3 or CCStudiov4, convert to AIS File format. Obtain and install the AIS file format generator tool described in Section 5 of the Using the D800K001 Bootloader document.

For SPI:
hexgen -romid D800K001 -seqread -crc 1 -spiclk 0 -appln <PATH to ubl-spi.out> -output <dsp-spi-ais.bin>
For NAND:
hexgen -romid D800K001 -seqread -crc 1 -spiclk 0 -appln <PATH to ubl-nand.out> -output <dsp-nand-ais.bin>

The resulting output file is the DSP AIS binary.

Rebuilding the SPI Flash writer

SPI flash writer is used to flash UBL and U-Boot images to SPI flash. The flash writer also supports flashing a given image at a chosen offset.

Use the following steps to build SPI Flash writer using CCStudio v3.3:

  1. Use your Linux host to extract the SPI flash writer code from the src/utils/spiflash-writer-#.#.#.#.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.
  2. If the extracted files are not accessable from your Microsoft Windows host, copy all the extracted files to a location that is accessable.
  3. Start CCStudio v3.3.
  4. From the menus, choose Project->Open.
  5. Browse to the the extracted source directory, and open the spiflash_writer.pjt project.
  6. Select the active configuration as SPI0 if the flash writer is being built for DA830/OMAP-L137/AM17xx or as SPI1 if it is being built for DA850/OMAP-L138/AM18xx.
  7. From the menus, choose Project->Build. The built image spiflash-writer.out is placed in the ccsv3.3/Debug subdirectory under the project directory.

Use the following steps to build SPI Flash writer using CCStudio v4:

  1. Extract the SPI flash writer code from src/utils/spiflash-writer-MM.mm.bb.pp.tar.gz file in PSP installation.
  2. Start CCStudio v4. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project.
  3. Browse to the the extracted source directory, select the root directory where the ccsv4 project resides.
  4. Select the active configuration as SPI0 if the flash writer is being built for DA830/OMAP-L137/AM17xx or as SPI1 if it is being built for DA850/OMAP-L138/AM18xx.
  5. From the menus, choose Project->Build Project. The built image spiflash-writer.out is placed in the ccsv4/Debug under the top directory.
  1. Extract the SPI flash writer code from src/boot-strap/flash-utils-#.#.#.#.tar.gz file in PSP installation.
  2. Start CCStudio v5. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project.
  3. Browse to the the extracted source directory, select the SPIWriter_ARM directory where the ccsv5 project resides.
  4. From the menus, choose Project->Build Project. The built image SPIWriter_OMAP-L138.out is placed in the /src/boot-strap/flash-utils-#.#.#.#/OMAP-L138/CCS/SPIWriter/ARM under the top directory.


To flash images to SPI Flash, see Flashing images to SPI Flash.
To boot U-Boot from SPI Flash, see Booting from SPI Flash.
To boot the Linux kernel from SPI Flash using U-Boot, see Booting the Linux kernel from SPI Flash.

Rebuilding the NAND Flash writer

NAND flash writer is used to flash the ARM UBL and U-Boot images to NAND flash. The flash writer also supports flashing a given image at a chosen offset.

Use the following steps to build NAND Flash writer using CCStudio v3.3:

  1. Use your Linux host to extract the NAND flash writer code from the src/utils/nand-writer-#.#.#.#.tar.gz tarball from the 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.
  2. If the extracted files are not accessable from your Microsoft Windows host, copy all the extracted files to a location that is accessable.
  3. Start CCStudio v3.3.
  4. From the menus, choose Project->Open.
  5. Browse to the extracted source directory and open the nand_writer.pjt project file.
  6. From the menus, choose Project->Build. The built image nand-writer.out is placed in the ccsv3.3/Debug subdirectory under the project directory. Use the following steps to build NAND Flash writer using CCStudio v4:
  1. Extract the NAND flash writer code from src/boot-strap/flash-utils-#.#.#.#.tar.gz file in PSP installation.
  2. Start CCStudio v5. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project.
  3. Browse to the the extracted source directory, select the NANDWriter_ARM directory where the ccsv5 project resides.
  4. From the menus, choose Project->Build Project. The built image NANDWriter_OMAP-L138.out is placed in the /src/boot-strap/flash-utils-#.#.#.#/OMAP-L138/CCS/NANDWriter/Debug/ under the top directory.

To flash images to NAND Flash, see Flashing images to NAND Flash.
To boot U-Boot from NAND Flash, see Booting from NAND Flash.
To boot the Linux kernel from NAND Flash using U-Boot, see Booting the Linux kernel from NAND Flash.

Rebuilding NOR Flash writer

Note: NOR flash writer is supported only on the EVMs for OMAP-L138 (or DA850, AM18xx).

NOR flash writer is used to flash UBL and U-Boot images to NOR flash. The flash writer also supports flashing a given image at a chosen offset.

Use the following steps to build NOR Flash writer using CCStudio v3.3:

  1. Extract the NOR flash writer code from src/utils/norflash-writer-#.#.#.#.tar.gz directory in PSP installation.
  2. Start CCStudio v3.3. From the menus, choose Project->Open
  3. Browse to the extracted source directory and open the ccsv3.3/norflash_writer.pjt project file.
  4. From the menus, choose Project->Build. The built image norflash-writer.out is placed in the ccsv3.3/Debug directory under the top level source directory. Use the following steps to build NOR Flash writer using CCStudio v4:
  5. Extract the NOR flash writer code from src/utils/norflash-writer-#.#.#.#.tar.gz file in PSP installation.
  6. Start CCStudio v4. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project.
  7. Browse to the the extracted source directory, select the root directory where the CCSv4 project resides.
  8. From the menus, choose Project->Build Project. The built image norflash-writer.out is placed in the ccsv4/Debug under the top directory.
  1. Extract the NOR flash writer code from src/boot-strap/flash-utils-#.#.#.#.tar.gz file in PSP installation.
  2. Start CCStudio v5. From the menus, choose File->Import. Choose CCS->Existing CCS/CCE Eclipse Project.
  3. Browse to the the extracted source directory, select the NORWriter_ARM directory where the ccsv5 project resides.
  4. From the menus, choose Project->Build Project. The built image NORWriter_OMAP-L138.out is placed in the /src/boot-strap/flash-utils-#.#.#.#/OMAP-L138/CCS/NORWriter/Debug under the top directory.

What's next?

Please continue on to the Building the SDK section of the OMAP-L1 Getting Started Guide.

Retrieved from "http://processors.wiki.ti.com/index.php?title=GSG:_Building_Software_Components_for_OMAP-L1/AM1x&oldid=137923"