3.6.1.1API for GPIO...................................................................................................................................43
6.5.2Video4Linux API test......................................................................................................................................65
6.5.3IPU Device Unit test........................................................................................................................................66
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
7.1.1Overview of MIPI DSI IP Driver.....................................................................................................................71
7.1.2Overview of MIPI DSI Display Panel Driver..................................................................................................72
8.2.2Using the V4L2 Capture APIs.........................................................................................................................78
8.3.2Using the V4L2 Output APIs...........................................................................................................................80
9.3.7Enabling An EPDC Splash Screen...................................................................................................................89
9.6.2Structures and Defines.....................................................................................................................................94
10.3.1 Key Data Structs..............................................................................................................................................97
11.1.1.5 API References................................................................................................................................104
11.1.1.6 Menu Configuration Options...........................................................................................................104
12.4Setting Up DirectFB Acceleration................................................................................................................................109
13.3.1 Linux Menu Configuration Options.................................................................................................................120
14.3.1 X Windows Acceleration Architecture............................................................................................................124
14.3.2 i.MX 6 Driver for X-Windows System............................................................................................................125
14.3.3 i.MX 6 Direct Rendering Infrastructure (DRI) for X-Windows System.........................................................127
14.3.4 EGL- X Library................................................................................................................................................128
14.3.5 xorg.conf for i.MX 6........................................................................................................................................128
14.3.6 Setup X-Windows System Acceleration..........................................................................................................130
15.1.3 Menu Configuration Options...........................................................................................................................136
15.1.5 Defining an Application...................................................................................................................................138
Chapter 16
OmniVision Camera Driver
16.1OV5640 Using MIPI CSI-2 interface...........................................................................................................................139
16.1.4 Linux Menu Configuration Options.................................................................................................................140
16.2OV5640 Using parallel interface..................................................................................................................................141
16.2.4 Linux Menu Configuration Options.................................................................................................................142
17.2.2 MIPI CSI2 Common API Operation................................................................................................................145
17.3.2 Menu Configuration Options...........................................................................................................................146
18.1.3 Menu Configuration Options...........................................................................................................................150
18.1.5 Unit Test...........................................................................................................................................................151
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
19.4.3 Menu Configuration Options...........................................................................................................................157
22.3.2 Menu Configuration Options...........................................................................................................................166
23.2.5 Menu Configuration Options...........................................................................................................................171
24.2.2 Keeping Alive in the Power Off State.............................................................................................................174
24.3.2 Menu Configuration Options...........................................................................................................................175
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
12Freescale Semiconductor, Inc.
Section numberTitlePage
Chapter 25
Advanced Linux Sound Architecture (ALSA) System on a Chip (ASoC) Sound Driver
25.4.5 Menu Configuration Options...........................................................................................................................186
25.5.1 Stereo CODEC Unit Test.................................................................................................................................187
25.5.2 7.1 Audio Codec Unit Test..............................................................................................................................188
25.5.3 AM/FM Codec Unit Test.................................................................................................................................189
26.3.1 Linux Menu Configuration Options.................................................................................................................194
27.2.2 Provided User Interface...................................................................................................................................200
27.3.2 Provided User Interfaces..................................................................................................................................202
27.7Interrupts and Exceptions.............................................................................................................................................206
27.8Unit Test Preparation....................................................................................................................................................206
27.8.1 Tx test step.......................................................................................................................................................206
27.8.2 Rx test step.......................................................................................................................................................206
Chapter 28
SPI NOR Flash Memory Technology Device (MTD) Driver
28.1.5 Menu Configuration Options...........................................................................................................................211
29.2.2 Menu Configuration Options...........................................................................................................................217
30.2.3 Boot Control Block Management....................................................................................................................222
30.2.4 Bad Block Handling.........................................................................................................................................223
30.3.1 Menu Configuration Options...........................................................................................................................223
31.1.1 I2C Bus Driver Overview................................................................................................................................225
31.3.2 Menu Configuration Options...........................................................................................................................228
32.2.1 SPI Sub-System in Linux.................................................................................................................................232
32.2.3 Standard Operations.........................................................................................................................................233
32.3.2 Menu Configuration Options...........................................................................................................................236
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
16Freescale Semiconductor, Inc.
Section numberTitlePage
33.1.4 Linux Menu Configuration Options.................................................................................................................240
34.1.3 Modes of Operation.........................................................................................................................................243
35.2.3 Menu Configuration Options...........................................................................................................................250
35.3.1 USB Wakeup usage.........................................................................................................................................253
35.3.2 How to Enable USB WakeUp System Ability.................................................................................................253
35.3.3 WakeUp Events Supported by USB................................................................................................................254
35.3.4 How to Close the USB Child Device Power....................................................................................................255
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
36.1.2 Terminology and Conventions.........................................................................................................................257
36.1.3 PCIe Topology on i.MX 6 in PCIe RC Mode..................................................................................................259
36.3.1 System Resource: Interrupt lines.....................................................................................................................263
36.4Using PCIe Endpoint and running Tests.......................................................................................................................264
36.4.1 Ensuring PCIe System Initialization................................................................................................................265
36.4.3 Known Issues...................................................................................................................................................266
37.2.3 Menu Configuration Options...........................................................................................................................274
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
37.3.2 Getting a MAC Address...................................................................................................................................276
38.2.2 Linux Menu Configuration Options.................................................................................................................279
38.3.1 IXXAT Specific Data structure Defines..........................................................................................................279
39.3.1 Menu Configuration Options...........................................................................................................................286
40.1.4 Linux Menu Configuration Options.................................................................................................................290
41.2.2 Reset and Power control..................................................................................................................................295
42.1.6 Menu Configuration Options...........................................................................................................................300
43.2.2 Menu Configuration Options...........................................................................................................................302
44.2.1 Architecture Specific Components..................................................................................................................306
44.2.5 Post Profiling Tools.........................................................................................................................................308
44.3.2 Menu Configuration Options...........................................................................................................................308
45.2Configuration and Job Execution Level.......................................................................................................................311
45.4Job Ring Driver.............................................................................................................................................................312
45.8Limitations in the Existing Implementation Overview.................................................................................................318
45.13 Allocate a Slot from the Keystore.................................................................................................................................320
45.14 Load Data into a Keystore Slot.....................................................................................................................................321
45.16 Decapsulate Data in the Keystore.................................................................................................................................322
45.17 Read Data From a Keystore Slot..................................................................................................................................323
45.18 Release a Slot back to the Keystore..............................................................................................................................323
45.22 Install a Handler............................................................................................................................................................326
45.23 Remove an Installed Driver..........................................................................................................................................326
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
22Freescale Semiconductor, Inc.
Chapter 1
About This Book
1.1Audience
This document is targeted to individuals who will port the i.MX Linux BSP to customerspecific products.
The audience is expected to have a working knowledge of the Linux 3.0 kernel internals,
driver models, and i.MX processors.
1.1.1Conventions
This document uses the following notational conventions:
• Courier monospaced type indicate commands, command parameters, code examples,
and file and directory names.
• Italic type indicates replaceable command or function parameters.
• Bold type indicates function names.
1.1.2Definitions, Acronyms, and Abbreviations
The following table defines the acronyms and abbreviations used in this document.
Definitions and Acronyms
TermDefinition
ADCAsynchronous Display Controller
address
translation
APIApplication Programming Interface
®
ARM
Freescale Semiconductor, Inc.23
Address conversion from virtual domain to physical domain
Advanced RISC Machines processor architecture
Table continues on the next page...
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Audience
TermDefinition
AUDMUXDigital audio MUX-provides a programmable interconnection for voice, audio, and synchronous data routing
between host serial interfaces and peripheral serial interfaces
BCDBinary Coded Decimal
busA path between several devices through data lines
bus loadThe percentage of time a bus is busy
CODECCoder/decoder or compression/decompression algorithm-used to encode and decode (or compress and
decompress) various types of data
CPUCentral Processing Unit-generic term used to describe a processing core
CRCCyclic Redundancy Check-Bit error protection method for data communication
CSICamera Sensor Interface
DFSDynamic Frequency Scaling
DMADirect Memory Access-an independent block that can initiate memory-to-memory data transfers
DPMDynamic Power Management
DRAMDynamic Random Access Memory
DVFSDynamic Voltage Frequency Scaling
EMIExternal Memory Interface-controls all IC external memory accesses (read/write/erase/program) from all the
masters in the system
EndianRefers to byte ordering of data in memory. Little endian means that the least significant byte of the data is
stored in a lower address than the most significant byte. In big endian, the order of the bytes is reversed
EPITEnhanced Periodic Interrupt Timer-a 32-bit set and forget timer capable of providing precise interrupts at
regular intervals with minimal processor intervention
FCSFrame Checker Sequence
FIFOFirst In First Out
FIPSFederal Information Processing Standards-United States Government technical standards published by the
National Institute of Standards and Technology (NIST). NIST develops FIPS when there are compelling
Federal government requirements such as for security and interoperability but no acceptable industry
standards
FIPS-140Security requirements for cryptographic modules-Federal Information Processing Standard 140-2(FIPS 140-2)
is a standard that describes US Federal government requirements that IT products should meet for Sensitive,
but Unclassified (SBU) use
FlashA non-volatile storage device similar to EEPROM, where erasing can be done only in blocks or the entire chip.
Flash pathPath within ROM bootstrap pointing to an executable Flash application
FlushProcedure to reach cache coherency. Refers to removing a data line from cache. This process includes
cleaning the line, invalidating its VBR and resetting the tag valid indicator. The flush is triggered by a software
command
GPIOGeneral Purpose Input/Output
hashHash values are produced to access secure data. A hash value (or simply hash), also called a message
digest, is a number generated from a string of text. The hash is substantially smaller than the text itself, and is
generated by a formula in such a way that it is extremely unlikely that some other text produces the same hash
value.
I/OInput/Output
ICEIn-Circuit Emulation
IPIntellectual Property
IPUImage Processing Unit -supports video and graphics processing functions and provides an interface to video/
still image sensors and displays
Table continues on the next page...
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
24Freescale Semiconductor, Inc.
Chapter 1 About This Book
TermDefinition
IrDAInfrared Data Association-a nonprofit organization whose goal is to develop globally adopted specifications for
infrared wireless communication
ISRInterrupt Service Routine
JTAGJTAG (IEEE Standard 1149.1) A standard specifying how to control and monitor the pins of compliant devices
on a printed circuit board
KillAbort a memory access
KPPKeyPad Port-16-bit peripheral used as a keypad matrix interface or as general purpose input/output (I/O)
lineRefers to a unit of information in the cache that is associated with a tag
LRULeast Recently Used-a policy for line replacement in the cache
MMUMemory Management Unit-a component responsible for memory protection and address translation
MPEGMoving Picture Experts Group-an ISO committee that generates standards for digital video compression and
audio. It is also the name of the algorithms used to compress moving pictures and video
MPEG
standards
MQSPIMultiple Queue Serial Peripheral Interface-used to perform serial programming operations necessary to
MSHCMemory Stick Host Controller
NAND Flash Flash ROM technology-NAND Flash architecture is one of two flash technologies (the other being NOR) used
NOR FlashSee NAND Flash
PCMCIAPersonal Computer Memory Card International Association-a multi-company organization that has developed
physical
address
PLLPhase Locked Loop-an electronic circuit controlling an oscillator so that it maintains a constant phase angle (a
RAMRandom Access Memory
RAM pathPath within ROM bootstrap leading to the downloading and the execution of a RAM application
RGBThe RGB color model is based on the additive model in which Red, Green, and Blue light are combined to
RGBARGBA color space stands for Red Green Blue Alpha. The alpha channel is the transparency channel, and is
RNGARandom Number Generator Accelerator-a security hardware module that produces 32-bit pseudo random
Several standards of compression for moving pictures and video:
• MPEG-1 is optimized for CD-ROM and is the basis for MP3
• MPEG-2 is defined for broadcast video in applications such as digital television set-top boxes and DVD
• MPEG-3 was merged into MPEG-2
• MPEG-4 is a standard for low-bandwidth video telephony and multimedia on the World-Wide Web
configure radio subsystems and selected peripherals
in memory cards such as the Compact Flash cards. NAND is best suited to flash devices requiring high
capacity data storage. NAND flash devices offer storage space up to 512-Mbyte and offers faster erase, write,
and read capabilities over NOR architecture
a standard for small, credit card-sized devices, called PC Cards. There are three types of PCMCIA cards that
have the same rectangular size (85.6 by 54 millimeters), but different widths
The address by which the memory in the system is physically accessed
lock) on the frequency of an input, or reference, signal
create other colors. The abbreviation RGB comes from the three primary colors in additive light models
unique to this color space. RGBA, like RGB, is an additive color space, so the more of a color placed, the
lighter the picture gets. PNG is the best known image format that uses the RGBA color space
numbers as part of the security module
Internal boot code encompassing the main boot flow as well as exception vectors
Table continues on the next page...
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.25
Audience
TermDefinition
SDMASmart Direct Memory Access
SDRAMSynchronous Dynamic Random Access Memory
SoCSystem on a Chip
SPBAShared Peripheral Bus Arbiter-a three-to-one IP-Bus arbiter, with a resource-locking mechanism
SPISerial Peripheral Interface-a full-duplex synchronous serial interface for connecting low-/medium-bandwidth
external devices using four wires. SPI devices communicate using a master/slave relationship over two data
lines and two control lines: Also see SS, SCLK, MISO, and MOSI
SRAMStatic Random Access Memory
SSISynchronous-Serial Interface-standardized interface for serial data transfer
TBDTo Be Determined
UARTUniversal Asynchronous Receiver/Transmitter-asynchronous serial communication to external devices
UIDUnique ID-a field in the processor and CSF identifying a device or group of devices
USBUniversal Serial Bus-an external bus standard that supports high speed data transfers. The USB 1.1
specification supports data transfer rates of up to 12 Mb/s and USB 2.0 has a maximum transfer rate of 480
Mbps. A single USB port can be used to connect up to 127 peripheral devices, such as mice, modems, and
keyboards. USB also supports Plug-and-Play installation and hot plugging
USBOTGUSB On The Go-an extension of the USB 2.0 specification for connecting peripheral devices to each other.
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
wordA group of bits comprising 32-bits
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
26Freescale Semiconductor, Inc.
Chapter 2
Introduction
2.1Overview
The purpose of this software package is to support Linux on the i.MX 6Solo/6DualLite
family of Integrated Circuits (ICs) and their associated platforms. It provides the
necessary software to interface the standard open-source Linux kernel to the i.MX
hardware. The goal is to enable Freescale customers to rapidly build products based on
i.MX devices that use the Linux OS.
The BSP is not a platform or product reference implementation. It does not contain all of
the product-specific drivers, hardware-independent software stacks, Graphical User
Interface (GUI) components, Java Virtual Machine (JVM), and applications required for
a product. Some of these are made available in their original open-source form as part of
the base kernel.
The BSP is not intended to be used for silicon verification. While it can play a role in
this, the BSP functionality and the tests run on the BSP do not have sufficient coverage to
replace traditional silicon verification test suites.
2.1.1Software Base
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.
2.1.2Features
Table below describes the features supported by the Linux BSP for specific platforms.
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.27
Overview
Table 2-1. Linux BSP Supported Features
FeatureDescriptionChapter SourceApplicable
Machine Specific Layer
MSLMachine Specific Layer (MSL) supports interrupts,
Timer, Memory Map, GPIO/IOMUX, SPBA, SDMA.
• Interrupts GIC: The linux kernel contains common
ARM GIC interrupts handling code.
• Timer (GPT): The General Purpose Timer (GPT)
is set up to generate an interrupt as programmed
to provide OS ticks. Linux facilitates timer use
through various functions for timing delays,
measurement, events, alarms, high resolution
timer features, and so on. Linux defines the MSL
timer API required for the OS-tick timer and does
not expose it beyond the kernel tick
implementation.
• GPIO/EDIO/IOMUX: The GPIO and EDIO
components in the MSL provide an abstraction
layer between the various drivers and the
configuration and utilization of the system,
including GPIO, IOMUX, and external board I/O.
The IO software module is board-specific, and
resides in the MSL layer as a self-contained set
of files. I/O configuration changes are centralized
in the GPIO module so that changes are not
required in the various drivers.
• SPBA: The Shared Peripheral Bus Arbiter
(SPBA) provides an arbitration mechanism
among multiple masters to allow access to the
shared peripherals. The SPBA implementation
under MSL defines the API to allow different
masters to take or release ownership of a shared
peripheral.
SDMA APIThe Smart Direct Memory Access (SDMA) API driver
controls the SDMA hardware. It provides an API to
other drivers for transferring data between MCU, DSP
and peripherals. . The SDMA controller is responsible
for transferring data between the MCU memory space,
peripherals, and the DSP memory space. The SDMA
API allows other drivers to initialize the scripts, pass
parameters and control their execution. SDMA is based
on a microRISC engine that runs channel-specific
scripts.
DMACBoth AHB-to-APBH and AHB-to-APBX DMA support
configurable DMA descript chain.
Low-level PM
Drivers
CPU Frequency
Scaling
The low-level power management driver is responsible
for implementing hardware-specific operations to meet
power requirements and also to conserve power on the
development platforms. Driver implementations are
often different for different platforms. It is used by the
DPM layer.
The CPU frequency scaling device driver allows the
clock speed of the CPUs to be changed on the fly.
Machine Specific Layer (MSL)All
Smart Direct Memory Access
(SDMA) API
AHB-to-APBH Bridge with DMA
(APBH-Bridge-DMA)
Low-level Power Management
(PM) Driver
CPU Frequency Scaling
(CPUFREQ) Driver
Platform
i.MX 6Solo/
6DualLite
i.MX 6Solo/
6DualLite
i.MX 6Solo/
6DualLite
i.MX 6Solo/
6DualLite
Table continues on the next page...
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
28Freescale Semiconductor, Inc.
Chapter 2 Introduction
Table 2-1. Linux BSP Supported Features (continued)
FeatureDescriptionChapter SourceApplicable
Platform
DVFSThe Dynamic Voltage Frequency Scaling (DVFS)
device driver allows simple dynamic voltage frequency
scaling. The frequency of the core clock domain and
the voltage of the core power domain can be changed
on the fly with all modules continuing their normal
operations.
Multimedia Drivers
IPUThe Image Processing Unit (IPU) is designed to
support video and graphics processing functions and to
interface with video/still image sensors and displays.
The IPU driver is a self-contained driver module in the
Linux kernel. It contains a custom kernel-level API to
manipulate logical channels. A logical channel
represents a complete IPU processing flow. The IPU
driver includes a frame buffer driver, a V4L2 device
driver, and low-level IPU drivers.
HDMIThis driver provides the support HDMI moduleHDMI Driveri.MX 6Solo/
Dual DisplayThis chapter introduces the basic infromation about
dual display
V4L2 OutputThe Video for Linux 2 (V4L2) output driver uses the IPU
post-processing functions for video output. The driver
implements the standard V4L2 API for output devices.
V4L2 CaptureThe Video for Linux 2 (V4L2) capture device includes
two interfaces: the capture interface and the overlay
interface. The capture interface records the video
stream. The overlay interface displays the preview
video.
VPUThe Video Processing Unit (VPU) is a multi-standard
video decoder and encoder that can perform decoding
and encoding of various video formats.
Sound Drivers
ALSA SoundThe Advanced Linux Sound Architecture (ALSA) is a
sound driver that provides ALSA and OSS compatible
applications with the means to perform audio playback
and recording functions. ALSA has a user-space
component called ALSAlib that can extend the features
of audio hardware by emulating the same in software
(user space), such as resampling, software mixing,
snooping, and so on. The ASoC Sound driver supports
stereo CODEC playback and capture through SSI.
S/PDIFThe S/PDIF driver is designed under the Linux ALSA
subsystem. It implements one playback device for Tx
and one capture device for Rx.
Memory Drivers
SPI NOR MTDThe SPI NOR MTD driver provides the support to the
Atmel data Flash using the SPI interface.
Dynamic Voltage Frequency
Scaling (DVFS) Driver
Image Processing Unit (IPU)
Drivers
Dual Displayi.MX 6Solo/
Video for Linux Two (V4L2) Driveri.MX 6Solo/
Video for Linux Two (V4L2) Driveri.MX 6Solo/
Video Processing Unit (VPU)
Driver
ALSA Sound Driveri.MX 6Solo/
The Sony/Philips Digital Interface
(S/PDIF) Driver
SPI NOR Flash Memory
Technology Device (MTD) Driver
i.MX 6Solo/
6DualLite
i.MX 6Solo/
6DualLite
6DualLite
6DualLite
6DualLite
6DualLite
i.MX 6Solo/
6DualLite
6DualLite
i.MX 6Solo/
6DualLite
i.MX 6Solo/
6DualLite
Table continues on the next page...
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.29
Overview
Table 2-1. Linux BSP Supported Features (continued)
FeatureDescriptionChapter SourceApplicable
NAND MTDThe NAND MTD driver interfaces with the integrated
NAND controller. It can support various file systems,
such as UBIFS, CRAMFS and JFFS2UBI and
UBIFSCRAMFS and JFFS2. The driver implementation
supports the lowest level operations on the external
NAND Flash chip, such as block read, block write and
block erase as the NAND Flash technology only
supports block access. Because blocks in a NAND
Flash are not guaranteed to be good, the NAND MTD
driver is also able to detect bad blocks and feed that
information to the upper layer to handle bad block
management.
Input Device Drivers
Networking Drivers
ENETThe ENET Driver performs the full set of IEEE 802.3/
Ethernet CSMA/CD media access control and channel
interface functions. The FEC requires an external
interface adaptor and transceiver function to complete
the interface to the Ethernet media. It supports half or
full-duplex operation on 10M\100M related Ethernet
networks.
Bus Drivers
I2CThe I2C bus driver is a low-level interface that is used
to interface with the I2C bus. This driver is invoked by
the I2C chip driver; it is not exposed to the user space.
The standard Linux kernel contains a core I2C module
that is used by the chip driver to access the bus driver
to transfer data over the I2C bus. This bus driver
supports:
• Compatibility with the I2C bus standard
• Bit rates up to 400 Kbps
• Standard I2C master mode
• Power management features by suspending and
resuming I2C.
CSPIThe low-level Enhanced Configurable Serial Peripheral
Interface (ECSPI) driver interfaces a custom, kernelspace API to both ECSPI modules. It supports the
following features: