MontaVista Linux PSP for OMAP-L137

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

PSP Overview

The PSP package supports the OMAP-L137 EVM. This PSP package includes the following components:

Note: NAND and NOR Flash are not present on OMAP-L137 DSP Starter Kit board. OMAP-L137 SoC however supports interfacing with NAND and NOR Flash..

Downloading the Release

You can get the latest PSP release from the PSP download page at https://www-a.ti.com/downloads/sds_support/targetcontent/psp/mv_lsp_2_20/index.html or from http://www.ti.com/myregisteredsoftware as a part of the OMAP-L137 SDK product. It does not matter which of these locations you use to download the PSP package as long as the version number remains the same.


Host platform Requirements

The complete installation of all PSP components requires both a Windows and a Linux machine.

The Windows machine is required for running CCStudio 3.3. CCStudio is required for building the User Boot Loader (UBL) and Flash writers. CCStudio is also used to burn the boot images (UBL, U-Boot) into the flash using the flash writers provided.

Microsoft Windows XP Service Pack 2 is supported.

Linux host is required

The Linux version supported is RedHat Enterprise Linux WS release 4

You can use a Microsoft Windows or a Linux host for running the terminal emulation program for connecting to the EVM using serial port. Preferred terminal emulation programs are HyperTerminal and Tera term Pro on Microsoft Windows and Minicom on Linux.


Host Software Requirements

The Microsoft Windows and Linux hosts need the following software:


Target Hardware Requirements

The target board required is OMAP-L137 EVM. The EVM comes with on-board emulation so no separate emulator hardware is required. The EVM ships with other peripheral hardware like power supply, USB, ethernet and serial cables.


Running the Installation

As outlined in Host Platform Requirements, the PSP package consists of components that need a Microsoft Windows host as well as components that need a Linux host. The recommended installation procedure is to install the PSP package on a Linux host and then copy portions used with a Microsoft Windows host (such as CCStudio projects for building the UBL and flash writers) to a Microsoft Windows host.

Alternately, you can install the PSP package in a disk partition that can be accessed both from a Microsoft Windows and Linux host.

