Page 1
AM3517 EVM Linux PSP User Guide 03.00.00.03 Publication date 27 November 2009...
Page 2
Version 03.00.00.03 Platform Support Products...
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
Version 03.00.00.03 Platform Support Products...
Read This First About This Manual This document describes how to install and work with Texas Instruments' Platform Support Package (PSP) for AM35x platform running Linux. This PSP provides a fundamental software platform for development, deployment and execution on. It abstracts the functionality provided by the hardware.
Page 16
Read This First Notation of information elements • Chapter 3, U-Boot - describes the procedure to build and execute U-Boot. • Chapter 4, Kernel - describes the procedure to build and execute the Linux kernel. • Chapter 5, Audio Driver - describes the implementation of audio driver.
Page 17
This is an example of a useful tip. If You Need Assistance For any assistance, please send an mail to 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 03.00.00.03 Platform Support Products...
Page 18
Version 03.00.00.03 Platform Support Products...
Installation Abstract This chapter describes the layout of the Linux PSP package for AM3517 EVM and steps to install on your development host. Table of Contents 1.1. System Requirements ............2 1.2. Installation ................ 3 1.3. Environment Setup ............5 1.4.
AM3517 Beta EVM Software Requirements: • CodeSourcery ARM tool chain version 2009-q1 Important AM3517 Beta EVM - Base Board (Rev5), Processor board (Rev2) and Application board (Rev3)- has been used for development and test for this release. Platform Support Products Version 03.00.00.03...
Extract the contents of release package with the following command: $ tar -xvfz AM35x-OMAP35x-PSP-SDK-MM.mm.pp.bb.tgz This creates a directory AM35x-OMAP35x-PSP-SDK-MM.mm.pp.bb with the following contents: \---AM35x-OMAP35x-PSP-SDK-MM.mm.pp.bb Software-manifest.html Arago-FS-Software-manifest.html +----docs |----Building-RootFs-Arago.html |----DataSheet-MM.mm.pp.bb.pdf |----ReleaseNotes-MM.mm.pp.bb.pdf |----am3517 `----UserGuide-MM.mm.pp.bb.pdf |----omap3530 `----UserGuide-MM.mm.pp.bb.pdf +----host-tools |----linux `----signGP |----src `----signGP.c +----images |----boot-strap |----am3517 `----x-load.bin.ift...
Installation Environment Setup 1.3. 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/2009-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...
Installation Setup NFS filesystem 1.4. 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.gz) to a directory exported via NFS. $ cd /opt/nfs/target $ tar xjfz nfs.tar.gz Important Execute this command as root user.
x-loader Abstract This chapter describes the steps required to build and execute the x-loader. Table of Contents 2.1. Introduction ..............8 2.2. Compiling X-Loader ............9 2.2.1. Signing x-load.bin ............. 9 2.3. Saving x-loader on target media ........10 2.3.1. NAND ..............10 2.3.2.
x-loader Introduction 2.1. Introduction X-loader is the primary bootloader. The ROM bootloader loads it in the internal SRAM and passes control to it. The X-loader supports boot from NAND and MMC/SD media. Platform Support Products Version 03.00.00.03...
$ 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 AM3517 EVM. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm am3517evm_config Initiate the build.
U-Boot Abstract This chapter describes the steps required to build and configure u-boot to use different filesystems during the kernel boot. Table of Contents 3.1. Compiling U-Boot ............. 13 3.2. Flashing U-Boot ..............14 3.2.1. Micron NAND ............14 3.3. Configuring U-Boot ............15 3.3.1.
Page 30
U-Boot 3.4.2. Viewing bad blocks ..........18 3.4.3. Erasing NAND ............18 3.4.4. Writing to NAND ............. 19 3.4.5. Reading from NAND ..........19 3.4.6. NAND ECC algorithm selection ........20 3.5. MUSB Host support ............21 Platform Support Products Version 03.00.00.03...
$ 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 AM3517 EVM. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm am3517_evm_config Initiate the build.
U-Boot Configuring U-Boot 3.3. Configuring U-Boot This section assumes that EVM has been setup properly. Connect EVM (UART3) 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. Important Some commands entered on the console are long.
U-Boot Using NFS 3.3.2. Using NFS Set the bootargs: AM3517_EVM # setenv bootargs console=ttyS2,115200n8 noinitrd ip=dhcp rw root=/dev/nfs nfsroot=192.168.1.101: /opt/nfs/target, nolock mem=256M eth=00:11:22:33:44:55 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.
Page 35
U-Boot Using NFS tftp 0x80000000 uImage; bootm 0x80000000' Note The entire command should be entered in a single line. Important Save the changes to these variables on the flash with u-boot command - saveenv. Version 03.00.00.03 Platform Support Products...
U-Boot Managing NAND 3.4. Managing NAND The u-boot has been updated to include NAND flash support 3.4.1. Marking a bad block To forcefully mark a block as bad: AM3517_EVM # nand markbad <offset> For example, to mark block 32 (assuming erase block size of 128Kbytes) as bad block - offset = blocknum * 128 * 1024: AM3517_EVM # nand markbad 0x400000 3.4.2.
U-Boot Writing to NAND For example, to erase blocks 32 through 34 AM3517_EVM # nand erase 0x00400000 0x40000 3.4.4. Writing to NAND To write len bytes of data from a memory buffer located at addrto the NAND block offset: AM3517_EVM # nand write <addr> <offset> <len> If a bad block is encountered during the write operation, it is skipped and the write operation continues from next 'good' block.
U-Boot NAND ECC algorithm selection just marked bad block is irrecoverably lost. The offset and length for reading have to be page aligned else the command will abort. For example, to read 0x40000 bytes from NAND - starting at block 32 (offset 0x400000) to memory buffer at address 0x80000000: AM3517_EVM # nand read 0x80000000 0x400000 0x40000 3.4.6.
U-Boot MUSB Host support 3.5. MUSB Host support The u-boot now supports USB Mass storage class (MSC) on the MUSB port. It can be used to load any file from USB MSC device. Important Ensure that USB MSC device is connected to the MUSB port before issuing any of the commands described in this section.
Page 40
U-Boot MUSB Host support This command reads specified file from MSC device and writes its contents at the specified address. Note Substitute D with the storage device number and p with the partition number on the device. Platform Support Products Version 03.00.00.03...
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 ............24 4.2. Configuring Linux Kernel ........... 25 4.3.
Kernel Compiling Linux Kernel 4.1. Compiling Linux Kernel Change to the base of the Linux source directory. Create default configuration for the AM3517 EVM. $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm am3517_evm_defconfig Initiate the build. Note For the kernel image (uImage) to be built, mkimage utility must be included in the path.
4.2. Configuring Linux Kernel Before building the Linux kernel, it should be configured for a specific platform. This chapter describes steps to configure the kernel for AM3517 EVM and illustrates related configuration items for reference. To create default configuration: $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm...
Page 44
Kernel Configuring Linux Kernel Choose Exit to successively to return to previous menu(s) and eventually back to the shell. Some of the key drivers are enabled in the default configuration are: • Serial port • Mentor USB in OTG mode (Host/Slave) •...
Kernel Booting Linux Kernel 4.3. Booting Linux Kernel 4.3.1. Selecting boot mode The boot mode is selected by DIP switch S7 on the main board. This selection identifies the location from where the x-loader and u-boot binaries are loaded for execution. To boot from NAND, the switch settings are shown below: Figure 4.1.
Kernel Boot from MMC $ bootm 0x80000000 When kernel image is and ramdisk image are fetched from a tftp server: $ setenv autoload no $ dhcp $ setenv serverip <Server IP Address> $ tftp 0x80000000 uImage $ tftp 0x82000000 ramdisk.gz $ setenv bootargs 'mem=128M console=ttyS0,115200n8 root=/dev/ram0 initrd=0x82000000,40M ramdisk_size=32768 ip=dhcp' $ bootm 0x80000000...
Page 47
Kernel Boot from MMC Note Once the Linux kernel boots, login as "root". No password is required. Version 03.00.00.03 Platform Support Products...
Page 48
Version 03.00.00.03 Platform Support Products...
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 ..............33 5.1.1. References ............. 33 5.1.2. Acronyms & Definitions ..........33 5.2.
5.1. Introduction The AIC23 audio module contains audio analog inputs and outputs. It is connected to the main AM3517 processor through the TDM/I2S interface (audio interface) and used to transmit and receive audio data. The AIC23 codec is connected via Multi-Channel Buffered Serial Port (McBSP) interface, a communication peripheral, to the main processor.
Page 52
Audio Driver Acronyms & Definitions Acronym Definition 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. Audio Driver: Acronyms Platform Support Products Version 03.00.00.03...
Audio Driver Features 5.2. Features This section describes the features supported by ALSA SoC Audio driver. • Supports AIC23 audio codec in ALSA SoC framework. • Supports audio in both mono and stereo modes. • Supports multiple sample rates (8KHz, 16KHz, 22.05KHz, 32KHz, 44.1KHz, 48KHz, 64KHz, 88.2KHz and 96KHz) for both playback and capture.
Audio Driver ALSA SoC Architecture 5.3. ALSA SoC Architecture 5.3.1. Introduction The overall project goal of the ALSA System on Chip (ASoC) layer is to provide better ALSA support for embedded system on chip processors and portable audio codecs. Currently there is some support in the kernel for SoC audio, however it has some limitations: •...
Audio Driver Design • Machine driver: The machine driver handles any machine specific controls and audio events. i.e. turning 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 Version 03.00.00.03 Platform Support Products...
Audio Driver Configuration 5.4. Configuration To enable/disable audio support, start the Linux Kernel Configuration tool. $ make menuconfig Select Device Drivers from the main menu. Power management options ---> [*] Networking support ---> Device Drivers ---> File systems ---> Kernel hacking --->...
Page 57
Audio Driver Configuration Select SoC Audio for AM3517 EVM as shown here: --- ALSA for SoC audio support <*> SoC Audio for the Texas Instruments OMAP chips <*> SoC Audio support for OMAP3517 / AM3517 EVM < > Build all ASoC CODEC drivers (NEW) Make sure that McBSP support is enabled.
Audio Driver Application Interface 5.5. Application Interface This section provides the details of the Application Interface for the ALSA Audio driver. Application developer uses ALSA-lib, a user space library, rather than the kernel API. The library offers 100% of the functionality of the kernel API, but adds major improvements in usability, making the application code simpler and better looking.
Audio Driver Commonly Used APIs Name Description cardX/pcm0c The directory of the given PCM capture stream. Table 5.3. Proc Interface 5.5.3. Commonly Used APIs Some of the commonly used APIs to write an ALSA based application are: Name Description snd_pcm_open Opens a PCM stream.
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 62
Audio Driver A minimal playback application int main (int argc, char *argv[]) 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;...
Page 63
Audio Driver A minimal playback application snd_strerror (err)); exit (1); 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 64
Audio Driver A minimal playback application exit (1); 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)) <...
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 66
Audio Driver A minimal record application /* Open PCM. The last parameter of this function is * the mode. if ((err = snd_pcm_open (&capture_handle, device, SND_PCM_STREAM_CAPTURE, 0)) < 0) { fprintf (stderr, "cannot open audio device (%s)\n", snd_strerror (err)); exit (1); memset(buf,0,BUFF_SIZE);...
Page 67
Audio Driver A minimal record 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(capture_handle, hw_params, 2)) <...
Page 68
Version 03.00.00.03 Platform Support Products...
This section defines and describes the usage of user level interfaces of Video Display Driver. Note Please note that the AM3517 Display Sub-System module is same as OMAP35x, so terms have been used inter-changeably and referred as OMAP35x in this document.
Page 72
Display Driver Hardware Overview • Remote frame buffer interface (RFBI) module • Serial display interface (SDI) complex input/output (I/O) module with the associated phased-locked loop (PLL) • Display serial interface (DSI) complex I/O module and a DSI protocol engine • DSI PLL controller that drives a DSI PLL and high-speed (HS) divider •...
Display Driver Features 6.2. Features 6.2.1. Overview The Display driver supports the following features: • Supports LCD display interface at WQVGA resolution (480x272) • Supports TV display interface at NTSC/PAL resolutions (Only S-Video out is supported) • Supports DVI digital interface (mode selection via boot argument). •...
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 75
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.
Display Driver Usage 6.4. Usage 6.4.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. Application can open the driver only in blocking mode. Non-blocking mode of open is not supported.
Display Driver Command Line arguments V4L2 driver uses the VRFB buffers for rotation. Because of the limitation of the VRFB engine these buffers are quite big in size. Please refer to the Buffer Management section for required and allocated size of the VRFB buffers.
Page 78
Display Driver Command Line arguments 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 set of command line argument for enabling/ setting rotation angle, enable/disable VRFB rotation, default mode, size of vram and debug option. These command line arguments can only be used with boot time arguments as FBDEV driver only supports static build.
Display Driver Buffer Management Note The entire command should be entered in a single line. Misc (DSS) Argument There are few arguments which allows control over core DSS functionality. Argument Description def_disp Name of default display, to which all overlays will be connected.
Page 80
Display Driver Buffer Management Note Please note that user must configure the required amount of buffer size through command line argument in case of Framebuffer VRFB rotation. V4L2 Driver Memory Mapped buffer mode and User pointer buffer mode are the two memory allocation modes supported by driver.
Page 81
Display Driver Buffer Management reqbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; reqbuf.memory = V4L2_MEMORY_MMAP; ret = ioctl(fd , VIDIOC_REQBUFS, &reqbuf); if(ret < 0) { printf("cannot allocate memory\n"); close(fd); return -1; 2) Getting physical address This ioctl is used to query buffer information like buffer size and buffer physical address.
Page 82
Display Driver Buffer Management fd, buffer.m.offset); /* buffer.m.offset is same as returned from VIDIOC_QUERYBUF */ FBDEV Driver FBDEV driver supports only memory mapped buffers, it allocates one physically contiguous buffers, which can support 480x272 resolution for 16 bits per pixel format. Following steps are required to map buffers in application memory space: 1) Getting fix screen information FBIOGET_FSCREENINFO ioctl is used to get the not-changing screen...
Display Driver Rotation /* Get the fix screen info */ /* Get the variable screen information */ buffersize = fix.line_length * var.yres; addr = mmap(NULL, buffersize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); /* buffer.m.offset is same as returned from VIDIOC_QUERYBUF */ 6.4.4.
Page 84
Display Driver Rotation for calculating buffer formats. Also VIDIOC_S_FMT ioctl must be called after changing the rotation angle to change parameters as per the new rotation angle struct v4l2_control control; int degree = 90; control.id = V4L2_CID_ROTATE; control.value = degree; ret = ioctl(fd, VIDIOC_S_CTRL, &control);...
Display Driver Color Keying This allocation can be overridden using the command line arguments "vram=<size> and omapfb.vram=<fb>:<size> Memory requirement can be calculated by following equation (2048 max(xres_virtual, yres_virtual) max_Bpp)* NO_OF_BUFFERS, 2048 is the default pitch required by VRFB, xres_virtual = maximum virtual x-resolution required, yres_virtual = maximum virtual y-resolution required, max_Bpp = maximum bytes per pixel required, NO_OF_BUFFERS = Number of buffers required for panning.
Page 86
Display Driver Color Keying Figure 6.2. Video source color Keying Platform Support Products Version 03.00.00.03...
Page 87
Display Driver Color Keying Figure 6.3. 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 88
Display Driver Color Keying if (ret < 0) { perror ("VIDIOC_G_FBUF"); close(fd); exit(1); /* 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"); close(fd);...
Page 89
Display Driver Color Keying close(fd); exit(1); The code snippet below illustrates how to disable destination color keying struct v4l2_framebuffer framebuffer; ret = ioctl (fd, VIDIOC_G_FBUF, &framebuffer); if (ret < 0) { perror ("VIDIOC_G_FBUF"); close(fd); exit(1); if(framebuffer.capability & V4L2_FBUF_CAP_CHROMAKEY) { framebuffer.flags &= ~V4L2_FBUF_FLAG_CHROMAKEY; ret = ioctl (fd, VIDIOC_S_FBUF, &framebuffer);...
Display Driver Alpha Blending ret = ioctl(fd, VIDIOC_G_FMT, &fmt); if (ret < 0) { perror("VIDIOC_G_FMT\n"); close(fd); exit(0); printf("Global alpha value read is %d\n", fmt.fmt.win.chromakey); 6.4.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.
Display Driver Alpha Blending Figure 6.5. Alpha blending with almost 100% transparency Figure 6.6. Alpha blending with almost 0% transparency Overlay manager of DSS is capable of supporting the alpha blending. This is done by displaying more than one layer (video and graphics) to the same output device, TV or LCD.
Page 92
Display Driver Alpha Blending 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 93
Display Driver Alpha Blending ret = ioctl (fd, VIDIOC_S_FBUF, &framebuffer); if (ret < 0) { perror ("VIDIOC_S_FBUF"); close(fd); return 0; Following program listing will enable/disable alpha blending through SYSFS entry - # echo 0/1 > /sys/devices/platform/omapdss/manager<index>/ alpha_blending_enabled where, => 0 - Disable, 1 - Enable. index =>...
Page 94
Display Driver Alpha Blending if (ret < 0) { perror("VIDIOC_G_FMT\n"); close(fd); exit(0); fmt.fmt.win.global_alpha = global_alpha; ret = ioctl(fd, VIDIOC_S_FMT, &fmt); if (ret < 0) { perror("VIDIOC_G_FMT\n"); close(fd); exit(0); FBDEV Driver Frame buffer driver supports setting of pixel alpha value as well as global alpha value Pixel alpha value is supported through 32 bpp.
Display Driver Buffer Format Note Before using the global alpha or pixel based alpha on graphics pipeline. Alpha blending needs to be enabled using either sysfs entry described below or V4L2 ioctl described under V4L2 driver in this section. # echo 1 > /sys/devices/platform/omapdss/manager0/ alpha_blending_enabled 6.4.7.
Page 96
Display Driver Buffer Format per-pixel, and for a color depth of 24 bits the pixel data is padded to 32 bits-per-pixel. So application has to specify bits per pixel 16 and 32 for the color depth 12 and 24. To specify exact color depth, red, green and blue member of the fb_varscreeninfo can be used.
Page 97
Display Driver Buffer Format Figure 6.10. 8-BPP Data Memory Organization Figure 6.11. 12-BPP Data Memory Organization Figure 6.12. 16-BPP Data Memory Organization Figure 6.13. 24-BPP Data Memory Organization Figure 6.14. ARGB 32-BPP Data Memory Organization Version 03.00.00.03 Platform Support Products...
Display Driver Display Window Figure 6.15. RGBA 32-BPP Data Memory Organization Figure 6.16. 24-BPP Packed Data Memory Organization Figure 6.17. UYVY 4:2:2 Data Memory Organization Figure 6.18. YUV2 4:2:2 Data Memory Organization 6.4.8. Display Window The video pipelines can be connected to either an DVI output LCD output or a TV output either through boot time parameter or through SYSFS interface.
Display Driver Cropping 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. When a switch from LCD to TV or from TV to LCD happens, an application is expected to adjust the display window.
Display Driver Scaling 6.4.10. Scaling Video pipe line contains scaling unit which is used when transferring pixels from the system memory to the LCD panel or the TV set. The scaling unit consists of two scaling blocks: The vertical scaling block followed by the horizontal scaling block.
Display Driver Color look table 6.4.11. Color look table The graphics pipeline supports the color look up table. The CLUT mode uses the encoded pixel values from the input image as pointers to index the 24-bit-wide CLUT value: 1-BPP pixels address 2 entries, 2-BPP pixels address 4 entries, 4-BPP pixels address 16 entries, and 8-BPP pixels address 256 entries.
Page 102
Display Driver Streaming struct v4l2_requestbuffers req; struct v4l2_buffer buf; struct v4l2_format fmt; /* Fill the buffers with the image */ /* Enqueue buffers */ for (i = 0; i < req.count; i++) { buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; buf.index = i; buf.memory = V4L2_MEMORY_MMAP; ret = ioctl(fd, VIDIOC_QBUF, &buf);...
Page 103
Display Driver Streaming for (i = 0; i < req.count; i++){ /* Unmap all the buffers if call fails */ exit(0); Version 03.00.00.03 Platform Support Products...
Display Driver Software Interfaces 6.5. Software Interfaces 6.5.1. Frame-Buffer Driver Interface 6.5.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 105
Display Driver Frame-Buffer Driver Interface 6.5.1.3. Supported Custom IOCTLs OMAPFB_WAITFORVSYNC This ioctl can be used to put an application to sleep until next vertical sync interval of the display. OMAPFB_GET_VRAM_INFO Ioctl returns the configured/allocated vram information. OMAPFB_QUERY_MEM Returns the size and type of the frame buffer. Data Structure: #define OMAPFB_MEMTYPE_SDRAM #define OMAPFB_MEMTYPE_SRAM...
Page 106
Display Driver Frame-Buffer Driver Interface __u8 reserved[3]; Usage: struct omapfb_mem_info mi; mi.size = <Expected size of buffer> mi.type = <Expected type of buffer> if (ioctl(fb, OMAPFB_SETUP_MEM, &mi)) { perror("Error: OMAPFB_SETUP_MEM.\n"); exit(1); OMAPFB_QUERY_PLANE Query the plane (gfx) and returns the omapfb_plane_info information - Data Structure: struct omapfb_plane_info { __u32 pos_x;...
Display Driver V4L2 Driver Interface fb_fix_screeninfo This structure is used by applications to get the fixed properties of the display, e.g. the start address of the framebuffer memory, framebuffer length etc. fb_cmap This structure is used to get/set the color-map for the framebuffer 6.5.2.
Page 108
Display Driver V4L2 Driver Interface VIDIOC_G_FMT This is used to get the current image format or display window depending on the buffer type. The driver fills the information to a v4l2_format struct. VIDIOC_TRY_FMT This is used to validate a new image format or a new display window depending on the buffer type.
Display Driver SYSFS Software Interfaces 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. After that, any VIDIOC_QBUF results in an image being rendered. VIDIOC_S_CTRL VIDIOC_G_CTRL VIDIOC_QUERYCTRL These ioctls are used to set/get and query various V4L2 controls like rotation, mirror and background color.
Page 110
Display Driver SYSFS Software Interfaces subsystem uevent virt_addr virtual_size root@am3517evm:~# SYSFS attribute Description bits_per_pixel Allows user to control bits per pixel configuration, currently the supported values are 16, 24 and 32. # echo 16/24/32 > /sys/class/graphics/fb0/ bits_per_pixel blank Allows user to control lcd display blanking configuration independently.
Display Driver SYSFS Software Interfaces uevent update_mode root@am3517evm:~# SYSFS attribute Description enabled User can enable/disable the display through this entry timings Displays the timing configuration for specific display panel name Shows name of the display panel/output Table 6.7. DSS Library-display0/1/2: sysfs attributes 6.5.3.2.2.
Display Driver Miscellaneous Configurations root@am3517evm:~# root@am3517evm:~# ls -1 /sys/devices/platform/omapdss/overlay0/ enabled global_alpha input_size manager name output_size position screen_width root@am3517evm:~# SYSFS attribute Description enabled User can enable/disable overlay through this entry. global_alpha User can configure global alpha value through this entry. manager Allows control over...
Display Driver Driver Configuration 6.6. Driver Configuration 6.6.1. V4L2 video driver To V4L2 video driver start the Linux Kernel Configuration tool. $ make menuconfig ARCH=arm Select Device Drivers from the main menu. Kernel Features ---> Boot options ---> CPU Power Management --->...
Display Driver Framebuffer driver < > DVB for Linux Select Video capture adapters from the same menu. Press <ENTER> to enter the corresponding sub-menu. Customize analog and hybrid tuner modules to build ---> Video capture adapters ---> Radio Adapters ---> DAB adapters Select TI Media Drivers from the menu.
Page 118
Display Driver Framebuffer driver Kernel Features ---> Boot options ---> CPU Power Management ---> Floating point emulation ---> Userspace binary formats ---> Power management options ---> [*] Networking support ---> Device Drivers ---> Select Graphics support from the menu. Sonics Silicon Backplane --->...
Page 119
Display Driver Framebuffer driver [ ] Backlight & LCD device support ---> Configure default VRAM size to the required/expected size of buffer, the default is 4MB. --- OMAP2/3 Display Subsystem support (EXPERIMENTAL) VRAM size (MB) Debug support Select VENC support from the menu. Debug support RFBI support VENC support...
Page 120
Display Driver Framebuffer driver Fake VSYNC irq from manual update displays Minimum FCK/PCK ratio (for scaling) <*> OMAP2/3 frame buffer support (EXPERIMENTAL) ---> OMAP2/3 Display Device Drivers ---> Value for Number of framebuffers can be changed here. Force main display to automatic update mode Number of framebuffers Note If this value is set as 1, the graphics pipeline of the DSS is controlled by...
Display Driver Sample Application Flow 6.7. Sample Application Flow This chapter describes the application flow using the V4l2 and FBDEV drivers. Figure 6.19. Application for v4l2 driver using MMAP buffers Version 03.00.00.03 Platform Support Products...
Display Driver Revision History 6.8. Revision History 03.00.00.02 Updated for 03.00.00.02 PSP release 03.00.00.03 Updated for 03.00.00.03 PSP release Version 03.00.00.03 Platform Support Products...
Page 124
Version 03.00.00.03 Platform Support Products...
Page 125
Capture Driver Abstract This chapter provides detailed description of feature set and software interface for the capture driver implementation. Table of Contents 7.1. Introduction ..............109 7.1.1. References ............110 7.1.2. Acronyms & Definitions .......... 110 7.2. Features ............... 111 7.3.
The Capture Module is a key component for still-image capture applications. The capture module provides the system interface and the processing capability to connect RAW image-sensor modules and video decoders to the AM3517 device. The capture module consists of the following interfaces: •...
V4L2 provides good streaming support and support for many buffer formats. It also has its own buffer management mechanism that can be used. 7.1.1. References AM3517 VPSS TRM Author: Texas Instruments, Inc. Video for Linux Two API Specification Author: Michael H Schimek Version: 0.23...
Capture Driver Features 7.2. Features The 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. • Supports buffer access mechanism through memory mapping and user pointers.
Capture Driver Architecture 7.3. Architecture 7.3.1. Overview The following figure shows the basic block diagram of capture interface. Figure 7.2. Capture Driver Component Overview 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.
Camera Driver: The Camera Driver allows capturing video through an external decoder. It is a V4L2-compliant driver with addition of an AM3517 Capture 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 132
Capture Driver Software Design Interfaces 7.3.2.2. Buffer Management Capture driver only works with physically contiguous buffers and buffer address should be aligned to 32 bytes boundary. The driver supports both memory usage modes: 1) Memory map buffer mode 2) User Pointer mode In Memory map buffer mode, application can request memory from the driver by calling VIDIOC_REQBUFS IOCTL.
Page 133
Capture Driver Software Design Interfaces reqbuf.memory = V4L2_MEMORY_MMAP; ret = ioctl(fd, VIDIOC_REQBUFS, &reqbuf); if (ret < 0) { printf("cannot allocate memory\n"); close(fd); return -1; printf("Number of buffers allocated = %d\n", reqbuf.count); 2. Getting Physical Address This IOCTL is used to query buffer information like buffer size and buffer physical address.
Page 134
Capture Driver Software Design Interfaces /* allocate buffer by VIDIOC_REQBUFS */ /* query the buffer using VIDIOC_QUERYBUF */ /* addr hold the user space address */ int addr; addr = mmap(NULL, buffer.size,PROT_READ | PROT_WRITE, MAP_SHARED, fd, buffer.m.offset); /* buffer.m.offset is same as returned from VIDIOC_QUERYBUF */ 7.3.2.3.
Page 135
Capture Driver Software Design Interfaces It takes pointer to v4l2_input structure. Application provides the index number for which it requires the information, in index member of v4l2_input structure. Index with value zero indicates first input type of the decoder. It returns combination of the standards supported on this input in the std member of v4l2_input structure.
Page 136
Capture Driver Software Design Interfaces perror("VIDIOC_ENUMINPUT\n"); close(fd); return -1; printf("name of the input = %s\n",input.name); 7.3.2.6. Get Input This IOCTL is used to get the current input type (analog interface type). Ioctl: VIDIOC_G_INPUT This IOCTL takes pointer to integer using which the detected inputs will be returned.
Page 137
Capture Driver Software Design Interfaces member of this structure. It provides information like standard name, standard ID defined at V4L2 header files (few new standards are included in the respective decoder header files, which were not available in standard V4L2 header files), and numerator and denominator values for frame period and frame lines.
Page 138
Capture Driver Software Design Interfaces v4l2_std_id std; struct v4l2_standard standard; ret = ioctl(fd, VIDIOC_QUERYSTD, &std); if (ret < 0) { perror("VIDIOC_QUERYSTD\n"); close(fd); return -1; while(1) { standard.index = i; ret = ioctl(fd, VIDIOC_ENUMSTD, &standard); if (ret < 0) break; if (standard.std & std) { printf("%s standard detected\n", standard.name);...
Page 139
Capture Driver Software Design Interfaces while(1) { standard.index = i; ret = ioctl(fd, VIDIOC_ENUMSTD, &standard); if (ret < 0) break; if (standard.std & std) { printf("%s standard is selected\n"); break; i++; 7.3.2.10. Get Standard This IOCTL is used to get the current standard in the current decoder. Ioctl: VIDIOC_G_STD It takes a pointer to v4l2_std_id instance as an output argument.
Page 140
Capture Driver Software Design Interfaces Ioctl: VIDIOC_ENUM_FMT It takes a pointer to instance of v4l2_fmtdesc structure as an output parameter. Application must provide the buffer type in the type argument of v4l2_fmtdesc structure as V4L2_BUF_TYPE_VIDEO_CAPTURE and index member of this structure as zero. Example: struct v4l2_fmtdesc fmt;...
Page 141
Capture Driver Software Design Interfaces pointer mode. Driver validates the provided buffer size along with the other members and uses this buffer size for calculating offsets for storing video data. This IOCTL is a necessary IOCTL for the user buffer mode because driver will know the buffer size for user buffer mode.
Page 142
Capture Driver Software Design Interfaces Example: struct v4l2_format fmt; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ret = ioctl(fd, VIDIOC_G_FMT, &fmt); if (ret < 0) { perror("VIDIOC_G_FMT\n"); close(fd); return -1; if (fmt.fmt.pix.pixelformat == V4L2_PIX_FMT_YUYV) printf("8-bit UYVY pixel format\n"); printf("Size of the buffer = %d\n", fmt.fmt.pix.sizeimage); printf("Line offset = %d\n", fmt.fmt.pix.bytesperline);...
Page 143
Capture Driver Software Design Interfaces 7.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 144
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; 7.3.2.17. Get Control This IOCTL is used to get the value for a particular control in the current decoder.
Page 145
Capture Driver Software Design Interfaces For the 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.
Page 146
Capture Driver Software Design Interfaces struct v4l2_buffer buf; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.type = V4L2_MEMORY_MMAP; ret = ioctl(fd, VIDIOC_DQBUF, &buf); if (ret < 0) { perror("VIDIOC_DQBUF\n"); close(fd); return -1; 7.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.
Capture Driver Driver Configuration 7.4. Driver Configuration 7.4.1. Configuration Steps To enable V4L2 capture driver support in the kernel: Start Linux Kernel Configuration tool. $ make menuconfig ARCH=arm Select Device Drivers from the main menu. Kernel Features ---> Boot options --->...
Page 148
Capture Driver Configuration Steps Enable Video For Linux API 1 (DEPRECATED) < > DVB for Linux Select Video capture adapters from the same menu. Customize analog and hybrid tuner modules to build > Video capture adapters ---> Radio Adapters ---> DAB adapters Select TI Media Drivers from the menu.
Page 149
< > Virtual Video Driver Select TVP5146 Video Decoder driver from the menu. *** Audio decoders *** < > Philips SAA7191 video decoder <*> Texas Instruments TVP514x video decoder < > Texas Instruments TVP5150 video decoder Version 03.00.00.03 Platform Support Products...
Page 150
7.5.2. Hardware Setup Following are the steps required to run the capture sample application: • Connect the AM3517 User interface card module containing the TVP5146 deocoder to the AM3517 main board. • Make sure that switch settings on UI Card, S11.1 and S11.2 are turned ON.
Page 151
Capture Driver Sample Applications LCD using display driver. The application makes use of V4L2 display driver buffers as a user pointer in capture driver. Version 03.00.00.03 Platform Support Products...
Page 152
Version 03.00.00.03 Platform Support Products...
Page 153
USB Driver Abstract This chapter provides detailed description of feature set and software interface supported by the USB driver. Table of Contents 8.1. Introduction ..............137 8.1.1. References ............137 8.1.2. Hardware Overview ..........137 8.2. Features ................ 138 8.2.1. Supported ............138 8.3.
Page 154
USB Driver 8.3.3. MUSB OTG controller in gadget mode ....... 140 8.3.4. MUSB OTG controller in OTG mode ......141 8.3.5. Host mode applications .......... 142 8.3.6. USB Controller and USB MSC HOST ......142 8.3.7. USB HID Class ............143 8.3.8.
It can be an L3 master while performing DMA transfers and an L4 target when host CPU/DMA engine is the master. AM3517 HS USB port1 is connected to SMSC3320 high speed PHY and available on baseboard while port2 is connected to same SMSC PHY but is available on UI card.
USB Driver Features 8.2. Features The MUSB OTG and EHCI driver supports a significant subset of all the features provided by the USB controller. The following section discusses the features supported in this release. 8.2.1. Supported The Driver supports the following features for MUSB OTG port: •...
USB Driver Driver configuration 8.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. 8.3.1. USB phy selection for MUSB OTG port Please select NOP USB transceiver for MUSB support.
USB Driver MUSB OTG controller in gadget mode [*] USB device class-devices (DEPRECATED) <*> EHCI HCD (USB2.0) Support [ ] Root hub transaction translators *** USB Host Controller Drivers *** 8.3.3. MUSB OTG controller in gadget mode 8.3.3.1. Configuration Please do not disable support for host side usb as this will disable EHCI host interface also.Gadget option in driver mode will appear only when gadget support is also selected.Please enable gadget support as given below.
USB Driver MUSB OTG controller in OTG mode 8.3.4. MUSB OTG controller in OTG mode 8.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.
USB Driver Host mode applications 8.3.5. Host mode applications 8.3.5.1. Mass Storage Driver This figure illustrates the stack diagram of the system with USB Mass Storage class. Figure 8.1. USB Driver: Illustration of Mass Storage Class 8.3.6. USB Controller and USB MSC HOST 8.3.6.1.
USB Driver USB HID Class *** 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) [*] Enable debugging messages --- USB Device Class drivers <*>...
USB Driver USB Audio <*> Support for Host-side USB *** Miscellaneous USB options *** [*] USB device filesystem [*] 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) --->...
USB Driver USB Video 8.3.10. USB Video 8.3.10.1. Configuration Device Drivers ---> Multimedia devices ---> *** Multimedia core support *** <*> Video for Linux [*] Enable Video for Linux API 1 (DEPRICATED) [*] Enable Video for Linux API 1 (compatible) layer *** Multimedia Drivers *** [*] Video capture adapters --->...
Page 164
USB Driver Gadget Mode Applications 8.3.11.1. Configuration Device Drivers ---> USB support ---> <*> Support for USB Gadgets USB Peripheral Controller (Inventra HDRC Peripheral(TI, ...)) ---> <M> USB Gadget Drivers <M> File-backed Storage Gadget <*> Inventra Highspeed Dual Role Controller (TI, ...) *** OMAP 343x high speed USB support *** Driver Mode (USB Peripheral (gadget stack)) --->...
USB Driver CDC/RNDIS gadget 8.3.12. CDC/RNDIS gadget The CDC RNDIS gadget driver that is used to send standard Ethernet frames using USB. 8.3.12.1. Configuration for USB controller and CDC/RNDIS Gadget Device Drivers ---> USB support ---> <*> Support for USB Gadgets USB Peripheral Controller (Inventra HDRC Peripheral (TI, ...)) --->...
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 AM3517 EVM. If gadget driver is built as module then insert it to complete USB initialization.
Page 167
USB Driver USB OTG (HNP/SRP) testing $ echo "F" > /proc/driver/musb_hdrc If this command is executed on B-device then SRP protocol will be used to request A-device to switch-on the Vbus power. Now the connect event occurs, enumeration will complete and gadget driver on B-device will be ready to use if this driver is in "Targeted Peripheral List (TPL)"...
USB Driver Software Interface 8.4. Software Interface The USB driver exposes its state/control through the sysfs and the procfs interfaces. The following sections talks about these. 8.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.
USB Driver Revision history 8.5. Revision history 03.00.00.01 Initial release. 03.00.00.02 Update for EHCI and OTG new class support. Version 03.00.00.03 Platform Support Products...
Page 170
Version 03.00.00.03 Platform Support Products...
Page 171
MMC Driver Abstract This chapter provides detailed description of feature set and software interface supported by the MMC driver. Table of Contents 9.1. Introduction ..............154 9.1.1. References ............154 9.1.2. Acronyms & Definitions .......... 154 9.2. Features ................ 155 Version 03.00.00.03 Platform Support Products...
MMC Driver Introduction 9.1. Introduction TI OMAP 3517 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 MMC driver implements the Host controller driver layer of the MMC stack under linux.
MMC Driver Features 9.2. Features 9.2. Features The Driver supports the following features: • The driver is built into the kernel itself. • MMC cards including High Speed cards. • SD cards including SD High Speed and SDHC cards. • Uses block bounce buffer to aggregate scattered blocks Version 03.00.00.03 Platform Support Products...
Page 174
Version 03.00.00.03 Platform Support Products...
Page 175
Power Management Abstract This chapter describes the power management features available on AM3517 and AM3505. Table of Contents 10.1. Introduction ..............159 10.1.1. References ............159 10.2. Features ..............160 10.2.1. Supported ............160 10.3. Architecture ..............161 10.3.1. Dynamic Tick Suppression ........161 10.3.2.
Page 176
Power Management 10.5. Software Interface ............164 10.5.1. Suspend & Resume ..........164 10.6. Revision History ............165 Platform Support Products Version 03.00.00.03...
Power Management Introduction 10.1. Introduction AM3517 and AM3505 silicon provides a limited set of power management features. These features are described in detail in the AM3517/05 TRM. In summary: • Clock control at the module and clock domain level. •...
Power Management Features 10.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. 10.2.1. Supported This is list of features supported in this release: •...
Power Management Architecture 10.3. Architecture 10.3.1. Dynamic Tick Suppression The dynamic tick suppression is achieved through generic Linux framework for the same. A 32K timer (HZ=128) is used by the tick suppression algorithm. 10.3.2. Suspend & Resume The suspend operation results in the system transitioning to the lowest power state being supported.
Power Management Configuration 10.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 181
Power Management Power Management Debug Support File systems ---> Kernel hacking ---> Security options ---> -*- Cryptographic API ---> Select Debug Filesystem from the next menu. [ ] Enable unused/obsolete exported symbols [*] Debug Filesystem [ ] Run 'make headers_check' when building vmlinux [*] Kernel debugging 10.4.1.2.
Page 182
Power Management Software Interface 10.5. Software Interface 10.5.1. Suspend & Resume The suspend for device can be asserted as follows: $ echo -n "mem" > /sys/power/state To wakeup, tap any key on the serial console. Automatic wakeup can be done by programming the wakeup timer before asserting suspend.
Page 183
Power Management Revision History 10.6. Revision History 03.00.00.01 Initial version for this GIT based release. 03.00.00.02 Update for 2.6.31 kernel release. 03.00.00.03 Update for 2.6.32 kernel release. Version 03.00.00.03 Platform Support Products...
Page 184
Version 03.00.00.03 Platform Support Products...
Page 185
Power Management IC Abstract This chapter provides details on how to configure the PMIC driver, its interfaces and a simple application code illustrating the use of this interface. Table of Contents 11.1. Introduction ..............169 11.1.1. References ............169 11.1.2. Acronyms & Definitions ........169 11.2.
Page 186
Power Management IC 11.4.1. Consumer driver interface ........175 11.4.2. Sysfs interface ............ 175 11.5. Writing a Consumer Driver ..........177 11.6. Revision History ............179 Platform Support Products Version 03.00.00.03...
Power Management IC Introduction 11.1. Introduction A Power Management IC (PMIC) is a device that contains one or more regulators (voltage or current) and often contains other susbsystems like audio codec, keypad etc. From the power management perspective, its main function is to regulate the output power from input power or simply enable/disable the output as and when required.
Page 188
Power Management IC Acronyms & Definitions Acronym Definition Voltage Regulator Framework Low Drop-Out Table 11.1. PMIC Driver: Acronyms Platform Support Products Version 03.00.00.03...
Power Management IC Features 11.2. Features This section describes the supported features and constraints of the PMIC drivers. 11.2.1. Features Supported • Support for TPS65023 and TPS65073 PMICs in Linux Voltage Regulator Framework. • Enabling / disabling of voltage regulators. •...
Power Management IC Configuration 11.3. Configuration To enable/disable VRF support, start the Linux Kernel Configuration tool. $ make menuconfig Check whether I2C support is enabled or not; it is required for the voltage regulator. Select Device Drivers from the main menu: Power management options --->...
Page 191
---> System Type ---> Bus support ---> Kernel Features ---> Make sure that the PMIC present on the AM3517 EVM is selected here: [ ] OMAP 3530 EVM board ---> [*] OMAP3517/ AM3517 EVM board ---> TPS65023 Power Module [ ] OMAP3 Pandora --->...
Page 192
Power Management IC Configuration Select Voltage and Current Regulator Support as shown here: [ ] DMA Engine support ---> [ ] Auxiliary Display support ---> [*] Voltage and Current Regulator Support ---> < > Userspace I/O drivers ---> [ ] Staging drivers --->...
Power Management IC Application Interface 11.4. Application Interface This section provides the details of the application interface for the PMIC regulator driver. Client device drivers are the ones which use PMIC regulator drivers to enable/ disable and/or regulate output voltage/current. Specifically, a client driver uses: •...
Power Management IC Sysfs interface Name Description name string identifying the regulator, may be empty type regulator type (voltage, current) state regulator enable status (enabled, disabled) microvolts regulator output voltage microvolts) microamps regulator output current limit (in microamps) min_microvolts minimum safe working output...
Power Management IC Writing a Consumer Driver 11.5. Writing a Consumer Driver This chapter describes the steps required in writing a consumer driver to regulate the output voltage and to enable/disable the regulator. User should refer to "include/linux/regulator/consumer.h" for the complete list of supported APIs.
Page 196
Power Management IC Writing a Consumer Driver • Releasing the regulator handle: Consumer driver can release the regulator if it is no more required. regulator_put(reg); After that, the handle becomes no more valid and should not be used for any further operations. Platform Support Products Version 03.00.00.03...
Power Management IC Revision History 11.6. Revision History 03.00.00 Initial version Version 03.00.00.03 Platform Support Products...
Page 198
Version 03.00.00.03 Platform Support Products...
Page 199
Appendix Abstract This chapter contains useful information referenced in the earlier sections of the document. Table of Contents 12.1. Creating bootable partition on MMC/SD Card ..... 182 Version 03.00.00.03 Platform Support Products...
Page 200
Appendix Creating bootable partition on MMC/SD Card 12.1. Creating bootable partition on MMC/SD Card The MMC/SD card should have a valid bootable partition on the card before it can be used as boot media. Download and install HP USB Disk Storage Format Tool [http:// www.sysanalyser.com/sp27213.exe] on a Microsoft Windows host.
Need help?
Do you have a question about the AM3517 and is the answer not in the manual?
Questions and answers