Freescale Semiconductor i.MX 6SoloLite Linux Reference Manual

Hide thumbs Also See for i.MX 6SoloLite Linux:
Table of Contents

Advertisement

Quick Links

i.MX 6SoloLite Linux Reference
Manual
Document Number: IMXL6SLRM
Rev L3.0.35_4.1.0, 09/2013

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the i.MX 6SoloLite Linux and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Freescale Semiconductor i.MX 6SoloLite Linux

  • Page 1 6SoloLite Linux Reference Manual Document Number: IMXL6SLRM Rev L3.0.35_4.1.0, 09/2013...
  • Page 2 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 3: Table Of Contents

    Timer Software Operation..........................30 3.3.2 Timer Features..............................30 3.3.3 Timer Source Code Structure..........................31 3.3.4 Timer Programming Interface..........................31 Memory Map..................................31 3.4.1 Memory Map Hardware Operation........................31 3.4.2 Memory Map Software Operation........................31 3.4.3 Memory Map Features............................31 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 4 GPIO Module Source Code Structure........................37 3.6.4 GPIO Programming Interface 2.........................38 Chapter 4 Smart Direct Memory Access (SDMA) API Overview..................................39 4.1.1 Hardware Operation............................39 4.1.2 Software Operation............................39 4.1.3 Source Code Structure............................40 4.1.4 Menu Configuration Options..........................41 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 5 Structures and Defines............................55 Chapter 6 Sipix Display Controller (SPDC) Frame Buffer Driver Introduction..................................57 Hardware Operation................................58 Software Operation.................................58 6.3.1 SPDC Frame Buffer Driver Overview.......................58 6.3.2 SPDC Frame Buffer Driver Extensions......................59 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 6 Key Data Structs..............................71 7.3.2 Channel Management............................72 7.3.3 Descriptor Management.............................72 7.3.4 Completion Notification............................72 7.3.5 Limitations.................................73 Menu Configuration Options............................73 Source Code Structure..............................73 Chapter 8 ELCDIF Frame Buffer Driver Introduction..................................75 Hardware Operation................................75 Software Operation.................................75 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 7 Chapter 11 X Windows Acceleration 11.1 Introduction..................................85 11.2 Hardware Operation................................85 11.3 Software Operation.................................85 11.3.1 X Windows Acceleration Architecture......................86 11.3.2 i.MX 6 Driver for X-Windows System......................87 11.3.3 xorg.conf for i.MX 6............................89 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 8 Low-level Power Management (PM) Driver 14.1 Hardware Operation................................99 14.1.1 Software Operation............................99 14.1.2 Source Code Structure............................100 14.1.3 Menu Configuration Options..........................100 14.1.4 Programming Interface............................101 14.1.5 Unit Test................................101 Chapter 15 PF100 Regulator Driver 15.1 Introduction..................................103 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 9 17.1.3 Source Code Structure............................114 17.2 Menu Configuration Options............................114 17.2.1 Board Configuration Options..........................114 Chapter 18 Thermal Driver 18.1 Introduction..................................115 18.1.1 Thermal Driver Overview..........................115 18.2 Hardware Operation................................115 18.2.1 Thermal Driver Software Operation........................116 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 10 20.3 Driver Features................................124 20.3.1 Source Code Structure............................125 20.3.2 Menu Configuration Options..........................125 Chapter 21 Advanced Linux Sound Architecture (ALSA) System on a Chip (ASoC) Sound Driver 21.1 ALSA Sound Driver Introduction...........................127 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 11 22.1.4 Source Code Structure............................138 22.1.5 Menu Configuration Options..........................139 Chapter 23 MMC/SD/SDIO Host Driver 23.1 Introduction..................................141 23.1.1 Hardware Operation............................141 23.1.2 Software Operation............................142 23.2 Driver Features................................144 23.2.1 Source Code Structure............................145 23.2.2 Menu Configuration Options..........................145 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 12 25.2 Software Operation.................................156 25.2.1 SPI Sub-System in Linux...........................156 25.2.2 Software Limitations............................157 25.2.3 Standard Operations............................157 25.2.4 ECSPI Synchronous Operation..........................158 25.3 Driver Features................................160 25.3.1 Source Code Structure............................160 25.3.2 Menu Configuration Options..........................160 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 13 27.2.1 Software Operation............................176 27.2.2 Source Code Structure............................176 27.2.3 Menu Configuration Options..........................176 27.3 Programming Interface..............................177 27.3.1 Device-Specific Defines............................177 27.3.2 Getting a MAC Address.............................178 Chapter 28 Universal Asynchronous Receiver/Transmitter (UART) Driver 28.1 Introduction..................................179 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 14 29.1.6 Menu Configuration Options..........................188 Chapter 30 Watchdog (WDOG) Driver 30.1 Introduction..................................189 30.1.1 Hardware Operation............................189 30.1.2 Software Operation............................189 30.2 Generic WDOG Driver..............................190 30.2.1 Driver Features..............................190 30.2.2 Menu Configuration Options..........................190 30.2.3 Source Code Structure............................190 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 15 31.2.2 oprofilefs Pseudo Filesystem..........................195 31.2.3 Generic Kernel Driver............................195 31.2.4 OProfile Daemon...............................195 31.2.5 Post Profiling Tools............................196 31.3 Requirements..................................196 31.3.1 Source Code Structure............................196 31.3.2 Menu Configuration Options..........................196 31.3.3 Programming Interface............................197 31.3.4 Interrupt Requirements............................197 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 16 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 17: About This Book

    Definition Asynchronous Display Controller address Address conversion from virtual domain to physical domain translation Application Programming Interface ® Advanced RISC Machines processor architecture Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 18 Input/Output In-Circuit Emulation Intellectual Property Interrupt Service Routine Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 19 Smart Direct Memory Access SDRAM Synchronous Dynamic Random Access Memory System on a Chip SPBA Shared Peripheral Bus Arbiter-a three-to-one IP-Bus arbiter, with a resource-locking mechanism Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 20 USBOTG devices, also known as dual-role peripherals, can act as limited hosts or peripherals themselves depending on how the cables are connected to the devices, and they also can connect to a host PC word A group of bits comprising 32-bits i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 21: Introduction

    The i.MX BSP is based on version 3.0.35 of the Linux kernel from the official Linux kernel web site (http://www.kernel.org ). It is enhanced with the features provided by Freescale. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 22: Features

    Low-level Power Management i.MX Drivers for implementing hardware-specific operations to meet (PM) Driver 6SoloLite power requirements and also to conserve power on the Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 23 Ethernet CSMA/CD media access control and channel Driver 6SoloLite interface functions. The FEC requires an external interface adaptor and transceiver function to complete Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 24 MXC PWM driver The MXC PWM driver provides the interfaces to access Pulse-Width Modulator (PWM) i.MX MXC PWM signals Driver 6SoloLite Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 25 SoC's temperature in a certain frequency. It defines three trip points: critical, hot, and active. OProfile OProfile is a system-wide profiler for Linux systems, OProfile i.MX capable of profiling all running code at low overhead. 6SoloLite i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 26 Overview i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 27: Machine Specific Layer (Msl)

    Because of the complexity of the SDMA module, its design is explained in SDMA relevant chapter. Each of the following sections contains an overview of the hardware operation. For more information, see the corresponding device documentation. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 28: Interrupts (Operation)

    The following file describes the ARM interrupt architecture. <ltib_dir>/rpm/BUILD/linux/Documentation/arm/Interrupts The software provides a processor-specific interrupt structure with callback functions defined in the irqchip structure and exports one initialization function, which is called during system startup. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 29: Interrupt Features

    This is done with the global structure irq_desc of type struct irqdesc. After the initialization, the interrupt can be used by the drivers through the request_irq() function to register device-specific interrupt handlers. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 30: Timer

    3.3.2 Timer Features The timer implementation supports the following features: • Functions required by Linux to provide the system timer and dynamic timers. • Generates an interrupt every 10 ms. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 31: Timer Source Code Structure

    Manual (TRM) from ARM Limited. 3.4.2 Memory Map Software Operation A table mapping the virtual memory to physical memory is implemented for i.MX platforms as defined in the file in <ltib_dir>/rpm/BUILD/linux/arch/arm/mach-mx6/ mm.c . i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 32: Memory Map Source Code Structure

    GPIO pin. A functional pin can be subdivided into either a primary function or alternate functions. The pin operation is controlled by a i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 33: Iomux Hardware Operation

    • SW_PAD_CTL: Controls pad slew rate, driver strength, pull-up/down resistance, and so on. 3.5.2 IOMUX Software Operation The IOMUX software implementation provides an API to set up pin functions and pad features. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 34: Iomux Features

    GPIO module. In addition, there are some special configurations for a GPIO pin (such as output based A_IN, B_IN, C_IN or DATA register, but input based A_OUT or B_OUT). i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 35: Gpio Hardware Operation

    The GPIO module has a PULLUP control register (PUEN) for each GPIO port to control every pin of that port. 3.5.6.2 GPIO Software Operation (general) The GPIO software implementation provides an API to setup pin functions and pad features. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 36: Gpio Implementation

    3.6.1 GPIO Software Operation The general purpose input/output (GPIO) module provides an API to configure the i.MX processor external pins and a central place to control the GPIO interrupts. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 37: Api For Gpio

    This GPIO implementation supports the following features: • Implementing the functions for accessing the GPIO hardware modules • Provideing a way to control GPIO signal direction and GPIO interrupts i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 38: Gpio Module Source Code Structure

    GPIO public header file gpio.c Function implementation 3.6.4 GPIO Programming Interface 2 For more information, see the Documentation/gpio.txt under the Linux source code directory for the programming interface. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 39: Smart Direct Memory Access (Sdma) Api

    RAM-located scripts. • 8-KB RAM area is divided into a processor context area and a code space area used to store channel scripts that are downloaded from the system memory. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 40: Software Operation

    Table 4-2. SDMA API Source Files File Description dmaengine.c SDMA management routine imx-sdma.c SDMA implement driver The following table shows the image files available in the directory /<ltib_dir>/rpm/ BUILD/linux/firmware/imx/sdma i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 41: Menu Configuration Options

    For additional information, refer to the ESAI driver. 4.1.6 Usage Example Refer to one of the drivers, such as SPDIF driver, UART driver or SSI driver, that uses the SDMA API driver as a usage example. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 42 Overview i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 43: Electrophoretic Display Controller (Epdc) Frame Buffer Driver

    • Support for automated full and partial screen updates through the Linux fb_deferred_io mechanism. • Support for three EPDC driver display update schemes: Snapshot, Queue, and Queue and Merge. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 44: Hardware Operation

    (VT) console to switch from serial to graphics mode. The device is accessed through special device nodes, located in the /dev directory, as /dev/fb*. fb0 is generally the primary frame buffer. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 45: Epdc Frame Buffer Driver Extensions

    The EPDC driver is kept panel- agnostic through the use of an EPDC panel mode structure, mxc_epdc_fb_mode, which can be found in arch/arm/plat-mxc/include/mach/epdc.h. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 46: Boot Command Line Parameters

    The bpp setting from this command line sets the initial bits per pixel setting for the frame buffer. A setting of 16 selects RGB565 pixel format, while a setting of 8 selects 8-bit grayscale (Y8) format. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 47: Epdc Waveform Loading

    For example, to load the epdc_E060SCM.fw default firmware file for a Pearl panel, set the EPDC kernel command line paratmeter to the following: video=mxcepdcfb:E060SCM,bpp=16 i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 48: Using A Custom Waveform File

    EPD panel. To initialize the EPDC hardware and E-ink panel, an FBIOPUT_VSCREENINFO ioctl call must be made, with the xres and yres fields of the i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 49: Grayscale Framebuffer Selection

    Once this change has been made, rebuild the U-Boot image and flash it to your SD card. Then perform the following steps to flash a waveform file to an SD card where U-Boot can find it: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 50: Source Code Structure

    Table 5-2. EPDC Global Header Files File Description mxcfb.h Header file for the MXC framebuffer drivers mxcfb_epdc_kernel.h Header file for direct kernel access to the EPDC API extension i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 51: Menu Configuration Options

    This option must be selected for the EPDC framebuffer driver to operate correctly. In menuconfig, this option is available under: • Device Drivers > DMA Engine support > MXC PxP support 5.6 Programming Interface i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 52: Ioctls/Functions

    TEMP_USE_AMBIENT when using the MXCFB_SEND_UPDATE ioctl. MXCFB_SET_AUTO_UPDATE_MODE / mxc_epdc_fb_set_auto_update Description: Select between automatic and region update mode. Parameters: __u32 mode In region update mode, updates must be submitted via the MXCFB_SEND_UPDATE IOCTL. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 53 After attempting to merge all pending updates, the final merged update will be processed and submitted. MXCFB_SEND_UPDATE / mxc_epdc_fb_send_update Description: Request a region of the frame buffer be updated to the display. Parameters: mxcfb_update_data *upd_data i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 54 EPDC and the E Ink display power supplies. Parameters: int32_t delay Input delay value in milliseconds. To disable EPDC power down altogether, use FB_POWERDOWN_DISABLE (defined below). MXCFB_GET_PWRDOWN_DELAY / mxc_epdc_fb_get_pwrdown_delay Description: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 55: Structures And Defines

    /* Rectangular update region bounds */ __u32 waveform_mode; /* Waveform mode for update */ __u32 update_mode; /* Update mode selection (partial/full) */ __u32 update_marker; /* Marker used when waiting for completion */ i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 56 /* Temperature in Celsius */ uint flags; /* Select options for the current update */ struct mxcfb_alt_buffer_data alt_buffer_data; /* Alternate buffer data */ struct mxcfb_update_marker_data { __u32 update_marker; __u32 collision_test; }; i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 57: Sipix Display Controller (Spdc) Frame Buffer Driver

    • Support for setting the ambient temperature through either a one-time designated API call or on a per-update basis. • Support for user control of the delay between completing all updates and powering down the SPDC. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 58: Hardware Operation

    (the main use). The difference is that the memory that appears in the special file is not the whole memory, but the frame buffer of some video hardware. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 59: Spdc Frame Buffer Driver Extensions

    SPDC panel mode structure, imx_spdc_fb_mode, which can be found in arch/arm/plat-mxc/include/mach/epdc.h. struct imx_spdc_fb_mode { struct fb_videomode *vmode; struct imx_spdc_panel_init_set *init_set; const char *wave_timing; i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 60: Boot Command Line Parameters

    Sipix panel. A pointer to the waveform file data is programmed into the SPDC before the first update is performed. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 61: Using A Default Waveform File

    For example, if the panel waveform is named "pvi", wave_timing then the converted waveform file should be named spdc_pvi.fw. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 62: Spdc Panel Initialization

    The exception is when the FB Console driver is included in the kernel. When the SPDC driver registers the framebuffer device, the FB Console driver will subsequently make an FBIOPUT_VSCREENINFO ioctl call. This will in turn initialize the SPDC panel. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 63: Grayscale Framebuffer Selection

    Table 6-2. SPDC Global Header Files File Description mxcfb.h Header file for the MXC framebuffer drivers mxcfb_epdc_kernel.h Header file for direct kernel access to the SPDC API extension i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 64: Menu Configuration Options

    This option must be selected for the SPDC framebuffer driver to operate correctly. In menuconfig, this option is available under: • Device Drivers > DMA Engine support > MXC PxP support 6.6 Programming Interface i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 65: Ioctls/Functions

    SPDC_DEFAULT_TEMP when using the MXCFB_SEND_UPDATE ioctl. MXCFB_SET_AUTO_UPDATE_MODE / mxc_spdc_fb_set_auto_update Description: Select between automatic and region update mode. Parameters: __u32 mode In region update mode, updates must be submitted via the MXCFB_SEND_UPDATE IOCTL. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 66 After attempting to merge all pending updates, the final merged update will be processed and submitted. MXCFB_SEND_UPDATE / mxc_spdc_fb_send_update Description: Request a region of the frame buffer be updated to the display. Parameters: mxcfb_update_data *upd_data i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 67 SPDC and the Sipix display power supplies. Parameters: int32_t delay Input delay value in milliseconds. To disable SPDC power down altogether, use FB_POWERDOWN_DISABLE (defined below). MXCFB_GET_PWRDOWN_DELAY / mxc_spdc_fb_get_pwrdown_delay Description: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 68: Structures And Defines

    __u32 update_mode; /* Update mode selection (partial/full) */ __u32 update_marker; /* Marker used when waiting for completion */ int temp; /* Temperature in Celsius */ uint flags; /* Select options for the current update */ i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 69 Chapter 6 Sipix Display Controller (SPDC) Frame Buffer Driver struct mxcfb_alt_buffer_data alt_buffer_data; /* Alternate buffer data */ struct mxcfb_update_marker_data { __u32 update_marker; __u32 collision_test; }; i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 70 Programming Interface i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 71: Pixel Pipeline (Pxp) Dma-Engine Driver

    Framework (or DMA slave) when a DMA slave (client) interacts with the DMA Engine. The PxP driver implements the following callback functions in struct dma_device: device_alloc_chan_resources /* allocate resources and descriptors */ device_free_chan_resources /* release DMA channel's resources */ i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 72: Channel Management

    The extended TX descriptor packet (pxp_tx_desc), allows the user to pass PxP configuration information to the driver. This includes everything that the PxP needs to execute a processing task. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 73: Completion Notification

    Device Drivers ---> DMA Engine support ---> [*] MXC PxP support [*] MXC PxP Client Device 7.5 Source Code Structure The PxP driver source code is located in drivers/dma/ and include/linux/. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 74 Source Code Structure i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 75: Elcdif Frame Buffer Driver

    IOCTLs which act on it and through which information about the hardware can be queried and set. The color map handling operates through IOCTLs as well. See linux/fb.h for more information on which IOCTLs there are and which data structures they use. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 76: Menu Configuration Options

    The frame buffer driver includes the source/header files shown in table below. Table 8-1. Frame Buffer Driver Files File Description drivers/video/mxc/elcdif_regs.h The register head file for ELCDIF module include/linux/mxcfb.h The head file for MXC frame buffer drivers i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 77: Graphics Processing Unit (Gpu)

    Flash and SVG) 1.1 API defined by Khronos Group. 9.1.1.1 Hardware Operation For detailed hardware operation and programming information, see the GPU chapter in the i.MX 6SoloLiteApplications Processor Reference Manual. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 78: Software Operation

    Table below lists GPU driver user mode library structure: <ROOTFS>/usr/lib Table 9-2. GPU Library Files File Description libCLC.so OpenCL frontend compiler library libEGL.so* EGL1.4 library libGAL.so* GAL user mode driver Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 79 > cd <ROOTFS>/usr/lib > sudo ln -s libGAL-dfb.so libGAL.so > sudo ln -s libEGL-dfb.so libEGL.so > sudo ln -s libEGL-dfb.so libEGL.so.1 > sudo ln -s libVIVANTE-dfb.so libVIVANTE.so i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 80: Api References

    When the next screen appears, select the following options to enable the GPU driver: • Package list > gpu-viv-bin-mx6q • This package provides proprietary binary libraries, and test code built from the GPU for framebuffer i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 81: High-Definition Multimedia Interface (Hdmi)

    MXC Display Driver interface, the HDMI video driver waits for a hotplug interrupt indicating that a valid HDMI sink device is connected and ready to receive HDMI video data. Subsequent communications between the HDMI and LECDIF FB are conducted i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 82: Source Code Structure

    S/PDIF Audio SoC CODEC driver implementation. sound/soc/imx/imx-spdif.c S/PDIF Audio SoC Machine driver implementation. sound/soc/imx/imx-spdif-dai.c S/PDIF Audio SoC DAI driver implementation. sound/soc/imx/imx-pcm-dma-mx2.c S/PDIF Audio SoC platform layer driver implementation. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 83: Linux Menu Configuration Options

    Each time the cable is reconnected, the driver should re-determine the appropriate video mode based on the modes read via EDID from the HDMI sink and display that mode on the sink device. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 84: Audio

    HDMI sink device, and that the HDMI video image is being properly displayed on the device. 2. Use this command line to play out a pcm audio file "file.wav" to HDMI sink device: $ aplay -Dplughw:1,0 file.wav i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 85: Windows Acceleration

    • Solid fill of a rectangle. • Upload image from the system memory to the video memory. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 86: Windows Acceleration Architecture

    OpenGL/ES and EGL, though some of the families in the i.MX 6 series, such as the i.MX 6SoloLite, do not contain 3D HW module. The i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 87: I.mx 6 Driver For X-Windows System

    • EXA composite allows for many options and combinations of source/mask/target for rendering. Commonly used EXA composite operations are accelerated. The following types of EXA composite operations are accelerated: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 88 The actual amount needed depends on the number of X-Windows and pixmaps used, the possible usage of X pixmaps as textures, and whether X-Windows are using the XComposite extension. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 89: Xorg.conf For I.mx 6

    The following entry ties a specific graphics device to a screen. The Device Identifier string must match the string in a section of the file. For Device Screen xorg.conf example, i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 90: Setup X-Windows System Acceleration

    • xserver-xorg-video-imx-viv_<bsp-version>_armel.deb • This package contains the vivante-drv.so driver module for X acceleration and is installed in the folder with all the other X.org driver modules • File verification: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 91 34.229] (II) EXA(0): Driver registered support for the following operations: 34.229] (II) Solid 34.229] (II) Copy 34.229] (II) Composite (RENDER acceleration) 34.229] (II) UploadToScreen 34.244] (==) VIVANTE(0): Backing store disabled 34.244] (==) VIVANTE(0): DPMS enabled i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 92 Software Operation i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 93: Camera Sensor Interface (Csi) Driver

    • Configurable master clock frequency output to sensor. For more information, see the CSI chapter in the i.MX 6SoloLite Multimedia Applications Processor Reference Manual. 12.2 Software Operation This section includes the following: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 94: Csi Software Operation

    The memory map stream API is supported. Supported V4L2 IOCTLs include the following: • VIDIOC_QUERYCAP • VIDIOC_G_FMT • VIDIOC_S_FMT • VIDIOC_G_FBUF • VIDIOC_S_FBUF • VIDIOC_S_PARM • VIDIOC_G_PARM • VIDIOC_CROPCAP i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 95: Use Of The V4L2 Capture Apis

    The following table shows the CSI sensor and V4L2 driver source files available in the directory: <ltib_dir>/rpm/BUILD/linux/drivers/media/video/mxc/capture Table 12-1. V4L2 and CSI Driver Files File Description fsl_csi.c CSI driver source file fsl_csi.h CSI driver header file Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 96: Linux Menu Configuration Options

    > MXC Video For Linux Camera > MXC Camera/V4L2 PRP Features support By default, this option is enabled. 12.5 Programming Interface For more information, see the V4L2 Specification and the API Documents for the programming interface. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 97: Ov5640 Using Parallel Interface

    The camera driver implements the V4L2 capture interface and applications and uses the V4L2 capture interface to operate the camera. The supported operations of V4L2 capture are: • Capture stream mode • Capture still mode i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 98: Source Code Structure

    • Device Drivers > Multimedia devices > Video capture adapters > MXC Video For Linux Camera > MXC Camera/V4L2 PRP Features support > OmniVision ov5640 camera support. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 99: Low-Level Power Management (Pm) Driver

    • Standby: maps to STOP mode that offers significant power saving, as all blocks in the system are put into a low-power state, except for ARM core that is still powered on, and memory is placed in self-refresh mode to retain its contents. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 100: Source Code Structure

    Table below shows the PM driver source files. These files are available in <ltib_dir>/ rpm/BUILD/linux/arch/arm/mach-mx6/. Table 14-2. PM Driver Files File Description pm.c Supports suspend operation system.c Supports low-power modes mx6_suspend.S Assembly file for CPU suspend i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 101: Menu Configuration Options

    > /sys/devices/platform/imx-uart.'x'/tty/ttymxc'x'/power/wakeup; Here 'x' is your debug uart's index; echo +x > /sys/class/rtc/rtc0/wakealarm; RTC will wake up system after x seconds. To test this mode automatically, refer to the script in /unit_tests/suspend_auto.sh i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 102 Hardware Operation i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 103: Pf100 Regulator Driver

    PF100 is that PWRON is low. PMIC_ON_REQ pin of i.MX 6, which is controlled by SNVS block of i.MX 6, will connect with PWRON pin of PF100 to control PF100 on/off, so that system can power off. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 104: Driver Features

    Under this framework, most power operations can be done by the following unified API calls: • is an unified API call to lookup and obtain a reference to a regulator: regulator_get i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 105 API call to get regulator output voltage: regulator_get_voltage int regulator_get_voltage(struct regulator *regulator); You can find more APIs and details in the regulator core source code inside the Linux kernel at: <ltib_dir>/rpm/BUILD/linux/drivers/regulator/core.c i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 106: Driver Architecture

    15.4 Driver Architecture Figure below shows the basic architecture of the PF100 regulator driver. Device drivers PF100 driver Regulator core driver PF100 regulator driver PF100 core driver(MFD) I2C or SPI driver i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 107: Driver Interface Details

    Implementation of the PF100 regulator client driver. drivers/regulator/ pf100-regulator.c The PF100 regulators for i.MX 6SoloLite EVK board are registered under <ltib_dir>/ rpm/BUILD/linux/arch/arm/mach-mx6/mx6sl_evk_pmic_pf100.c. 15.4.3 Menu Configuration Options The following are menu configuration options: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 108 2. On the configuration screen select Configure Kernel, and then exit. When the next screen appears, choose the following: Device Drivers > Voltage and Current regulator support > Support regulators on Freescale PF100 PMIC. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 109: Cpu Frequency Scaling (Cpufreq) Driver

    /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state To change the CPU frequency to a value that is given by using the command above (for example, to 792 MHz), use this command: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 110: Source Code Structure

    16.2 Menu Configuration Options The following Linux kernel configuration is provided for this module: CONFIG_CPU_FREQ: In menu configuration, this option is located under: CPU Power Management > CPU Frequency scaling i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 111: Board Configuration Options

    • Interactive CPU frequency policy governor • Conservative CPU frequency governor • CPU frequency driver for i.MX CPUs 16.2.1 Board Configuration Options There are no board configuration options for the CPUFREQ device driver. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 112 Menu Configuration Options i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 113: Dynamic Voltage Frequency Scaling (Dvfs) Driver

    1. High Frequency Setpoint: AHB is at 132MHz, AXI is at 264Mhz and DDR is at the maximum frequency. This mode is used when most periphrals that need higher frequency for good performance are active. For ex, video playback, graphics processing etc. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 114: Source Code Structure

    There are no menu configuration options for this driver. The Bus Frequency drivers is included and enabled by default. 17.2.1 Board Configuration Options There are no board configuration options for the Linux busfreq device driver. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 115: Thermal Driver

    SoC's temperature reaches. 18.2 Hardware Operation The thermal driver uses an internal thermal sensor to monitor the SoC temperature. The cooling device uses the CPU frequency to protect the SoC. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 116: Thermal Driver Software Operation

    Configure the Kernel and exit. When the next screen appears, select the following options to enable this module: Device Drivers > MXC support drivers > ANATOP_THERMAL > Thermal Zone i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 117: Programming Interface

    Restore the trip point's temperature. When SoC temperature drops to below active trip point, thermal driver will remove all the protections. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 118 Unit Test i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 119: Anatop Regulator Driver

    I/O power segments if their I/O voltage needs to be different than what is provided above. Some internal regulators can be bypassed, so that external PMIC can supply these power directly to decrease power numer, such as VDD_SOC and VDD_ARM. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 120: Driver Features

    • int regulator_enable(struct regulator *regulator); • used to disable regulator output: regulator_disable • int regulator_disable(struct regulator *regulator); • is the regulator output enabled: regulator_is_enabled • int regulator_is_enabled(struct regulator *regulator); i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 121: Driver Interface Details

    • Device Drivers > Voltage and Current regulator support > Anatop Regulator Support. • System Type > Freescale MXC Implementations > Internal LDO in i.MX 6Quad and i.MX 6DualLite bypass. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 122 Driver Features i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 123: Snvs Real Time Clock (Srtc) Driver

    The following sections describe the software operation of the SRTC driver. 20.2.1 IOCTL The SRTC driver complies with the Linux RTC driver model. See the Linux documentation in <ltib_dir>/rpm/BUILD/linux/Documentation/rtc.txt for information on the RTC API. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 124: Keeping Alive In The Power Off State

    • Implementing all the functions required by Linux to provide the real-time clock and alarm interrupt. • Reserveing time in power-ff state. • Alarm wakes up the system from low-power modes. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 125: Source Code Structure

    Configure the kernel and exit. When the next screen appears, select the following options to enable the SRTC driver: • Device Drivers > Real Time Clock > Freescale SNVS Real Time Clock i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 126 Driver Features i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 127: Alsa Sound Driver Introduction

    DAPM guarantees the lowest audio power state at all times and is completely transparent to user space audio components. DAPM is ideal for mobile devices or devices with complex audio requirements. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 128 (including using digital mute). ASoC signals the CODEC when to change power states. • Machine specific controls, allows machines to add controls to the sound card, for example, volume control for speaker amp. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 129 Chapter 21 Advanced Linux Sound Architecture (ALSA) System on a Chip (ASoC) Sound Driver Figure 21-1. ALSA SoC Software Architecture ASoC basically splits an embedded audio system into 3 components: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 130: Soc Sound Card

    • Playback: supports two channels. • Capture: supports two channels. • Audio formats: • Playback: • SNDRV_PCM_FMTBIT_S16_LE • SNDRV_PCM_FMTBIT_S20_3LE • SNDRV_PCM_FMTBIT_S24_LE • Capture: • SNDRV_PCM_FMTBIT_S16_LE • SNDRV_PCM_FMTBIT_S20_3LE • SNDRV_PCM_FMTBIT_S24_LE i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 131: Hardware Operation

    APIs are exported to the upper layer by the structure snd_soc_dai_ops . Headphone insertion/removal can be detected through a GPIO interrupt signal. SSI dual FIFO features are enabled by default. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 132: Software Operation

    Header file for stereo CODEC driver 21.4.2 Sound Card Registration The CODECs have the same registration sequence: 1. The CODEC driver registers the CODEC driver, DAI driver, and their operation functions. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 133: Device Open

    : The IRQ line used for micphone detection mic_gpio • : When micphone is inserted, the detection pin status, if pin voltage mic_active_low level is low, the value should be 1. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 134: Menu Configuration Options

    The recording feature may be tested by the following command: • arecord [-Dplughw:0,0] -r 44100 -f S16_LE -c 2 -d 5 record.wav More usage for aplay/arecord/amixer may be obtained by the following commands. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 135 Chapter 21 Advanced Linux Sound Architecture (ALSA) System on a Chip (ASoC) Sound Driver • aplay --h • arecord --h • amixer --h i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 136 Unit Test i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 137: Spi Nor Flash Memory Technology Device (Mtd) Driver

    1 to 256 bytes at a time using the Page Program instruction. The whole memory can be erased using the Bulk Erase instruction, or a sector at a time, using the Sector Erase instruction. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 138: Software Operation

    MTD driver also provides the interfaces to read, write, and erase NOR Flash. 22.1.3 Driver Features This NOR MTD implementation supports the following features: • Provides necessary information for the upper layer MTD driver i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 139: Source Code Structure

    • Device Drivers > Memory Technology Device (MTD) support >Self-contained MTD device drivers > Support most SPI Flash chips (AT26DF, M25P, W25X, ...) i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 140 Introduction i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 141: Mmc/Sd/Sdio Host Driver

    The SD memory card system defines two alternative communication protocols: SD and SPI. The uSDHC only supports the SD bus protocol. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 142: Software Operation

    MMC host controller interface driver to send the commands to the uSDHC. The MMC driver is responsible for implementing standard entry points for init exit , and . The driver implements the following functions: request set_ios i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 143 • handles the clock change request. esdhc_set_clock() • it's the interrupt routine for card detect. cd_irq() Figure below shows how the MMC-related drivers are layered. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 144: Driver Features

    • SD3.0 cards. • Recognizes data transfer errors such as command time outs and CRC errors. • Power management. • It supports to be built as loadable or builtin module i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 145: Source Code Structure

    To compile SDHCI driver as a loadable module, several options should be selected as indicated below: • CONFIG_MMC_SDHCI=m, it can be found at Device Drivers > MMC/SD Card Support > Secure Digital Host Controller Interface support i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 146: Platform Data

    • .platform_pad_change: callback function used to change the pad settings due to different SD bus clock frequency • .keep_power_at_suspend: keep MMC/SD slot power when system enters suspend • .delay_line: delay line setting for DDR mode i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 147: Programming Interface

    $> modprobe sdhci.ko $> modprobe sdhci-platform.ko run the following commands to unload module.: • unload modules via insmod command. $> rmsmod sdhci-platform $> rmsmod sdhci • unload modules via modprobe command. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 148 Driver Features $> modprobe -r sdhci-platform $> modprobe -r sdhci i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 149: Inter-Ic (I2C) Driver

    • Compatible with the I2C bus standard • Bit rates up to 400 Kbps • Starts and stops signal generation/detection • Acknowledge bit generation/detection • Interrupt-driven, byte-by-byte data transfer • Standard I2C master mode i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 150: I2C Device Driver Overview

    • Address is received that matches its own specific address in slave-receive mode • Arbitration is lost 24.2 Software Operation The I2C driver for Linux has two parts: an I2C bus driver and an I2C chip driver. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 151: I2C Device Driver Software Operation

    The I2C driver supports the following features: • I2C communication protocol • I2C master mode of operation NOTE The I2C driver does not support the I2C slave mode of operation. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 152: Source Code Structure

    The highest interrupt rate is associated with the transfer complete interrupt as shown in table below. Table 24-2. I2C Interrupt Requirements Parameter Equation Typical Best Case Rate Transfer Bit Rate/8 25,000/sec 50,000/sec Latency 8/Transfer Bit Rate 40 μs 20 μs i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 153 The typical value of the transfer bit-rate is 200 Kbps. The best case values are based on a baud rate of 400 Kbps (the maximum supported by the I2C interface). i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 154 Driver Features i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 155: Enhanced Configurable Serial Peripheral Interface (Ecspi) Driver

    • Up to 32-bit programmable data transfer • 64 x 32-bit FIFO for both transmit and receive data • Configurable polarity and phase of the Chip Select (SS) and SPI Clock (SCLK) i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 156: Software Operation

    Only the controller driver can interact with the underlying SPI hardware module. Figure below shows how the different SPI drivers are layered in the SPI subsystem. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 157: Software Limitations

    • SPI setup function spi_imx_setup() initializes the current SPI device. • SPI driver ISR spi_imx_isr() is called when the data transfer operation is completed and an interrupt is generated. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 158: Ecspi Synchronous Operation

    Software Operation 25.2.4 ECSPI Synchronous Operation Figure below shows how the ECSPI provides synchronous read/write operations. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 159 Chapter 25 Enhanced Configurable Serial Peripheral Interface (ECSPI) Driver SPI Core SPI Controller ECSPI Client Driver Driver Driver Hardware spi_read/write spi transfer spi_enable_rx_intr spi_load_TxFifo spi_init_exchange Rx_Data_Ready_intr spi_getRxData callback after return transfer completion i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 160: Driver Features

    • Device Drivers > SPI Support > Utilities for Bitbanging SPI masters. • CONFIG_SPI_IMX implements the SPI master mode for ECSPI. In menuconfig, this option is available under: • Device Drivers > SPI Support > Freescale i.MX SPI controllers. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 161: Programming Interface

    1 and a 32-bit transfer length. The worst-case is based on a baud rate of 12 Mbps (max supported by the SPI interface) with a 8-bits transfer length. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 162 Driver Features i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 163: Arc Usb Driver

    The USB host system is composed of a number of hardware and software layers. Figure below shows a conceptual block diagram of the building block layers in a host system that support USB 2.0. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 164: Hardware Operation

    For the USB host, it only implements the hardware specified initialization functions. For the USB peripheral, it implements the gadget framework. static struct usb_ep_ops fsl_ep_ops = { .enable = fsl_ep_enable, .disable = fsl_ep_disable, .alloc_request = fsl_alloc_request, .free_request = fsl_free_request, i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 165: Source Code Structure

    Host driver source file for IRAM support gadget/arcotg_udc.c Peripheral driver source file gadget/arcotg_udc.h USB peripheral/endpoint management registers otg/fsl_otg.c OTG driver source file Table continues on the next page... i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 166 ULPI PHY driver (USB3317 uses the same driver as ISP1504) utmixc.c Internal UTMI transceiver driver usb_hsic_xcvr.c HSIC featured phy's interface usb_common.c Common platform related part of USB driver usb_wakeup.c Handle USB wakeup events i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 167: Menu Configuration Options

    Device drivers > USB support > USB Mass Storage support. By default, this option is Y. • CONFIG_USB_HID-Build support for all USB HID devices. In menuconfig this option is available under i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 168 Device drivers > USB support > USB Gadget Support > Ethernet Gadget (with CDC Ethernet Support) > RNDIS support. By default, this option is Y. • CONFIG_USB_FILE_STORAGE-Build support for Mass Storage gadget. In menuconfig, this option is available under i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 169: Programming Interface

    USB wakeup usage is outlined in three procedures: how to enable USB wakeup system, what kinds of wakeup events USB supports, and how to close USB child device power. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 170: Wakeup Events Supported By Usb

    > /sys/bus/usb/devices/1-1/power/wakeup NOTE For the hub on board, it is necessary to enable hub's wakeup first. For remote wakeup, it is necessary to perform the three steps outlined below: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 171: How To Close The Usb Child Device Power

    The following code string outlines how to close the USB child device power: echo auto > /sys/bus/usb/devices/1-1/power/control echo auto > /sys/bus/usb/devices/1-1.1/power/control (If there is a hub at usb device) i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 172 System WakeUp i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 173: Fast Ethernet Controller (Fec) Driver

    Mbps RMII. A brief overview of the device functionality is provided here. For details see the FEC chapter of the i.MX 6 i.MX 6SoloLite Multimedia Applications Processor Reference Manual. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 174 FEC_TX_EN and starts transmitting the preamble (PA) sequence, the start frame delimiter (SFD), and then the frame information from the FIFO. However, the controller defers the transmission if the network is busy (FEC_CRS asserts). i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 175 FEC driver and registered into the system.You can refer to Documentation/networking/ phy.txt under linux source directory for more information. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 176: Software Operation

    • Device Drivers > Network device support > Ethernet (10, 100 or 1000 Mbit) > FEC Ethernet controller. • To mount NFS-rootfs through FEC, disable the other Network config in the menuconfig if need. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 177: Programming Interface

    0x150 /* FIFO receive start reg */ #define FEC_R_DES_START 0x180 /* Receive descriptor ring */ #define FEC_X_DES_START 0x184 /* Transmit descriptor ring */ #define FEC_R_BUFF_SIZE 0x188 /* Maximum receive buff size */ i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 178: Getting A Mac Address

    MAC address for network devices. i.MX 6 user needs to provide MAC address by kernel command line so that user can use sb_loader to load kernel and run it without bootloader interaction. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 179: Universal Asynchronous Receiver/Transmitter (Uart) Driver

    The UART type should be set to 52 as defined in the serial_core.h header file. • Serial IrDA i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 180: Hardware Operation

    DMA receive buffer. The minimum size of this buffer is 512 bytes. The size should be a multiple of 256. The driver breaks the DMA receive buffer into smaller sub-buffers of i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 181: Driver Features

    • Implements support for Serial IrDA • Power management • Interrupt-driven and DMA-driven data transfer 28.2.3 Source Code Structure Table below shows the UART driver source files that are available in the directory: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 182: Configuration

    Device Drivers > Character devices > Serial drivers > IMX serial port support > Console on IMX serial port By default, this option is Y. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 183: Source Code Configuration Options

    With the SDMA enabled, the DMA RX interrupt occurs only when the received data fills all the 4K buffer. The DMA TX interrupt occurs when the data is sent out. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 184 Programming Interface i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 185: Pulse-Width Modulator (Pwm) Driver

    Linux driver that allows privileged users to control the backlight by the appropriate duty cycle of the PWM Output (PWMO) signal. 29.1.1 Hardware Operation Figure below shows the PWM block diagram. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 186: Clocks

    • Four low power and debug mode signals • Four scan signals • Standard IP slave bus signals 29.1.2 Clocks The clock that feeds the prescaler can be selected from: i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 187: Software Operation

    29.1.4 Driver Features The PWM driver includes the following software and hardware support: • Duty cycle modulation • Varying output intervals • Two power management modes-full on and full of i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 188: Menu Configuration Options

    • System Type > Enable PWM driver • Select the following option to enable the Backlight driver: Device Drivers > Graphics support > Backlight & LCD device support > Generic PWM based Backlight Driver i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 189: Watchdog (Wdog) Driver

    WDOG can be suspended/resumed in STOP/DOZE and WAIT modes independently. Since some bits of the WGOD registers are only one-time programmable after booting, ensure these registers are written correctly. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 190: Generic Wdog Driver

    30.2.3 Source Code Structure Table below shows the source files for WDOG drivers that are in the following directory: <ltib_dir>/rpm/BUILD/linux/drivers/watchdog. Table 30-1. WDOG Driver Files File Description imx2_wdt.c WDOG function implementations i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 191: Programming Interface

    The following IOCTLs are supported in the WDOG driver: • WDIOC_GETSUPPORT • WDIOC_GETSTATUS • WDIOC_GETBOOTSTATUS • WDIOC_KEEPALIVE • WDIOC_SETTIMEOUT • WDIOC_GETTIMEOUT For detailed descriptions about these IOCTLs, see <ltib_dir>/rpm/BUILD/linux/ Documentation/watchdog. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 192 Generic WDOG Driver i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 193: Introduction

    • Performance counter support-Enables collection of various low-level data and association for particular sections of code. • Call-graph support-With an 2.6 kernel, OProfile can provide gprof-style call-graph profiling data. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 194: Hardware Operation

    OProfile can use these interrupts to generate samples and the profile results are a statistical approximation of which code caused how many instances of the given event. 31.2 Software Operation i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 195: Architecture Specific Components

    The OProfile userspace daemon takes the raw data provided by the kernel and writes it to the disk. It takes the single data stream from the kernel and logs sample data against a number of sample files (available in /var/lib/oprofile/samples/current/). For the benefit of i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 196: Post Profiling Tools

    Source file with the implementation required for all platforms The generic kernel driver for Oprofile is located under <ltib_dir>/rpm/BUILD/linux/ drivers/oprofile/ 31.3.2 Menu Configuration Options The following Linux kernel configurations are provided for this module. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 197: Programming Interface

    The number of interrupts generated with respect to the OProfile driver are numerous. The latency requirements are not needed. The rate at which interrupts are generated depends on the event. i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 198 Requirements i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013 Freescale Semiconductor, Inc.
  • Page 199 Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners.

Table of Contents