To install the PSP package, extract the release package with the following command (replace ## with the release version number of your release package):

tar -xzf  REL_LSP_02_20_##_##.tgz

The following files and directories are extracted:


   REL_LSP_02_20_##_##
   | 
   +------ mvl_5_0_0_demo_lsp_setuplinux_02_20_##_##.bin
   |
   +------ PSP_02_20_##_##
          |
          +------ examples
          |
          +------ docs
          |
          +------ board_utilities
          |       |
          |       +------ armubl
          |       |
          |       +------ dspubl
          |       |
          |       +------ u-boot-1.3.3.tar.gz
          |       |
          |       +------ flash_writers
          |       |
          |       +------ spi_flash_writer
          |       |
          |       +------ nand_flash_writer
          |       
          +------ bin
          |
          +------ release notes/license agreement/software manifest

Getting Started Quickly

To help you get started quickly, pre-built binaries for the UBL, U-Boot, Linux kernel, and flash writers are provided in the PSP_02_20_##_##/bin directory.

The following list is an overview of the steps you should follow to set up and begin using the OMAP-L137 Evaluation Module (EVM) with the Linux Platform Support Product (PSP) package.

Note: If you do not see U-Boot and Linux boot sequence messages, the EVM is not pre-flashed with boot software. You need to flash the EVM with boot software. The pre-built binaries required for booting the EVM are provided in PSP_02_20_##_##/bin folder of PSP installation directory. Skip to "Running PSP Components" to learn how to use them.

Running PSP Components

Pre-built binaries for UBL, U-Boot, Linux kernel, and flash writers are provided in the PSP_02_20_##_##/bin directory in the PSP installation.

On the OMAP-L137 SoC, the DSP boots first. On boot-up, the DSP runs the DSP AIS binary, whose purpose is to load the ARM UBL into internal RAM, set the ARM reset vector correctly, and get the ARM out of reset.

The DSP AIS is written such that there should not be a need to change its contents for a custom board. You should be able to use the DSP AIS binary that ships with the PSP package for your custom designs.

The ARM UBL initializes the PLLs, SDRAM, and other hardware. Once done, it copies the U-Boot into SDRAM and starts it.

U-Boot is an open source boot loader and is responsible for booting the Linux kernel.


Booting U-Boot

Flashing Images to SPI Flash

Follow these steps to boot from SPI Flash:


Pin# 7 2 1 0 3
Position 1 1 1 1 0


Note: On EVM revisions A and B, the SW2 switch for Pin #3 is inverted. That is, OFF = 1 and ON = 0. This problem has been corrected from EVM revision C onwards.


Booting from SPI Flash

In order to boot from SPI flash, which has been written with the boot images, follow these steps:


Pin# 7 2 1 0 3
Position 0 1 0 1 X



Booting Linux kernel using U-Boot

Booting the kernel requires a valid kernel image (uImage) and a target filesystem. A pre-built kernel image is included in the PSP_02_20_##_##/bin directory of the PSP installation. File systems of various kinds are supported by Linux kernel. A pre-built RAM Disk image can be found in your MontaVista tools installation at <installation root>/pro/devkit/arm/v5t_le/images/ramdisk.gz. A target filesystem hierarchy suitable for export through NFS is found at <installation root>/pro/devkit/arm/v5t_le/target/

Various methods to boot Linux kernel using U-Boot are detailed here

Loading Linux Kernel Modules

Many of the kernel features can be built as run-time loadable modules so that they are not part of the kernel image, but can be inserted into the kernel at run-time to increase the running kernel’s functionality.

To understand how to configure some features as modules and how to build them, refer to Building a New Linux Kernel

Pre-built binaries for features configured by default as kernel modules are included in the PSP package in the PSP_02_20_##_##/bin/kernel_modules/lib directory. To use these modules, copy the contents of this directory to the /lib directory of your root file system.

On the target Linux command prompt use command modinfo to get information on the module. Use modprobe command to load the module. rmmod command can be used to remove the module. Below is an example of loading the USB file storage gadget module. Similar steps can be followed for any driver module.


Loading USB 2.0

Loading File backed storage module

# modinfo g_file_storage
filename:       /lib/modules/2.6.18_pro500/kernel/drivers/usb/gadget/g_file_stor
age.ko
license:        Dual BSD/GPL
author:         Alan Stern
description:    File-backed Storage Gadget
depends:        musb_hdrc
vermagic:       2.6.18_pro500 preempt mod_unload ARMv5 gcc-4.2
parm:           file:names of backing files or devices (array of charp)
parm:           ro:true to force read-only (array of bool)
parm:           luns:number of LUNs (uint)
parm:           removable:true to simulate removable media (bool)
parm:           stall:false to prevent bulk stalls (bool) 
# modprobe g_file_storage file=/dev/blockdevX 

Building PSP Components

Building U-Boot

Follow these steps to rebuild U-Boot:

make distclean
make da830_omapl137_config
make

The compiled u-boot.bin file will be created in the same directory. The U-Boot build options are specified in the include file include/configs/da8xx_evm.h, which is in the U-Boot source tree. To change build options, edit this file and re-build the U-Boot binary. You can modify the following build options:

See important note on NAND and NOR flash here

Note: Only one of these three options should be defined at a time. Defining more than one option results in a compilation error when you build U-Boot.


Building a New Linux Kernel

make distclean ARCH=arm CROSS_COMPILE=arm_v5t_le-
make da830_omapl137_defconfig ARCH=arm CROSS_COMPILE=arm_v5t_le- 
make menuconfig ARCH=arm CROSS_COMPILE=arm_v5t_le-

In the menu that appears, to select or deselect a feature, press the Space key after moving your cursor over the selection box. An asterisk (*) in the selection box means that feature is currently selected for building statically into the kernel. An empty selection box means that feature is de-selected. To configure a particular feature as a runtime loadable kernel module, press the Space key until an "M" appears in the selection box.

make uImage ARCH=arm CROSS_COMPILE=arm_v5t_le-

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

make modules ARCH=arm CROSS_COMPILE=arm_v5t_le-
make modules modules_install INSTALL_MOD_PATH=<root fs path>  ARCH=arm CROSS_COMPILE=arm_v5t_le-

where the <root fs path> is the path of your target root file system on the host machine.

See #Loading_Linux_Kernel_Modules for more information on using kernel modules.


Driver configuration in Linux kernel

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

For configuring the Linux kernel, run the following commands:

make da830_omapl137_defconfig ARCH=arm CROSS_COMPILE=arm_v5t_le-
make menuconfig ARCH=arm CROSS_COMPILE=arm_v5t_le-

For selecting/de-selecting a feature, press 'space' after bringing cursor over selection box. When '*' appears in selection box, the feature is selected, when the selection box is empty, the feature is de-selected.

For configuring a particular feature as module, press 'space' until an 'M' appears in the selection box.

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

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 ISO devices (audio etc), choose the following

        <*> Reserve ISO Endpoint

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

        --- USB Device Class drivers
        <*> USB Mass Storage support

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

        --- USB Input Devices
        <*> USB Human Interface Device(full HID) support
        [*] HID input layer support
        USB Gadget Support  --->

            < > Support for USB Gadgets 

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

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

Configuring for Gadget

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

When required to support Ethernet gadget choose the following

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

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

        <M> USB Gadget Drivers
            <M>   File-backed Storage Gadget


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

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

        --- USB Device Class drivers
        <*> USB Mass Storage support

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

        --- USB Input Devices
        <*> USB Human Interface Device(full HID) support
        [*] HID input layer support
        USB Gadget Support  --->

            < > Support for USB Gadgets 

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

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


Audio

Device Drivers --->
    Sound --->
        <*> Sound card support
            Advanced Linux Sound Architecture --->
                <*> Advanced Linux Sound Architecture 
                System on Chip audio support  ---> 
                    <*> ALSA for SoC audio support
                    <*> SoC Audio support for DA830/OMAP-L137 EVM
                    [ ] DA830/OMAP-L137 McASP0 control by ARM
                    [*] DA830/OMAP-L137 McASP1 control by ARM
                    [ ] DA830/OMAP-L137 McASP2 control by ARM
                    DA830/OMAP-L137 CODEC (Using the TLV3106 CODEC)  ---> 
                        (X) Using the TLV3106 CODEC 


Graphical LCD

Note: Graphical LCD part is not present on OMAP-L137 DSP Starter Kit board. OMAP-L137 SoC however supports interfacing with Graphical LCD through LCD controller.

System Type  --->
    [*] DA830/OMAP-L137 UI (User Interface) board support
        Select DA830/OMAP-L137 UI board peripheral --->
            (X) LCD      

Device Drivers --->
    Character devices  ---> 
        < > DA830/OMAP-L137 Character LCD Support
    Graphics support  --->
        <*> Support for frame buffer devices
        <*> DA830/OMAP-L137 Framebuffer support
        [*]   Use SHARP LQ035Q3DG01 LCD Display 


Character LCD

Note: Character LCD part is not present on OMAP-L137 DSP Starter Kit board. OMAP-L137 SoC however supports interfacing with Character LCD through LCD controller.

System Type  --->
    [*] DA830/OMAP-L137 UI (User Interface) board support
        Select DA830/OMAP-L137 UI board peripheral --->
            (X) LCD      

Device Drivers --->
    Graphics support  --->
        < > Support for frame buffer devices
        < > DA830/OMAP-L137 Framebuffer support
    Character devices  ---> 
        <*> DA830/OMAP-L137 Character LCD Support 


NAND

See important note on NAND flash here

System Type  --->
    [*] DA830/OMAP-L137 UI (User Interface) board support
        Select DA830/OMAP-L137 UI board peripheral --->
            (X) NAND flash

Device Drivers --->

    Character devices  ---> 
        < > DA830/OMAP-L137 Character LCD Support

    Graphics support  --->
        < > Support for frame buffer devices

    Memory Technology Devices (MTD)  --->
    [*]     Command line partition table parsing
        NAND Flash Device Drivers  ---> 
            <*> NAND Device Support 
            <*> NAND Flash device on DaVinci SoC 


NOR Flash

See important note on NOR flash here

System Type  --->
    [*] DA830/OMAP-L137 UI (User Interface) board support
        Select DA830/OMAP-L137 UI board peripheral --->
            (X) NOR flash

Device Drivers --->

    Character devices  ---> 
        < > DA830/OMAP-L137 Character LCD Support

    Graphics support  --->
        < > Support for frame buffer devices

    Memory Technology Devices (MTD)  --->
        RAM/ROM/Flash chip drivers  --->
            <*> Detect flash chips by Common Flash Interface (CFI) probe  
            <*> Support for AMD/Fujitsu flash chips
        Mapping drivers for chip access  ---> 
            [*] Support non-linear mappings of flash chips
            <*> Latch-assisted Flash Chip Support 


MMC/SD

Device Drivers --->

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


eQEP

Note: Rotary encoder is not present on OMAP-L137 DSP Starter Kit board. OMAP-L137 SoC however supports interfacing with rotary encoders through eQEP peripheral.

System Type  ---> 
   [*] DA830/OMAP-L137 UI (User Interface) board support 

Device Drivers --->

   SPI support  --->
      [ ] SPI support  

   Input device support  --->
      [*]  Miscellaneous devices  --->
         <*>   TI enhanced Quadrature Encoder Pulse (eQEP) support  


SPI

Device Drivers --->

   SPI support  --->
      [*] SPI support  
      --- SPI Master Controller Drivers   
      <*> SPI controller driver for DaVinci SoC
      [*]   Set DaVinci SPI to DMA mode 


Building the User Boot Loader

The following steps build the ARM side User Boot Loader (ARM UBL) using CCStudiov3.3:


Building Flash writers

A flash writer is used to flash the DSP AIS binary, ARM UBL and UBoot images to flash. The flash writer supports flashing a given image at a chosen offset.

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


Building DSP AIS Binary

Building the DSP AIS binary requires CCStudio v3.3 and the AIS generation tool. Typically you should not need to rebuild the DSP AIS binary. In most cases, you can use the binary provided in the REL_LSP_02_20_##_##/PSP_02_20_##_##/bin directory in PSP installation.

In case you require to rebuild, follow these steps:

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

The resulting output file is the DSP AIS binary.

Additional topics

Linux timer usage

On the OMAP-L137 SoC, there are two 64-bit timers. Currently the usage if the timers in the kernel is as follows:

Note that watchdog can only be supported on Timer 1. Linux used the additinal comparator support to use a single 32-bit timer both as a system timer and as the freerun timer required for HRT support. Since the additional comparators are only available on bottom 32-bit timers, the system/freerun timer can only be shifted to Timer 1 bottom. Here is a patch which does this. Note that by using this patch, the watchdog timer cannot be used since it requires a full 64-bit timer.

diff -urN a/arch/arm/configs/da830_omapl137_defconfig b/arch/arm/configs/da830_omapl137_defconfig
--- a/arch/arm/configs/da830_omapl137_defconfig	2009-02-20 08:06:07.000000000 +0530
+++ b/arch/arm/configs/da830_omapl137_defconfig	2009-03-09 20:40:44.000000000 +0530
@@ -712,14 +712,12 @@
 #
 # Watchdog Cards
 #
-CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
 
 #
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_DAVINCI_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
diff -urN a/arch/arm/mach-da8xx/time.c b/arch/arm/mach-da8xx/time.c
--- a/arch/arm/mach-da8xx/time.c	2009-02-20 06:30:29.000000000 +0530
+++ b/arch/arm/mach-da8xx/time.c	2009-03-09 20:16:59.000000000 +0530
@@ -24,6 +24,9 @@
 /* Compare registers are only available to the bottom timer 0 */
 static	int da8xx_cmp_irqs[NUM_TIMERS] = {
 	IRQ_DA8XX_T12CMPINT0_0,
+    0,
+    IRQ_DA8XX_T12CMPINT0_1,
+    0
 };
 
 static u32 da8xx_bases[] = { DA8XX_TIMER64P0_BASE, DA8XX_TIMER64P1_BASE };
@@ -39,7 +42,7 @@
 	 * T1_BOT: Timer 1: used as watchdog timer.
 	 */
 	davinci_common_timer_init(da8xx_bases, 2, da8xx_timer_irqs,
-				  da8xx_cmp_irqs, T0_BOT, T0_BOT);
+				  da8xx_cmp_irqs, T1_BOT, T1_BOT);
 }
 
 struct sys_timer davinci_timer = { 
E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article MontaVista Linux PSP for OMAP-L137 here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox