Texas Instruments OMAP35 Series User Manual
Texas Instruments OMAP35 Series User Manual

Texas Instruments OMAP35 Series User Manual

Evm linux psp
Hide thumbs Also See for OMAP35 Series:
Table of Contents

Advertisement

Quick Links

OMAP35x EVM Linux PSP
User Guide
02.01.01.08
Published 22 May 2009

Advertisement

Table of Contents
loading

Summary of Contents for Texas Instruments OMAP35 Series

  • Page 1 OMAP35x EVM Linux PSP User Guide 02.01.01.08 Published 22 May 2009...
  • Page 2 Platform Support Products Version 02.01.01.08...
  • Page 3 IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
  • Page 4 OMAP35x EVM Linux PSP Platform Support Products Version 02.01.01.08...
  • Page 5: Table Of Contents

    Table of Contents Read This First ................xvii 1. Installation .................. 1 1.1. System Requirements ............2 1.2. Installation ................3 1.3. Installation Steps ..............5 1.4. Environment Setup .............. 6 1.5. Setup NFS filesystem ............7 2. x-loader ..................9 2.1.
  • Page 6 OMAP35x EVM Linux PSP 3.4.1. Marking a bad block ........... 22 3.4.2. Erasing OneNAND ............22 3.4.3. Writing to OneNAND ........... 23 3.4.4. Reading from OneNAND ..........23 3.4.5. Scrubbing OneNAND ........... 24 3.5. Managing NAND ..............25 3.5.1. Marking a bad block ........... 25 3.5.2.
  • Page 7 OMAP35x EVM Linux PSP 5.4.1. Configuration Steps ............ 45 5.4.2. Installation ..............55 5.5. Software Interfaces ............. 56 5.5.1. Application Interface ..........56 5.5.2. Driver Interface ............59 5.6. Sample Applications ............. 63 5.6.1. Introduction .............. 63 5.6.2. A minimal playback application ........63 5.6.3.
  • Page 8 OMAP35x EVM Linux PSP 7. Resizer Driver ................117 7.1. Introduction ..............118 7.1.1. References ............. 118 7.1.2. Acronyms .............. 118 7.1.3. Hardware Overview ..........118 7.2. Features ................119 7.2.1. Overview of features supported ......... 119 7.2.2. Usage of Features ........... 119 7.2.3.
  • Page 9 OMAP35x EVM Linux PSP 9.2. Features ................153 9.2.1. Supported features ..........153 9.2.2. Constraints/Limitations ..........153 9.2.3. Known Issues ............153 9.3. Architecture ..............155 9.3.1. System Diagram ............. 155 9.3.2. Software Design Interfaces ........157 9.4. Driver Configuration ............172 9.4.1.
  • Page 10 OMAP35x EVM Linux PSP 10.3.10. USB Video ............192 10.3.11. Gadget Mode Applications ........193 10.3.12. CDC/RNDIS gadget ..........194 10.3.13. USB OTG (HNP/SRP) testing ........195 10.4. Software Interface ............197 10.4.1. sysfs ..............197 10.4.2. procfs ..............197 10.5.
  • Page 11 OMAP35x EVM Linux PSP 12.4.2. cpufreq ..............211 12.4.3. SmartReflex ............211 12.5. Software Interface ............213 12.5.1. cpuidle ..............213 12.5.2. Suspend & Resume ..........214 12.5.3. SmartReflex ............214 12.6. Revision History ............... 216 Version 02.01.01.08 Platform Support Products...
  • Page 12 Version 02.01.01.08 Platform Support Products...
  • Page 13 List of Figures 4.1. Boot switch position ..............34 5.1. ALSA SoC Architecture ..............44 5.2. Configure ALSA Driver: Step 2 ............. 45 5.3. Configure ALSA Driver: Step 3 ............. 46 5.4. Configure ALSA Driver: Step 4 ............. 47 5.5. Configure ALSA Driver: Step 5 ............. 48 5.6.
  • Page 14 OMAP35x EVM Linux PSP 6.14. RGBA 32-BPP Data Memory Organization ........94 6.15. 24-BPP Packed Data Memory Organization ........94 6.16. UYVY 4:2:2 Data Memory Organization ........95 6.17. YUV2 4:2:2 Data Memory Organization ........95 6.18. OMAP35x Display Subsystem Architecture ........100 6.19.
  • Page 15 OMAP35x EVM Linux PSP 9.4. Configure Capture Driver: Step 2 ..........172 9.5. Configure Capture Driver: Step 3 ..........173 9.6. Configure Capture Driver: Step 4 ..........173 9.7. Configure Capture Driver: Step 5 ..........174 9.8. Configure Capture Driver: Step 6 ..........174 9.9.
  • Page 16 Version 02.01.01.08 Platform Support Products...
  • Page 17 List of Tables 5.1. Acronyms .................. 40 5.2. Audio Driver : Constraints ............42 5.3. Device Interface ................. 56 5.4. Proc Interface ................57 5.5. Commonly Used APIs ..............57 6.1. Acronyms .................. 73 6.2. Memory requirement for V4L2 and FBDEV driver Buffers ....77 7.1.
  • Page 18 OMAP35x EVM Linux PSP 12.1. C-states in OMAP3 ..............208 Platform Support Products Version 02.01.01.08...
  • Page 19: Read This First

    Read This First About This Manual This document describes how to install and work with Texas Instruments' (TI) Platform Support Package for OMAP35x platform for Linux 2.6.29-rc3. The PSP Package serves to provide a fundamental software platform for development, deployment and execution. This abstracts the functionality provided by the hardware.
  • Page 20 Read This First Notation of information elements • Chapter 4, Kernel - describes the procedure to build and execute the Linux kernel. • Chapter 5, Audio Driver - describes the implementation of audio driver. • Chapter 6, Display Driver - describes the implementation of video display driver.
  • Page 21 This is an example of a useful tip. If You Need Assistance assistance, please send mail software support [mailto:softwaresupport@ti.com]. Trademarks OMAP™ is a trademark of Texas Instruments Incorporated. All other trademarks are the property of the respective owner. Version 02.01.01.08 Platform Support Products...
  • Page 22 Version 02.01.01.08 Platform Support Products...
  • Page 23: Installation

    Installation Abstract This chapter describes the layout of the Linux PSP package for OMAP35x EVM and steps to install on your development host. Table of Contents 1.1. System Requirements ..............2 1.2. Installation .................. 3 1.3. Installation Steps ................ 5 1.4.
  • Page 24: System Requirements

    Installation System Requirements 1.1. System Requirements Hardware Requirements: • OMAP EVM Main Board (REV C or later) and OMAP35XX Processor Board with OMAP35x ES 2.1/3.1 Processor (REV B or later) Software Requirements: • Code Sourcery ARM tool chain version 2008-q1 Platform Support Products Version 02.01.01.08...
  • Page 25: Installation

    Installation Installation 1.2. Installation Extract the contents of release package with the following command: $ tar -xvfz OMAP35x-PSP-SDK-MM.mm.pp.bb.tgz This creates a directory OMAP35x-PSP-SDK-MM.mm.pp.bb with the following contents: \---OMAP35x-PSP-SDK-MM.mm.pp.bb |-- License.html |-- Software-manifest.html |-- docs |-- Building-RootFs-Arago.html |-- DataSheet-MM.mm.pp.bb.pdf |-- GettingStarted.pdf |-- MigrationGuide-MM.mm.pp.bb.pdf |-- ReleaseNotes-MM.mm.pp.bb.pdf `-- UserGuide-MM.mm.pp.bb.pdf...
  • Page 26 Installation Installation `-- itbok.bin |-- scripts |-- Readme.txt |-- initenv-micron.txt |-- initenv-samsung.txt |-- reflash-micron.txt `-- reflash-samsung.txt |-- src |-- boot-strap |-- ChangeLog-MM.mm.pp.bb |-- ShortLog |-- Unified-patch-MM.mm.pp.bb.gz |-- diffstat-MM.mm.pp.bb |-- x-loader-patches-MM.mm.pp.bb.tar.gz `-- x-loader-MM.mm.pp.bb.tar.gz |-- examples `-- examples.tar.gz |-- kernel |-- Readme.txt |-- ChangeLog-MM.mm.pp.bb |-- ShortLog |-- Unified-patch-MM.mm.pp.bb.gz...
  • Page 27: Installation Steps

    Installation Installation Steps 1.3. Installation Steps Instructions for initial setup of the EVM are contained in the OMAP3 EVM Users Guide included with the EVM kit. Refer section 2.1 for the detailed instructions to bring-up the EVM. To use the pre-built binaries included in the release, skip to section 2.4. You can always return to section 2.1 for instructions on how to build the x-loader, u-boot and Linux kernel.
  • Page 28: Environment Setup

    Installation Environment Setup 1.4. Environment Setup Set the environment variable PATH to contain the binaries of the CodeSourcery cross-compiler tool-chain. For example, in bash: $ export PATH=/opt/toolchain/2008-q1/bin:$PATH Add location of u-boot tools to the PATH environment variable. For example, in bash: $ export PATH=/opt/u-boot/tools:$PATH Note Actual instructions and the path setting will depend upon your shell and location...
  • Page 29: Setup Nfs Filesystem

    Installation Setup NFS filesystem 1.5. Setup NFS filesystem This step is required when root filesystem is mounted from an NFS location. Extract the contents of the NFS image (nfs.tar.bz2) to a directory exported via NFS. $ cd /opt/nfs/target $ tar xjfv nfs.tar.bz2 Important Execute this command as 'root' user.
  • Page 30 Version 02.01.01.08 Platform Support Products...
  • Page 31: X-Loader

    x-loader Abstract This chapter describes the steps required to build and execute the x-loader. Table of Contents 2.1. Introduction ................10 2.2. Compiling X-Loader ..............11 2.3. Signing x-load.bin ..............12 2.4. Flashing x-loader ................ 13 2.4.1. OneNAND ................ 13 2.4.2.
  • Page 32: Introduction

    x-loader Introduction 2.1. Introduction X-loader is loaded by ROM boot loader into internal RAM. X-loader support boot from OneNAND, NAND, MMC/SD. Platform Support Products Version 02.01.01.08...
  • Page 33: Compiling X-Loader

    x-loader Compiling X-Loader 2.2. Compiling X-Loader Change to the base of the X-Loader directory. $ cd ./x-load Remove the intermediate files generated during build. This step is not necessary when building for the first time. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean Choose the configuration for OMAP3 EVM.
  • Page 34: Signing X-Load.bin

    x-loader Signing x-load.bin 2.3. Signing x-load.bin The file x-load.bin needs to be signed before it can be used by the ROM bootloader. To sign the X-Loader binary: (look for signGP tool under host-tools/linux folder) $ signGP x-load.bin The signing utility creates x-load.bin.ift in the current directory. Platform Support Products Version 02.01.01.08...
  • Page 35: Flashing X-Loader

    x-loader Flashing x-loader 2.4. Flashing x-loader 2.4.1. OneNAND To flash the x-loader into OneNAND, execute following commands at the U-Boot prompt: OMAP3EVM# mw.b 0x80000000 0xFF 0x100000 OMAP3EVM# tftp 0x80000000 x-load.bin.ift Note On Older U-boot versions(from PSP 1.0.x releases), the OneNand will have to be unlocked before write/erase operation.
  • Page 36: Preparing Mmc/Sd For Boot

    x-loader Preparing MMC/SD for boot 2.5. Preparing MMC/SD for boot 2.5.1. Creating bootable partition To be able to boot from MMC/SD, there should be valid bootable partition on the card. Disk Storage Format Tool (available from http:// www.sysanalyser.com/sp27213.exe) and follow the steps below: •...
  • Page 37: U-Boot

    U-Boot Abstract This chapter describes the steps required to build and configure u-boot to use different filesystems during the kernel boot. It also describes new commands for managing bad blocks. Table of Contents 3.1. Compiling U-Boot ............... 17 3.2. Flashing U-Boot ................. 18 3.2.1.
  • Page 38 U-Boot 3.5.2. Viewing bad blocks ............25 3.5.3. Erasing NAND ..............25 3.5.4. Writing to NAND ............... 26 3.5.5. Reading from NAND ............27 3.5.6. Unlocking NAND address space ........... 27 3.5.7. NAND ECC algorithm selection ..........28 Platform Support Products Version 02.01.01.08...
  • Page 39: Compiling U-Boot

    U-Boot Compiling U-Boot 3.1. Compiling U-Boot Change to the base of the u-boot directory. $ cd ./u-boot Remove the intermediate files generated during build. This step is not necessary when building for the first time. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean Choose the configuration for OMAP3 EVM.
  • Page 40: Flashing U-Boot

    U-Boot Flashing U-Boot 3.2. Flashing U-Boot 3.2.1. OneNAND To flash u-boot.bin to the OneNAND execute the commands listed below: OMAP3EVM# mw.b 0x80000000 0xFF 0x100000 OMAP3EVM# tftp 0x80000000 u-boot.bin Note With Older U-boot versions(from PSP 1.0.x releases), the OneNand will have to be unlocked before erase/write operation.
  • Page 41: Configuring U-Boot

    U-Boot Configuring U-Boot 3.3. Configuring U-Boot This section assumes that EVM has been setup properly. Enable UART1 on the EVM : On Jumper J8 select 1-2 Connect EVM (UART1) to the HOST PC through serial cable. Start a terminal emulator (e.g. Hyperterm) on the HOST PC. Power on EVM and wait for u-boot to come up.
  • Page 42: Using Nfs With No Dhcp In Linux

    U-Boot Using NFS with no DHCP in Linux ip=dhcp rw root=/dev/nfs nfsroot=192.168.1.101: /opt/nfs/target,nolock,rsize=4096,wsize=4096,proto=tcp mem=128M Note • The entire command should be entered in a single line. • Replace NFS server IP address(192.168.1.101) and mount path(/opt/nfs/ target) with actuals based on your NFS server setting. Set the bootcmd: OMAP3EVM# setenv 'bootcmd dhcp;tftp 0x80000000 uImage;bootm' 3.3.3.
  • Page 43 U-Boot Using NFS with no DHCP in Linux Important To save the variables on the flash, use the u-boot command saveenv. Version 02.01.01.08 Platform Support Products...
  • Page 44: Managing Onenand

    U-Boot Managing OneNAND 3.4. Managing OneNAND The u-boot has been updated to include bad block management for OneNAND. These updates also impacted behavior of existing OneNAND commands. This section describes the new and modified commands added for the purpose. 3.4.1. Marking a bad block To forcefully mark a block as bad: OMAP3EVM# onenand markbad <offset>...
  • Page 45: Writing To Onenand

    U-Boot Writing to OneNAND OMAP3EVM# onenand erase 0x00400000 0x00440000 OMAP3EVM# onenand erase block 32-34 3.4.3. Writing to OneNAND To write len bytes of data from a memory buffer located at addrto the OneNAND block offset: OMAP3EVM# onenand write <addr> <offset> <len> Note The behavior of this command was modified.
  • Page 46: Scrubbing Onenand

    U-Boot Scrubbing OneNAND If a bad block is encountered during the read operation, it is skipped and the read operation continues from next 'good' block. Important If the read fails on ECC check, the block where the failure occurred is marked bad and read operation is aborted.
  • Page 47: Managing Nand

    U-Boot Managing NAND 3.5. Managing NAND The u-boot has been updated to include NAND flash support 3.5.1. Marking a bad block To forcefully mark a block as bad: OMAP3EVM# nand markbad <offset> Note This is a new command. For example, to mark block 32 (assuming erase block size of 128Kbytes) as bad block - offset = blocknum * 128 * 1024: OMAP3EVM# nand markbad 0x400000 3.5.2.
  • Page 48: Writing To Nand

    U-Boot Writing to NAND Note The behavior of this command was modified. This commands skips bad blocks (both factory or user marked) encountered within the specified range. Important If the erase operation fails, the block is marked bad and the command aborts. To continue erase operation, the command needs to be re-executed for the remaining blocks in the range.
  • Page 49: Reading From Nand

    U-Boot Reading from NAND OMAP3EVM# nand write 0x80000000 0x400000 0x40000 3.5.5. Reading from NAND To read len bytes of data from NAND block at offset to memory buffer located at addr: OMAP3EVM# nand read <addr> <offset> <len> Note The behavior of this command was modified. If a bad block is encountered during the read operation, it is skipped and the read operation continues from next 'good' block.
  • Page 50: Nand Ecc Algorithm Selection

    U-Boot NAND ECC algorithm selection OMAP3EVM# nand unlock 0x20000 3.5.7. NAND ECC algorithm selection To select ECC algorithm for NAND OMAP3EVM# nandecc <sw/hw> Note To write X-loader from U-Boot, ECC algorithm to be selected is HW since bootrom uses this algorithm for reading. To write U-Boot from U-Boot, ECC algorithm to be selected is SW.
  • Page 51: Kernel

    Kernel Abstract This chapter describes the steps required to build and configure the Linux kernel. It also provides basic steps to boot kernel on the EVM. Table of Contents 4.1. Compiling Linux Kernel ............... 30 4.2. Configuring Linux Kernel ............. 31 4.2.1.
  • Page 52: Compiling Linux Kernel

    Kernel Compiling Linux Kernel 4.1. Compiling Linux Kernel Change to the base of the Linux source directory. Create default configuration for the OMAP3EVM. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm omap3_evm_defconfig Initiate the build. Note For the kernel image(uImage) to be built, mkimage utility must be included in the path.
  • Page 53: Configuring Linux Kernel

    Kernel Configuring Linux Kernel 4.2. Configuring Linux Kernel Enter following command to make changes to default configuration. The configuration options for various drivers will be described in the PSP datasheet $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm menuconfig Following drivers are enabled in the default configuration: •...
  • Page 54 Kernel Build configuration for OMAP35x General setup ---> [*] Enable loadable module support ---> [*] Enable the block layer ---> System Type ---> Bus support ---> Kernel Features ---> These items would be selected by default: • OMAP35x Family • OMAP 3530 EVM board ARM system type (TI OMAP) --->...
  • Page 55 Now select Power board for OMAP3 EVM. Return back to main menu, and select Device Drivers Now select Multifunction device drivers From this sub-menu, deselect Texas Instruments TWL4030/TPS659x0 Support. Return back to main menu, and select Device Drivers Now select Voltage and Current Regulator Support...
  • Page 56: Booting Linux Kernel

    Kernel Booting Linux Kernel 4.3. Booting Linux Kernel 4.3.1. Selecting boot mode Boot mode can be selected using dip switch SW4 on the EVM. It is shown below in figure boot switch and "SW-1" in the figure indicates pin 1 position in the SW4 dip switch on the EVM and similarly it is mapped for other pins.
  • Page 57 Kernel Selecting boot mode OMAP3EVM# boot To boot the Linux kernel from MMC/SD card, set the mmcboot environment variable as follows(only an illustration - substitute with actual image path and load address for your system) OMAP3EVM# setenv mmcboot 'mmcinit; fatload mmc 0 0x82000000 uImage; bootm 0x82000000' OMAP3EVM# saveenv Once setup, the mmcboot variable can be exercised as follows:...
  • Page 58 Version 02.01.01.08 Platform Support Products...
  • Page 59: Audio Driver

    Audio Driver Abstract This chapter provides details on how to configure the audio driver, its interfaces and a simple application code illustrates the use of this interface. Table of Contents 5.1. Introduction ................39 5.1.1. References ............... 39 5.1.2. Acronyms & Definitions ............40 5.2.
  • Page 60 Audio Driver 5.6.2. A minimal playback application ........... 63 5.6.3. A minimal record application ..........67 5.7. Revision History ................. 70 Platform Support Products Version 02.01.01.08...
  • Page 61: Introduction

    ALSA Project Homepage [http://www.alsa-project.org/main/index.php/ Main_Page] ALSA User Space Library [http://www.alsa-project.org/alsa-doc/alsa-lib/] Using ALSA Audio API [http://www.equalarea.com/paul/alsa-audio.html/] Author: Paul Davis TWL4030 OMAP Power Management and System Companion Device Silicon Revision 2.1. (Author: Texas Instruments) Literature Number: SWCU026D Version 02.01.01.08 Platform Support Products...
  • Page 62: Acronyms & Definitions

    Audio Driver Acronyms & Definitions 5.1.2. Acronyms & Definitions Acronym Definition ALSA Advanced Linux Sound Architecture ALSA SoC ALSA System on Chip Direct Memory Access Inter-Integrated Circuit McBSP Multi-channel Buffered Serial Port Pulse Code Modulation Time Division Multiplexing Open Sound System Inter-IC Sound Table 5.1.
  • Page 63: Features

    Audio Driver Features 5.2. Features This section describes the supported features and constraints of the ALSA SoC Audio driver. 5.2.1. Features Supported • Supports TWL4030 audio codec in ALSA SoC framework. • Supports audio in both mono and stereo modes. •...
  • Page 64: Constraints

    Audio Driver Constraints 5.2.2. Constraints Constraint Remark Support for synthesizer and similar Synthesizer and midi interfaces are interfaces other than ones described in not supported as many codecs do not supported features. support the same. If any codec driver does support it, it would be a specific functionality of that driver alone.
  • Page 65: Architecture

    Audio Driver Architecture 5.3. Architecture 5.3.1. ALSA SoC Layer The overall project goal of the ALSA System on Chip (ASoC) layer is to provide better ALSA support for embedded system on chip procesors and portable audio codecs. Currently there is some support in the kernel for SoC audio, however it has some limitations: •...
  • Page 66 Audio Driver Design • Machine driver: The machine driver handles any machine specific controls and audio events. i.e. turing on an amp at start of playback. Following architecture diagram shows all the components and the interactions among them: Figure 5.1. ALSA SoC Architecture Platform Support Products Version 02.01.01.08...
  • Page 67: Driver Configuration

    Audio Driver Driver Configuration 5.4. Driver Configuration 5.4.1. Configuration Steps To enable audio driver support in the kernel: Open menuconfig options from kernel command prompt. Select Device Drivers as shown here: Figure 5.2. Configure ALSA Driver: Step 2 Select Device Drivers > Sound card support as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 68 Audio Driver Configuration Steps Figure 5.3. Configure ALSA Driver: Step 3 Select Device Drivers > Sound card support > Advanced Linux Sound Architecture as shown here: Platform Support Products Version 02.01.01.08...
  • Page 69 Audio Driver Configuration Steps Figure 5.4. Configure ALSA Driver: Step 4 Select Device Drivers > Advanced Linux Sound Architecture > OSS PCM (digital audio) API and OSS PCM (digital audio) API - Include plugin system (NEW), as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 70 Audio Driver Configuration Steps Figure 5.5. Configure ALSA Driver: Step 5 Select Device Drivers > Advanced Linux Sound Architecture > Dynamic device file minor numbers as shown here: Platform Support Products Version 02.01.01.08...
  • Page 71 Audio Driver Configuration Steps Figure 5.6. Configure ALSA Driver: Step 6 Select Device Drivers > Sound > Advanced Linux Sound Architecture > Support old ALSA API as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 72 Audio Driver Configuration Steps Figure 5.7. Configure ALSA Driver: Step 7 Select Device Drivers > Sound > Advanced Linux Sound Architecture > ALSA for SoC audio support as shown here: Platform Support Products Version 02.01.01.08...
  • Page 73 Figure 5.8. Configure ALSA Driver: Step 8 Select Device Drivers > Sound > Advanced Linux Sound Architecture > ALSA for SoC audio support > SoC Audio for the Texas Instruments OMAP chips and SoC Audio support for OMAP3EVM board, as shown here: Version 02.01.01.08...
  • Page 74 Audio Driver Configuration Steps Figure 5.9. Configure ALSA Driver: Step 9 10. To enable McBSP hardware, select System Type as shown here: Platform Support Products Version 02.01.01.08...
  • Page 75 Audio Driver Configuration Steps Figure 5.10. Configure ALSA Driver: Step 10 11. Select System Type > TI OMAP Implementations as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 76 Audio Driver Configuration Steps Figure 5.11. Configure ALSA Driver: Step 11 12. Select System Type > TI OMAP Implementations > McBSP Support, as shown here: Platform Support Products Version 02.01.01.08...
  • Page 77 Audio Driver Installation Figure 5.12. Configure ALSA Driver: Step 12 5.4.2. Installation 5.4.2.1. Driver built statically If the audio driver is built statically into the kernel, it is activated during boot- up. There is no special procedure to install the driver. Version 02.01.01.08 Platform Support Products...
  • Page 78: Device Interface

    Audio Driver Software Interfaces 5.5. Software Interfaces This section provides the details of the Application Interface and the Driver Interface for the ALSA Audio driver. 5.5.1. Application Interface Application developer uses ALSA-lib, a user space library, rather than the kernel API.
  • Page 79: Proc Interface

    Audio Driver Application Interface Name Description cards List of registered cards. version Version and date the driver was built devices List of registered ALSA devices. The list of allocated PCM streams. cardX/ (X = 0-7) The card specific directory. cardX/pcm0p directory given playback stream.
  • Page 80 Audio Driver Application Interface 5.5.1.4. User Space Interactions This section depicts the sequence of operations for a simple playback and capture application. Figure 5.13. OMAP3 ALSA Driver : Half duplex playback Figure 5.14. OMAP3 ALSA Driver : Half duplex record Platform Support Products Version 02.01.01.08...
  • Page 81 Audio Driver Driver Interface 5.5.2. Driver Interface This section describes the various function entry points into the various platform specific drivers of the audio driver. The platform specific codec drivers are required to implement the mentioned entry points and register with the device driver framework by calling platform_driver_register and platform_device_register with the appropriate data structures.
  • Page 82 Audio Driver Driver Interface close Codec clean up operations are done here. This function is the last to be called and is to be designed to request all the communication paths to shutdown. Codec is no longer operational at the end of this stage. ioctl This is used for any special action to pcm ioctls.
  • Page 83 Audio Driver Driver Interface 5.5.2.2. States Figure 5.15. State Diagram The diagram above defines the various generic high level states through which the audio driver transitions during its life time. On the driver initialization, the various data structures are initialized, all the devices are registered and basic operations to make the driver ready for operation are done.
  • Page 84 Audio Driver Driver Interface During operational or ready stage, if a suspend request is received, the driver locks out any further data transfers and enters into suspended state after shutting down the codec. On resumption, the driver moves into ready state after re-initializing the codec, awaiting further data transfers to happen.
  • Page 85 Audio Driver Sample Applications 5.6. Sample Applications This chapter describes the sample application provided along with the package. The binary and the source for these sample application can are available in the Examples directory of the Release Package folder. 5.6.1. Introduction Writing an audio application involves the following steps: •...
  • Page 86 Audio Driver A minimal playback application int err; short buf[BUFF_SIZE]; int rate = 44100; /* Sample rate */ unsigned int exact_rate; /* Sample rate returned by */ /* Handle for the PCM device */ snd_pcm_t *playback_handle; /* Playback stream */ snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;...
  • Page 87 Audio Driver A minimal playback application Before we can write PCM data to the soundcard, we have to specify access type, sample format, sample rate, number of channels, number of periods and period size. First, we initialize the hwparams structure with the full configuration space of the soundcard: /* Init hwparams with full configuration space */ if ((err = snd_pcm_hw_params_any (playback_handle,...
  • Page 88 Audio Driver A minimal playback application if (rate != exact_rate) { fprintf(stderr, "The rate %d Hz is not supported by your hardware.\n ==> Using %d Hz instead.\n", rate, exact_rate); /* Set number of channels */ if ((err = snd_pcm_hw_params_set_channels (playback_handle, hw_params, 2)) <...
  • Page 89 Audio Driver A minimal record application After the PCM playback is started, we have to make sure that our application sends enough data to the soundcard buffer. Otherwise, a buffer under-run will occur. After such an under-run has occurred, snd_pcm_prepare should be called. 5.6.2.4.
  • Page 90 Audio Driver A minimal record application snd_strerror (err)); exit (1); memset(buf,0,BUFF_SIZE); /* Allocate the snd_pcm_hw_params_t structure on the stack. */ if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)); exit (1); /* Init hwparams with full configuration space */ if ((err = snd_pcm_hw_params_any (capture_handle, hw_params)) <...
  • Page 91 Audio Driver A minimal record application /* Set number of channels */ if ((err = snd_pcm_hw_params_set_channels(capture_handle, hw_params, 2)) < 0) { fprintf (stderr, "cannot set channel count (%s)\n", snd_strerror (err)); exit (1); /* Apply HW parameter settings to PCM device and * prepare device.
  • Page 92 Audio Driver Revision History 5.7. Revision History 0.95 Original version 0.97 Added proc and device related information and reorganized the content. 0.97p1 Added constraint that configuration of capture and playback streams in different sampling rates is not possible because of McBSP instance 2 limitation. 02.00.00 Moved to kernel version 2.6.26 and alsa core version 1.0.16.
  • Page 93 Display Driver Abstract This chapter provides detailed description of feature set and software interface for the display driver implementation. Table of Contents 6.1. Introduction ................73 6.1.1. References ............... 73 6.1.2. Acronyms & Definitions ............73 6.1.3. Hardware Overview ............73 6.2.
  • Page 94 Display Driver 6.6. Sample Application Flow ............113 6.7. Revision History ............... 115 Platform Support Products Version 02.01.01.08...
  • Page 95: Introduction

    Display Driver Introduction 6.1. Introduction This chapter describes the driver overview along with the supported features and constraints 6.1.1. References Video for Linux Two Home Page [http://linux.bytesex.org/v4l2/] Video for Linux Two API Specification [http://v4l2spec.bytesex.org/ v4l2spec/v4l2.pdf] 6.1.2. Acronyms & Definitions Acronym Definition V4L2 Video for Linux Two...
  • Page 96: Features

    Display Driver Features 6.2. Features 6.2.1. Overview The OMAP35x Display driver supports the following features: • Supports LCD display interface at VGA resolution (480*640) • Supports TV display interface at NTSC resolutions on Video Pipelines (only S-Video out is supported, composite out is not supported) •...
  • Page 97 Display Driver Usage /* call to open a video Display logical channel in blocking mode */ video2fd_blocking =open ("/dev/v4l/video1", O_RDWR); /* closing of channels */ close (video2fd_blocking); FBDEV Driver The driver will expose one software channels (/dev/fb0) for the graphics pipeline.
  • Page 98 Display Driver Usage OMAP3EVM# setenv bootargs console=ttyS0,115200n8 mem=128M root=/dev/nfs noinitrd nfsroot=172.24.190.19:nfs-server/ home,nolock,rsize=4096,wsize=4096,proto=tcp ip=dhcp omap_vout.video1_numbuffers=3 omap_vout.video2_numbuffers=3 omap_vout.video1_bufsize=64400 omap_vout.video2_bufsize=64400 omap_vout.vid1_static_vrfb_alloc=y omap_vout.vid2_static_vrfb_alloc=y Note The entire command should be entered in a single line. FBDEV Driver FBDEV driver supports command line argument for enabling/setting rotation angle, rotation type and size of vram.
  • Page 99 Display Driver Usage 6.2.2.3. Buffer Management Driver Without Rotation With Rotation FBDEV Driver A single buffer size single buffer size 1280*720*4*2 bytes 2048*720*4 bytes V4L2 Driver Single buffer takes Same requirement 1280*720*4 bytes. Number without rotation. of buffers can be configures Additionally allocates one using VIDIOC_REQBUFS...
  • Page 100 Display Driver Usage exchange mechanism. Driver always allocates buffers of maximum image size supported. If application wants to change buffer size, it can be done through video1_buffsize and video2_buffsize command line arguments When rotation is enabled, driver also allocates buffer for the VRFB virtual memory space along with the mmap or user buffer.
  • Page 101 Display Driver Usage 3) Mapping Kernel space address to user space Mapping the kernel buffer to the user space can be done via mmap. User can pass buffer size and physical address of buffer for getting the user space address /* allocate buffer by VIDIOC_REQBUFS */ /* query the buffer using VIDIOC_QUERYBUF */ /* addr hold the user space address */...
  • Page 102 Display Driver Usage printf("Resolution = %dx%d\n",var.xred, var.yres); printf("bites per pixel = %d\n",var.bpp); 3) Mapping Kernel space address to user space Mapping the kernel buffer to the user space can be done via mmap system call. /* addr hold the user space address */ unsigned int addr, buffersize;...
  • Page 103 Display Driver Usage change the rotation angle. Rotation angle cannot be changed while streaming is on. Following code shows how to set rotation angle to 90 degree. Important Rotation value must be set using VIDIOC_S_CTRL before setting any format using VIDIOC_S_FMT as VIDIOC_S_FMT uses rotation value for calculating buffer formats.
  • Page 104 Display Driver Usage Important var.rotate variable should not be modified when rotation is not selected through command line arguments else behaviour is unexpected. Currently, rotation is only supported for 16 bits-per-pixel display mode. Rotation enabled using "omapfb.rotate=1" "omapfb.rotate_type=1" boot time argument given to the boot loader. Following gives an example of enabling rotation by setting rotation angle of 90 degree.
  • Page 105 Display Driver Usage Figure 6.1. Video source color Keying Version 02.01.01.08 Platform Support Products...
  • Page 106 Display Driver Usage Figure 6.2. Video destination color Keying Constraint:The video source transparency color key and graphics destination transparency color key cannot be active at the same time. Color keys are only available in V4L2 Driver. Video source transparency color key value allows defining a color that the matching pixels with that color in the video pipelines are replaced by the pixels in graphics pipeline.
  • Page 107 Display Driver Usage /* Set SRC_COLOR_KEYING if device supports that */ if(framebuffer.capability & V4L2_FBUF_CAP_SRC_CHROMAKEY) { framebuffer.flags |= V4L2_FBUF_FLAG_SRC_CHROMAKEY; ret = ioctl (fd, VIDIOC_S_FBUF, &framebuffer); if (ret < 0) { perror ("VIDIOC_S_FBUF"); exit(1); Below example shows how to disable source color keying struct v4l2_framebuffer framebuffer;...
  • Page 108 Display Driver Usage ret = ioctl (fd, VIDIOC_G_FBUF, &framebuffer); if (ret < 0) { perror ("VIDIOC_G_FBUF"); exit(1); if(framebuffer.capability & V4L2_FBUF_CAP_CHROMAKEY) { framebuffer.flags &= ~V4L2_FBUF_FLAG_CHROMAKEY; ret = ioctl (fd, VIDIOC_S_FBUF, &framebuffer); if (ret < 0) { perror ("VIDIOC_S_FBUF"); exit(1); Below program listing shows how to set the chromakey value. Please note that chroma key value should be set before enabling the chroma keying.
  • Page 109 Display Driver Usage 6.2.2.6. Alpha Blending Alpha blending is a process of blending a foreground color with a background color and producing a new blended color. New blended color depends on the transparency factor referred to as alpha factor of the foreground color. If the alpha factor is 100% then blended image will have only foreground color.
  • Page 110 Display Driver Usage Figure 6.4. Alpha blending with almost 100% transparency Figure 6.5. Alpha blending with almost 0% transparency Overlay manager of DSS is capable of supporting the alpha blending. This is done by displaying more that one layer (video and graphics) to the same output device TV or LCD.
  • Page 111 Display Driver Usage and video2 is on top of video1. While in alpha mode video1 plane is at bottom, video2 is on top of video1, and graphics plane is above video2. Alpha mode is selectable on any of the output device TV or LCD. Video2 and graphics layer of the DSS is capable of supporting alpha blending.
  • Page 112 Display Driver Usage V4l2 driver supports alpha blending through ARGB pixel format as well as global alpha value. To set the pixel alpha value set ARGB format by setting format type to V4L2_PIX_FMT_RGB32. Call VIDIOC_S_FMTioctl of the driver to set it to ARGB format.
  • Page 113 Display Driver Usage fb_var_screeninfo var; /* Get variable screen information. Variable screen information * gives information like size of the image, bites per pixel, * virtual size of the image etc. */ ret = ioctl(display_fd, FBIOGET_VSCREENINFO, &var); if (ret < 0) { perror("Error reading variable information.\n");...
  • Page 114 Display Driver Usage Video layer supports following buffer format: YUYV, UYVY, RGB565, RGB24 (packed and unpacked). The corresponding v4l2 defines for pixel format are V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_RGB565, V4L2_PIX_FMT_RGB32. (For video1 and V4L2_PIX_FMT_RGB24 (packed), video2 V4L2_PIX_FMT_RGB32 corresponds to RGB24 unpacked). Buffer format can be changed using VIDIOC_S_FMT ioctl with type as V4L2_BUF_TYPE_VIDEO_OUTPUT and appropriate pixel format type.
  • Page 115 Display Driver Usage Figure 6.6. 1-BPP Data Memory Organization Figure 6.7. 2-BPP Data Memory Organization Figure 6.8. 4-BPP Data Memory Organization Figure 6.9. 8-BPP Data Memory Organization Figure 6.10. 12-BPP Data Memory Organization Version 02.01.01.08 Platform Support Products...
  • Page 116 Display Driver Usage Figure 6.11. 16-BPP Data Memory Organization Figure 6.12. 24-BPP Data Memory Organization Figure 6.13. ARGB 32-BPP Data Memory Organization Figure 6.14. RGBA 32-BPP Data Memory Organization Figure 6.15. 24-BPP Packed Data Memory Organization Platform Support Products Version 02.01.01.08...
  • Page 117 Display Driver Usage Figure 6.16. UYVY 4:2:2 Data Memory Organization Figure 6.17. YUV2 4:2:2 Data Memory Organization 6.2.2.8. Display Window The video pipelines can be connected to either an DVI output LCD output or a TV output through compile time option. Although the display Driver computes a default display window whenever the image size or cropping is changed, an application should position the display window via the VIDIOC_S_FMT I/O control with the V4L2_BUF_TYPE_VIDEO_OVERLAY buffer type.
  • Page 118 Display Driver Usage buffer type. When application calls V4L2_BUF_TYPE_VIDEO_OUTPUT VIDIOC_S_FMT ioctl, driver sets default cropping rectangle that is the largest rectangle no larger than the image size and display windows size. The default cropping rectangle is centered in the image. All cropping dimensions are rounded down to even numbers.
  • Page 119 Display Driver Usage fmt.fmt.win.w.width = 200; fmt.fmt.win.w.height = 200; ret = ioctl(fd, VIDIOC_S_FMT, &fmt); if (ret < 0) { perror("VIDIOC_S_FMT\n"); close(fd); exit(0); /* Changing crop window size to 400x400 */ crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; crop.c.left = 0; crop.c.top = 0; crop.c.width = 400; crop.c.height = 400;...
  • Page 120 Display Driver Usage ioctl. Once driver allocates the requested buffers application should call VIDIOC_QUERYBUF and mmap to get the physical address of the buffers and map the kernel memory to user space as explained earlier. Following are the steps to enable streaming. 1.
  • Page 121 Display Driver Usage exit(0); /* Fill the buffer with new data fill(buff_info[buf.index].start, fmt.fmt.pix.width, fmt.fmt.pix.height,0); /Queue the buffer again */ ret = ioctl(fd, VIDIOC_QBUF, &buf); if(ret < 0){ perror("VIDIOC_QBUF\n"); for (j = 0; j < req.count; j++){ /* Unmap all the buffers if call fails */ exit(0);...
  • Page 122: Architecture

    Display Driver Architecture 6.3. Architecture This chapter describes the Driver Architecture and Design concepts 6.3.1. Driver Architecture OMAP35x display hardware integrates one graphics pipeline, two video pipelines, and two overlay managers (one for digital and one for analog interface). Digital interface is used for LCD and DVI output and analog interface is used for TV out.
  • Page 123 Display Driver Software Design Interfaces Display Library This is a HAL/functional layer controlling the bulk of DSS hardware. It exposes the number of APIs controlling the overlay managers, clock, and pipelines to the user interface drivers like V4L2 and FBDEV. It also exposes the functions for registering and de-registering of the various display devices like LCD and DVI to the DSS overlay managers.
  • Page 124: Software Interfaces

    Display Driver Software Interfaces 6.4. Software Interfaces 6.4.1. 'fbdev' Driver Interface 6.4.1.1. Application Interface open () To open a framebuffer device close () To close a framebuffer device ioctl () To send ioctl commands to the framebuffer driver. mmap () To obtain the framebuffer region as mmap'ed area in user space.
  • Page 125: V4L2 Driver Interface

    Display Driver V4L2 Driver Interface 6.4.1.3. Data Structures fb_var_screeninfo This structure is used to query and set the so-called variable screen information. This allows an application to query or change the display mode, including the color depth, resolution, timing etc. fb_fix_screeninfo This structure is used by applications to get the fixed properties of the display, e.g.
  • Page 126 Display Driver V4L2 Driver Interface VIDIOC_ENUM_FMT This is used to enumerate the image formats that are supported by the driver. The driver fills a v4l2_fmtdesc struct. VIDIOC_G_FMT This is used to get the current image format or display window depending on the buffer type.
  • Page 127: Sysfs Software Design Interfaces

    Display Driver SYSFS Software Design Interfaces VIDIOC_QBUF This is used to queue a buffer by passing a v4l2_buffer struct associated to that buffer. VIDIOC_DQBUF This is used to dequeue a buffer by passing a v4l2_buffer struct associated to that buffer. VIDIOC_STREAMON This is used to turn on streaming.
  • Page 128: Driver Configuration

    Display Driver Driver Configuration 6.5. Driver Configuration 6.5.1. Configuration Steps To enable V4L2 video driver: Open menuconfig options from kernel command prompt. Select Device Drivers as shown here: Figure 6.19. Configure V4L2 video Driver: Step 2 Select Device Drivers > Multimedia devices as shown here: Figure 6.20.
  • Page 129 Display Driver Configuration Steps Figure 6.21. Configure V4L2 video Driver: Step 4 Select Device Drivers > Multimedia devices > Video capture adapaters as shown here and go inside the main menu: Figure 6.22. Configure V4L2 video Driver: Step 5 Select OMAP2/OMAP3 V4L2-DSS Drivers.Select Videoout library Videoout driver support under OMAP2/OMAP3 V4L2-DSS Drivers Version 02.01.01.08 Platform Support Products...
  • Page 130 Display Driver Configuration Steps Figure 6.23. Configure V4L2 video Driver: Step 6 To enable Frame buffer driver. Open menuconfig options from kernel command prompt. Select Device Drivers as shown here: Figure 6.24. Configure Graphics display Driver: Step 2 Select Device Drivers > Graphics Supports as shown here: Platform Support Products Version 02.01.01.08...
  • Page 131 Display Driver Configuration Steps Figure 6.25. configure Graphics display Driver: Step 3 Select Support for frame buffer devices under Graphics support as shown. Figure 6.26. configure Graphics display Driver: Step 4 Select OMAP2/3 Frame buffer support (EXPERIMENTAL) and 1 as Number of Frame buffers.
  • Page 132 Display Driver Configuration Steps Figure 6.27. configure Graphics display Driver: Step 5 There are some other configuration parameters which user can select during building of kernel - - Select the TV as the default output device for Video1 and Video2 pipeline - Select the NTSC_M as the default mode for TV.
  • Page 133: Installation

    Display Driver Installation Open menuconfig options from kernel command prompt. Select Device Drivers > Multimedia devices > Video capture adapaters as mentioned in section "V4L2 video driver:" Select "Use NTSC_M Mode" as the TV mode from the choice menu. Figure 6.29. Select NTSC_M as TV mode: Step 6 6.5.2.
  • Page 134 Display Driver Installation rmmod omap_vout.ko rmmod omap_voutlib.ko Platform Support Products Version 02.01.01.08...
  • Page 135 Display Driver Sample Application Flow 6.6. Sample Application Flow This chapter describes the application flow using the V4l2 and FBDEV drivers. Figure 6.30. Application for v4l2 driver using MMAP buffers Version 02.01.01.08 Platform Support Products...
  • Page 136 Display Driver Sample Application Flow Figure 6.31. Application for FBDEV driver Platform Support Products Version 02.01.01.08...
  • Page 137 Display Driver Revision History 6.7. Revision History 02.01.00 Created for the first git release. 02.01.01 Updated for the second snapshot release. Version 02.01.01.08 Platform Support Products...
  • Page 138 Version 02.01.01.08 Platform Support Products...
  • Page 139 Resizer Driver Abstract This chapter provides detailed description of feature set and software interface for the video resizer driver implementation. Table of Contents 7.1. Introduction ................118 7.1.1. References ..............118 7.1.2. Acronyms ..............118 7.1.3. Hardware Overview ............118 7.2.
  • Page 140: Introduction

    Resizer Driver Introduction 7.1. Introduction This section provides overview of the Resizer Hardware. 7.1.1. References • Video for Linux Two API Specification [http://v4l2spec.bytesex.org/ v4l2spec/v4l2.pdf] 7.1.2. Acronyms • V4L2: Video For Linux 2 7.1.3. Hardware Overview The OMAP Resizer module enables up scaling and down scaling. It resizes YUV422 image and stores output image in the RAM.
  • Page 141: Features

    Resizer Driver Features 7.2. Features This section describes features supported by the resizer driver. 7.2.1. Overview of features supported The Resizer driver supports the following features: • Resizes input frame stored in RAM and stores output frame in RAM. • Supports resizing from 1/4x to 4x.
  • Page 142 Resizer Driver Usage of Features buffers need to be virtually contiguous. Physically buffers can be scattered in the memory. The Resizer Driver supports two memory usage models. • Memory map/Driver allocated buffer mode • User Pointer Exchange 7.2.2.2.1. Memory map/Driver Allocated buffer In Memory map buffer mode, application can request memory from the driver by calling RSZ_REQBUF ioctl.
  • Page 143 Resizer Driver Usage of Features The RSZ_QUERYBUF IOCTL can obtain the physical address of the allocated buffer. Application has to specify the index, buffer type and buffer's memory type at time of calling this ioctl. Buffer type must be V4L2_BUF_TYPE_VIDEO_CAPTURE. Index of each type of buffer starts from 0.
  • Page 144 Resizer Driver Usage of Features struct v4l2_requestbuffers reqbuf; reqbuf. type =V4L2_BUF_TYPE_VIDEO_CAPTURE; reqbuf.count = 2; /* number of buffers */ reqbuf.memory = V4L2_MEMORY_USERPTR; /* Type of buffer exchange mechanism if(ioctl(rszfd, RSZ_REQBUF, &reqbuf)< 0) { perror("RSZ_REQBUF failed\n"); close(rszfd); exit(-1); /* This above example will allocate 2 buffer descriptors */ 7.2.2.3.
  • Page 145 Resizer Driver Usage of Features Where sph = horizontal starting phase spv = vertical starting phase ow = output width oh = output height hrsz = horizontal resize value vrsz = vertical resize value. Application sets the resizing ratio by providing input size and output size parameters in RSZ_S_PARAMS ioctl.
  • Page 146 Resizer Driver Usage of Features by providing one of RSZ_INTYPE_YCBCR422_16BIT or RSZ_INTYPE_PLANAR_8BIT value to inptype member of rsz_params structure. Configured input image format is used for both input and output image. When YUV422 interleaved (packed) image format is selected, resizer module resizes entire image and stores it in output buffer.
  • Page 147: Constraints

    Resizer Driver Constraints 7.2.2.3.6. Configuring the Read cycle for Resizer module ISP module supports configuration of number of clock cycles between two consecutive read request from resizer module. Value supported is 0 - 0x3FF. unsigned int read_exp; read_exp = 0xe; ret_val = ioctl(fd, RSZ_S_EXP, &read_exp);...
  • Page 148: Architecture

    Resizer Driver Architecture 7.3. Architecture Following block diagram shows the basic architecture of the Resizer Driver - Figure 7.2. Basic Architecture of Resizer Driver Resizer Driver provides Resizer Hardware access to a channel by using Linux Character driver interface. Driver supports all the features supported by the hardware.
  • Page 149: Software Interface

    Resizer Driver Software Interface 7.4. Software Interface This section describes Data Structures, Enumerations, Specifications used in the OMAP Resizer Driver. 7.4.1. Application Programming Interface 7.4.1.1. open Description Opens the device driver for processing. Prototype int fd = open(device_name, mode); Field Description It is /dev/omap-resizer device_name...
  • Page 150: Ioctls

    Resizer Driver IOCTLs 7.4.1.3. mmap Description Map the kernel space buffer to user space. Prototype void * mmap(void *, size_t image_size, int prot, int flags, int fd, off_t offset) Field Description Generally NULL void * Buffer size that needs to be mapped image_size flag PROT_SHARED...
  • Page 151: Resizer: Ioctl Rsz_S_Params Arguments

    Resizer Driver IOCTLs 7.4.2.1. RSZ_S_PARAMS Description Set the resizer parameters necessary for processing. Prototype int ioctl(int fd, RSZ_S_PARAMS, struct rsz_params *argp) Field Description File handle associated with fd. RSZ_S_PARAMS ioctl command. Pointer to rsz_params structure. argp Table 7.6. Resizer: ioctl RSZ_S_PARAMS arguments Return Values Zero on success, EINVAL, if parameters are incorrect.
  • Page 152: Resizer: Ioctl Rsz_G_Status Argument

    Resizer Driver IOCTLs Get the channel status for the particular current Resizer channel. Prototype int ioctl(int fd, RSZ_G_STATUS, struct rsz_status *argp) Field Description File handle associated with fd. RSZ_G_STATUS ioctl command. Pointer to rsz_status structure. argp Table 7.8. Resizer: ioctl RSZ_G_STATUS argument Return Values Zero on success, 7.4.2.4.
  • Page 153: Resizer: Ioctl Rsz_Resize Arguments

    Resizer Driver IOCTLs Field Description File handle associated with fd. RSZ_RESIZE ioctl command. Pointer to int. argp Table 7.10. Resizer: ioctl RSZ_RESIZE arguments Return Values Zero on success, EINVAL, if parameters are incorrect. EBUSY/EINTR, if device is in use by the same channel handle. 7.4.2.6.
  • Page 154: Resizer: Ioctl Rsz_Querybuf Arguments

    Resizer Driver Data Structures Field Description File handle associated with fd. RSZ_QUERYBUF ioctl command. Pointer to v4l2_buffer structure. argp Table 7.12. Resizer: ioctl RSZ_QUERYBUF arguments Return Values Zero on success, EINVAL/EFAULT, if parameters are incorrect. EINTR, if device is in use by the same channel handle. 7.4.2.8.
  • Page 155: Resizer: Parameters Configuration Structure Fields

    Resizer Driver Data Structures __s32 in_pitch; __s32 inptyp; __s32 vert_starting_pixel; __s32 horz_starting_pixel; __s32 cbilin; __s32 pix_fmt; __s32 out_hsize; __s32 out_vsize; __s32 out_pitch; __s32 hstph; __s32 vstph; __u16 tap4filt_coeffs[32]; __u16 tap7filt_coeffs[32]; struct rsz_yenh yenh_params; Name Description Width of the input image in pixels. in_hsize Height of the input image in pixels.
  • Page 156 Resizer Driver Data Structures Name Description Buffer type V4L2_BUF_TYPE_VIDEO_CAPTURE. type Number of buffers to be allocated. count Type buffer exchange mechanism memory requested. Table 7.15. Resizer: Request Buffer Structure fields 7.4.3.3. Buffer structure struct v4l2_buffer { unsigned int index; unsigned int type; enum v4l2_memory memory;...
  • Page 157 Resizer Driver Data Structures 7.4.3.5. Status structure struct rsz_status { __s32 chan_busy; __s32 hw_busy; __s32 src; Name Description Status of the channel. chan_busy Status of the hardware. hw_busy Input source. Table 7.18. Resizer: Status structure fields 7.4.3.6. Crop Size structure struct rsz_cropsize { __u32 hcrop;...
  • Page 158 Resizer Driver Data Structures Platform Support Products Version 02.01.01.08...
  • Page 159: Driver Configuration

    Resizer Driver Driver Configuration 7.5. Driver Configuration 7.5.1. Configuration Steps To enable OMAP Resizer driver: Open menuconfig options from kernel command prompt. Select Device Drivers as shown here: Figure 7.3. Configure omap-resizer Driver: Step 2 Select Device Drivers > Multimedia devices as shown here: Figure 7.4.
  • Page 160 Resizer Driver Configuration Steps Figure 7.5. Configure omap-resizer Driver: Step 4 Select Device Drivers > Multimedia devices > Video capture adapaters as shown here and go inside the main menu: Figure 7.6. Configure omap-resizer Driver: Step 5 Select "OMAP ISP Resizer" option to enable resizer driver, Platform Support Products Version 02.01.01.08...
  • Page 161 Resizer Driver Configuration Steps Figure 7.7. Configure omap-resizer Driver: Step 6 Version 02.01.01.08 Platform Support Products...
  • Page 162: Sample Application Flow

    Resizer Driver Sample Application Flow 7.6. Sample Application Flow This section shows application flow diagram for resizer application. Figure 7.8. Resizer Sample Application Flow Platform Support Products Version 02.01.01.08...
  • Page 163: Revision History

    Resizer Driver Revision History 7.7. Revision History 0.97 Initial Draft. 02.00.00 Moved to GIT kernel basline. 02.00.01 Updated for the second snapshot release. Version 02.01.01.08 Platform Support Products...
  • Page 164 Version 02.01.01.08 Platform Support Products...
  • Page 165 Daughter Card Module Abstract This chapter provides detailed description of feature set supported on Daughter Card and software package. Table of Contents 8.1. Mass Market Daughter Card ............144 8.1.1. Acronyms & Definitions ............ 144 8.1.2. Introduction ..............144 8.2. Block Diagram ................145 8.3.
  • Page 166: Mmdc Acronyms

    Daughter Card Module Mass Market Daughter Card 8.1. Mass Market Daughter Card 8.1.1. Acronyms & Definitions Acronym Definition MMDC Multi-Media Daughter Card/Customer Daughter Card Table 8.1. MMDC Acronyms 8.1.2. Introduction OMAP35x daughter-card (MMDC) supports following features which are not available on the main EVM. TVP5146 decoder interface supporting BT656 format.
  • Page 167: Block Diagram

    Daughter Card Module Block Diagram 8.2. Block Diagram The top level block depicts the features supported on the daughter-card. Figure 8.1. Block Diagram Version 02.01.01.08 Platform Support Products...
  • Page 168: Board Illustration

    Daughter Card Module Board Illustration 8.3. Board Illustration The various connectors and hardware modules on the daughter card are illustrated in the picture below: Figure 8.2. Board Illustration Platform Support Products Version 02.01.01.08...
  • Page 169: Features Supported Under Software

    Daughter Card Module Features supported under software 8.4. Features supported under software • Video capture (BT656 interface) using the TVP5146 decoder. • Support Composite and S-video interface only. • EHCI on USB port-2 using HSUSB TRANSCEIVER- USB83320. Version 02.01.01.08 Platform Support Products...
  • Page 170 Version 02.01.01.08 Platform Support Products...
  • Page 171 Capture Driver Abstract This chapter provides detailed description of feature set and software interface for the video Capture driver implementation. Table of Contents 9.1. Introduction ................150 9.1.1. References ..............151 9.1.2. Acronyms & Definitions ............ 152 9.2. Features ................. 153 9.2.1.
  • Page 172: Introduction

    Capture Driver Introduction 9.1. Introduction The camera ISP is a key component for imaging and video applications such as video preview, video record, and still-image capture with or without digital zooming. The camera ISP provides the system interface and the processing capability to connect RAW image-sensor modules and video decoders to the OMAP35x device.
  • Page 173: References

    It also has its own buffer management mechanism that can be used. 9.1.1. References OMAP35x Camera Interface Subsystem (ISP) TRM Author: Texas Instruments, Inc. Literature Number: SPRUFA2 OOMAP35x Memory Management Units (MMUs)TRM Author: Texas Instruments, Inc.
  • Page 174: Capture Driver Acronyms

    Capture Driver Acronyms & Definitions 9.1.2. Acronyms & Definitions Acronym Definition MMDC Mass Market Daughter Card/Customer Daughter Card Auto White Balance, Auto Focus, Auto Exposure Application Programming Interface CCDC Input interface block of ISP Direct Memory Access Input & Output IOCTL Input &...
  • Page 175: Features

    Capture Driver Features 9.2. Features 9.2.1. Supported features The ISP Capture Driver provides the following features: • Supports one software channel of capture and a corresponding device node (/dev/video0) is created. • Supports single I/O instance and multiple control instances. •...
  • Page 176 Capture Driver Known Issues • Video quality issues observed with video test patterns. • Buffer Constraints: - IO mapped buffer is not supported. - Platform Support Products Version 02.01.01.08...
  • Page 177: Architecture

    Capture Driver Architecture 9.3. Architecture 9.3.1. System Diagram Following block diagram shows basic architecture of the ISP Capture Driver. Figure 9.3. Capture Driver Basic Architecture The system architecture diagram illustrates the software components that are relevant to the Camera Driver. Some components are outside the scope of this design document.
  • Page 178 Capture Driver System Diagram Camera Driver: The Camera Driver allows capturing video through an external decoder. It is a V4L2-compliant driver with addition of an OMAP3 ISP hardware feature. This driver conforms to the Linux driver model for power management. The camera driver is registered to the V4L2 layer as a master device driver.
  • Page 179: Software Design Interfaces

    Capture Driver Software Design Interfaces user space algorithms to configure and request these statistics through custom IOCTLs. 9.3.2. Software Design Interfaces 9.3.2.1. Opening and Closing of driver The device can be opened using open call from the application, with the device name and mode of operation as parameters.
  • Page 180 Capture Driver Software Design Interfaces Ioctl: VIDIOC_REQBUFS It takes a pointer to instance of v4l2_requestbuffers structure as an argument. User should specify buffer type as (V4L2_BUF_TYPE_VIDEO_CAPTURE), number of buffers, and memory type (V4L2_MEMORY_MMAP, V4L2_MEMORY_USERPTR) at the time of buffer allocation. Constraint: This IOCTL can be called only once from the application.
  • Page 181 Capture Driver Software Design Interfaces close(fd); exit(-1); The buffer.m.offset will contain the physical address returned from driver. 3. Mapping Kernel Space Address to User Space Mapping the kernel buffer to the user space can be done via mmap. This is only required for MMAP buffer mode.
  • Page 182 Capture Driver Software Design Interfaces if (capability.capabilities & V4L2_CAP_VIDEO_CAPTURE) { printf("Capture capability is supported\n"); if (capability.capabilities & V4L2_CAP_STREAMING) { printf("Streaming is supported\n"); 9.3.2.4. Input Enumeration This IOCTL is used to enumerate the information of available inputs (analog interface). It includes information like name of input type and supported standards for that input type.
  • Page 183 Capture Driver Software Design Interfaces Example: int index = 1; /*To set S-Video input*/ struct v4l2_input input; ret = ioctl(fd, VIDIOC_S_INPUT, &index); if (ret < 0) { perror("VIDIOC_S_INPUT\n"); close(fd); return -1; input.index = index; ret = ioctl(fd, VIDIOC_ENUMINPUT, &input); if (ret < 0) { perror("VIDIOC_ENUMINPUT\n");...
  • Page 184 Capture Driver Software Design Interfaces printf("name of the input = %s\n", input.name); 9.3.2.7. Standard Enumeration This IOCTL is used to enumerate the information regarding video standards. This IOCTL is used to enumerate all the standards supported by the registered decoder. Ioctl: VIDIOC_ENUMSTD This IOCTL takes a pointer to v4l2_standard structure.
  • Page 185 Capture Driver Software Design Interfaces Ioctl: VIDIOC_QUERYSTD It takes a pointer to v4l2_std_id instance as an output argument. Driver will call the current decoder's function internally (which has been initialized) to detect the current standard set in hardware. Support of this IOCTL depends on decoder device, whether it can detect a standard or not.
  • Page 186 Capture Driver Software Design Interfaces particular standard. In this case, the decoder driver auto detect function is disabled. Auto detect can be enabled again only by closing and re-opening the driver. Example: v4l2_std_id std = V4L2_STD_NTSC; ret = ioctl(fd, VIDIOC_S_STD, &std); if (ret <...
  • Page 187 Capture Driver Software Design Interfaces break; if (standard.std & std) { printf("%s standard is selected\n"); break; i++; 9.3.2.11. Format Enumeration This IOCTL is used to enumerate the information of pixel formats. The driver supports only two pixel form at -8-bit UYVY interleaved and 8-bit YUYV interleaved.
  • Page 188 Capture Driver Software Design Interfaces Please note that, V4L2_FIELD_INTERLACED is the only storage format supported. The application can decide the buffer pixel format using pixelformat member of this IOCTL. The current driver supports - 8-bit UYVY interleaved and 8-bit YUYV interleaved formats. The desired pitch of the buffer can be set by using the bytesperline member.
  • Page 189 Capture Driver Software Design Interfaces v4l2_format structure contains parameters like pixel format, image size, bytes per line, and field type. For type V4L2_BUF_TYPE_VIDEO_CAPTURE, the v4l2_pix_format structure of fmt union is filled. Example: struct v4l2_format fmt; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ret = ioctl(fd, VIDIOC_G_FMT, &fmt); if (ret <...
  • Page 190 Capture Driver Software Design Interfaces if (ret < 0) { perror("VIDIOC_TRY_FMT\n"); close(fd); return -1; 9.3.2.15. Query Control This IOCTL is used to get the information of controls that is, brightness, contrast, and so on supported by the current decoder. Ioctl: VIDIOC_QUERYCTRL This IOCTL takes a pointer to the instance of v4l2_queryctrl structure as the argument and returns the control information in the same pointer.
  • Page 191 Capture Driver Software Design Interfaces struct v4l2_control ctrl; ctrl.id = V4L2_CID_CONTRAST; ctrl.value = 100; ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl); if (ret < 0) { perror("VIDIOC_S_CTRL\n"); close(fd); return -1; 9.3.2.17. Get Control This IOCTL is used to get the value for a particular control in the current decoder. Ioctl: VIDIOC_G_CTRL It takes a pointer to instance of v4l2_control structure as an output parameter.
  • Page 192 Capture Driver Software Design Interfaces user pointer buffer exchange mechanism, application also has to provide buffer pointer in the m.userptr member of v4l2_buffer structure. Driver will enqueue buffer in the driver's incoming queue. It will take pointer to instance of v4l2_ buffer structure as an input parameter. Example: struct v4l2_buffer buf;...
  • Page 193 Capture Driver Software Design Interfaces ret = ioctl(fd, VIDIOC_DQBUF, &buf); if (ret < 0) { perror("VIDIOC_DQBUF\n"); close(fd); return -1; 9.3.2.20. Stream On This IOCTL is used to start video capture functionality. Ioctl: VIDIOC_STREAMON If streaming is already started, this IOCTL call returns an error. Example: v4l2_buf_type buftype = V4L2_BUF_TYPE_VIDEO_CAPTURE;...
  • Page 194: Driver Configuration

    Capture Driver Driver Configuration 9.4. Driver Configuration 9.4.1. Configuration Steps To enable capture driver support in the kernel: Open menuconfig options from kernel command prompt. Select System Type as shown here: Figure 9.4. Configure Capture Driver: Step 2 Select System Type > OMAP 3530 EVM daughter card board option as shown here: Platform Support Products Version 02.01.01.08...
  • Page 195 Capture Driver Configuration Steps Figure 9.5. Configure Capture Driver: Step 3 Go back to Main Menu and select Device Drivers as shown here: Figure 9.6. Configure Capture Driver: Step 4 Select Device Drivers > Multimedia devices as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 196 Capture Driver Configuration Steps Figure 9.7. Configure Capture Driver: Step 5 Select Device Drivers > Multimedia devices > Video capture adapters as shown here: Figure 9.8. Configure Capture Driver: Step 6 Platform Support Products Version 02.01.01.08...
  • Page 197 Capture Driver Configuration Steps Select Device Drivers > Multimedia devices > Video capture adapters > OMAP 3 Camera support as shown here: Figure 9.9. Configure Capture Driver: Step 7 Select Device Drivers > Multimedia devices > Video capture adapters > Encoders/decoders and other helper chips as shown here: Version 02.01.01.08 Platform Support Products...
  • Page 198 Capture Driver Configuration Steps Figure 9.10. Configure Capture Driver: Step 8 Select Device Drivers > Multimedia devices > Video capture adapters > Encoders/decoders and other helper chips > Texas Instruments TVP514x video decoder as shown here: Platform Support Products Version 02.01.01.08...
  • Page 199: Installation

    Capture Driver Installation Figure 9.11. Configure Capture Driver: Step 9 9.4.2. Installation 9.4.2.1. Driver built statically If the OMAP35x Camera driver and TVP514x driver are built statically into the kernel, it is activated during boot-up. There is no special procedure to install the driver.
  • Page 200 Capture Driver Installation rmmod tvp514x.ko Platform Support Products Version 02.01.01.08...
  • Page 201: Sample Applications

    Capture Driver Sample Applications 9.5. Sample Applications This chapter describes the sample application provided along with the package. The binary and the source for these sample application can are available in the Examples directory of the Release Package folder. 9.5.1. Introduction Writing a capture application involves the following steps: •...
  • Page 202 Version 02.01.01.08 Platform Support Products...
  • Page 203 USB Driver Abstract This chapter describes set of features supported by the USB driver. Table of Contents 10.1. Introduction ................183 10.1.1. References ..............183 10.1.2. Hardware Overview ............183 10.2. Features ................185 10.2.1. Supported ..............185 10.2.2. Not supported ............... 185 10.3.
  • Page 204 USB Driver 10.3.12. CDC/RNDIS gadget ............194 10.3.13. USB OTG (HNP/SRP) testing .......... 195 10.4. Software Interface ..............197 10.4.1. sysfs ................197 10.4.2. procfs ................197 10.5. Revision history ..............198 Platform Support Products Version 02.01.01.08...
  • Page 205: Introduction

    USB Driver Introduction 10.1. Introduction TI OMAP35x has a host cum gadget controller MUSB OTG,an EHCI and its companion OHCI controller.There are three USB ports which are to be controlled by either EHCI or OHCI controller individually. In ES2.0/2.1 silicon all the three port can either be configured in PHY mode or in TLL mode at a time.This limitation got resolved in ES3.0/3.1 silicon where PHY/TLL mode selection can be done on per port basis.
  • Page 206 USB Driver Hardware Overview Figure 10.1. MUSB OTG: Location of Mini-AB receptacle on the EVM Figure 10.2. MUSB OTG: Location of USB PHY from NXP on the EVM The OMAP35x HS USB port2 is connected to SMSC USB83320 high speed phy in ULPI mode on Mistral/Multimedia daughter card thus only EHCI controller can be supported on port2.Port1 and Port3 are not available on Mistral daughter card.
  • Page 207: Features

    USB Driver Features 10.2. Features The MUSB OTG and EHCI drivers supports a significant subset of all the features provided by the USB controller. The following section discusses the supported and unsupported features in this release. 10.2.1. Supported The Driver supports the following features for MUSB OTG port: •...
  • Page 208: Driver Configuration

    USB Driver Driver configuration 10.3. Driver configuration The MUSB OTG controller is used in Host and Gadget modes while EHCI is used only in Host mode.The following section shows the configuration options for USB and its associated class drivers. 10.3.1. USB phy selection for MUSB OTG port Please select NOP USB transceiver for MUSB support.
  • Page 209: Musb Otg Controller In Gadget Mode

    USB Driver MUSB OTG controller in gadget mode [*] USB device filesystem [*] USB device class-devices (DEPRECATED) <*> EHCI HCD (USB2.0) Support Daughter card used on OMAP35xx EVM (Mistral daughter card) ---> [*] Select PHY/TLL mode for USB ports on OMAP24xx/OMAP35xx ---> Port2 in PHY/TLL mode (PHY mode) --->...
  • Page 210: Musb Otg Controller In Otg Mode

    USB Driver MUSB OTG controller in OTG mode 10.3.4. MUSB OTG controller in OTG mode 10.3.4.1. OTG Configuration Both Host and Gadget driver should be selected for OTG support.If gadget driver is build as module then the host side module will be initialized only after gadget module is inserted after bootup.
  • Page 211: Host Mode Applications

    USB Driver Host mode applications 10.3.5. Host mode applications 10.3.5.1. Mass Storage Driver This figure illustrates the stack diagram of the system with USB Mass Storage class. Figure 10.3. USB Driver: Illustration of Mass Storage Class 10.3.6. USB Controller and USB MSC HOST 10.3.6.1.
  • Page 212: Usb Hid Class

    USB Driver USB HID Class [*] USB device class-devices (DEPRECATED) *** USB Host Controller Drivers *** <*> Inventra Highspeed Dual Role Controller (TI, ...) *** OMAP 343x high speed USB support *** Driver Mode (USB Host) ---> [ ] Disable DMA (always use PIO) [ ] Use System DMA for Rx endpoints [*] Enable debugging messages --- USB Device Class drivers...
  • Page 213: Usb Controller And Usb Hid

    USB Driver USB Controller and USB HID 10.3.8. USB Controller and USB HID 10.3.8.1. Configuration Device Drivers ---> USB support ---> <*> Support for Host-side USB *** Miscellaneous USB options *** [*] USB device filesystem [*] USB device class-devices (DEPRECATED) *** USB Host Controller Drivers *** <*>...
  • Page 214: Usb Video

    USB Driver USB Video [ ] Use System DMA for Rx endpoints [*] Enable debugging messages 10.3.9.2. Resources For testing USB Audio support we need any ALSA compliant audio player/capture application. Kindly read the Audio driver section to get more inputs on this. 10.3.10.
  • Page 215: Gadget Mode Applications

    USB Driver Gadget Mode Applications 10.3.11. Gadget Mode Applications File Storage Gadget: This is the Mass storage gadget driver. 10.3.11.1. Configuration Device Drivers ---> USB support ---> <*> Support for USB Gadgets USB Peripheral Controller (Inventra HDRC Peripheral(TI, ...)) ---> <M>...
  • Page 216: Cdc/Rndis Gadget

    USB Driver CDC/RNDIS gadget 10.3.12. CDC/RNDIS gadget The CDC RNDIS gadget driver that is used to send standard Ethernet frames using USB.Please enable "Use System DMA for Rx endpoints" to fix the flood ping hang issue with packet size of more than 16KB. 10.3.12.1.
  • Page 217: Usb Otg (Hnp/Srp) Testing

    USB Driver USB OTG (HNP/SRP) testing For details on usage of USBNet, refer this url. [http://embedded.seattle.intel research.net/wiki/index.php?title=Setting_up_USBnet] 10.3.13. USB OTG (HNP/SRP) testing Please choose the configuration as described in driver configuration section for OTG and follow the steps below for testing. Boot the OTG build image on two OMAP35xx EVM.
  • Page 218 USB Driver USB OTG (HNP/SRP) testing $ echo "S" > /proc/driver/musb_hdrc It will suspend the bus and role-switch will follow after that. Repeat step 4,5,6 and 7 for further testing. Platform Support Products Version 02.01.01.08...
  • Page 219: Software Interface

    USB Driver Software Interface 10.4. Software Interface The USB driver exposes its state/control through the sysfs and the procfs interfaces. The following sections talks about these. 10.4.1. sysfs SYSFS attribute Description mode entry /sys/devices/platform/ musb_hdrc.0/mode is a read-only entry. It will show the state of the OTG (though this feature is not supported) state machine.
  • Page 220: Revision History

    USB Driver Revision history 10.5. Revision history 02.00.00 Initial release. 02.01.00 Update for OTG and EHCI support. Platform Support Products Version 02.01.01.08...
  • Page 221 MMC Driver Abstract This chapter describes set of features supported by the MMC driver. Table of Contents 11.1. Introduction ................200 11.1.1. References ..............200 11.1.2. Acronyms & Definitions ..........200 11.2. Features ................201 11.2.1. Features Supported ............201 11.2.2.
  • Page 222: Introduction

    MMC Driver Introduction 11.1. Introduction TI OMAP 35x has an multimedia card high-speed/secure data/secure digital I/O (MMC/SD/SDIO) host controller, which provides an interface between microprocessor and either MMC, SD memory cards, or SDIO cards. The current version of the user guide talks about the MMC/SD controller.The MMC driver is implemented on top of host controller as a HSMMC controller driver and supports MMC, SD, SD High Speed and SDHC cards.
  • Page 223: Features

    MMC Driver Features 11.2. Features 11.2.1. Features Supported The Driver supports the following features: • The driver is built in-kernel (part of vmlinux). • MMC cards including High Speed cards. • SD cards including SD High Speed and SDHC cards. •...
  • Page 224: Revision History

    MMC Driver Revision History 11.3. Revision History 0.97 Document Created. 02.00.00 Moved to open source kernel version 2.6.26. Platform Support Products Version 02.01.01.08...
  • Page 225 Power Management Abstract Get to know the power management infrastructure available. This chapter also provides brief introduction to cpuidle framework as implemented in this release. Table of Contents 12.1. Introduction ................205 12.1.1. References ..............205 12.2. Features ................206 12.2.1.
  • Page 226 Power Management 12.5.3. SmartReflex ..............214 12.6. Revision History ..............216 Platform Support Products Version 02.01.01.08...
  • Page 227: Introduction

    Power Management Introduction 12.1. Introduction OMAP35x silicon provides a rich set of power management features. These features are described in detail in the OMAP35x TRM. In summary: • Clock control at the module and clock domain level. • 16 power domains i.e. 16 sets of one or more hardware modules sharing same power source.
  • Page 228: Features

    Power Management Features 12.2. Features The power management features available in this release are based on the proposed PM interface for OMAP. This interface is described in the filename Documentation/arm/OMAP/omap_pm. 12.2.1. Supported This is list of features supported in this release: •...
  • Page 229: Architecture

    Power Management Architecture 12.3. Architecture 12.3.1. cpuidle The cpuidle framework consists of two key components: • A governor that decides the target C-state of the system. • A driver that implements the functions to transition to target C-state. 12.3.1.1. System Diagram Figure 12.1.
  • Page 230 Power Management cpuidle State Description MPU WFI + Core active MPU WFI + Core inactive MPU CSWR + Core inactive MPU OFF + Core inactive MPU RET + CORE RET MPU OFF + CORE RET MPU OFF + CORE OFF Table 12.1.
  • Page 231: Dynamic Tick Suppression

    Power Management Dynamic Tick Suppression Important Functions omap2_block_sleep() and omap2_allow_sleep() should be used to protect idle state transition in a controlled and narrow scope - where driver is doing real work. Else, power consumption will increase. 12.3.2. Dynamic Tick Suppression The dynamic tick suppression is achieved through generic Linux framework for the same.
  • Page 232: Configuration

    Power Management Configuration 12.4. Configuration To enable/ disable power management start the Linux Kernel Configuration tool. $ make menuconfig Select Power management options from the main menu. Kernel Features ---> Boot options ---> CPU Power Management ---> Floating point emulation --->...
  • Page 233: Cpufreq

    Power Management cpufreq Floating point emulation ---> Userspace binary formats ---> Select CPU idle PM support to enable the cpuidle driver. [ ] CPU Frequency scaling [*] CPU idle PM support 12.4.2. cpufreq Start the Linux Kernel Configuration tool. $ make menuconfig Select CPU Power Management from the main menu.
  • Page 234 Power Management SmartReflex [*] Enable the block layer ---> System Type ---> Bus support ---> Boot options ---> CPU Power Management ---> Select TI OMAP Implementations from the menu. ARM system type (TI OMAP) ---> TI OMAP Implementations ---> -*- OMAP34xx Based System OMAP3430 support [*] OMAP35x Family Select SmartReflex support from the menu.
  • Page 235: Software Interface

    Power Management Software Interface 12.5. Software Interface The cpuidle framework defines a standard interface through /sys interface. 12.5.1. cpuidle The parameters controlling cpuidle can be viewed via via /sys interface. $ ls -1 /sys/devices/system/cpu/cpuidle/ current_driver current_governor_ro current_governor_ro lists the current governor. $ cat /sys/devices/system/cpu/cpuidle/current_governor_ro menu current_driver lists the current driver.
  • Page 236: Suspend & Resume

    Power Management Suspend & Resume time usage 12.5.1.1. Idle state transition To allow/prevent the processor to enter idle states, execute these commands: $ echo 1 > /sys/power/sleep_while_idle $ echo 0 > /sys/power/sleep_while_idle Some of the clocks are not explicitly enabled and disabled on idle. To allow these clocks to be enabled/ disabled execute these commands: $ echo 1 >...
  • Page 237 Power Management SmartReflex $ echo 1 > /sys/power/sr_vdd2_autocomp $ echo 0 > /sys/power/sr_vdd2_autocomp Version 02.01.01.08 Platform Support Products...
  • Page 238 Power Management Revision History 12.6. Revision History 02.00.00 Initial version for this GIT based release. 02.01.00 Updated C-state definition. 02.01.01 Updated C-state definition. Moved configuration information from DataSheet Release specific updates. Platform Support Products Version 02.01.01.08...

This manual is also suitable for:

Omap3515Omap3525Omap3530

Table of Contents