I.mx Linux Reference Manual
I.mx Linux Reference Manual
Document information
Information Content
Keywords i.MX, Linux, LF5.15.71_2.2.0
Abstract The i.MX family Linux Board Support Package (BSP) supports the Linux
Operating System (OS) on the i.MX application processors.
NXP Semiconductors
IMXLXRM
i.MX Linux Reference Manual
1 Introduction
1.1 Overview
The i.MX family Linux Board Support Package (BSP) supports the Linux Operating
System (OS) on the i.MX application processors.
The purpose of this software package is to support Linux OS on the i.MX 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 i.MX 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.
1.1.2 Features
The table below describes the features supported by the BSP for specific platforms.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
1.2 Audience
This document is targeted to individuals who will port the i.MX Linux OS Board Support
Package (BSP) to customer-specific products.
The audience is expected to have a working knowledge of the Linux kernel internals,
driver models, and i.MX processors.
1.2.1 Conventions
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.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
1.3 References
i.MX has multiple families supported in software. The following are the listed families and
SoCs per family. The i.MX Linux Release Notes describes which SoC is supported in the
current release. Some previously released SoCs might be buildable in the current release
but not validated if they are at the previous validated level.
• i.MX 6 Family: 6QuadPlus, 6Quad, 6DualLite, 6SoloX, 6SLL, 6UltraLite, 6ULL, 6ULZ
• i.MX 7 Family: 7Dual, 7ULP
• i.MX 8 Family: 8QuadMax, 8ULP
• i.MX 8M Family: 8M Plus, 8M Quad, 8M Mini, 8M Nano
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2 System
2.1.1 Introduction
The Machine-Specific Layer (MSL) provides the Linux kernel with the following machine-
dependent components.
• Interrupts including GPIO and EDIO (only on certain platforms)
• Timer
• Memory map
• General Purpose Input/Output (GPIO) including IOMUX on certain platforms
• Clock
• Shared Peripheral Bus Arbiter (SPBA)
• Smart Direct Memory Access (SDMA)
The Interrupt Controller controls and prioritizes all internal and external interrupt sources.
By default, all interrupts have the same priority.
Each interrupt source can be enabled or disabled by configuring the interrupt controller’s
registers.
There are three types of interrupts in GIC: PPI, SGI, and SPI.
• PPI is private peripheral interrupts of each CPU. It can only be handled by each CPU.
• SGI is software generated interrupts. It can be triggered by software operation, and it
also can only be handled by each CPU.
• SPI is shared peripheral interrupts, which are normally external interrupt sources from
SoC platform. It can be handled by all CPUs.
For the Arm architecture-based processors with GIC-400 of i.MX 6 and i.MX 7 SoCs,
normal interrupt and fast interrupt are two different exception types. The exception vector
addresses can be configured to start at low address (0x0) or high address (0xFFFF0000)
for i.MX 6 and i.MX 7 platforms. The Linux OS implementation running on the Arm
architecture chooses the high-vector address model.
For Arm architecture-based processors with GIC-500 of i.MX 8 SoCs, the exception
vector addresses are defined as VBAR_ELn + offset. The offset depends on which
exception level the interrupt exception is taken. The file Documentation/arm/Interrupts
has a description of the Arm interrupt architecture.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.1.3 Timer
The Linux kernel relies on the underlying hardware to provide support for both the system
timer (which generates periodic interrupts) and the dynamic timers (to schedule events).
After the system timer interrupt occurs, it does the following:
• Updates the system uptime
• Updates the time of day
• Reschedules a new process if the current process has exhausted its time slice
• Runs any dynamic timers that have expired
• Updates resource usage and processor time statistics
The following tables describes the different timers used.
Table 5. Timers
Timer Description
General Purpose Timer (GPT) GPT is configured to generate a periodic
interrupt at a certain interval (every 10 ms).
Used by i.MX 6 to go into WFI mode. Used by i.
MX 6 and i.MX 7.
Enhanced Periodic Interrupt Timer (EPIT) Available on i.MX 6 and i.MX 7.
Arm Arch Timer i.MX 8 usage instead of GPT
System Counter Timer i.MX 8M and i.MX 8X usage instead of GPT
The timer software implementation provides an initialization function that initializes the
GPT with the proper clock source, interrupt mode and interrupt interval.
The timer then registers its interrupt service routine and starts timing. The interrupt
service routine is required to service the OS for the purposes mentioned in the previous
Section Section 2.1.3. Another function provides the time elapsed as the last timer
interrupt.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The timer module utilizes four hardware timers, to implement clock source and clock
event objects.
This is done with the clocksource_mxc structure of struct clocksource type and
clockevent_mxc structure of struct clockevent_device type. Both structures provide
routines required for reading current timer values and scheduling the next timer event.
The module implements a timer interrupt routine that services the Linux OS with timer
events for the purposes mentioned in the beginning of this chapter.
The MMU, as part of the Arm core, provides the virtual to physical address mapping
defined by the page table. For more information, see the Arm Technical Reference
Manual (TRM) from Arm Limited.
The Memory Map implementation programs the Memory Map module to creates the
physical to virtual memory map for all the I/O modules.
2.1.5 IOMUX
The limited number of pins of highly integrated processors can have multiple purposes.
The IOMUX module controls a pin usage so that the same pin can be configured for
different purposes and can be used by different modules. This is a common way to
reduce the pin count while meeting the requirements from various customers. Platforms
that do not have the IOMUX hardware module can do pin muxing through the GPIO
module.
The IOMUX module provides the multiplexing control so that each pin may be configured
either as a functional pin or as a GPIO pin. A functional pin can be subdivided into either
a primary function or alternate functions. The pin operation is controlled by a specific
hardware module. A GPIO pin, is controlled by the user through software with further
configuration through the GPIO module. For example, the TXD1 pin might have the
following functions:
• TXD1-internal UART1 Transmit Data. This is the primary function of this pin.
• UART2 DTR-alternate mode 3
• LCDC_CLS-alternate mode 4
• GPIO4[22]-alternate mode 5
• SLCDC_DATA[8]-alternate mode 6
If the hardware modes are chosen at the system integration level, this pin is dedicated
only to that purpose and cannot be changed by software. Otherwise, the IOMUX module
needs to be configured to serve a particular purpose that is dictated by the system
(board) design. If the pin is connected to an external UART transceiver and therefore
to be used as the UART data transmit signal, it should be configured as the primary
function. If the pin is connected to an external Ethernet controller for interrupting the Arm
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
core, then it should be configured as GPIO input pin with interrupt enabled. Again, be
aware that the software does not have control over what function a pin should have. The
software only configures pin usage according to the system design.
The following discussion applies only to those processors that have an IOMUX hardware
module. The IOMUX controller registers are briefly described in this section. For detailed
information, see the pin multiplexing section of the IC Reference Manual.
• SW_MUX_CTL-Selects the primary or alternate function of a pin. Also enables
loopback mode when applicable.
• SW_SELECT_INPUT-Controls pin input path. This register is only required when
multiple pads drive the same internal port.
• SW_PAD_CTL-Control pad slew rate, driver strength, pull-up/down resistance, and so
on.
The IOMUX software implementation provides an API to set up pin functionality and pad
features.
The IOMUX implementation programs the IOMUX module to configure the pins that are
supported by the hardware.
Table below lists the source files for the IOMUX module. The files are in the drivers/
princtrl/freescale folder.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For a multipurpose pin, the GPIO controller provides the multiplexing control so that
each pin may be configured either as a functional pin, or a GPIO pin. The operation of
the functional pin, which can be subdivided into either major function or one alternate
function, is controlled by a specific hardware module. If it is configured as a GPIO pin, the
pin is controlled by the user through software with further configuration through the 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).
The following discussion applies to those platforms that control the muxing of a pin
through the general purpose input/output (GPIO) module.
If the hardware modes are chosen at the system integration level, this pin is dedicated
only to that purpose which cannot be changed by software. Otherwise, the GPIO module
needs to be configured properly to serve a particular purpose that is dictated with the
system (board) design. If this pin is connected to an external UART transceiver, it should
be configured as the primary function or if this pin is connected to an external Ethernet
controller for interrupting the core, then it should be configured as GPIO input pin with
interrupt enabled. The software does not have control over what function a pin should
have. The software only configures a pin for that usage according to the system design.
The GPIO controller module is divided into MUX control and PULLUP control sub
modules. The following sections briefly describe the hardware operation. For detailed
information, see the relevant device documentation.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The GPIO module has a PULLUP control register (PUEN) for each GPIO port to control
every pin of that port.
The GPIO software implementation provides an API to setup pin functionality and pad
features.
The GPIO implementation programs the GPIO module to configure the pins that are
supported by the hardware.
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.
The GPIO utility functions should be called to configure a pin instead of directly
accessing the GPIO registers. The GPIO interrupt implementation contains functions,
such as the interrupt service routine (ISR) registration/un-registration and ISR
dispatching once an interrupt occurs. All driver-specific GPIO setup functions should
be made during device initialization in the MSL layer to provide better portability and
maintainability. This GPIO interrupt is initialized automatically during the system startup.
If a pin is configured as GPIO by the IOMUX, the state of the pin should also be set since
it is not initialized by a dedicated hardware module. Setting the pad pull-up, pull-down,
slew rate and so on, with the pad control function may be required as well.
API for GPIO lists the features supported by the GPIO implementation.
The GPIO implementation supports the following features:
• An API for registering an interrupt service routine to a GPIO interrupt. This is
made possible as the number of interrupts defined by NR_IRQS is expanded to
accommodate all the possible GPIO pins that are capable of generating interrupts.
• Functions to request and free an IOMUX pin. If a pin is used as GPIO, another set
of request/free function calls are provided. The user should check the return value of
the request calls to see if the pin has already been reserved before modifying the pin
state. The free function calls should be made when the pin is not needed. See the API
document for more details.
• Aligned parameter passing for both IOMUX and GPIO function calls. In this
implementation the same enumeration for iomux_pins is used for both IOMUX and
GPIO calls and the user does not have to figure out in which bit position a pin is located
in the GPIO module.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Minimal changes required for the public drivers such as Ethernet and UART drivers as
no special GPIO function call is needed for registering an interrupt.
All of the GPIO module source code is in the GPIO framework, in the following files,
located in the directories indicated at the beginning of this chapter:
For more information, see the Documentation/gpio/gpio.txt under Linux source code
directory for the programming interface.
2.1.7 Clock
The Linux clock framework relies on the underlying hardware to provide support for clock
tree management.
The following table describes different clock hardware used.
File Description
Clock controller module (CCM) i.MX 6Quad/DualLite/SoloX/UltraLite/ULL/SLL,
i.MX 7Dual, i.MX 8M Quad, i.MX 8M Mini, and i.
MX 8M Nano
Peripheral clock control (PCC) and System i.MX 7ULP
clock generator (SCG)
Distributed slave system controller (DSC) i.MX 8QuadMax/8QuadXPlus
The clock implementation supports the following features according to different clock
types:
• Prepare/Unprepare a clock.
• Enable/Disable a clock.
• Get/Set the clock rate.
• Get/Set the clock parent.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
File Description
drivers/clk/imx/clk-imx6q.c i.MX 6Quad/6DualLite clock driver
drivers/clk/imx/clk-imx6sx.c i.MX 6SoloX clock driver
drivers/clk/imx/clk-imx6ul.c i.MX 6UltraLite and 6ULL clock driver
drivers/clk/imx/clk-imx6sll.c i.MX 6SLL clock driver
drivers/clk/imx/clk-imx7d.c i.MX 7Dual clock driver
drivers/clk/imx/clk-imx7ulp.c i.MX 7ULP clock driver
drivers/clk/imx/clk-imx8qm.c i.MX 8QuadMax clock driver
drivers/clk/imx/clk-imx8qxp.c i.MX 8QuadXPlus clock driver
drivers/clk/imx/clk-imx8mq.c i.MX 8M Quad clock driver
drivers/clk/imx/clk-imx8mm.c i.MX 8M Mini clock driver
drivers/clk/imx/clk-imx8mn.c i.MX 8M Nano clock driver
drivers/clk/imx/clk-imx8ulp.c i.MX 8ULP clock driver
2.1.7.4
Different clock types provide different clock operation callbacks. Device drivers call
standard clock APIs to clock framework and eventually call into platform clock driver, and
the corresponding clock node’s operation callback is executed.
2.2.1 Introduction
The System Controller is provided on i.MX 8 and i.MX 8X families and provides an
abstraction to many underlying features of the hardware and runs on a Cortex-M
processor which executes SC firmware (SCFW). This overview describes the features of
the SCFW and APIs exposed to other software components.
The System Controller features include:
• System Intiialization and Boot - The SC firmware runs on the SCU immediately after
the SCU Read-only-memory (ROM) finishes loading code/data images from the first
container. It is responsible for initializing many aspects of the system. This includes
additional power and clock configuration and resource isolation hardware configuration.
By default, the SC firmware configures the primary boot core to own most of the
resources and launches the boot core. Additional configuration can be done by boot
code.
• System Controller Communication - Other software components in the system
communicate to the SC via an exposed API library. This library is implemented to make
Remote Procedure Calls (RPC) via an underlying Inter-Processor Communication
(IPC) mechanism. The IPC is facilitated by a hardware-based mailbox system.
Software components (Linux, QNX, FreeRTOS, MCUXpresso SDK) delivered for i.MX8
already include ports of the client API. Other 3rd parties will need to first port the API to
their environment before the API can be used. The porting kit release includes archives
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
of the client API for existing SW. These can be used as reference for porting the client
API. All that needs to be implemented is the IPC layer which will utilize messaging units
(MU) to communicate with the SCFW.
• Power Management - All aspects of power management including power control, bias
control, clock control, reset control, and wake-up event monitoring are grouped within
the SC Power Management service.
– Power Control - The SC firmware is responsible for centralized management of
power controls and external power management devices. It manages the power
state and voltage of power domains as well as bias control. It also resets peripherals
as required due to power-state transitions. This is immplemented with the API by
communicating power state needs for individual resources.
– Clock Control - The SC firmware is responsible for centralized management of clock
controls. This includes clock sources such as oscillators and PLLs as well as clock
dividers, muxes, and gates. This is implemented with the API by communicating
clocking needs for individual resources.
– Reset Control - The SC firmware is responsible for reset control. This includes
booting/rebooting a partition, obtaining reset reasons, and starting/stopping of CPUs.
Before any hardware in the SoC can be used, SW must first power up the resource and
enable any clocks that it requires, otherwise access will generate a bus error.
• Resource Management - SC firmware is responsible for managing ownership and
access permissions to system resources. The features of the resource management
service supported by SC firmware include:
– Management of system resources such as SoC peripherals, memory regions, and
pads
– Allows resources to be partitioned into different ownership groupings that are
associated with different execution environments including multiple operating
systems executing on different cores, TrustZone, and hypervisor
– Associates ownership with requests from messaging units within a resource partition
– Allows memory to be divided into memory regions that are then managed like other
resources
– Allows owners to configure access permissions to resources
– Configures hardware components to provide hardware enforced isolation
– Configures hardware components to directly control secure/nonsecure attribute
driven on bus fabric
– Provides ownership and access permission information to other system controller
functions (e.g., pad ownership information to the pad muxing functions)
– Protection of resources is provided in two ways. First, the SCFW itself checks
resource access rights when API calls are made that affect a specific resource.
Depending on the API call, this may require that the caller be the owner, parent of
the owner, or an ancestor of the owner. Second, any hardware available to enforce
access controls is configured based on the RM state. This includes the configuration
of IP such as XRDC2, XRDC, or RDC, as well as management pages of IP like
CAAM.
• Pad Configuration - Pad configuration is managed by SC firmware. The pad
configuration features supported by the SC firmware include:
– Configuring the mux, input/output connection, and low-power isolation mode.
– Configuring the technology-specific pad setting such as drive strength, pullup/
pulldown, etc.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.3.1 Introduction
For i.MX 6 and i.MX 7, the boot image uses only the U-Boot bootloader. For the SoC
in the i.MX 8 and i.MX 9 series, the boot image is more complex and includes U-Boot
as well various firmware required for a successful boot. This chapter describes the
additional components for an i.MX 8 series boot loader.
For i.MX 7ULP, the boot partition requires the Arm Cortex M-4 SDK flash since the Arm
Cortex M-4 boots the U-Boot boot loader, but other i.MX 6 and i.MX 7 with Arm Cortex
M-4 cores do not require this for succesful boot.
The i.MX 8 and i.MX 9 bootloaders are created using imx-mkimage tool available on
imx-mkimage on github.com/nxp-imx/ and all i.MX 8 Series require Arm trusted firmware
available on imx-atf on github.com/nxp-imx/.
For details on how to use the imx-mkimage tool to create an i.MX boot partition, refer to
the i.MX Linux User's Guide. This tool for execution requires the following components.
For i.MX 8M Quad, i.MX 8M Mini, and i.MX 8M Nano, the following firmware is needed:
• Synopys DDR frimware
• Signed HDMI firmware - that integrates with the DCSS driver. HDMI firmware is for
i.MX 8M Quad only
• Arm Trusted firmware - bl31-*soc*
For i.MX 8QuadMax, the following firmware is needed:
• System Controller Firmware (SCFW)
• Arm Trusted firmware - bl31-*soc*
• SECO firmware container image (ahab-container.img) for B0
For i.MX 8QuadXPlus, i.MX 8DualX, and i.M 8DualXLite, the following firmware is
needed:
• System Controller Firmware (SCFW)
• Arm Trusted firmware - bl31-*soc*
• SECO firmware container image (ahab-container.img)
For i.MX 93, the following firmware is needed:
• Synopsys DDR firmware
• Arm Trusted firmware - bl31-*soc*
• Sentinel firmware container
All the i.MX series require Arm trusted firmware and U-boot. Also i.MX SoC supporting
OP-TEE (all i.MX 6, 7 and 8M families) enabled with OP-TEE boot need the tee.bin
created from building optee_ox.
Type 2 hypervisors such as Jailhouse and kvm are not part of the boot loader. Type 1
hypervisors are part of the loader however xen is not currently supported.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.4.1 Introduction
The Anatop regulator driver provides the low-level control of the power supply regulators,
and selection of voltage levels. This device driver makes use of the regulator core driver
to access the Anatop hardware control registers and is only supported on i.MX 6 and
i.MX 7.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For more APIs and details in the regulator core source code inside the Linux kernel see:
drivers/regulator/core.c.
The Anatop regulators are registered in each SoC-specific dts file in arch/arm/boot/dts.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.5.1.1 Introduction
Information found here describes the low-level Power Management (PM) driver which
controls the low-power modes.
The following describes the differences between how power management is handled for
each supported i.MX family.
Table below lists the detailed clock information for the different low power modes.
For detailed information about low power modes, see the Applications Processor
Reference Manual associated with SoC.
The i.MX 6 and i.MX 7 power management driver maps the low-power modes to the
kernel power management states as listed below:
• Standby-maps to STOP mode, which offers significant power saving, as all blocks in
the system are put into a low-power state, except for Arm core, which is still powered
on, and memory is placed in self-refresh mode to retain its contents.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Mem (suspend to RAM) maps to DORMANT mode, which offers most significant power
saving, as all blocks in the system are put into a low-power state, except for memory,
which is placed in self-refresh mode to retain its contents. If there is "fsl,enable-
lpsr" defined in DTB ocrams node, mem is mapped to LPSR mode instead of
DORMANT, and all the blocks in the system are put into power off state, except the
LPSR, SNVS, and DRAM power domains.
• System idle maps to WAIT mode.
• If Arm Cortex-M4 processor is alive together with Arm Cortex-A processor before
the kernel enters standby/mem mode, and if Arm Cortex-M4 processor is not in its
low-power idle mode, Arm Cortex-A processor triggers the SoC to enter WAIT mode
instead of STOP mode to make sure that Arm Cortex-M4 processor can continue
running.
The i.MX 6 and i.MX 7 power management driver performs the following steps to enter
and exit low power mode:
1. Allow the Cortex-A platform to issue a deep sleep mode request.
2. If STOP or DORMANT mode:
• Program i.MX 6 CCM_CLPCR or i.MX 7 GPC_LPCR_A7_BSC and GPC_SLPCR
registers to set low-power control register.
• If DORMANT mode, request switching off CPU power when pdn_req is asserted.
• Request switching off embedded memory peripheral power when pdn_req is
asserted.
• Program GPC mask register to unmask wakeup interrupts.
3. Call cpu_do_idle to execute WFI pending instructions for wait mode.
4. Execute imx6_suspend or imx7_suspend in IRAM.
5. In DORMANT mode, save Arm context, and change the drive strength of DDR
PADs as "low" to minimize the power leakage in DDR PADs. Execute WFI pending
instructions for stop mode.
6. Generate a wakeup interrupt and exit low-power mode. In DORMANT mode, restore
Arm core and DDR drive strength.
In DORMANT mode, the i.MX 6 and i.MX 7 can assert the PMIC_STBY_REQ pin to
the PMIC and request a voltage change. The U-Boot or Machine-Specific Layer (MSL)
usually sets the standby voltage in STOP mode according to i.MX 6 and i.MX 7 data
sheet.
On i.MX 8M Family the power management driver uses the following modes.
• RUN Mode: In this mode, the Quad-A53 CPU core is active and running. Some
portions can be shut off for power saving.
• IDLE Mode: This mode is defined as a mode which CPU can automatically enter when
there is no thread running and all high-speed devices are not active. The CPU can be
put into power gated state but with L2 data retained, DRAM and bus clock are reduced,
and most of the internal logics are clock gated but still remain powered.
• SUSPEND Mode: This mode is defined as the most power saving mode where all
the clocks are off and all the unnecessary power supplies are off. Cortex-A53 CPU
platform is fully power gated. All the internal digital logics and analog circuits that can
be powered down will be off.
• SNVS Mode: This mode is also called RTC mode. In this mode, only the power for the
SNVS domain remains on to keep RTC and SNVS logic alive.
On i.MX 8 and i.MX 8X:
• Low-power mode management is not controlled by a dedicated hardware block.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• All low-power modes are implemented in system controller firware (SCFW) using
software method.
• SCFW powers off clusters/CPUs when the system is suspended.
On i.MX 8ULP:
• uPower is responsible for controlling the power mode transition, Power switch, and
mem ON/OFF.
• For detailed power mode description, see the Applications Processor Reference
Manual associated with SoC.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
In menu configuration enable the CONFIG_PM: CONFIG_PM builds support for power
management. By default, this option is Y In menuconfig, this option is available under:
Power management options > Power Management support.
In menu configuration enable the CONFIG_SUSPEND. CONFIG_SUSPEND builds
support for suspend. In menuconfig, this option is available under: Power management
options > Suspend to RAM and standby
Look in the cpu_idle for each SoC as shown in the source code structure table and
search for lpm. This will be the API for lower power mode. This implements all the steps
required to put the system into WAIT and STOP modes.
2.5.2.1 Introduction
PMIC PF regulator provides reference and supply voltages for the application processor
and peripheral devices.
Four buck (step down) converters (up to 6 independent output) and one boost (step up)
converter are included. The buck converters provide the power supply to processor cores
and to other low voltage circuits such as memory. Dynamic voltage scaling is provided to
allow controlled supply rail adjustments for the processor cores and/or other circuitry.
Linear regulators are directly supplied from the battery or from the switchers and
include supplies for I/O and peripherals, audio, camera, BT, WLAN, and so on. Naming
conventions are suggestive of typical or possible use case applications, but the switchers
and regulators may be utilized for other system power requirements within the guidelines
of specified capabilities.
The only power on event of PF100 is PWRON is high, and the only power off event of
PF100 is PWRON is low. PMIC_ON_REQ pin of i.MX 6, which is controlled by SNVS
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
block of i.MX 6, will connect with PWRON pin of PF100 to control PF100 on/off, so that
system can power off.
PMIC PF regulator client driver performs operations by reconfiguring the PMIC hardware
control registers.
Some of the PMIC power management operations depend on the system design and
configuration. For example, if the system is powered by a power source other than
the PMIC, then turning off or adjusting the PMIC voltage regulators has no effect.
Conversely, if the system is powered by the PMIC, then any changes that use the power
management driver and the regulator client driver can affect the operation or stability of
the entire system.
PMIC PF regulator driver is based on regulator core driver. It provides the following
services for regulator control of the PMIC component:
• Switch ON/OFF all voltage regulators.
• Set the value for all voltage regulators.
• Get the current value for all voltage regulators.
The regulator power architecture is designed to provide a generic interface to voltage and
current regulators within the Linux kernel.
It is intended to provide voltage and current control to client or consumer drivers and
to provide status information to user space applications through a sysfs interface. The
intention is to allow systems to dynamically control regulator output to save power and
prolong battery life. This applies to both voltage regulators (where voltage output is
controllable) and current sinks (where current output is controllable).
For more details, see opensource.wolfsonmicro.com/node/15
Under this framework, most power operations can be done by the following unified API
calls:
• regulator_get is an unified API call to lookup and obtain a reference to a regulator:
struct regulator *regulator_get(struct device *dev, const char
*id);
• regulator_put is an unified API call to free the regulator source:
void regulator_put(struct regulator *regulator, struct device
*dev);
• regulator_enable is an unified API call to enable regulator output:
int regulator_enable(struct regulator *regulator);
• regulator_disable is an unified API call to disable regulator output:
int regulator_disable(struct regulator *regulator);
• regulator_is_enabled is the regulator output enabled:
int regulator_is_enabled(struct regulator *regulator);
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
You can find more APIs and details in the regulator core source code inside the Linux
kernel at:
drivers/regulator/core.c
The following figure shows the basic architecture of the PMIC PF regulator driver.
Access to PFUZE100 regulator is provided through the API of the regulator core driver.
PFUZE100 regulator driver provides the following regulator controls:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• 4 buck switch regulators on normal mode (up to 6 independent rails): SW1AB, SW1C,
SW2, SW3A, SW3B, and SW4.
• Buck switch can be programmed to a state of standby with specific register
(PFUZE100_SWxSTANDBY) in advance.
• 6 Linear Regulators: VGEN1, VGEN2, VGEN3, VGEN4, VGEN5, and VGEN6.
• 1 LDO/Switch supply for VSNVS support on i.MX processors.
• 1 Low current, high accuracy, voltage reference for DDR Memory reference voltage.
• 1 Boost regulator with USB OTG support.
• Most power rails from PFUZE100 have been programmed properly according to the
hardware design. Therefore, you can't find the kernel using PFUZE100 regulators.
PFUZE100 regulator driver has implemented these regulators so that customers can
use it freely if default PFUZE100 value can't meet their hardware design.
There is no board file related to PMIC. Some PFUZE driver code was moved to U-Boot,
such as standby voltage setting. Some code is implemented by DTS file. Search for
PFUZE100 in Uboot source and pfuze in device trees dtsi files in i.MX 6 and i.MX7 in
arch/arm/boot/dts and for i.MX 8M in arch/arm64/boot/dts.
2.5.3.1 Introduction
The CPU frequency scaling device driver allows the clock speed of the CPU to be
changed on the fly. Once the CPU frequency is changed, the voltage of the necessary
power supplies are changed to the voltage value defined in device tree scripts (DTS).
This method can reduce power consumption (thus saving battery power), because the
CPU uses less power as the clock speed is reduced.
The CPUFREQ device driver is designed to change the CPU frequency and voltage on
the fly.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
If the frequency is not defined in DTS, the CPUFREQ driver changes the CPU frequency
to the nearest higher frequency in the array. The frequencies are manipulated using
the clock framework API, while the voltage is set using the regulators API. The CPU
frequencies in the array are based on the boot CPU frequency. Interactive CPU
frequency governor is used which cannot be changed manually. To change CPU
frequency manually, the userspace CPU frequency governor can be used. By default, the
conservative CPU frequency governor is used.
See the API document for more information on the functions implemented in the driver.
To view what values the CPU frequency can be changed to in KHz (the values in the first
column are the frequency values), use this command:
cat /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:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Use the following command to view the current CPU frequency in KHz:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
cat /sys/devices/system/cpu/cpu0/cpufreq/
scaling_available_governors
Table below shows the source files and headers available in the following directory.
For CPU frequency working point settings, see the SoC corresponding dtsi file in arch/
arm/boot/dts for i.MX 6 and i.MX7 and arch/arm64/boot/dts for i.MX 8, i.MX 8X and i.MX
8M.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.5.4.1 Introduction
To improve power consumption, the Bus Frequency driver dynamically manages the
various system frequencies for i.MX 6, i.MX 7, and i.MX 8M families.
The frequency changes are transparent to the higher layers and require no intervention
from the drivers or middleware. Depending on activity of the peripheral devices and CPU
loading, the bus frequency driver varies the DDR frequency between 24 MHz and its
maximum frequency. Similarly, the AHB frequency is varied between 24 MHz and its
maximum frequency.
2.5.4.2 Operation
The Bus Frequency driver is part of the power management module in the Linux BSP.
The main purpose of this driver is to scale the various operating frequency of the system
clocks (like AHB, DDR, AXI, etc.) based on peripheral activity and CPU loading.
The bus frequency depends on the request and release of device drivers for its
operation. Drivers will call bus frequency APIs to request or release the bus setpoint they
want. The bus frequency will set the system frequency to highest frequency setpoint
based on the peripherals that are currently requesting.
To enable the bus frequency driver, use the following command:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
If Arm Cortex-M4 processor is alive with Arm Cortex-A processor together, Arm Cortex-
M4 processor also requests or releases bus frequency high setpoint for its operation.
This means that Arm Cortex-A processor treats Arm Cortex-M4 processor as one of its
high-speed devices.
The setpoint modes do the following:
• High Frequency Setpoint mode is used when most peripherals that need higher
frequency for good performance are active. For example, video playback and graphics
processing.
• Audio Playback setpoints mode is used in audio playback mode.
• Low Frequency setpoint mode is used when the system is idle waiting for user input
(display is off). For i.MX 8M, this mode is used when no peripheral device request high
mode or audio mode.
The following table explains the software setpoints for each Family.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Bus frequency modes are defined in the SoC dtsi files in arch/arm/boot/dts for i.MX 6 and
i.MX 7 and arch/arm64/boot/dts for i.MX 8M.
On i.MX 8ULP, there is a simple interface to change the APD-side voltage and frequency
scaling.
To enabled the system level voltage and frequency scaling, use the following command:
Note: Before enabling this mode, the FEC and the display must be off, and the system is
idle.
To disable the system level voltage and frequency scaling, use the following command:
There are no menu configuration options for this driver. The Bus Frequency drivers are
included and enabled by default for the SoC that support bus frequency drivers.
2.5.5.1 Introduction
Battery Charging is supported by the max8903-charger for the i.MX 6 SABRE SD boards.
None.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.6 OProfile
2.6.1 Introduction
OProfile is a system-wide profiler capable of profiling all running code at low overhead.
OProfile consists of a kernel driver, a daemon for collecting sample data, and several
post-profiling tools for turning data into information.
2.6.1.1 Overview
OProfile leverages the hardware performance counters of the CPU to enable profiling
of a wide variety of interesting statistics, which can also be used for basic time-spent
profiling.
All code is profiled: hardware and software interrupt handlers, kernel modules, the kernel,
shared libraries, and applications.
2.6.1.2 Features
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
OProfile achieves this by taking the stream of sampled PC values, along with the detail
of which task was running at the time of the interrupt, and converting the values into a file
offset against a particular binary file. Each PC value is thus converted into a tuple (group
or set) of binary-image offset. The userspace tools can use this data to reconstruct where
the code came from, including the particular assembly instructions, symbol, and source
line (through the binary debug information if present).
Regularly sampling the PC value like this approximates what actually was executed
and how often and, more often than not, this statistical approximation is good enough to
reflect reality. In common operation, the time between each sample interrupt is regulated
by a fixed number of clock cycles. This implies that the results reflect where the CPU
is spending the most time. This is a very useful information source for performance
analysis.
The Arm CPU provides hardware performance counters capable of measuring these
events at the hardware level. Typically, these counters increment once per each event
and generate an interrupt on reaching some pre-defined number of events. 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.
The generic kernel driver resides in drivers/oprofile, and forms the core of how OProfile
operates in the kernel. The generic kernel driver takes samples delivered from the
architecture-specific code (through oprofile_add_sample()), and buffers this data (in a
transformed configuration) until releasing the data to the userspace daemon through the /
dev/oprofile/buffer character device.
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
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
of the separate functionality, the names and paths of these sample files are changed to
reflect where the samples were from. This can include thread IDs, the binary file path, the
event type used, and more.
After this final step from interrupt to disk file, the data is now persistent (that is, changes
in the running of the system do not invalidate stored data). This enables the post-profiling
tools to run on this data at any time (assuming the original binary files are still available
and unchanged).
The collected data must be presented to the user in a useful form. This is the job of
the post-profiling tools. In general, they collate a subset of the available sample files,
load and process each one correlated against the relevant binary file, and produce user
readable information.
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.
The following Linux kernel configurations are provided for this module.
In menu configuration enable the following module:
• CONFIG_OPROFILE-configuration option for the oprofile driver. In the menuconfig this
option is available under
• General Setup > Profiling support (EXPERIMENTAL) > OProfile system profiling
(EXPERIMENTAL)
This driver implements all the methods required to configure and control PMU and L2
cache EVTMON counters.
More information, see the Linux document generated from build: make htmldocs.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following steps show and example of how to configure the OProfile:
1. Use the command bitbake linux-imx -c menuconfig. On the screen, first, go to
Package list and select Oprofile.
2. Then, return to the first screen and select Configure Kernel, follow the instruction
from Section 2.6.2.2, to enable Oprofile in the kernel space.
3. Save the configuration and start to build.
4. Copy Oprofile binaries to target rootfs. Copy vmlinux to /boot directory and run
Oprofile
2.7.1 Introduction
The pulse-width modulator (PWM) has a 16-bit counter and is optimized to generate
sound from stored sample audio images and generate tones. The PWM also provides
control for the back light.
The PWM has 16-bit resolution and uses a 4x16 data FIFO to generate sound. The
software module is composed of a Linux driver that allows privileged users to control the
backlight by the appropriate duty cycle of the PWM Output (PWMO) signal.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The PWM follows IP Bus protocol for interfacing with the processor core. It does not
interface with any other modules inside the device except for the clock and reset inputs
from the Clock Control Module (CCM) and interrupt signals to the processor interrupt
handler. The PWM includes a single external output signal, PMWO. The PWM includes
the following internal signals:
• Three clock inputs
• Four interrupt lines
• One hardware reset line
• Four low power and debug mode signals
• Four scan signals
• Standard IP slave bus signals
2.7.3 Clocks
The clock that feeds the prescaler can be selected from:
• High frequency clock-provided by the CCM. The PWM can be run on this clock in low
power mode.
• Low reference clock - 32 KHz low reference clock provided by the CCM. The PWM can
be run on this clock in the low power mode.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Global functional clock - for normal operations. In low power modes this clock can be
switched off.
The clock input source is determined by the CLKSRC field of the PWM control register.
The CLKSRC value should only be changed when the PWM is disabled.
The function pwm_config() includes most of the configuration tasks for the PWM module,
including the clock source option, period and duty cycle of the PWM output signal. It is
recommended to select the peripheral clock of the PWM module, rather than the local
functional clock, as the local functional clock can change.
2.8.1 Introduction
With the newest multicore architecture designed by using the Arm Cortex-A series
processors and the ArmCortex-M series processors, industrial applications can achieve
greater power efficiency for a reduced carbon footprint. This reduces power consumption
without performance deterioration.
A homogeneous SoC would traditionally run a single operating system (OS) that controls
all the memory. The OS or a hypervisor would handle task management among available
cores to maximize system utilization. Such a system is called Symmetric MultiProcessing
(SMP).
A heterogeneous multicore chip where different processing cores running different
instruction sets and different OSs. Each processing core handles a specific task as
required. Such a system is called Asymmetric Multiprocessing (AMP). To understand
the distinction between the SMP and AMP systems, it is possible for a homogeneous
multicore SoC to be an AMP system but a heterogeneous multicore SoC cannot be an
SMP system.
A multicore architecture brings new challenges to the system design, because the
software must be rewritten to distribute tasks across the available cores. In addition, all
the peripheral resources need to be properly allocated to avoid resource contention and
achieve efficient sharing of the data spaces between the cores. A multicore SoC also
needs mechanisms for reliable communication and synchronization among tasks running
on different processing cores.
RPMsg is a virtio-based messaging bus, which allows kernel drivers to communicate
with remote processors available on the system. In turn, drivers could then expose
appropriate user space interfaces if needed. Every RPMsg device is a communication
channel with a remote processor (so the RPMsg devices are called channels). Channels
are identified by a textual name and have a local ("source") RPMsg address, and
remote ("destination") RPMsg address. For more information, see www.kernel.org/doc/
Documentation/rpmsg.txt.
As shown in the following figure, the messages pass between endpoints through
bidirectional connection-less communication channels.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.8.2 Features
• Designed for low-latency and low overhead operation, and compliant with the Linux
RPMsg framework.
• Optimized for embedded environments with constrained CPU and memory resources.
• Implementation by using shared memory without data translation or message headers.
• Application communication by using a client-server methodology.
• Dynamic allocation of the RPMsg channels.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.9 Thermal
2.9.1 Introduction
Thermal driver is a necessary driver for monitoring and protecting the SoC. The thermal
driver monitors the SoC temperature in a certain frequency from an internal thermal
sensor.
It defines two trip points: critical and passive. Cooling device will take actions to protect
the SoC according to the different trip points that SoC has reached:
• When reaching critical point, cooling device will shut down the system.
• When reaching passive point, cooling device will lower CPU frequency and notify GPU/
VPU to run at a lower frequency.
• When the temperature drops to 10 °C below passive point, cooling device will release
all the cooling actions.
Thermal driver has two parts:
• Thermal zone defines trip points and monitors the SoC's temperature.
• Cooling device takes the actions according to the different trip points.
The critical and passive points threshold are confiugured in the following files.
• i.MX 6 and i.MX 7 SoCs configure this in drivers/thermal/imx_thermal.c
• i.MX 8M SoCs configure this in their dtsi file and specify CONFIG_IMX8M_THERMAL
in defconfig.
• i.MX 8 and i.MX 8X SoCsconfigure this in their dtsi file and specify
CONFIG_IMX_SC_THERMAL in defconfig.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.10 Sensors
2.10.1 Introduction
Sensors include a group of drivers for Accelerometer, Pressure, Gyroscope, Ambient
Light, and Magnetometer.
Sensors are configured in the device trees for each board.
i.MX supports accelerometers for the following SoC:
• i.MX 6SABRE-SD, 6SABRE-AI, and 6SoloX use the MMA8451 sensor
• i.MX 6UltraLite and 6ULL EVK use the FXLS8571Q sensor.
• i.MX 7Dual SABRE-SD and i.MX 8QuadMax and i.MX 8QuadXPlus use the FX0S8700
sensor.
i.MX Supports pressure sensor MPL3115 for the following SoC:
• i.MX 7 Dual SABRE-SD
• i.MX 8 QuadMax
• i.MX 8 QuadXPlus
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.11.1 Introduction
The Watchdog Timer module protects against system failures by providing an escape
from unexpected hang or infinite loop situations or programming errors.
Some platforms may have two WDOG modules with one of them having interrupt
capability. i.MX 6 and 7Dual share the same watch dog driver with i.MX 8M. i.MX 7ULP
has a separate watchdog driver. i.MX 8 and i.MX 8X share a virtual watchdog driver
interface through system controller firmware.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
3 Storage
3.1.1 Overview
The AHB-to-APBH bridge provides the processor with an inexpensive peripheral
attachment bus running on the AHB's HCLK. The H in APBH denotes that the APBH is
synchronous to HCLK.
The AHB-to-APBH bridge includes the AHB-to-APB PIO bridge for a memory-mapped
I/O to the APB devices, as well as a central DMA facility for devices on this bus and a
vectored interrupt controller for the Arm core. Each one of the APB peripherals, including
the vectored interrupt controller, is documented in their own chapters elsewhere in this
document.
There is no separate DMA bus for these devices. Contention between the DMA's use of
the APBH bus and the AHB-to-APB bridge functions' use of the APBH is mediated by an
internal arbitration logic. For contention between these two units, the DMA is favored and
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
the AHB slave will report "not ready" through its HREADY output until the bridge transfer
can complete. The arbiter tracks repeated lockouts and inverts the priority, guaranteeing
the Arm platform every fourth transfer on the APB.
The SDMA controller is responsible for transferring data between the MCU memory
space and peripherals and includes the following features.
• Multichannel DMA supporting up to 32 time-division multiplexed DMA channels
• Powered by a 16-bit Instruction-Set micro-RISC engine
• Each channel executes a specific script
• Very fast context-switching with two-level priority based preemptive multitasking
• 4 Kbytes ROM containing startup scripts (that is, boot code) and other common utilities
that can be referenced by RAM-located scripts
• 8 Kbyte 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.
The DMA supports sixteen channels of DMA services, as shown in the following table.
The shared DMA resource allows each independent channel to follow a simple chained
command list. Command chains are built up using the general structure.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The module implements standard DMA API. See the API documents, which are located
in the Linux documentation package, for more information on the functions implemented
in the driver such as GPMI NAND driver.
3.2.1 Introduction
The External Interface Module (EIM) NOR driver supports the Parallel NOR flash.
3.3.1 Introduction
The MultiMediaCard (MMC)/ Secure Digital (SD)/ Secure Digital Input Output (SDIO)
Host driver implements a standard Linux driver interface to the ultra MMC/SD host
controller (uSDHC).
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
on the platform-specific bus > SDHCI platform support for the Freescale eSDHC i.MX
controller
To compile SDHCI driver as a builttin module, several options should be selected as
indicated below:
– CONFIG_MMC_SDHCI=y, it can be found at Device Drivers > MMC/SD Card
Support > Secure Digital Host Controller Interface support
– CONFIG_MMC_SDHCI_PLTFM=y, it can be found at Device Drivers > MMC/SD
Card Support > Secure Digital Host Controller Interface support > SDHCI support on
the platform-specific bus.
– CONFIG_MMC_SDHCI_ESDHC_IMX=y, it can be found at Device Drivers > MMC/
SD Card Support > Secure Digital Host Controller Interface support > SDHCI support
on the platform-specific bus > SDHCI platform support for the Freescale eSDHC i.MX
controller
• CONFIG_MMC_UNSAFE_RESUME is used for embedded systems which use a MMC/
SD/SDIO card for rootfs. In menuconfig, this option is found under:
Example:usdhc@02194000 { /* uSDHC2 */
compatible = "fsl,imx6q-usdhc";
reg = <0x02194000 0x4000>;
interrupts = <0 23 0x04>;
clocks = <&clks 164>, <&clks 164>, <&clks 164>;
clock-names = "ipg", "ahb", "per";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc2_1>;
cd-gpios = <&gpio2 2 0>;
wp-gpios = <&gpio2 3 0>;
bus-width = <8>;
no-1-8-v;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
Reference:
• Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
• arch/arm/boot/dts/imx6*.dtsi
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
3.4.1 Introduction
The NAND Flash Memory Technology Devices (MTD) driver is used in the Generic-
Purpose Media Interface (GPMI) controller on the i.MX 6 series and i.MX 7Dual.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Only the hardware-specific layer has to be implemented for the NAND MTD driver to
operate.
The rest of the functionality such as Flash read/write/erase is automatically handled by
the generic layer provided by the Linux MTD subsystem for NAND devices.
The NAND MTD driver interfaces with the integrated NAND controller supporting 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.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Since Kernel 4.1, the GPMI driver provides raw read/write modes, which exports these
callbacks:
• gpmi_ecc_read_page_raw (without ECC)
• gpmi_ecc_write_page_raw (without ECC)
• gpmi_ecc_read_oob_raw (without ECC)
• gpmi_ecc_write_oob_raw (without ECC)
These functions read the requested amount of data, with or without error correction. In
the case of read, the gpmi_read_page() function is called, which creates the DMA chain,
submits it to execute, and waits for completion. The write case is a bit more complex: the
data to be written is mapped and flushed out by calling gpmi_send_page().
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
3.5.1 Introduction
The Quad Serial Peripheral Interface (QuadSPI) block acts as an interface to one single
or two external serial flash devices, each with up to four bidirectional data lines.
It supports the following features:
• Flexible sequence engine to support various flash vendor devices.
• Single, dual, quad and octal mode of operation.
• DDR/DTR mode wherein the data is generated on every edge of the serial flash clock.
• Support for flash data strobe signal for data sampling in DDR and SDR mode.
• DMA support to read RX Buffer data via AMBA AHB bus (64-bit width interface) or IP
registers space (32-bit access).
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MTD subsystem for Linux OS is a generic interface to memory devices, such as
Flash and RAM, providing simple read, write, and erase access to physical memory
devices. Devices called mtdblock devices can be mounted by JFFS, JFFS2, and
CRAMFS file systems. The Quad SPI NOR MTD driver is based on the MTD data Flash
driver in the kernel by adding SPI access. In the initialization phase, the Quad SPI NOR
MTD driver detects a data Flash by reading the JEDEC ID. Then the driver adds the MTD
device. The SPI NOR MTD driver also provides the interfaces to read, write, and erase
NOR Flash.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
3.6 SATA
3.6.1 Introduction
The SATA AHCI driver is based on the LIBATA layer of the block device infrastructure of
the Linux kernel. The detailed hardware operation of SATA is detailed in the Synopsys
DesignWare Cores SATA AHCI documentation, named SATA_Data_Book.pdf.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
You may use standard Linux utilities to partition and create a file system on the drive (for
example: fdisk and mke2fs) to be mounted and used by applications.
The device nodes for the drive and its partitions appears under /dev/sda*. For example,
to check basic kernel settings for the drive, execute hdparm /dev/sda.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following command can be used to find out the capacities of the hard disk. If the
hard disk is pre-formatted, this command shows the size of the hard disk, partitions, and
filesystem type:
$fdisk -l /dev/sda
If the hard disk is not formatted, create the partitions on the hard disk using the following
command:
$fdisk /dev/sda
To read 1KB of data from the card enter the following text, substituting the name of the
file to be written for output_file, do the following:
$mkfs.ext2 /dev/sda1
$mkfs.vfat /dev/sda1
$mkdir /mnt/sda1
$mount -t ext2 /dev/sda1 /mnt/sda1
$umount /mnt/sda1
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
3.7.1 Overview
The Smart Direct Memory Access (SDMA) API driver controls the SDMA hardware. It
provides an API to other drivers for transferring data between MCU memory space and
the peripherals. It supports the following features:
• Loading channel scripts from the MCU memory space into SDMA internal RAM
• Loading context parameters of the scripts
• Loading buffer descriptor parameters of the scripts
• Controlling execution of the scripts
• Callback mechanism at the end of script execution
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Note:
This table contains the functions currently supported by SDMA scripts, but the specific
implementation may be different in each platform. The peripherals supported by SDMA
are subject to the DTS configuration of each platform.
The following table shows the image files available in the directory firmware/imx/sdma for
4.1 and 4.9 kernels. For 4.14 kernel, the sdma firmware is provided with the firmware-imx
package and not in the kernel source tree.
In the current release, the I2C controller and SDMA script in i.MX 6/7Dual/8M either do
not support SDMA.
There are two limitations:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• I2C uses DMA mode when the frame length is greater than 16 bytes, because I2C itself
still needs to use the CPU to process the first few and last few bytes when sending and
receiving a frame. Therefore, when the data being sent is not long, using DMA to send
data does not improve efficiency.
• The SDMA script is loaded in rootfs stage, so any use of I2C DMA transfer in kernel
boot stage will fail.
It is strongly recommended not to use I2C SDMA mode when sending small amounts
of data. If there is a special case that needs to send a large amount of I2C data,
contact NXP Pro-support to get the patchset.
3.8.1 Introduction
The SPI NOR Flash Memory Technology Device (MTD) driver provides the support to the
data Flash though the SPI interface.
By default, the SPI NOR Flash MTD driver creates static MTD partitions to support data
Flash.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MTD subsystem for Linux OS is a generic interface to memory devices, such as
Flash and RAM, providing simple read, write, and erase access to physical memory
devices. Devices called mtdblock devices can be mounted by JFFS, JFFS2 and
CRAMFS file systems. The SPI NOR MTD driver is based on the MTD data Flash driver
in the kernel by adding SPI access. In the initialization phase, the SPI NOR MTD driver
detects a data Flash by reading the JEDEC ID. Then the driver adds the MTD device.
The SPI NOR MTD driver also provides the interfaces to read, write, and erase NOR
Flash.
4 Connectivity
4.1 ADC
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
4.2.1 Introduction
ENET IEEE-1588 driver performs a set of functions that enabling precise synchronization
of clocks in network communication.
The driver requires a protocol stack to complete IEEE-1588 full protocol. It complies with
the LinuxPTP stack.
To allow for IEEE 1588 or similar time synchronization protocol implementations, the
ENET MAC is combined with a time-stamping module to support precise time stamping
of incoming and outgoing frames.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
On transmit, only 1588 event frames need to be time-stamped. The Client application
(for example, the MAC driver) should detect 1588 event frames and set the signal
ff_tx_ts_frm together with the frame.
For every transmitted frame, the MAC returns the captured timestamp on tx_ts (31:0)
with the frame sequence number (tx_ts_id(3:0)) and the transmit status. The transmit
status bit tx_ts_stat (5) indicates that the application had the ff_tx_ts_frm signal asserted
for the frame.
If ff_tx_ts_frm is set to '1', the MAC additionally memorizes the timestamp for the frame
in the register TS_TIMESTAMP. The interrupt bit EIR (TS_AVAIL) is set to indicate that a
new timestamp is available.
Software would implement a handshaking procedure by setting the ff_tx_ts_frm
signal when it transmits the frame it needs a timestamp for and then waits on the EIR
(TS_AVAIL) interrupt bit to know when the timestamp is available. It then can read
the timestamp from the TS_TIMESTAMP register. This is done for all event frames;
other frames do not use the ff_tx_ts_frm indicator and hence do not interfere with the
timestamp capture.
When a frame is received, the MAC latches the value of the timer when the frame SFD
field is detected and provides the captured timestamp on ff_rx_ts(31:0). This is done for
all received frames.
The DMA controller has to ensure that it transfers the timestamp provided for the frame
into the corresponding field within the receive descriptor for software access.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The 1588 driver complies with the Linuxptp protocol stack interface.
Stack-specific defines are added to the header file (fec.h).
Linuxptp:
4.3.1 Introduction
The ECSPI driver implements a standard Linux driver interface to the ECSPI controllers.
It supports the following features:
• Interrupt-driven transmit/receive of bytes
• Multiple master controller interface
• Multiple slaves select
• Multiclient requests
ECSPI is used for fast data communication with fewer software interrupts than
conventional serial communications. >Each ECSPI is equipped with a data FIFO and is
a master/slave configurable serial peripheral interface module, allowing the processor to
interface with external SPI master or slave devices.
The primary features of the ECSPI includes:
• Master/slave-configurable
• Four chip select signals to support multiple peripherals
• 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)
The ECSPI module supports the following features:
• Implements each of the functions required by a ECSPI module to interface to Linux OS
• Multiple SPI master controllers
• Multiclient synchronous requests
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
SPI-NOR ....
Client #2 driver Client #3 driver
mtd driver
SPI Subsystem
ECSPI Hardware
All SPI clients must have a protocol driver associated with them and they all must
be sharing the same controller driver. Only the controller driver can interact with the
underlying SPI hardware module. The figure below shows how the different SPI drivers
are layered in the SPI subsystem.
ECSPI Controller
Electrical Interface
SPI slave device
SPI Slave
(SPI-NOR Flash)
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The typical values are based on a baud rate of 1 Mbps with a receiver trigger level (Rxtl)
of 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.
4.4.1 Introduction
The Fast Ethernet Controller (FEC) 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 adapter and transceiver function to complete the
interface to the Ethernet media. It supports half or full-duplex operation on 10 Mbps, 100
Mbps, and 1000 Mbps-related Ethernet networks.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MII management interface consists of two pins, FEC_MDIO, and FEC_MDC. The
FEC hardware operation can be divided in the parts listed below. For details, see the
Applications Processor Reference Manuals.
• Transmission-The Ethernet transmitter is designed to work with almost no intervention
from software. Once ECR[ETHER_EN] is asserted and data appears in the transmit
FIFO, the Ethernet MAC is able to transmit onto the network. When the transmit
FIFO fills to the watermark (defined by the TFWR), the MAC transmit logic asserts
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).
• Before transmitting, the controller waits for carrier sense to become inactive, then
determines if carrier sense stays inactive for 60 bit times. If the transmission begins
after waiting an additional 36 bit times (96 bit times after carrier sense originally
became inactive), both buffer (TXB) and frame (TXF) interrupts may be generated as
determined by the settings in the EIMR.
• Reception-The FEC receiver is designed to work with almost no intervention from
the host and can perform address recognition, CRC checking, short frame checking,
and maximum frame length checking. When the driver enables the FEC receiver by
asserting ECR[ETHER_EN], it immediately starts processing receive frames. When
FEC_RX_DV asserts, the receiver checks for a valid PA/SFD header. If the PA/SFD
is valid, it is stripped and the frame is processed by the receiver. If a valid PA/SFD
is not found, the frame is ignored. In MII mode, the receiver checks for at least one
byte matching the SFD. Zero or more PA bytes may occur, but if a 00 bit sequence is
detected prior to the SFD byte, the frame is ignored.
• After the first six bytes of the frame have been received, the FEC performs address
recognition on the frame. During reception, the Ethernet controller checks for various
error conditions and once the entire frame is written into the FIFO, a 32-bit frame
status word is written into the FIFO. This status word contains the M, BC, MC, LG, NO,
CR, OV, and TR status bits, and the frame length. Receive Buffer (RXB) and Frame
Interrupts (RXF) may be generated if enabled by the EIMR register. When the receive
frame is complete, the FEC sets the L bit in the RxBD, writes the other frame status bits
into the RxBD, and clears the E bit. The Ethernet controller next generates a maskable
interrupt (RXF bit in EIR, maskable by RXF bit in EIMR), indicating that a frame has
been received and is in memory. The Ethernet controller then waits for a new frame.
• Interrupt management-When an event occurs that sets a bit in the EIR, an interrupt
is generated if the corresponding bit in the interrupt mask register (EIMR) is also set.
The bit in the EIR is cleared if a one is written to that bit position; writing zero has no
effect. This register is cleared upon hardware reset. These interrupts can be divided
into operational interrupts, transceiver/network error interrupts, and internal error
interrupts. Interrupts which may occur in normal operation are GRA, TXF, TXB, RXF,
RXB. Interrupts resulting from errors/problems detected in the network or transceiver
are HBERR, BABR, BABT, LC, and RL. Interrupts resulting from internal errors are
HBERR and UN. Some of the error interrupts are independently counted in the MIB
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
block counters. Software may choose to mask off these interrupts as these errors are
visible to network management through the MIB counters.
• PHY management-phylib was used to manage all the FEC PHY-related operation such
as PHY discovery, link status, and state machine.MDIO bus will be created in FEC
driver and registered into the system. See Documentation/networking/phy.txt under the
Linux OS source directory for more information.
/*
* Define the buffer descriptor structure.
*/
struct bufdesc {
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MAC address can be set through the kernel command line, kernel device tree DTS
file, OCOTP, or MAC registers set by bootloader, such as U-Boot. The FEC driver uses
it to configure the MAC address for the network device. In general, use kernel command
line in a form of fec.macaddr=0x00,0x04,0x9f,0x01,0x30,0xe0 to set the MAC address.
Due to certain pin conflicts (FEC RMII mode needs to use GPIO_16 or RGMII_TX_CTL
pin as reference clock input/output channel), the one of the both pins cannot connect to
branch lines for other modules use because the branch lines have serious influence on
clock.
4.5 FlexCAN
4.5.1 Introduction
FlexCAN is a communication controller implementing the CAN protocol according to the
CAN 2.0B protocol specification.
The CAN protocol was primarily designed to be used as a vehicle serial data bus meeting
the specific requirements of this field such as real-time processing, reliable operation
in the EMI environment of a vehicle, cost-effectiveness, and required bandwidth. The
standard and extended message frames are supported. The maximum message buffer is
64. The driver is a network device driver of PF_CAN protocol family.
For detailed information, see lwn.net/Articles/253425 or Documentation/networking/
can.txt in Linux source directory.
The FlexCAN on the i.MX 8QuadMax/8QuadXPlus supports CAN FD protocol.
The CAN driver is a network device driver. For the common information on software
operation, refer to the documents in the kernel source directory Documentation/
networking/can.txt.
The CAN network device driver interface provides a generic interface to setup, configure
and monitor CAN network devices. The user can then configure the CAN device, like
setting the bit-timing parameters, via the netlink interface using the program "ip" from the
"IPROUTE2" utility suite.
Starting and stopping the CAN network device.
A CAN network device is started or stopped as usual with the command "ifconfig canX
up/down" or "ip link set canX up/down". Be aware that you *must* define proper bit-timing
parameters for real CAN devices before you can start it to avoid error-prone default
settings:
• ip link set canX up type can bitrate 125000
The iproute2 tool also provides some other configuration capbilities for can bus such as
bit-timing setting. For details, see kernel doc: Documentation/networking/can.txt
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following kernel configuration options are provided for this module.
• CONFIG_CAN - Build support for PF_CAN protocol family. In menuconfig, this option is
available under
Networking > CAN bus subsystem support.
• CONFIG_CAN_RAW - Build support for Raw CAN protocol. In menuconfig, this option
is available under
Networking > CAN bus subsystem support > Raw CAN Protocol (raw access with CAN-
ID filtering).
• CONFIG_CAN_BCM - Build support for Broadcast Manager CAN protocol. In
menuconfig, this option is available under
Networking > CAN bus subsystem support > Broadcast Manager CAN Protocol (with
content filtering).
• CONFIG_CAN_VCAN - Build support for Virtual Local CAN interface (also in Ethernet
interface). In menuconfig, this option is available under
Networking > CAN bus subsystem support > CAN Device Driver > Virtual Local CAN
Interface (vcan).
• CONFIG_CAN_DEBUG_DEVICES - Build support to produce debug messages to the
system log to the driver. In menuconfig, this option is available under
Networking > CAN bus subsystem support > CAN Device Driver > CAN devices
debugging messages.
• CONFIG_CAN_FLEXCAN - Build support for FlexCAN device driver. In menuconfig,
this option is available under
Networking > CAN bus subsystem support > CAN Device Driver > Freescale FlexCAN.
4.6.1 Introduction
LPI2C is a bidirectional serial bus that provides a simple, efficient method of data
exchange, minimizing the interconnection between devices.
The LPI2C driver for Linux OS has two parts:
• Bus driver-low level interface that is used to communicate with the LPI2C bus
• Chip driver-interface between other device drivers and the LPI2C bus driver
The 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 and 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
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
attach_adapter. The flags field is set to a value I2C_DF_NOTIFY so that the chip driver
can be notified of any new I2C devices, after the driver is loaded. When the I2C bus
driver is loaded, this driver stores the i2c_adapter structure associated with this bus
driver so that it can use the appropriate methods to transfer data.
4.7.1 Introduction
MediaLB is an on-PCB or inter-chip communication bus specifically designed to
standardize a common hardware interface and software API library.
This standardization allows an application or multiple applications to access the MOST
Network data or to communicate with other applications with minimum effort. MediaLB
supports all the MOST Network data transport methods: synchronous stream data,
asynchronous packet data, and control message data. MediaLB also supports an
isochronous data transport method. For detailed information about the MediaLB, see the
Media Local Bus Specification.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MediaLB module implements the Physical Layer and Link Layer of the MediaLB
specification, interfacing the i.MX to the MediaLB controller.
The MLB implements the 3-pin MediaLB mode and can run at speeds up to 1024Fs.
It does not implement MediaLB controller functionality. All MediaLB devices support
a set of physical channels for sending data over the MediaLB. Each physical channel
is 4 bytes in length (quadlet) and grouped into logical channels with one or more
physical channels allocated to each logical channel. These logical channels can be any
combination of channel type (synchronous, asynchronous, control, or isochronous) and
direction (transmit or receive).
The MLB provides support for up to 64 logical channels and up to 64 physical channels.
Each logical channel is referenced using an unique channel address and represents
a unidirectional data path between a MediaLB device transmitting the data and the
MediaLB device(s) receiving the data.
The supported features are the following.
• Synchronous, asynchronous, control, and isochronous channel.
• Up to 64 logical channels and 64 physical channels running at a maximum speed of
1024Fs.
• Transmission of commands and data and reception of receive status when functioning
as the transmitting device associated with a logical channel address.
• Reception of commands and data and transmission as receive status responses when
functioning as the receiving device associated with a logical channel address.
• MediaLB lock detection.
• System channel command handling.
• 256Fs, 512Fs and 1024Fs frame rates.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MLB driver creates four minor devices. These four devices support control Tx/Rx
channel, asynchronous Tx/Rx channel, synchronous Tx/Rx channel, and isochronous
Tx/Rx channel. Their device files are /dev/ctrl, /dev/async, /dev/sync, and /dev/isoc.
Each minor device has the same interfaces, and handle both Tx and Rx operation. The
following description is for both control and asynchronous device.
The driver uses IRAM as MLB device module Tx/Rx buffer. All the data transmission and
reception between module and IRAM is handled by the MLB module DMA. The driver is
responsible for configuring the buffer start and end pointer for the MLB module.
For reception, the driver uses a ring buffer to buffer the received packet for read. When
a packet arrives, the MLB module puts the received packet into the IRAM Rx buffer, and
notifies the driver by interrupt. The driver then copy the packet from the IRAM to one
ring buffer node indicated by the write position, and updates the write position with the
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
next empty node. Finally the packet reader application is notified, and it gets one packet
from the node indicated by the read position of ring buffer. After the read is completed, it
updates the read position with the next available buffer node. There is no received packet
in the ring buffer when the read and write position is the same.
For transmission, the driver writes the packet given by the writer application into the
IRAM Tx buffer, updates the Tx status and sets MLB device module Tx buffer pointer to
start transmission. After transmission completes, the driver is notified by interrupt and
updates the Tx status to accept the next packet from the application.
The driver supports NON BLOCK I/O. User applications can poll to check if there are
packets or exception events to read, and also they can check if a packet can be sent
or not. If there are exception events, the application can call ioctl to get the event. The
ioctl also provides the interface to configure the frame rate, device address, and channel
address.
MLB_SET_FPS
MLB_GET_VER
MLB_SET_DEVADDR
MLB_CHAN_SETADDR
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Set the corresponding channel address [8:1] bits. This ioctl combines both tx and rx
channel address, the argument format is: tx_ca[8:1] << 16 | rx_ca[8:1].
MLB_CHAN_STARTUP
MLB_CHAN_SHUTDOWN
MLB_CHAN_GETEVENT
MLB_EVT_TX_PROTO_ERR_CUR
MLB_EVT_TX_BRK_DETECT_CUR
MLB_EVT_RX_PROTO_ERR_CUR
MLB_EVT_RX_BRK_DETECT_CUR
4.8.1 Introduction
PCI Express hardware module, contained in i.MX SoC, can either be configured to act as
a Root Complex or a PCIe Endpoint. This document is used to describe the PCI Express
Root Complex implementation on i.MX SoC families.It also describes the drivers needed
to be configured and operated on i.MX PCI Express device as Root Complex.
PCI Express (PCIe) is Third Generation I/O Interconnect, targeting low cost, high volume,
multiplatform interconnection usages. It has the concepts with earlier PCI and PCI-X and
offers backwards compatibility for existing PCI software with following differences:
• PCIe is a point-to-point interconnect
• Serial link between devices
• Packet based communication
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Any element of the fabric which is relatively closer towards RC is treated as 'Upstream'.
All PCIe Endpoint ports (including termination points for bridges) and Switch ports, which
are closer to RC are called Upstream Ports on that device. An Upstream Flow is the
communication moving towards RC.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
4.8.4 Features
The following are the various features supported by i.MX as a PCI Express Root
Complex driver.
• Express Base Specification Revision 2.0-compliant.
• Gen2 operation with x1 link supporting 5 GT/s raw transfer rate in single direction.
• Support Legacy Interrupts (INTx) and MSI.
• Max_Payload_Size size (128 bytes).
• It fits into Linux PCI Bus framework to provide PCI compatible software enumeration
support.
• In addition, it provides interface to Endpoint Drivers to access the respective devices
detected downstream.
• The same interface can be used by the PCI Express Port Bus Driver framework in
Linux OS to handle AER, ASP, and so on.
• Interrupt handling facility for EP drivers either as Legacy Interrupts (INTx).
• Access to EP I/O BARs through generic I/O accessories in Linux PCI subsystem.
• Seamless handling of PCIe errors.
• Supports the L0, L0s, L1, and L1.1 ASPM power management.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• IO and memory spaces are two address spaces used by the devices to communicate
with their device driver running in the Linux kernel on CPU.
• The upper 16 KB PCIe host configuration space.
– This memory segment is used to map the configuration space of PCIe RC. SW can
access PCIe RC core configuration space through the DBI interface.
• PCIe device configuration space.
– Used to map the configuration spaces of PCIe EP devices that are inserted to the RC
downstream port.
i.MX 8QuadMax/8QuadXPlus:
i.MX 8QuadMax has both PCIeA and PCIeB, while i.MX 8QuadXPlus has only PCIeB.
• PCIeA
– PCIe host configuration space: 0x5f00_0000 – 0x5f00_ffff (64K bytes)
– PCIe device configuration space: 0x6ff0_0000 – 0x6ff7_ffff (512K bytes)
– PCIe IO space: 0x6ff8_0000 – 0x6ff8_ffff (64K bytes)
– PCIe memory space: 0x6000_0000 – 0x6fef_ffff (255M bytes)
• PCIeB
– PCIe host configuration space: 0x5f01_0000 – 0x5f01_ffff (64K bytes)
– PCIe device configuration space: 0x7ff0_0000 – 0x7ff7_ffff (512K bytes)
– PCIe IO space: 0x7ff8_0000 – 0x7ff8_ffff (64K bytes)
– PCIe memory space: 0x7000_0000 – 0x7fef_ffff (255M bytes)
i.MX 8M Quad:
• PCIe0
– PCIe host configuration space: 0x3380_0000 – 0x33bf_ffff (4Mbytes)
– PCIe device configuration space: 0x1ff0_0000 – 0x1ff7_ffff (512K bytes)
– PCIe IO space: 0x1ff8_0000 – 0x1ff8_ffff (64K bytes)
– PCIe memory space: 0x1800_0000 – 0x1fef_ffff (127M bytes)
• PCIE1
– PCIe host configuration space: 0x33c0_0000 – 0x33ff_ffff (4Mbytes)
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
4.9 USB
4.9.1 Introduction
The universal serial bus (USB) driver implements a standard Linux driver interface to the
CHIPIDEA USB-HS OTG controller.
The USB provides a universal link that can be used across a wide range of PC-to-
peripheral interconnects. It supports plug-and-play, port expansion, and any new USB
peripheral that uses the same type of port.
The CHIPIDEA USB controller is Enhanced Host Controller Interface (EHCI)-compliant.
This USB driver has the following features:
• High-speed OTG core supported
• High-speed Host Only core (Host1), high-speed, full speed, and low devices are
supported
• High-speed Inter-Chip core (Host2 & Host3)
• High-speed Host Only core (OTG2), high-speed, full speed, and low devices are
supported. A USB2Pci bridge is connected to OTG2 by default. Therefore, users may
not be able to connect other USB devices on this port.
• High-speed Inter-Chip core (Host2)
• Host mode-Supports HID (Human Interface Devices), MSC (Mass Storage Class)
• Peripheral mode-Supports MSC, and CDC (Communication Devices Class) drivers,
which include Ethernet and serial support
• Embedded DMA controller
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
EHCI wakeup setting, after the following settings, the host will have wakeup ability, such
as remote wakeup and connect/disconnect wakeup
Note: When the OTG mode switches from the host to the device, it will delete the EHCI
wakeup, and the user needs to set it again before the system suspending.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
modprobe phy_mxs_usb
modprobe ci_hdrc_imx
modprobe -r ci_hdrc_imx
modprobe -r phy_mxs_usb
cat /sys/class/power_supply/imx6_usb_charger/type
cat /sys/class/power_supply/imx6_usb_charger/current_max
cat /sys/class/power_supply/imx6_usb_charger/present
Currently, the i.MX 6 Sabre-SD board does not support the USB charger detection
function. i.MX 6 Sabre-Auto supports the function.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
To pass embeded host USB certification, "tpl-support" should be added in DTS to enable
Targeted Peripheral List (TPL). For example, to enable TPL on the Host port of i.MX
6UltraLite EVK board (imx6ul-14x14-evk.dts):
&usbotg2 {
dr_mode = "host";
disable-over-current;
tpl-support;
status = "okay";
};
The VBUS should be kept off until the Linux USB host function is ready. For example,
on the i.MX 6UltraLite EVK board, because the pin is multiplexed with the touch
function, you need to rework the board to make the GPIO (GPIO1_IO02) selected for
VBUScontrol.
Disable the touch function in its DTS file (imx6ul-14x14-evk.dts) as follows:
&tsc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tsc>;
xnur-gpio = <&gpio1 3 0>;
measure_delay_time = <0xffff>;
pre_charge_time = <0xfff>;
status = "disabled";
};
pinctrl_usb_otg2: usbotg2grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0xb0
>;
};
reg_usb_otg2_vbus: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg2>;
regulator-name = "usb_otg2_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
&usbotg2 {
vbus-supply = <®_usb_otg2_vbus>;
dr_mode = "host";
disable-over-current;
tpl-support;
status = "okay";
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
};
4.10 USB3
4.10.1 Introduction
For i.MX 8 and i.MX 8X families, a super-speed USB IP from Cadence is provided
supporting USB 3.0 which includes a new transfer rate referred to as Super Speed (SS)
USB with higher transfer rates and significantly faster than the USB 2.0 standard.
The supported features the following.
• Host mode is implemented with a Linux OS standard XHCI driver with super-speed
supported and tested.
• For Device Mode only single queue is supported. Mass storage, ether, and serial are
supported.
4.11.1 Introduction
The low-level UART driver interfaces the Linux serial driver API to all the UART ports.
It has the following features:
• Interrupt-driven and eDMA-driven transmit/receive of characters
• Standard Linux baud rates up to 4 Mbps
• Transmit and receive characters with 7-bit, 8-bit, 9-bit, or 10-bit character length
• Transmits one or two stop bits
• Supports TIOCMGET IOCTL to read the modem control lines. Only supports the
constants TIOCM_CTS and TIOCM_CAR, plus TIOCM_RI in DTE mode only
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Supports TIOCMSET IOCTL to set the modem control lines. Supports the constants
TIOCM_RTS and TIOCM_DTR only
• Odd and even parity
• XON/XOFF software flow control. Serial communication using software flow control
is reliable when communication speeds are not too high and the probability of buffer
overruns is minimal
• CTS/RTS hardware flow control-both interrupt-driven software-controlled hardware flow
and hardware-driven hardware-controlled flow
• Send and receive break characters through the standard Linux serial API
• Recognizes frame and parity errors
• Ability to ignore characters with break, parity and frame errors
• Get and set UART port information through the TIOCGSSERIAL and TIOCSSERIAL
TTY IOCTL. Some programs like setserial and dip use this feature to make sure that
the baud rate was set properly and to get general information on the device. The UART
type should be set to 52 as defined in the serial_core.h header file.
• Power management feature by suspending and resuming the UART ports
• Standard TTY layer IOCTL calls
All the UART ports can be accessed from the device files /dev/ttyLP0 to /dev/ttyLP1.
For the i.MX 8, i.MX 8X and i.MX 8M configuration options are specified in the device
trees located in arch/arm64/boot/dts directory.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
4.12 Bluetooth
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• UART interface:
– CONFIG_SERIAL_IMX
– CONFIG_TTY
• HCI interface:
– CONFIG_BT_HCIUART
– CONFIG_BT_HCIUART_H4
– CONFIG_BT_HCIUART_BCM
• Bluetooth Stack:
– CONFIG_BT
– CONFIG_BT_RFCOMM
– CONFIG_BT_RFCOMM_TTY
– CONFIG_BT_BNEP
– CONFIG_BT_BNEP_MC_FILTER
– CONFIG_BT_BNEP_PROTO_FILTER
– CONFIG_BT_HIDP
4.13 Wi-Fi
4.13.1 Introduction
Bluetooth and Wi-Fi are supported on i.MX through on-board chip solutions and
external hardware. For various on-board chips and external solutions, see the Section
"Connectivity for Bluetooth wireless technology and Wi-Fi" in the i.MX Linux® User's
Guide (IMXLUG).
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• CONFIG_CFG80211_WEXT=y
• CONFIG_HOSTAP=y
• CONFIG_CFG80211_INTERNAL_REGDB=y
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
ssid="NETGEAR73"
#psk="freshbutter"
psk=eb0376fc14ee5d1e6ce129ad54da038adab……
}
udhcpc -i mlan0
5 Graphics
5.1.1 Introduction
The Graphics Processing Unit (GPU) is a graphics accelerator targeting embedded
2D/3D graphics applications. The 3D graphics processing unit (GPU3D) is an embedded
engine that accelerates user level graphics Application Programming Interface (APIs)
such as OpenGL ES 1.1, OpenGL ES 2.0, and OpenGL ES 3.0 and OpenCL 1.1EP.
The 2D graphics processing unit (GPU2D) is an embedded 2D graphics accelerator
targeting graphical user interfaces (GUI) rendering boost. The VG graphics processing
unit (GPUVG) is an embedded vector graphic accelerator for supporting the OpenVG
1.1 graphics API and feature set. The GPU driver kernel module source is in the kernel
source tree, but the libraries are delivered as binary only.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Note:
• GC400T does not support OpenGL ES 3.0.
• GC880/GC400T does not support OpenCL 1.1EP. GC2000 and GC2000+ support
OpenCL 1.1 EP.
• GC7000XSVX supports OpenCL 1.2 FP, OpenVX 1.0.1, and Vulkan 1.0.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Automatic 3D core slowing down, when hot notification from thermal driver is active, 3D
core will run at 1/64 clock.
• OpenCL1.1/1.2FP API defined by Khronos Group.
• OpenVX 1.0.1 API defined by Khronos Group.
• Vulkan 1.0 API defined by Khronos Group.
drivers/mxc/gpu-viv
Note:
If you replace the whole content in this directory, the GPU kernel driver can be upgraded.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• If no SOC limitation, for framebuffer, directFB, and Wayland backends, the default
openVG library is linked to libOpenVG.2d.so.
This can be done by using the following sequence of commands:
cd <ROOTFS>/usr/lib
sudo ln -s libOpenVG_355.so libOpenVG.so
5.2 Wayland
5.2.1 Introduction
Wayland is a protocol for a compositor to talk to its clients as well as a C library
implementation of that protocol. The compositor can be a standalone display server
running on Linux kernel modesetting and evdev input devices, an X application, or a
Wayland client itself. The clients can be traditional applications, X servers or other display
servers.
Part of the Wayland project is also the Weston reference implementation of a Wayland
compositor. The Weston compositor is a minimal and fast compositor and is suitable for
many embedded and mobile use cases.
This chapter describes how to enable Wayland/Weston support on an i.MX series device.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Multi display was supported in G2D compositor only. Add these options to start Weston:
The Weston server supports both single buffering and multi buffering. In single buffering,
the damage area is rendered to the offscreen surface and blits to front buffer.The
offscreen surface is used to avoid flickering. By default, the Weston server starts with
single buffering.
In multi buffering, instead of rendering to offscreen, the damage area is rendered to
back buffer and does the flip, but the frame rate will be restricted to the display rate. A
maximum of three buffers are supported.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Before starting the Weston server, export FB_MULTI_BUFFER to control the number of
buffers to be used.
Environment variables for single buffering:
export FB_MULTI_BUFFER=1
export FB_MULTI_BUFFER=2
5.3.1 Introduction
X-Windows System (aka X11 or X) is a portable, client-server based, graphics display
system. X11 is only supported for i.MX 6.
X-Windows system can run with a default frame buffer driver which handles all drawing
operations to the main display. As there is a 2D GPU (graphics processing unit)
available, then some drawing operations can be accelerated. High-level X operations
may get decomposed into low level drawing operations which are accelerated for X-
Windows System.
• Copy of a rectangle with same pixel format with possible source-target rectangle
overlap.
• Copy of a rectangle supporting most XRender compositing operations with these
options:
– Pixel format conversion.
– Repeating pattern source.
– Porter-Duff blending of source with target.
– Source alpha masking.
The following list includes additional features supported as part of the X-Windows
acceleration:
• Allocation of X pixmaps directly in frame buffer memory.
• EGL swap buffers where the EGL window surface is an X-window.
• X-window can be composited into an X pixmap which can be used directly as any EGL
surface.
The components shown in green are those provided as part of the Vivante 2D/3D GPU
driver support which includes OpenGL/ES and EGL. The components shown in light
gray are the standard components in the X-Windows System without acceleration.
The components shown in orange are those added to support X-Windows System
acceleration and briefly described here.
The i.MX X Driver library module (vivante-drv.so) is loaded by the X server and
contains the high-level implementation of the X-Windows acceleration interface for i.MX
platforms containing the GC320 2D GPU core. The entire linearly contiguous frame
buffer memory in /dev/fb0 is used for allocating pixmaps for X both on screen and off
screen. The driver supports a custom X extension which allows X clients to query the
GPU address of any X pixmap stored in frame buffer memory.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The libGAL.so library module (libGAL.so) contains the register level programming
interface to the GC320 GPU module. This includes the storing of register programming
commands into packets which can be streamed to the device. The functions in the
libGAL.so library are called by the i.MX X Driver code.
The EGL-X library module (libEGL.so) contains the X-Windows implementation of the
low level EGL platform-specific support functions. This allows X-window and X pixmap
objects to be used as EGL window and pixmap surfaces. The EGL-X library uses Xlib
function calls in its implementation along with the i.MX X Driver module's X extension for
querying the GPU address of X pixmaps stored in frame buffer memory.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The implementation handles all pixmap allocation for X through the EXA callback
interface. A first attempt is made to allocate the memory where it can be accessed by
a physical GPU address. This attempt can fail if there is insufficient GPU accessible
memory remaining, but it can also fail when the bits per pixel being requested for the
pixmap is less than eight (8). If the attempt to allocate from the GPU accessible memory
fails, then the memory is allocated from the system. If the pixmap memory is allocated
from the system, then this pixmap cannot be involved in a GPU accelerated option. The
number of pitch bytes used to access the pixmap memory may be different depending
on whether it was allocated from GPU accessible memory or from the system. Once
the memory for an X pixmap has been allocated, whether it is from GPU accessible
memory or from the system, the pixmap is locked and can never migrate to the other
type of memory. Pixmap migration from GPU accessible memory to system memory is
not necessary since a system virtual address is always available for GPU accessible
memory. Pixmap migration from system memory to GPU accessible memory is not
currently implemented, but would only help in situations where there was insufficient
GPU accessible memory at initial allocation but more memory becomes available
(through de-allocation) at a later time. The GPU accessible memory pitch (horizontal)
alignment for Vivante 2D GPUs is 8 pixels. Because the memory can be allocated from
GPU accessible memory, these pixels could be used in EGL for OpenGL/ES drawing
operations. All of the memory allocated for /dev/fb0 is made available to an internal
linear offscreen memory manager based on the one used in EXA. The portion of this
memory beyond the screen memory is available for allocation of X pixmap, where this
memory area is GPU accessible. The amount of memory allocated to /dev/fb0 needs
to be several MB more than the amount needed for the screen. 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.
An X extension, i.e., VIVEXT shown in Fig. 1, is provided so that X clients can query the
physical GPU address associated with an X pixmap, if that X pixmap was allocated in the
GPU accessible memory.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
passed from the X server process to the X client processes (GL or GLES applications)
properly.
• The Vivante-specific X extension “vivext” passes buffer information from X server to X
clients. This Vivante X extension includes the following three interfaces:
– DrawableFlush, which enables X clients to notify X server to flush the GPU cache for
a drawable surface.
– DrawableInfo, which enables X clients to query the drawable information (position,
size, physical address, stride, cliplist, etc.) from the X server.
– PixmapPhysAddr, which enables X clients to query the physical address and stride of
a pixmap buffer from X server.
The integration of GL/GLES application windows with Ubuntu Unity2D desktop is
achieved by following steps:
• GL/GLES applications render a frame into the pixmap buffers that are allocated in the
EXA driver.
• In the SwapBuffers implementation, the driver notifies X server that the pixmap buffer
region is damaged through Xdamage and Xfixes APIs.
• Then the X server will present the latest pixmap buffer to the Unity2D desktop while
maintaining the proper window overlap characteristics relative to the other windows on
the desktop.
On a compositing X desktop, such as Ubuntu Unity 2D, GLES/GL applications always
render into the full rectangular back buffer of a window. There is no window clipping
required. So the Vivante DRI implementation can take advantage of the GPU’s resolve
function and render into the window back buffer directly.
On a legacy X window desktop, such as Gnome, Xwin, etc., GLES/GL applications
have to render onto the frame buffer surface directly. Thus, the DRI driver uses the
DrawableInfo interface in the VIVEXT extension to obtain the cliplist of the window, then
copies the sub-regions of the render target to the frame buffer according to the cliplist.
This will ensure that the GLES/GL windows overlap with other windows on the desktop
properly. However, the copying of the render target sub-regions to the frame buffer has
to be done by the CPU as the sub-regions’ starting address and alignment may not meet
GPU copy requirements.
The Vivante DRI implementation can detect the type of X window manager (compositing
desktop manager or legacy desktop manager) at run-time, and use appropriate DRI
rendering paths for GLES/GL applications.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The back buffer is allocated by creating an X pixmap of the necessary size. Use the X
extension for the Vivante X Driver module to query the physical frame buffer address for
this X pixmap if it was allocated in the offscreen frame buffer memory.
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "freetype"
Load "glx"
Load "dri"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbLayout" "us"
Option "XkbModel" "pc105"
Option "XkbRules" "xorg"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
EndSection
Section "Device"
Identifier "Your Accelerated Framebuffer Device"
Driver "vivante"
Option "fbdev" "/dev/fb0"
Option "vivante_fbdev" "/dev/fb0"
Option "HWcursor" "false"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Your Accelerated Framebuffer Device"
DefaultDepth 24
EndSection
Section "DRI"
Mode 0666
EndSection
Mandatory Strings
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Some important entries recognized by the Vivante X Driver are described as follows.
Device Identifier and Screen Device String
The mandatory Identifier entry in the Device section specifies the unique name to
associate with this graphics device.
Section "Device"
Identifier "Your Accelerated Framebuffer Device"
The following entry ties a specific graphics device to a screen. The Device Identifier
string must match the Device string in a Screensection of the xorg.conf file. For example:
Section "Screen"
Identifier "Default Screen"
<other entries>
Device "Your Accelerated Framebuffer Device"
<other entries>
EndSection
Section "Device"
Identifier "Your Accelerated Framebuffer Device"
Driver "vivante"
Option "fbdev" "/dev/fb0"
Option "vivante_fbdev" "/dev/fb0"
<other entries>
EndSection
+#elif defined(__arm__)
+ #undef DRM_DEV_MODE
+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|
S_IWGRP|S_IROTH|S_IWOTH)
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
+
+ #define DRM_CAS(lock,old,new,__ret) \
+ do { \
+ __asm__ __volatile__ ( \
+ "1: ldrex %0, [%1]\n" \
+ " teq %0, %2\n" \
+ " strexeq %0, %3, [%1]\n" \
+ : "r" (__ret) \
+ : "r" (lock), "r" (old), "r" (new) \
+ : "cc","memory"); \
+ } while (0)
+
#endif /* architecture */
#endif /* __GNUC__ >= 2 */
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
5.3.11 Troubleshooting
1. Framebuffer devices can be specified by environment variable. This is especially
useful when there are multiple framebuffer devices.
export FB_FRAMEBUFFER_0=/dev/fb2
2. If the above does not resolve the issue:
• If DRM booted up properly, check the /var/log/X11.n log file (n will represent
instance number) for more information.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• If DRM did not boot properly, check your kernel mode driver installation. (See
sections 6.4.2 and 6.4.3 above).
3. Window is created, but nothing is drawn
• If you run an OpenGL application and find a window was created, but nothing was
drawn, try to export the ${__GL_DEV_FB} environment variable:
export __GL_DEV_FB=$FB_FRAMEBUFFER_0.
4. Cannot open Display message
• If you have a message similar to “Cannot open Display,” use the following
command to check whether X is running at :0 or at :1 instance, use:
$ ps –ef|grep X
• Then depending on the returned instance number, add the following environment
variable
export DISPLAY=:n
• Then run it again.
5. UART terminal cannot run GPU application with lightdm
• Use ssh terminal instead.
6. EXA build script failure
• Check the log file and make sure your system time is set correctly.
7. Invalid MIT-MAGIC-COOKIE-1 Key error message
• Some GPU applications are not permitted to run using root. Use an alternate
account instead.
8. Segment fault occurs while running GPU application
• Check the attribute for dev/galcore should be updated to 666.
• To update this attribute automatically on system boot,
• Locate and edit file /etc/udev/rules.d/<bsp-specific.rules>.
• Add: “KERNEL==”galcore”,MODE=”0666””
• Lastly, make sure your kernel and GPU drivers are matched.
9. Check whether Compiz is running
• If your host or target has issues after installing the OpenGL Development Packages
in Table 6, check whether compiz is running with the following command:
$ ps –ef|grep compiz
• If compiz is running, then Ubuntu is using Unity3D by default. To set the default
window manager to Unity2D:
• Locate and edit file /var/lib/AccountsService/users/<username>.
• Change ubuntu to ubunto-2d.
6 Video
6.1.1 Introduction
The i.MX capture driver support is through the V4L2 interface with camera sensor
controllers and interfaces. Applications cannot use the camera driver directly. Instead,
the applications use the V4L2 capture driver to open and close the camera for preview
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
and image capture, controlling the camera, getting images from camera, and starting the
camera preview.
The list of capture controllers are as follows:
• Camera Serial Interface - CSI
• IPU-CSI
• Video Interface Unit - VIU
• Image Sensor Interface - ISI
• Image Sensor Processing - ISP
The list of capture interfaces for transfering image data are as follows:
• Parallel-CSI
• MIPI-CSI2
• HDMI RX
• TV Decoder
This chapter describes the differences between the various controllers and interfaces.
Note: The i.MX 6 with IPU uses internaldev for V4L2 interface while all others use
subdev for V4L2 interface.
The following table describes the different controllers and interfaces combinations.
• The i.MX 6 with IPU use a customized CSI that interfaces with IPU hardware.
• Each SoC can support one or more interfaces as described in the previous table. The
interfaces align with Video for Linux V4L2 APIs.
• In some cases the capture controller is not interfacing to a camera but a video input
unit. Some also interface to HDMI Receivers
The Omnivision menu configuration has multiple options based on the support
Top level selection is the following:
Device Drivers > Multimedia support (MEDIA_SUPPORT [=y]) > V4L platform devices
(V4L_PLATFORM_DRIVERS)
The next level selections are based on the different interfaces for each SoC
• For i.MX 6 with IPU, select both > MXC Camera/V4L2 PRP Features support and >
OmniVision ov5640 camera support (MXC_CAMERA_OV5640).
• For i.MX 6 without IPU, select > OmniVision ov5640 camera support
(MXC_CAMERA_OV5640_V2).
• For i.MX 7, select > OmniVision ov5640 camera support using MIPI
(MXC_CAMERA_OV5640_MIPI_V2).
• For i.MX 8, select > IMX8 Camera ISI/MIPI Features support
(VIDEO_MX8_CAPTURE) > IMX8 Camera Controller (IMX8_CAPTURE_DRIVER) and
Maxim OV5640_V3 driver support (Device Drivers > Statging Drivers > Media Staging
Drivers > i.MXqQXP/QM Camera ISI/MIPI Features support).
• For i.MX 8M, select > OmniVision ov5640 camera support
(MXC_CAMERA_OV5640_V2) and OmniVision ov5640 camera support using MIPI
(MXC_CAMERA_OV5640_MIPI_V2).
The following table describes the supported camera features for each interface.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
i.MX 6 with IPU use a IPU-CSI driver that interfaces with the IPU directly. i.MX Quad
Plus/Quad/Dual have support for two IPU-CSI senaros. i.MX 6 without IPU and i.MX
7Dual/Solo use a separate CSI sensor driver that interfaces directly to the sensor.
6.1.5 HDMI
HDMI video interfaces with the Image Sensor Interface (ISI).
On i.MX 8QuadMax, the HDMI receiver video interface support one port HDMI 1.4 4K30.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.2.1 Introduction
The i.MX Display systems uses display controllers to optimize video data movement
to display interfaces and graphics processing. Each display controller is implemented
through a Linux driver and into a display framework either framebuffer or DRM. In some
cases a display controller includes authentication ensuring a secure video pipeline. In
others the display controller will include additional features for scaling, de-interlacing,
tiling and color conversion during tranfers. For i.MX 8 supporting multiple displays is done
with use of two controllers working together. This chapter provides a high level overview
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
of i.MX display controllers and interfaces and the difference between framebuffer and
DRM display drivers. The following display controllers are used.
• IPU
• PXP
• eLCDIF
• DPU
• DCSS - on i.MX 8M only
A display interface will interface to the display controller, display panel and in some cases
encoders display bridges. The following display interfaces are supported.
• EPDC - supporting EInk displays
• Parallel - supporting LCD displays
• LVDS - supporting LVDS displays
• HDMI - supporting both on chip and external HDMI
• Display Port - supporting eDP panels
• MIPI-DSI - supporting MIPI displays
Note: Analog display is no longer supported. Analog interface was used i.MX 37 and
i.MX 5 families.
The following HDMI display bridges/encoder are supported.
• Parallel to HDMI - using Silicon Image si902x
• LVDS to HDMI - using ITE it6263
• MIPI-DSI to HDMI - using Analog Devices adv7535
Each SOC supports different display features. Some of these are configured in the
device trees located at arch/arm/boot/dts and arch/arm64/boot/dts. Go to the hardware
reference manual for more details on the following.
• Throughput
– Number of outputs
– Pixel clock rate
– Max number of displays and corresponding resolution
– Resolution at 60 Hz.
• Interface
– Parallel - number of ports and bit size
– LVDS - number of lanes and channels.
– MIPI-DSI - number of ports, lanes channels and speed
• Processing
– On the fly combining including high resolution displays
– Off-line combining speed
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
imx_v7_defconfig. The Trully panels are only supported with the MIPI DSI interface. The
Eink panels are only supported with the EPDC interface.
6.2.5 Authentication
Display authentication allows hardware processing to ensure display content is
not compromised. This is done through a display authentication CRC using the
authentication hardware This hardware is the DCIC integrated through the frame buffer
display framework on i.MX 6 and the DPU implemented in the DRM display framework
for i.MX 8.
Display authentication CRC is supported on the following SoC.
• i.MX 6 Solox supports authentication using DCIC for 1 display.
• i.MX 6 QuadPlus/Quad/Dual support authentication using DCIC with 2 displays.
• i.MX 8QuadXPlus can authenticate 2 display using the DPU.
• i.MX 8QuadMax can authenticate 4 displays using DPU.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.2.6 Tiling
Tiling through hardware provides optimized video data display. This is implemented
through different hardware blocks. The newest feature is the Display Prefetch Resolve
(DPR) which increases performance on the i.MX 6 QuadPlus, i.MX 8QuadMax and i.MX
8QuadXPlus.
Tile support is enabled on the following
• i.MX 6Quad/Dual supports tiling using Video Data Order Adapter (VDOA).
• i.MX 6QuadPlus supports both tiling VDOA and Display Prefetch Resolve (DPR)
version 1
• i.MX 8QuadXPlus and i.MX 8QuadMax supports tiling using Display Prefetch Resolve
(DPR) version2
6.3.1.1 Introduction
The display processing unit (DPU) is designed to support video and graphics processing
functions and to interface with video and still display sensors and displays. The DPU
driver provides internel kernel-level APIs to manipulate logical channels. A logical
channel represents a complete DPU processing flow. For example, a complete DPU
processing flow (logical channel) might consist of reading a YUV buffer from memory and
displaying it to an external interface. The DPU API consists of a set of common functions
for all channels. Its functions are to initialize channels, set up buffers, enable and disable
channels and set up interrupts.
Typical logical channels include:
• CSI direct to memory
• Memory to synchronous frame buffer background
• Memory to synchronous frame buffer foreground
The higher level drivers are responsible for memory allocation and providing user-level
API. DPU interfaces are available for capture in the V4L2 framework and for display
using the DRM display framework. DPU interfaces with LVDS, MIPI-DSI, HDMI and
Parallel display interfaces.
The DPU display controller supports a 32bit display composition engine that includes the
following:
• 2 Display output streams on independent panels.
• Two layer composition
• Automatic safety stream panic plus detection using CRC matching using a Region CRC
checker
The DPU display controller supports a 2D composition engine which provides efficiency,
performance and safety. The DPU 2D graphics engine support reduces the burden on
the GPU so it only does 3D GPU. Video efficiency with overlay native video and graphics
uses minimal access to system memory. Power efficiencies allow the 3D engine to be off
for windowing GUI's like the Android Hardware Composer.
The DPU also supports the following for authentication.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.3.1.2 DRM
The display processing unit (DPU) interfaces with the DRM driver supporting video
display.
The DPU drivers are separating into DRM, blitting and main processing. Common
functions are provided in the drivers/gpu/drm/imx/dpu and drivers/gpu/imx/dpu-blit while
the main driver exists in drivers/gpu/imx/dpu. The following table lists the source files.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following Linux kernel configuration options are provided for the DPU module.
Device Drivers -> i.MX DPU core support
6.3.2.1 Introduction
The image processing unit (IPU) is designed to support video and graphics processing
functions and to interface with video and still image sensors and displays. The IPU
driver provides a kernel-level API to manipulate logical channels. A logical channel
represents a complete IPU processing flow. For example, a complete IPU processing
flow (logical channel) might consist of reading a YUV buffer from memory, performing
post-processing, and writing an RGB buffer to memory. A logical channel maps one
to three IDMA channels and maps to either zero or one IC tasks. A logical channel
can have one input, one output, and one secondary input IDMA channel. The IPU API
consists of a set of common functions for all channels. Its functions are to initialize
channels, set up buffers, enable and disable channels, link channels for auto frame
synchronization, and set up interrupts.
The IPU is a display controller and supports the following display interfaces which are
supported through the framebuffer display framework. The access is only exposed
through the framebuffer fbdev application framework.
• Parallel
• LVDS
• HDMI
• MIPI-DSI
Typical logical channels include:
• CSI direct to memory
• CSI to viewfinder pre-processing to memory
• Memory to viewfinder pre-processing to memory
• Memory to viewfinder rotation to memory
• Previous field channel of memory to video deinterlacing and viewfinder pre-processing
to memory
• Current field channel of memory to video deinterlacing and viewfinder pre-processing to
memory
• Next field channel of memory to video deinterlacing and viewfinder pre-processing to
memory
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The detailed hardware operation of the IPU is discussed in the Applications Processor
Reference Manual. The following figure shows the IPU hardware modules.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The drivers for IPUv1 are named simply ipu. Drivers for IPUv3 contain 3 or v3 in the
name. The IPU drivers are sub-divided as follows:
• Device drivers-include the frame buffer driver for the synchronous frame buffer, the
frame buffer driver for the displays, V4L2 capture drivers for IPU pre-processing,
the V4L2 output driver for IPU post-processing, and the ipu processing driver which
provide system interface to user space or V4L2 drivers. The frame buffer device drivers
are available in drivers/video/mxc. The V4L2 device drivers are available in
drivers/media/platform/mxc.
• The MXC display driver is introduced as a simple framework to manage interaction
between IPU and display device drivers (e.g., LCD, LVDS, HDMI, MIPI, etc.)
• Low-level library routines-interface to the IPU hardware registers. They take input from
the high-level device drivers and communicate with the IPU hardware. The low-level
libraries are available in the directory of the Linux kernel.
The frame buffer device provides an abstraction for the graphics hardware. It represents
the frame buffer video hardware, and allows application software to access the graphics
hardware through a well-defined interface, so that the software is not required to know
anything about the low-level hardware registers.
The driver is enabled by selecting the frame buffer option under the graphics parameters
in the kernel configuration. To supplement the frame buffer driver, the kernel builder may
also include support for fonts and a startup logo. This device depends on the virtual
terminal (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.
Other than the physical memory allocation and LCD panel configuration, the common
kernel video API is utilized for setting colors, palette registration, image blitting, and
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
memory mapping. The IPU reads the raw pixel data from the frame buffer memory and
sends it to the panel for display.
The frame buffer interacts with the IPU hardware driver module.
A frame buffer device is a memory device, such as /dev/mem, and it has features similar
to a memory device. Users can read it, write to it, seek to some location in it, and mmap()
it (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.
/dev/fb* also interacts with several IOCTLs, which allows users to query and set
information about the hardware. The color map is also handled through IOCTLs.
For more information on what IOCTLs exist and which data structures they use, see
include/uapi/linux/fb.h. The following are a few of the IOCTLs functions:
• Request general information about the hardware, such as name, organization of the
screen memory (planes, packed pixels, and so on), and address and length of the
screen memory.
• Request and change variable information about the hardware, such as visible and
virtual geometry, depth, color map format, timing, and so on. The driver suggests
values to meet the hardware capabilities (the hardware returns EINVAL if that is not
possible) if this information is changed.
• Get and set parts of the color map. Communication is 16 bits-per-pixel (values for red,
green, blue, transparency) to support all existing hardware. The driver does all the
calculations required to apply the options to the hardware (round to fewer bits, possibly
discard transparency value).
The hardware abstraction makes the implementation of application programs easier
and more portable. The only thing that must be built into the application programs is the
screen organization (bitplanes or chunky pixels, and so on), because it works on the
frame buffer image data directly.
The MXC frame buffer driver (drivers/video/mxc/mxc_ipuv3_fb.c) interacts closely with
the generic Linux frame buffer driver (drivers/video/fbdev/core/fbmem.c).
The synchronous frame buffer screen driver implements a Linux standard frame buffer
driver API for synchronous LCD panels or those without memory. The synchronous
frame buffer screen driver is the top level kernel video driver that interacts with kernel
and user level applications. This is enabled by selecting the Synchronous Panel Frame
buffer option under the graphics support device drivers in the kernel configuration. To
supplement the frame buffer driver, the kernel builder may also include support for fonts
and a startup logo. This depends on the VT console for switching from serial to graphics
mode.
Except for physical memory allocation and LCD panel configuration, the common kernel
video API is utilized for setting colors, palette registration, image blitting, and memory
mapping. The IPU reads the raw pixel data from the frame buffer memory and sends it to
the panel for display.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The frame buffer driver supports different panels as a kernel configuration option.
Support for new panels can be added by defining new values for a structure of panel
settings.
The frame buffer interacts with the IPU driver using custom APIs that allow:
• Initialization of panel interface settings
• Initialization of IPU channel settings for LCD refresh
• Changing the frame buffer address for double buffering support
The following features are supported:
• Configurable screen resolution
• Configurable RGB 16, 24, or 32 bits per pixel frame buffer
• Configurable panel interface signal timings and polarities
• Palette/color conversion management
• Power management
• LCD power off/on
• Enable/disable PRE/PRG features
User applications utilize the generic video API (the standard Linux frame buffer driver
API) to perform functions with the frame buffer. These include the following:
• Obtaining screen information, such as the resolution or scan length
• Allocating user space memory using mmap for performing direct blitting operations
A second frame buffer driver supports a second video/graphics plane.
IPU drivers also control the backlight. The IPU backlight driver implements IPU PWM
backlight control for panels. It exports a sys control file under /sys/class/backlight/pwm-
backlight.0/brightness to user space. The default backlight intensity value is 128.
struct ipu_task {
struct ipu_input input;
struct ipu_output output;
bool overlay_en;
struct ipu_overlay overlay;
#define IPU_TASK_PRIORITY_NORMAL 0
#define IPU_TASK_PRIORITY_HIGH 1
u8 priority;
#define IPU_TASK_ID_ANY 0
#define IPU_TASK_ID_VF 1
#define IPU_TASK_ID_PP 2
#define IPU_TASK_ID_MAX 3
u8 task_id;
int timeout;
};
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
struct ipu_input {
u32 width;
u32 height;
u32 format;
struct ipu_crop crop;
dma_addr_t paddr;
struct ipu_deinterlace deinterlace;
dma_addr_t paddr_n; /*valid when deinterlace enable*/
};
struct ipu_overlay {
u32 width;
u32 height;
u32 format;
struct ipu_crop crop;
struct ipu_alpha alpha;
struct ipu_colorkey colorkey;
dma_addr_t paddr;
};
struct ipu_output {
u32 width;
u32 height;
u32 format;
u8 rotate;
struct ipu_crop crop;
dma_addr_t paddr;
};
To prepare the task, the user just needs to fill task.input, task.overlay (if need
combine) and task.output parameters, and then queue task either by int
ipu_queue_task(struct ipu_task *task); if from the kernel level (V4L2 driver
for example), or by IPU_QUEUE_TASK ioctl under /dev/mxc_ipu if from the application
level.
The source files associated with the IPU, Sensor, V4L2, and Panel drivers are available
in the following folders.
• drivers/mxc/ipu3
• drivers/video/mxc
• drivers/video/fbdev/mxc
• drivers/video/backlight
See the V4L2 chapter for more information on the IPU V4L2 driver files
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Table 59 lists the header files associated with the IPU and Panel drivers.
The following Linux kernel configuration options are provided for the IPU module.
In menu configuration enable the following module:
• CONFIG_MXC_IPU_V3 - Includes support for the Image Processing Unit. In
menuconfig, this option is available under:
Device Drivers > MXC support drivers > Image Processing Unit Driver
By default, this option is Y for all architectures.
If ARCH_MXC is true, CONFIG_MXC_IPU_V3 will be set.
• CONFIG_MXC_IPU_V3_PRG - This enables support for the IPUv3 prefetch gasket
engine to support double buffer handshake control between IPUv3 and prefetch engine
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
(PRE), snoop the AXI interface for display refresh requests to memory, and modify the
request address to fetch the double buffered row of blocks in OCRAM.
Device Drivers > MXC support drivers > i.MX IPUv3 prefetch gasket engine
This option depends on CONFIG_MXC_IPU_V3 and CONFIG_MXC_IPU_V3_PRE.
• CONFIG_MXC_IPU_V3_PRE - This enables support for the IPUv3 prefetch engine
to improve the system memory performance. The engine has the capability to resolve
framebuffers in tile pixel format to linear.
Device Drivers > MXC support drivers > i.MX IPUv3 prefetch engine
This option depends on CONFIG_MXC_IPU_V3. Enabling this option selects
CONFIG_MXC_IPU_V3_PRG.
• CONFIG_MXC_CAMERA_OV5640_MIPI - Option for both the OV 5640
mipi sensor driver and the use case driver. This option is dependent on the
VIDEO_MXC_CAPTURE option. In menuconfig, this option is available under:
Device Drivers > Multimedia support > V4L platform devices > MXC Video For Linux
Video Capture > MXC Camera/V4L2 PRP Features support > OmniVision 5640
Camera support using mipi
• CONFIG_MXC_CAMERA_OV5640 - Option for both the OV5640 sensor driver and the
use case driver. This option is dependent on the VIDEO_MXC_CAPTURE option. In
menuconfig, this option is available under:
Device Drivers > Multimedia platform > V4L platform devices > MXC Video For Linux
Video Capture > MXC Camera/V4L2 PRP Features support > OmniVision ov5640
camera support
Only one sensor should be installed at a time.
• CONFIG_MXC_IPU_PRP_VF_SDC - Option for the IPU (here the > symbols illustrates
data flow direction between HW blocks):
CSI > IC > MEM MEM > IC (PRP VF) > MEM
Use case driver for dumb sensor or
CSI > IC(PRP VF) > MEM
for smart sensors. In menuconfig, this option is available under:
Multimedia devices > Video capture adapters > MXC Video For Linux Camera > MXC
Camera/V4L2 PRP Features support > Pre-Processor VF SDC library
By default, this option is M for all.
• CONFIG_MXC_IPU_PRP_ENC - Option for the IPU:
Use case driver for dumb sensors
CSI > IC > MEM MEM > IC (PRP ENC) > MEM
or for smart sensors
CSI > IC(PRP ENC) > MEM.
In menuconfig, this option is available under:
Device Drivers > Multimedia Devices > Video capture adapters > MXC Video For Linux
Camera > MXC Camera/V4L2 PRP Features support > Pre-processor Encoder library
By default, this option is set to M for all.
• CONFIG_VIDEO_MXC_CAMERA - This is configuration option for V4L2 capture
Driver. This option is dependent on the following expression:
VIDEO_DEV && MXC_IPU && MXC_IPU_PRP_VF_SDC && MXC_IPU_PRP_ENC
In menuconfig, this option is available under:
Device Drivers > Multimedia devices > Video capture adapters > MXC Video For Linux
Camera
By default, this option is M for all.
• CONFIG_VIDEO_MXC_OUTPUT - This is configuration option for V4L2 output Driver.
This option is dependent on VIDEO_DEV && MXC_IPU option. In menuconfig, this
option is available under:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Device Drivers > Multimedia devices > Video capture adapters > MXC Video for Linux
Video Output
By default, this option is Y for all.
• CONFIG_FB - This is the configuration option to include frame buffer support in the
Linux kernel. In menuconfig, this option is available under:
Device Drivers > Graphics support > Support for frame buffer devices
By default, this option is Y for all architectures.
• CONFIG_FB_MXC - This is the configuration option for the MXC Frame buffer driver.
This option is dependent on the CONFIG_FB option. In menuconfig, this option is
available under:
Device Drivers > Graphics support > MXC Framebuffer support
By default, this option is Y for all architectures.
• CONFIG_FB_MXC_SYNC_PANEL - This is the configuration option that chooses the
synchronous panel framebuffer. This option is dependent on the CONFIG_FB_MXC
option. In menuconfig, this option is available under:
Device Drivers > Graphics support > MXC Framebuffer support > Synchronous Panel
Framebuffer
By default this option is Y for all architectures.
• CONFIG_FB_MXC_LDB - This configuration option selects the LVDS module on
i.MX 6 chip. This option is dependent on CONFIG_FB_MXC_SYNC_PANEL and
CONFIG_MXC_IPUV3 || FB_MXS options. In menuconfig, this option is available
under:
Device Drivers > Graphics support > MXC Framebuffer support > Synchronous Panel
Framebuffer > MXC LDB
• CONFIG_FB_MXC_SII9022 - This configuration option selects the SII9022 HDMI chip.
This option is dependent on CONFIG_FB_MXC_SYNC_PANEL option. In menuconfig,
this option is available under:
Device Drivers > Graphics support > MXC Framebuffer support > Synchronous Panel
Framebuffer > Si Image SII9022 DVI/HDMI Interface Chip
6.3.3.1 Introduction
The PxP is a display controller that works wtih the EPDC display interface. The Pixel
Pipeline (PxP) DMA engine driver provides a unique API, which are implemented as
a dmaengine client that smooths over the details of different hardware offload engine
implementations. Typically, the users of PxP DMA-ENGINE driver include EPDC driver,
V4L2 Output driver, and the PxP user-space library.
The PxP driver uses PxP registers to interact with the hardware. For detailed hardware
operations, see the Applications Processor Reference Manual document associated with
SoC.
There are different versions of PxP IP. To ease the maintenance for the new version
of PxP used on i.MX 7Dual, which has new features mainly for EPDC like hardware
collision detection, E Ink Gen-II waveform algorithm (REAGL/-D) processing in
hardware, and hardware dithering support, there are different drivers (drivers/dma/pxp/
pxp_dma_v3.c). However, each version uses the DMA Engine framework.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The PxP DMA Engine driver implementation depends on the DMA Engine Framework.
There are three important structs in the DMA Engine Framework which are extended by
the PxP driver: struct dma_device, struct dma_chan, struct dma_async_tx_descriptor.
The PxP driver implements several callback functions which are called by the DMA
Engine 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 */
device_tx_status /* poll for transaction completion */
device_issue_pending /* push pending transactions to hardware */
and,
device_prep_slave_sg /* prepares a slave DMA operation */
device_terminate_all/* manipulate all pending operations on a channel, returns zero or
error code */
The first four functions are used by the DMA Engine Framework, the last two are used by
the DMA slave (DMA client). Notably, device_issue_pending is used to trigger the start of
a PxP operation.
The PxP DMA driver also implements the interface tx_submit in struct
dma_async_tx_descriptor, which is used to prepare the descriptor(s) which will be
executed by the engine. When tasks are received in pxp_tx_submit, they are not
configured and executed immediately. Rather, they are added to a task queue and the
function call is allowed to return immediately.
Although ePxP does not have multiple channels in hardware, the virtual channels are
supported in the driver. This provides flexibility in the multiple instance/client design.
At any time, a user can call dma_request_channel() to get a free channel, and then
configure this channel with several descriptors. A descriptor is required for each input
plane and for the output plane. When the PxP is no longer being used, the channel
should be released by calling dma_release_channel(). Detailed elements of channel
management are handled by the driver and are transparent to the client.
The DMA Engine processes the task based on the descriptor. One DMA channel
is usually associated with several descriptors. Descriptors are recycled resources,
under control of the offload engine driver, to be reused as operations complete. 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.
There are two ways for an application to receive notification that a PxP operation has
completed.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Call dma_wait_for_async_tx(). This call causes the CPU to spin while it polls for the
completion of the operation.
• Specify a completion callback.
The latter method is recommended. After the PxP operation completes, the PxP output
buffer data can be retrieved.
For general information for DMA Engine Framework, seeDocumentation/dmaengine.txt in
the Linux kernel source tree.
6.3.3.7 Limitations
• The driver currently does not support scatterlist objects in the way they are traditionally
used. Instead of using the scatterlist parameter object to provide a chain of memory
sources and destinations, the driver currently uses it to provide the input and output
buffers (and overlay buffers, if needed) for one transfer.
• The PxP driver may not properly execute a series of transfers that is queued in rapid
sequence. It is recommended to wait for each transfer to complete before submitting a
new one.
The following Linux kernel configuration option is provided for this module:
For i.MX 7Dual select Device Drivers > DMA Engine support > [*] MXC PxP V3 support >
[*] MXC PxP Client Device
For i.MX 6 select Device Drivers > DMA Engine support > [*] MXC PxP V2 support > [*]
MXC PxP Client Device
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.3.4.1 Introduction
The eLCDIF is a display controller that works with the Parallel LCD interface. The driver
is implemented as a display subsystem driver either frame buffer or DRM which controls
generic LCD low-level operations allowing low level hardware control. Only DOTCLK
mode of the ELCDIF is tested, so theoretically the ELCDIF frame buffer driver can work
with a sync LCD panel driver to support a frame buffer device. The sync LCD driver is
organized in a flexible and extensible manner and is abstracted from any specific sync
LCD panel support. To support another sync LCD panel, the user can write a sync LCD
driver by referring to the existing ones.
For the eLCDIF implemented as a framebuffer driver the frame buffer device is a memory
device similar to /dev/mem. It can be read from, written to, or some location in it can
be sought and mapped using mmap(). The difference is that the memory available
to the user is not the entire allocated memory, but only the frame buffer of the video
hardware. The device is accessed through special device nodes, usually located in the
/dev directory, /dev/fb*. /dev/fb* also has several 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 are used.
The i.MX ELCDIF frame buffer driver implementation is abstracted from the actual
hardware. The default panel driver is picked up by video mode defined in platform data
or passed in with 'video=mxc_elcdif_fb:resolution, bpp=bits_per_pixel' kernel bootup
command during probing. The resolution should be in the common frame buffer video
mode pattern and bits_per_pixel should be the frame buffer's color depth.
The following menu options will configure the MXC ELCDIF frame buffer driver. This
option depends on FB and (ARCH_MXS || ARCH_MXC).
Frame buffer Devices > MXS LCD framebuffer support (CONFIG_FB_MXS)
The source for frame buffer is in drivres/video/fbdev/mxc and the DRM driver is in drivers/
gpu/drm/imx/lcdif and drivers/gpu/drm/imx/lcdifv3.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.3.5.1 Introduction
The Display control subsystem (DCSS) is a display control for i.MX 8M Quad that
integrates through the DRM display framework. The DCSS provides a mechanism to
display frame buffers in memory out to UltraHD or HDTVs with the capability to combine
up to 3 layers of graphics or video overlay to the HDMI output. The key featuers of the
DCSS controller include:
• Supports up to 3 layers of graphics or video
– Arbitrary offset
– One plane can be graphics with 8 bit alpha support
– Upscale 1920x1080p60 video or graphics to 3840x2160p60
– Downscale 3840x2160p30 video to 1920x1080p30 or 1280x720p30
• HDR support:
– HDR10 with 2084 and 2020 color spaces
– Dolby Vision single and dual layer formats
– HLG
• HDMI 2.0a supporting one display:
– Resolutions of: 640x480p60, 720x480p60, 1280x720p60,
1920x1080p60,3840x2160p60, 4096x2160p60
– HDCP 2.2 and HDCP 1.4
• Pixel clock up to 596 MHz
• Output can also go to MIPI DSI output
• Frame Buffer Compression – Lossless compression of buffers
The DCSS drm driver is located in drivers/gpu/drm/imx/dcss and the DCSS core driver is
in drivers/gpu/imx/dcss
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.3.6 DCNANO
6.3.6.1 Introduction
The LCDIF is a high-performance graphics core that can be used for reading rendered
images from the frame buffer. In addition
to providing hardware cursor patterns, the display controller performs format conversions,
dithering, and gamma corrections.
Display controller key features are:
• Video Timing Generation
– HSYNC, VSYNC, DE signals
– Programmable timers
• MIPI Display Protocols
– Display Pixel Interface-2 (DPI-2) formats
– DPI 24-bit, 18-bit (2 configs) and 16-bit support (3 configs)
– (Optional) Display Bus Interface 2.0 (DBI-2)
• Display Interface
– Parallel Pixel Output with 24-bit Data, HSync, VSync, Data enable
– Easily adaptable to external serialization logic, e.g., HDMI
• Display
– Display sizes to 1024x480
– Sync and blank signals
– Gamma and dither tables
• Input Formats
– ARGB2101010/ARGB8888/ARGB1555/RGB565/ARGB4444
– YUV422 packed & semi planar (YUY2, UYVY)
• Format Conversion
– Pixel inputs accepted from multiple RGB formats
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.4.1.1 Introduction
The Parallel interface supports display to LCDs. The Parallel Display interface is
supported through the display controllers and implemented using the display framework
which is fbdev framework on i.MX 6 and i.MX 7 and drm framework for i.MX8. .
The following controllers support the parallel interface
• IPU on i.MX with IPU
• DPU on all i.MX8
• ElCDIF on i.MX with PxP
The Parallel interface supports at least one port on i.MX SoC that enable the parallel
interface and supports two ports for i.MX with IPU. The enabled SoC have varying
bitrates from 18bit to 24 bits per port. On i.MX 6 with IPU the Parallel interface also
supports a synchronous mode for display refresh and asynchronous mode to memory
and is very flexible with a glue-less connection to RAM-less displays, display controllers
and TV encoders.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.4.2.1 Introduction
The MIPI Display Interface (MIPI DSI) is a driver interface used to communicate with
MIPI device controller on the display panel. MIPI DSI display panel driver provides an
interface to configure the display panel through MIPI DSI.
The MIPI DSI Interface is a digital core accompanied with a multi-lane D-PHY that
implements all protocol functions defined in the MIPI DSI Specification, providing an
interface between the System and MIPI DSI compliant Display The MIPI DSI overview
can be found here however specifications are only available to MIPI members.
The MIPI DSI module provides a high-speed serial interface between a host processor
and a display module. It has higher performance, lower power, less EMI, and fewer pins
compared with parallel bus. It is designed to be compatible with the standard MIPI DSI
protocol and is built on the existing MIPI DPI-2, MIPI DBI-2 and MIPI DCS standards.
The module sends pixels or commands to the peripheral and reads back status or
pixel information from the peripheral. MIPI DSI serializes all pixels data, commands
and events, and contains two basic modes: command mode and video mode. It uses
command mode to write register and memory to the display controller while reading
display module status information. It also uses video mode to transmit a real-time pixel
streams from the host to peripheral in high-speed mode and generates an interrupt when
an error occurs.
For i.MX MIPI DSI is supported by a variety of drivers which are described in following
chapters. The MIPI DSI drivers support the following features:
• MIPI DSI communication protocol
• MIPI DSI command mode and video mode
• MIPI DCS command operation
The MIPI DSI driver used frame buffer driver for i.MX 6 and i.MX 7, and the DRM driver
for i.MX 8 and i.MX 93. Both drivers support the following.
• Drivers are not exposed to the user interface but through the drm or framebuffer
interface.
• MIPI DSI IP driver-low level interface used to communicate with MIPI device controller
on the display panel
• MIPI DSI display panel driver provides an interface to configure the display panel
through MIPI DSI
The driver enables the platform-related regulators and clock. It requests OS-related
system resources and registers buffer event notifier for blank/unblank operation. The
driver initializes MIPI D-PHY and configures the MIPI DSI IP according to the MIPI DSI
display panel.
The MIPI DSI driver supports the following features:
• Compatibility with MIPI Alliance Specification for DSI, Version1.01.0r11
• Compatibility with MIPI Alliance Specification for D-PHY, Version 1.00.00
• Supports 1 to 4 D-PHY data lanes depending on SoC capabilities.
• Bidirectional Communication and Escape Mode Support through Data Lane 0
• Programmable display resolutions
• Video Mode Pixel Formats, 16bpp (565 RGB),18bpp (666 RGB) packed, 18 bpp (666
RGB) loosely, 24bpp (888 RGB).
• Supports the transmission of all generic commands
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The MIPI DSI driver has two parts: MIPI DSI IP driver and MIPI DSI display panel driver.
The MIPI DSI IP driver has a private structure called mipi_dsi_info. The instance to which
the MIPI DSI IP is attached is described in field int dev_id while the DI instance inside
IPU is described in the field int disp_id.
During startup, the MIPI DSI IP driver is registered with the framebuffer driver through the
field struct mxc_dispdrv_handle when the driver is loaded. It also registers a framebuffer
event notifier with framebuffer core to perform the display panel blank/unblank operation.
The field struct fb_videomode *mode and struct mipi_lcd_config *lcd_config are received
from the display panel callback. The MIPI DSI IP needs this infomation to configure the
MIPI DSI hardware registers.
After initializing the MIPI DSI IP controller and the display module, the MIPI DSI IP gets
the pixel streams from IPU through DPI-2 interface and serializes pixel data and video
event through high-speed data links for display. When there is an framebuffer blank/
unblank event, the registered notifier will be called to enter/leave low power mode.
The MIPI DSI IP driver provides 3 APIs for MIPI DSI display panel driver to configure
display module.
The drivers uses the APIs provided by the MIPI DSI IP driver to read/write the display
module registers. Usually, there is a MIPI DSI slave controller integrated on the
display panel. After power on reset, the MIPI DSI display panel needs to be configured
through standard MIPI DCS command or MIPI DSI Generic command according to the
manufacturer's specification.
Table below shows the MIPI DSI driver source files available in drivers/video/fbdev/mxc.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.4.3.1 Introduction
Low Voltage Differential Signalling (LVDS) supports high bandwidth and high definitiion
graphics and fast frame rate with lower power consumption. The implentation uses paris
of wires where each wire in the pair carries inverse signal of the other. This creates less
interference and noise. The LVDS interferace uses four, six or eight paris of wirse with
additional ones carrying clock and ground wires.
The purpose of the LVDS interface is to support the flow of synchronous RGB data from
the display controller to external display devices through the LVDS interface.
This support covers all aspects of these activities:
1. Connectivity to relevant devices - Displays with LVDS receivers.
2. Data arrangement required by the external display receiver and by LVDS display
standards.
3. Synchronization and control capabilities.
The LVDS interface supports multiple controllers listed below.
• LDB - double on i.MX 6 with IPU
• Mixel on i.MX 8QuadMax
• Mixel Combo on i.MX 8QuadXPlus
The LVDS drivers works with the supported display framework, which is framebuffer for
i.MX 6 and i.MX 7, and DRM for i.MX 8 and i.MX 93.
The LVDS interface has the following structure of support
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The LVDS driver is functional if the driver is built-in and the device tree status is set to
"okay".
When the LVDS device driver is probed properly, the driver configures the clocks for the
LVDS. The LVDS driver probe function sets the default mode to 1080p60. The LVDS
channel mapping mode and bit mapping mode are set to use 30-bit JEIDA mode.
The driver takes the following steps to enable an LVDS channel:
1. Enable the power to the LVDS.
2. Set ldb_di_clk's parent clk and the parent clk's rate.
3. Set ldb_di_clk's rate.
4. Enable both ldb_di_clk and its parent clk.
5. Set the LVDS in a proper mode including display signals' polarities, channel mapping
mode, and bit mapping mode.
6. Enable related i.MX LVDS channels.
6.4.4.1 Introduction
This section describes the LVDS Display Bridge (LDB) driver which controls the LDB
module to connect with the external display devices with the LVDS interface. The
purpose of the LDB is to support flow of synchronous RGB data from IPU or LCDIF to
external display devices through LVDS interface.
This support covers the following:
• Connectivity to relevant devices - Displays with LVDS receivers.
• Arranging data as required by the external display receiver and by LVDS display
standards.
• Synchronization and control capabilities.
The following Linux kernel configuration options are provided for this module.
In menu configuration enable the following module:
Device Drivers -> Graphics support -> MXC Framebufer support ->Synchronous Panel
Framebuffer -> MXC LDB
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.4.5.1 Introduction
The frame buffer device provides an abstraction for the graphics hardware. It represents
the frame buffer video hardware and allows application software to access the graphics
hardware through a well-defined interface, abstracting from software how to manage the
low-level hardware registers. The EPDC driver supports this model with one key caveat:
the contents of the frame buffer are not automatically updated to the E Ink display.
Instead, a custom API function call is required to trigger an update to the E Ink display.
The details of this process are explained in the Section 6.4.5.3.
The frame buffer driver is enabled by selecting the frame buffer option under the graphics
parameters in the kernel configuration. To supplement the frame buffer driver, the kernel
builder may also includes support for fonts and a startup logo. The frame buffer device
depends on the virtual terminal (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.
A frame buffer device is a memory device, such as /dev/mem, and has features similar to
a memory device. Users can read it, write to it, seek to some location in it, and mmap()
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
it (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.
The EPDC frame buffer driver (drivers/video/fbdev/mxc/mxc_epdc_fb.c on i.MX 6DualLite
or drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c for generation-II EPDC on i.MX 7Dual)
interacts closely with the generic Linux frame buffer driver (drivers/video/fbmem.c).
For additional details on the frame buffer device, see documentation in the Linux kernel
found in Documentation/fb/framebuffer.txt.
E Ink display technology, in conjunction with the EPDC, has several features that
distinguish it from standard LCD-based frame buffer devices. These differences introduce
the need for API extensions to the frame buffer interface. The EPDC refreshes the E
Ink display asynchronously and supports partial screen updates. Therefore, the EPDC
requires notification from the user when the frame buffer contents have been modified
and which region needs updating. Another unique characteristic of EPDC updates to
the E Ink display is the long screen update latencies (between 300-980 ms), which
introduces the need for a mechanism to allow the user to wait for a given screen update
to complete.
The custom API extensions to the frame buffer device are accessible both from user
space applications and from within kernel space. The standard device IOCTL interface
provides access to the custom API for user space applications. The IOCTL extensions,
along with relevant data structures and definitions, can be found in include/linux/
mxcfb_epdc.h. A full description of these IOCTLs can be found in the Programming
Interface section Section 6.4.5.11.
For kernel mode access to the custom API extensions, the IOCTL interface should be
bypassed in favor of direct access to the underlying functions.
The EPDC driver is designed to flexibly support E Ink panels with a variety of panel
resolutions, timing parameters, and waveform modes. The EPDC driver is kept panel-
agnostic through the use of an EPDC panel mode structure, imx_epdc_fb_mode, which
can be found in include/linux/mxcfb_epdc.h.
struct imx_epdc_fb_mode {
struct fb_videomode *vmode;
int vscan_holdoff;
int sdoed_width;
int sdoed_delay;
int sdoez_width;
int sdoez_delay;
int gdclk_hp_offs;
int gdsp_offs;
int gdoe_offs;
int gdclk_offs;
int num_ce;
};
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
timing parameters, such as the source and gate driver timings. For details on how to
configure E Ink panel timing parameters, see the EPDC programming model section
in the i.MX 6DualLite Applications Processor Reference Manual (IMX6DLRM), or i.MX
7Dual Applications Processor Reference Manual (IMX7DRM).
In addition to the EPDC panel mode data, functions may be passed to the EPDC driver
to define how to handle the EPDC pins when the EPDC driver is enabled or disabled.
These functions should disable the EPDC pins for purposes of power savings.
Additional configuration for the EPDC driver is provided through boot command line
parameters. The format of the command line option is
epdc video=mxcepdcfb:[panel_name],bpp=16
.
The EPDC driver parses these options and tries to match panel_name to the name of
video mode specified in the imx_epdc_fb_mode panel mode structure. If no match is
found, then the first panel mode provided in the platform data is used by the EPDC driver.
The bpp setting from this command line sets the initial bits per pixel setting for the frame
buffer. A setting of 32 or 24 selects the RGB888 pixel format, one of 16 selects RGB565
pixel format, while a setting of 8 selects 8-bit grayscale (Y8) format.
The EPDC driver requires a waveform file for proper operation. This waveform file
contains the waveform information needed to generate the waveforms that drive updates
to the E Ink panel. A pointer to the waveform file data is programmed into the EPDC
before the first update is performed.
There are two options for selecting a waveform file:
1. Select one of the default waveform files included in this BSP release.
2. Use a new waveform file that is specific to the E Ink panel being used.
The waveform file is loaded by the EPDC driver using the Linux firmware APIs.
The quickest and easiest way to get started using an E Ink panel and the EPDC driver
is to use one of the default waveform files provided in the Linux BSP. This should enable
updates to several different types of E Ink panel without a panel-specific waveform file.
The drawback is that optimal quality should not be expected. Typically, using a non-
panel-specific waveform file for an E Ink panel results in more ghosting artifacts and
overall poorer color quality.
The following default waveform files included in the BSP reside in /lib/firmware/imx/epdc:
• epdc_E60_V110.fw - Default waveform for the 6.0 inch V110 E Ink panel.
• epdc_E60_V220.fw - Default waveform for the 6.0 inch V220 E Ink panel (supports
animation mode updates).
• epdc_E97_V110.fw - Default waveform for the 9.7 inch V110 E Ink panel.
• epdc_E060SCM.fw - Default waveform for the 6.0 inch Pearl E Ink panel (supports
animation mode updates).
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• epdc_ED060XH2C1.fw - Default waveform for the 6.0 inch E Ink panel (No Reagl/-D
Support by default. For Reagl/-D support, contact NXP support.)
The EPDC driver attempts to load a waveform file with the name "epdc_[panel_name].fw"
under the directory /lib/firmware/imx/epdc in rootfs, where panel_name refers to the
string specified in the fb_videomode name field. This panel_name information should be
provided to the EPDC driver through the kernel command line parameters described in
the preceding chapter. 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
To ensure the optimal E Ink display quality, use a waveform file specific to E Ink panel
being used. The raw waveform file type (.wbf) requires conversion to a format that can be
understood and read by the EPDC. This conversion script is not included as part of the
BSP. Therefore, contact NXP to acquire this conversion script.
Once the waveform conversion script has been run on the raw waveform file,
the converted waveform file should be renamed so that the EPDC driver can
find it and load it. The driver is going to search for a waveform file with the name
"epdc_[panel_name].fw" under the directory /lib/firmware/imx/epdc in rootfs, where
panel_name refers to the string specified in the fb_videomode name field. For example,
if the panel is named "E60_ABCD", then the converted waveform file should be named
epdc_E60_ABCD.fw.
Note: If the EPDC driver searches for a firmware waveform file that matches the names
of one of the default waveform files (see preceding chapter), it will choose the default
firmware files that are built into the BSP over any firmware file that has been added in
the firmware search path. Therefore, if you leave the BSP so that it uses the default
firmware files, make sure to use a panel name other than those associated with the
default firmware files, as those default waveform files will be preferred and selected over
a new waveform file placed in the firmware search path.
The framebuffer driver will not typically (see note below for exceptions) go through
any hardware initialization steps when the framebuffer driver module is loaded.
Instead, a subsequent user mode call must be made to request that the driver initialize
itself for a specific 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
fb_var_screeninfo parameter set to match the X and Y resolution of a supported E Ink
panel type. To ensure that the EPDC driver receives the initialization request, the activate
field of the fb_var_screeninfo parameter should be set to FB_ACTIVATE_FORCE.
Note: The exception is when the FB Console driver is included in the kernel. When the
EPDC driver registers the framebuffer device, the FB Console driver will subsequently
make an FBIOPUT_VSCREENINFO ioctl call. This will in turn initialize the EPDC panel.
The EPDC framebuffer driver supports the use of 8-bit grayscale (Y8) and 8-bit inverted
grayscale (Y8 inverted) pixel formats for the framebuffer (in addition to the more common
RGB565 pixel format). In order to configure the framebuffer format as 8-bit grayscale, the
application would call the FBIOPUT_VSCREENINFO framebuffer ioctl. This ioctl takes
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
fb_screen_info screen_info;
screen_info.bits_per_pixel = 8;
screen_info.grayscale = GRAYSCALE_8BIT;
retval = ioctl(fd_fb0, FBIOPUT_VSCREENINFO, &screen_info);
The EPDC Frame Buffer is accessible from user space and from kernel space. A single
set of functions describes the EPDC Frame Buffer driver extension. There are two modes
for accessing these functions with user space using the IOCTL interface and kernel
space using funcions directly. Each IOCTL and function combination is described next.
MXCFB_SET_WAVEFORM_MODES / mxc_epdc_fb_set_waveform_modes()
Description:
Defines a mapping for common waveform modes.
Parameters:
mxcfb_waveform_modes *modes
Pointer to a structure containing the waveform mode values for common waveform
modes. These values must be configured in order for automatic waveform mode
selection to function properly.
MXCFB_SET_TEMPERATURE / mxc_epdc_fb_set_temperature
Description:
Set the temperature to be used by the EPDC driver in subsequent panel updates.
Parameters:
int32_t temperature
Temperature value, in degrees Celsius. Note that this temperature setting may
be overridden by setting the temperature value parameter to anything other than
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.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
In automatic mode, updates are generated automatically by the driver by detecting pages
in frame buffer memory region that have been modified.
MXCFB_SET_UPDATE_SCHEME / mxc_epdc_fb_set_upd_scheme
Description:
Select a scheme that dictates how the flow of updates within the driver.
Parameters:
__u32 scheme
Select of the following updates schemes:
UPDATE_SCHEME_SNAPSHOT - In the Snapshot update scheme, the contents of the
framebuffer are immediately processed and stored in a driver-internal memory buffer. By
the time the call to MXCFB_SEND_UPDATE has completed, the framebuffer region is
free and can be modified without affecting the integrity of the last update. If the update
frame submission is delayed due to other pending updates, the original buffer contents
will be displayed when the update is finally submitted to the EPDC hardware. If the
update results in a collision, the original update contents will be resubmitted when the
collision has cleared.
UPDATE_SCHEME_QUEUE - The Queue update scheme uses a work queue to
asynchronously handle the processing and submission of all updates. When an update
is submitted via MXCFB_SEND_UPDATE, the update is added to the queue and then
processed in order as EPDC hardware resources become available. As a result, the
framebuffer contents processed and updated are not guaranteed to reflect what was
present in the framebuffer when the update was sent to the driver.
UPDATE_SCHEME_QUEUE_AND_MERGE - The Queue and Merge scheme uses
the queueing concept from the Queue scheme, but adds a merging step. This means
that, before an update is processed in the work queue, it is first compared with other
pending updates. If any update matches the mode and flags of the current update and
also overlaps the update region of the current update, then that update will be merged
with the current update. 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
Pointer to a structure defining the region of the frame buffer, waveform mode, and
collision mode for the current update. This structure also includes a flags field to select
from one of the following update options:
EPDC_FLAG_ENABLE_INVERSION - Enables inversion of all pixels in the update
region.
EPDC_FLAG_FORCE_MONOCHROME - Enables full black/white posterization of all
pixels in the update region.
EPDC_FLAG_USE_ALT_BUFFER - Enables updating from an alternate (non-
framebuffer) memory buffer.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
If enabled, the final upd_data parameter includes detailed configuration information for
the alternate memory buffer.
MXCFB_WAIT_FOR_UPDATE_COMPLETE / mxc_epdc_fb_wait_update_complete
Description:
Block and wait for a previous update request to complete.
Parameters:
mxfb_update_marker_data marker_data
The update_marker value used to identify a particular update (passed as a parameter in
MXCFB_SEND_UPDATE IOCTL call) should be re-used here to wait for the update to
complete. If the update was a collision test update, the collision_test variable will return
the result indicating whether a collision occurred.
MXCFB_SET_PWRDOWN_DELAY / mxc_epdc_fb_set_pwrdown_delay
Description:
Set the delay between the completion of all updates in the driver and when the driver
should power down the 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:
Retrieve the driver's current power down delay value.
Parameters:
int32_t delay
Output delay value in milliseconds.
#define GRAYSCALE_8BIT
0x1
#define GRAYSCALE_8BIT_INVERTED
0x2
#define AUTO_UPDATE_MODE_REGION_MODE
0
#define AUTO_UPDATE_MODE_AUTOMATIC_MODE
1
#define UPDATE_SCHEME_SNAPSHOT
0
#define UPDATE_SCHEME_QUEUE
1
#define UPDATE_SCHEME_QUEUE_AND_MERGE
2
#define UPDATE_MODE_PARTIAL
0x0
#define UPDATE_MODE_FULL
0x1
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
#define WAVEFORM_MODE_AUTO
257
#define TEMP_USE_AMBIENT
0x1000
#define EPDC_FLAG_ENABLE_INVERSION
0x01
#define EPDC_FLAG_FORCE_MONOCHROME
0x02
#define EPDC_FLAG_USE_ALT_BUFFER
0x100
#define EPDC_FLAG_TEST_COLLISION
0x200
#define FB_POWERDOWN_DISABLE
-1
struct mxcfb_rect {
__u32 left; /* Starting X coordinate for update region */
__u32 top; /* Starting Y coordinate for update region */
__u32 width; /* Width of update region */
__u32 height; /* Height of update region */
};
struct mxcfb_waveform_modes {
int mode_init; /* INIT waveform mode */
int mode_du; /* DU waveform mode */
int mode_gc4; /* GC4 waveform mode */
int mode_gc8; /* GC8 waveform mode */
int mode_gc16; /* GC16 waveform mode */
int mode_gc32; /* GC32 waveform mode */
};
struct mxcfb_alt_buffer_data {
__u32 phys_addr; /* physical address of alternate image buffer
*/
__u32 width; /* width of entire buffer */
__u32 height; /* height of entire buffer */
struct mxcfb_rect alt_update_region; /* region within buffer to
update */
};
struct mxcfb_update_data {
struct mxcfb_rect update_region; /* 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
*/
int temp; /* 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; };
The table below lists the source files associated with the EPDC driver and headers for
programming access.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following Linux kernel configuration options are provided for the EPDC module:
• CONFIG_FB_MXC_EINK_PANEL - support for the Electrophoretic Display Controller.
In menuconfig, select Device Drivers > Graphics Support > E-Ink Panel Framebuffer
• CONFIG_FB_MXC_EINK_V2_PANEL - support for v2 Electrophoretic Display
Controller. In menuconfig, this option is available with Device Drivers > Graphics
support > E-Ink Panel Framebuffer based on EPDC V2
• CONFIG_FB - includes frame buffer support and is enabled by default. In menuconfig
select Device Drivers > Graphics support > Support for frame buffer devices
• CONFIG_MXC_PXP_V2 - support for the PxP and required by the EPDC driver for
processing (color space conversion, rotation, auto-waveform selection) framebuffer
update regions. In menuconfig select Device Drivers > DMA Engine support > MXC
PxP support
• CONFIG_MXC_PXP_V3 - support for next level PxP and required by Generation-II
EPDC driver for processing framebuffer update regions. In menuconfig select Device
Drivers > DMA Engine support > MXC PxP V3 support
6.4.6 High-Definition Multimedia Interface (HDMI) and Display Port (DP) Overview
6.4.6.1 Introduction
High-Definition Multimedia Interface (HDMI) and Display Port (DP) present high defintion
video. The HDMI module is supported on some i.MX chips either with on chip solutions
or external solutions. The Display Port DP provides an embedded Display Port (eDP)
Transmitter including HDMI Tranmit (TX) Controller and PHY.
The following are compliance versions.
• HDMI 1.4 and 2.0
• DVI 1.0
• DP 1.3
• eDP 1.4
• HDCP 1.4/2.2
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Each SoC HDMI solution is presented in separate chapters. Display Port on i.MX uses
the same IP block but has a different specification. The following table lists which SOC
support HDMI and Display Port and its supported version.
The HDMI driver is divided into sub-components based on its two primary purposes:
providing video and audio to an HDMI sink device.
The video display driver component and audio driver component require an additional
core driver component to manage common HDMI resources, including the HDMI
registers, clocks, and IRQ.
6.4.6.3 Core
The onchip HDMI i.MX solutions support a core driver that manages resources that must
be shared between the HDMI audio and video drivers. The HDMI audio and video drivers
depend on the HDMI core driver, and the HDMI core driver should always be loaded and
initialized before audio and video. The core driver serves the following functions:
• Map the HDMI register region and provide APIs for reading and writing to HDMI
registers.
• Perform one-time initialization of key HDMI registers.
• Initialize the HDMI IRQ and provide shared APIs for enabling and disabling the IRQ.
• Provide a means for sharing information between the audio and video drivers (e.g., the
HDMI pixel clock).
• Provide a means for synchronization between HDMI video and HDMI audio while
blank/unblank, plug in/plug out events happen. HDMI audio cannot start work while
HDMI cable is in the state of plug out or HDMI is in state of blank. Every time HDMI
audio starts a playback, HDMI audio driver should register its PCM into core driver and
unregister PCM when the playback is finished. Once HDMI video blank or cable plug
out event happens, core driver would pause HDMI audio DMA controller if its PCM
is registered. When HDMI is unblanked or cable plug in event happens, core driver
would firstly check if the cable is in the state of plug in, the video state is unblank and
the PCM is registered. If items listed above are all yes, core driver would restart HDMI
audio DMA.
The following sequence of software activities occurs in the OS boot flow to connect the
HDMI display device to the i.MX Frame Buffer driver through the MXC Display Driver
system:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Once the connection between the i.MX frame buffer driver and the HDMI has been
established through the 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 i.MX
Frame Buffer Driver are conducted through the Linux Frame Buffer APIs. The following
list demonstrates the software flow to recognize a HDMI sink device and configure the
ELCDIF FB driver to drive video output:
1. The HDMI video driver receives a hotplug interrupt and reads the EDID from
the HDMI sink device constructing a list of video modes from the retrieved EDID
information. Using either the video mode string from the Linux kernel command line
(for the initial connection) or the most recent video mode (for a later HDMI cable
connection), the HDMI driver selects a video mode from the mode list that is the
closest match.
2. The HDMI video driver calls fb_set_var() to change the video mode in the i.MX
Frame Buffer driver. The i.MX Frame Buffer driver completes its reconfiguration for
the new mode.
3. As a result of calling fb_set_var(), a Frame Buffer notification is sent back to the
HDMI driver indicating that an FB_EVENT_MODE_CHANGE has occurred. The
HDMI driver configures the HDMI hardware for the new video mode.
4. Finally, the HDMI module is enabled to generate output to the HDMI sink device.
The i.MX Frame Buffer Driver will align to the display interface specific to each SoC as
noted for each SoC HDMI chapter.
6.4.6.6 Audio
Since the HDMI Tx audio driver uses the ALSA SoC framework, it is broken into several
files as listed in the source code structure sections of each hdmi chapter. Most of the
code is in the platform DMA driver (sound/soc/imx/imx-hdmi-dma.c) and the CODEC
driver (sound/soc/codecs/mxc_hdmi.c). The machine driver (sound/soc/imx/imx-hdmi.c)
allocates the SoC audio device and links all the SoC components together. The DAI
driver (sound/soc/imx/imx-hdmi-dai.c) is a SoC requirements. It is primarily used to get
the platform data.
The HDMI CODEC driver does most of the initialization of the HDMI audio sampler. Note
that the HDMI Tx block only implements the AHB DMA audio and not the other audio
interfaces (SSI, S/PDIF, etc). The other main function of the HDMI CODEC driver is to set
up a struct of the IEC header information which needs to go into the audio stream. Since
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
the struct is hooked into the ALSA layer, IEC settings will be accessible in userspace
using the ‘iecset’ utility.
The platform DMA driver handles the HDMI Tx block DMA engine. Note that HDMI audio
uses the HDMI block DMA as well as SDMA. SDMA is used to implement the multi-
buffer mechanism. Since the HDMI Tx block does not automatically merge the IEC audio
header information into the audio stream, the platform DMA driver does the merging
by using hdmi_dma_copy() (for no memory map use) or hdmi_dma_mmap_copy() (for
memory map mode use) function before sending the buffers out. Note that, due to IEC
audio header adding operation, it is possible that the user space application may not
be able to get enough CPU periods to feed the data into HDMI audio driver in time,
especially when system loading is high. In this case, some spark noise will be heard. In a
different audio framework (ALSA LIB, or PULSE AUDIO), a different log about this noise
may be printed. For example, in ALSA LIB, logs like "underrung!!! at least * ms is lost" are
printed.
HDMI audio playback depends on HDMI pixel clock. Therefore, while in the state of
HDMI blank and cable plug out, HDMI audio is either stopped or can't be played. See
detailed information in software_operation_core.
Note that, because HDMI audio driver needs to add the IEC header, the driver needs to
know the amount of data already written into the HDMI audio driver. If application is not
able to decipher the amount of data written, for example DMIX plugin in ALSA LIB, the
HDMI audio driver is not able to work properly. There will be no sound heard.
The HDMI audio supports the features below:
• Playback sample rate
– 32k, 44.1k, 48k, 88.2k, 96k, 176.4k, 192k
– HDMI sink capability
• Playback Channels:
– 2, 4, 6, 8
– HDMI sink capability
• Playback audio formats:
– SNDRV_PCM_FMTBIT_S16_LE
6.4.6.7.1 Introduction
The High-Definition Multimedia Interface (HDMI) driver supports the on-chip Cadence
HDTX IP module on the i.MX 8QuadMax and iMX 8MQuad providing capability to
transfer uncompressed video, audio, and data using a single cable. The HDMI driver is
divided into three sub-components: A video display device driver that integrates with the
DPU/DCSS DRM driver, an audio driver that integrates with the ALSA/SoC sub-system,
and a core API driver which manages the shared software and hardware resources of the
HDMI driver.
HDTX IP supports the following features:
• Compliant with HDMI 2.0 Specification.
• Supports up to 600 Mhz pixel CLK.
• All video formats are supported, including dual-vide, stereo, and all colorimetry options
(RGB, YCbCr444/422, and YCbCr420).
• These audio formats are supported: PCM, HBR, DST, one-bit-audio, multi-stream, and
3D audio.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The HD Display controller integrates a CPP (uCPU) running the embedded Firmware
(FW). The firmware manages the HD Display link and provides side-band channel
communication. The firmware is not involved in the data-path (video, audio, or info-
frames).
The host processor interfaces to the HD Display controller over APB-interface. The host
processor manages the HD Display Controller in one or more of the following methods:
• Direct access to the HW registers for debugging purposes.
• Direct access to I-MEM and D-MEM (during boot) for FW download.
• Direct access to the HW registers of designated HW modules during operational mode
(modules that are not controlled by the FW).
• Indirect access to the HW registers of designated HW modules during
operational mode, by communicating with FW over the command interface (using
GENERAL_WRITE_REGISTER and GENERAL_READ_REGISTER commands).
• Communication with different FW modules over a mailbox using the command
interface.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The HDMI driver is divided into sub-components based on its two primary purposes:
providing HDP DRM driver and Core API driver.
The HDP DRM driver require a Core API driver component to the configurated HDMI FW.
The HDMI driver has three software components: MHDP DRM Bridge and Core API
driver, MHDP i.MX 8 platform driver, and HDMI audio driver.
There are three main Linux kernel configuration options used to select and include HDMI
driver functionality in the Linux OS image.
The CONFIG_DRM_CDNS_MHDP option provides support for the MHDP DRM Bridge
and Core API driver, and can be selected in menuconfig at the following menu location:
Device Drivers > Graphics support >Display Interface Bridges > Cadence MHDP
COMMON API driver
The CONFIG_DRM_IMX_CDNS_MHDP option provides support for the i.MX 8 HDMI/DP
video driver, and can be selected in menuconfig at the following menu location:
Device Drivers > Graphics support > NXP i.MX MX8 DRM HDMI/DP
The CONFIG_SND_SOC_IMX_CDNHDMI option provides support for HDMI audio
through the ALSA/SoC subsystem, and can be found in menuconfig at the following
location:
Device Drivers > Sound card support > Advanced Linux Sound Architecture > ALSA for
SoC audio support > SoC Audio support for CDN - HDMI
6.4.6.8.1 Introduction
The High-Definition Multimedia Interface (HDMI) driver supports the on-chip DesignWare
HDMI hardware module on the i.MX 6QuadPlus, 6Quad and 6Dual SoC, This driver
provides the capability to transfer uncompressed video, audio, and data using a single
cable.
The HDMI driver is divided into four sub-components:
• Video display device driver that integrates with the Linux Frame Buffer API
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The video input to the HDMI is configurable and may come from either of the two IPU
modules in the i.MX 6 serials and from either of the two Display Interface (DI) ports of
the IPU, DI0 or DI1. This configuration is controlled through the IOMUX module using
the HDMI_MUX_CTRL register field. See the figure below for an illustration of this
interconnection.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The HDMI driver is divided into sub-components based on its two primary purposes:
providing video and audio to an HDMI sink device.
The video display driver component and audio driver component require an additional
core driver component to manage common HDMI resources, including the HDMI
registers, clocks, and IRQ. The following diagram illustrates both the interconnection
between the various HDMI sub-drivers and the interconnection between the HDMI video
driver and the Linux Frame Buffer subsystem.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.4.6.8.3 CEC
HDMI CEC is a protocol that provides high-level control functions between all of the
various audiovisual products is a user’s environment. The HDMI CEC driver implements
software part of HDMI CEC low Level protocol. It includes getting Logical address, CEC
message sending and receiving, error handle, message re-transmitting, etc.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The HDMI source code is provided in the HDMI core driver, the HDMI display driver, and
the HDMI audio driver.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
There are three main Linux kernel configuration options used to select and include HDMI
driver functionality in the Linux OS image.
HDMI video support is dependent on support for the Synchronous Panel Framebuffer
and also on the inclusion of IPUv3 support.
CONFIG_FB_MXC_HDMI provides support for the HDMI video driver and can be
selected with Device Drivers > Graphics support > Support for frame buffer devices >
MXC HDMI driver support
CONFIG_SND_SOC_IMX_HDMI provides support for HDMI audio through the ALSA/
SoC subsystem, and can be selected with Device Drivers > Sound card support >
Advanced Linux Sound Architecture > ALSA for SoC audio support > SoC Audio support
for IMX - HDMI
Selecting either of the previous two configuration options will cause the MXC HDMI Core
configuration option, CONFIG_MFD_MXC_HDMI, to be selected. This option can be
selected wtih Device Drivers > Multifunction device drivers > MXC HDMI Core
CONFIG_MXC_HDMI_CEC option provides support for the HDMI CEC driver, and can
be selected with Device Drivers > MXC support drivers > MXC HDMI CEC (Consumer
Electronic Control) support
6.4.6.9.1 Introduction
The High Definition Multimedia Interface (HDMI) driver supports the external SiI9022
HDMI hardware module providing capability to transfer uncompressed video, audio, and
data using a single cable.
The HDMI driver is divided into two sub-components: a video display device driver that
integrates with the Linux Frame Buffer API and an S/PDIF audio driver that transfers S/
PDIF audio data to SiI9022 HDMI hardware module.
The HDMI driver is only for demo application and supports the following features:
• HDMI video output supports 1080p60 and 720p60 resolutions.
• Support for reading EDID information from an HDMI sink device for video.
• Hotplug detection
• HDMI audio playback (2 channels, 16/24 bit, 44.1 KHz sample rate)
External HDMI is supported on i.MX 6 7ULP SoC.
Output data is transmitted via three Transition-Minimized Differential Signaling (TMDS)
channels to an HDMI sink device external to the SoC. Additionally, the HDMI carries a
VESA Data Display Channel (DDC). DDC is an I2C interface which allows the HDMI
source to query the HDMI sink for Extended Display Identification Data (EDID). A CEC
channel provides optional high-level control functions between the source and sink
devices.
The HDMI driver is divided into sub-components based on its two primary purposes:
providing video and audio to an HDMI sink device.
The audio output depends on video display.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The source code for the HDMI driver is divided into the HDMI display driver and HDMI
audio driver.
The HDMI display driver source is available in drivers/video/fbdev/mxc. The HDMI Audio
driver source is in sound/soc/fsl
There are two main Linux kernel configuration options used to select and include HDMI
driver functionality in the Linux OS image.
The following configuration options are required to enable HDMI support.
The CONFIG_FB_MXS_SII902X option provides support for the Sii902x HDMI video
driver and can be selected with Device Drivers > Support for frame buffer devices > Si
Image SII9022 DVI/HDMI Interface Chip.
HDMI video on i.MX 6Sololite is dependent on MXC ELCDIF Framebuffer.
The CONFIG_SND_SOC_IMX_SII902X option provides support for the HDMI Audio
driver and can be selected with Device Drivers > Sound card support > ALSA for SoC
audio support > ommon SoC Audio options for Freescale CPUs: > SoC Audio support for
i.MX boards with sii902x
6.5.1 Introduction
The Video for Linux Two (V4L2) driver is plug-in for the V4L2 framework that enables
support for camera capture and display.
Some i.MX SoC support V4L2 based on the associated images processing units and
capture hardware.
For more information on V4L2 go to the API specification for Linux Video for Linux 2
available at Linux Media Subsystem Documentation.
The V4L2 APIs enable camera and display controls but i.MX 8 only supports V4L2
capture and not display using the DPU instead for display control. i.MX 6 and i.MX 7 use
both capture and display V4L2.
The Video for Linux Two (V4L2) driver on i.MX 8 is plug-in for the V4L2 framework that
enables support for camera capture only with the Display Processing Unit (DPU).
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The V4L2 DPU camera driver supports only basic capture. The V4l2 capture device
takes incoming video images, either from a camera or a TV decoder, and captures the
images to memory. The features supported by the V4L2 driver are as follows:
• RGB 24-bit and YUV 4:2:2 interleaved formats for capture interface
• Plug-in of different sensor drivers
• Streaming (queued) input buffer
• Programmable input and output pixel format and size
• RGB 16, 24, and 32-bit, YUV 4:2:0, and 4:2:2 interleaved input formats
The command modprobe mxc_v4l2_capture must be run before using V4L2 camera
functions.
The Video for Linux Two (V4L2) drivers for PxP are used for dsiplay output only.
The Video for Linux Two (V4L2) drivers are plug-ins to the V4L2 framework that enable
support for camera and preprocessing functions, as well as video and post-processing
functions. The V4L2 camera driver implements support for all camera-related functions.
The V4l2 capture device takes incoming video images, either from a camera or a stream,
and manipulates them. The output device takes video and manipulates it, then sends it to
a display or similar device.
The features supported by the IPU V4L2 driver are the follows:
• Direct preview and output to SDC foreground overlay plane (with synchronized to LCD
refresh)
• Direct preview to graphics frame buffer (without synchronized to LCD refresh)
• Color keying or alpha blending of frame buffer and overlay planes
• Streaming (queued) capture from IPU encoding channel
• Direct (raw Bayer) still capture (sensor dependent)
• Programmable pixel format, size, frame rate for preview and capture
• Programmable rotation and flipping using custom API
• RGB 16-bit, 24-bit, and 32-bit preview formats
• Raw Bayer (still only, sensor dependent), RGB 16, 24, and 32-bit, YUV 4:2:0 and 4:2:2
planar, YUV 4:2:2 interleaved, and JPEG formats for capture
• Control of sensor properties including exposure, white-balance, brightness, contrast,
and so on
• Plug-in of different sensor drivers
• Link post-processing resize and CSC, rotation, and display IPU channels
• Streaming (queued) input buffer
• Double buffering of overlay and intermediate (rotation) buffers
• Configurable 3+ buffering of input buffers
• Programmable input and output pixel format and size
• Programmable scaling and frame rate
• RGB 16, 24, and 32-bit, YUV 4:2:0 and 4:2:2 planar, and YUV 4:2:2 interleaved input
formats
• TV output
The command modprobe mxc_v4l2_capture must be run before V4L2 functions.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
drivers/media/platform/mxc/capture/
.
The V4L2 capture device driver is in the mxc_v4l2_capture.c file. The low level overlay
driver is in the ipu_fg_overlay_sdc.c, ipu_bg_overlay_sdc.c
This code (ipu_prp_enc.c) interfaces with the IPU ENC hardware, and ipu_still.c
interfaces with the IPU CSI hardware. Sensor frame rate control is handled by
VIDIOC_S_PARM ioctl. Before the frame rate is set, the sensor turns on the AE and
AWB turn on. The frame rate may change depending on light sensor samples.
Drivers for specific cameras can be found in
drivers/media/platform/mxc/capture/
Currently, the memory map stream API is supported. Supported V4L2 IOCTLs include
the following:
• VIDIOC_QUERYCAP
• VIDIOC_G_FMT
• VIDIOC_S_FMT
• VIDIOC_REQBUFS
• VIDIOC_QUERYBUF
• VIDIOC_QBUF
• VIDIOC_DQBUF
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• VIDIOC_STREAMON
• VIDIOC_STREAMOFF
• VIDIOC_OVERLAY
• VIDIOC_G_FBUF
• VIDIOC_S_FBUF
• VIDIOC_G_CTRL
• VIDIOC_S_CTRL
• VIDIOC_CROPCAP
• VIDIOC_G_CROP
• VIDIOC_S_CROP
• VIDIOC_S_PARM
• VIDIOC_G_PARM
• VIDIOC_ENUMSTD
• VIDIOC_G_STD
• VIDIOC_S_STD
• VIDIOC_ENUMOUTPUT
• VIDIOC_G_OUTPUT
• VIDIOC_S_OUTPUT
V4L2 control code has been extended to provide support for rotation. The ID is
V4L2_CID_PRIVATE_BASE. Supported values include:
• 0-Normal operation
• 1-Vertical flip
• 2-Horizontal flip
• 3-180° rotation
• 4-90° rotation clockwise
• 5-90° rotation clockwise and vertical flip
• 6-90° rotation clockwise and horizontal flip
• 7-90° rotation counter-clockwise
The figure below shows a block diagram of V4L2 Capture API interaction.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
This section describes a sample V4L2 capture process. The application completes the
following steps:
1. Sets the capture pixel format and size by IOCTL VIDIOC_S_FMT.
2. Sets the control information by IOCTL VIDIOC_S_CTRL for rotation usage.
3. Requests a buffer using IOCTL VIDIOC_REQBUFS. The common V4L2 driver
creates a chain of buffers (currently the maximum number of frames is 3).
4. Memory maps the buffer to its user space.
5. Queues buffers using the IOCTL command VIDIOC_QBUF.
6. Starts the stream using the IOCTL VIDIOC_STREAMON. This IOCTL enables the
i.MX Processing Enginee tasks and the IDMA channels. When the processing is
completed for a frame, the driver switches to the buffer that is queued for the next
frame. The driver also signals the semaphore to indicate that a buffer is ready.
7. Takes the buffer from the queue using the IOCTL VIDIOC_DQBUF. This IOCTL
blocks until it has been signaled by the ISR driver.
8. Stores the buffer to a YCrCb file.
9. Replaces the buffer in the queue of the V4L2 driver by executing VIDIOC_QBUF
again.
For the V4L2 still image capture process, the application completes the following steps:
1. Sets the capture pixel format and size by executing the IOCTL VIDIOC_S_FMT.
2. Reads one frame still image with YUV422.
FOr the V4L2 overlay support use case, the application completes the following steps:
1. Sets the overlay window by IOCTL VIDIOC_S_FMT.
2. Turns on overlay task by IOCTL VIDIOC_OVERLAY.
3. Turns off overlay task by IOCTL VIDIOC_OVERLAY.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
drivers/media/platform/mxc/output/mxc_vout.c
Currently, the memory map stream API is supported. Supported V4L2 IOCTLs include
the following:
• VIDIOC_QUERYCAP
• VIDIOC_REQBUFS
• VIDIOC_G_FMT
• VIDIOC_S_FMT
• VIDIOC_QUERYBUF
• VIDIOC_QBUF
• VIDIOC_DQBUF
• VIDIOC_STREAMON
• VIDIOC_STREAMOFF
• VIDIOC_G_CTRL
• VIDIOC_S_CTRL
• VIDIOC_CROPCAP
• VIDIOC_G_CROP
• VIDIOC_S_CROP
• VIDIOC_ENUM_FMT
The V4L2 control code has been extended to provide support for de-interlace motion. For
this use, the ID is V4L2_CID_MXC_MOTION. Supported values include the following:
• 0-Medium motion
• 1-Low motion
• 2-High motion
This section describes a sample V4L2 output process that uses the V4L2 output APIs.
The application completes the following steps:
1. Sets the input pixel format and size using IOCTL VIDIOC_S_FMT.
2. Sets the control information using IOCTL VIDIOC_S_CTRL, for rotation, de-interlace
motion(if needed).
3. Sets the output information using IOCTL VIDIOC_S_CROP.
4. Requests a buffer using IOCTL VIDIOC_REQBUFS. The common V4L2 driver
creates a chain of buffers (not allocated yet).
5. Memory maps the buffer to its user space.
6. Executes the IOCTL VIDIOC_QUERYBUF to query buffers.
7. Passes the data that requires post-processing to the buffer.
8. Queues the buffer using the IOCTL command VIDIOC_QBUF.
9. Executes the IOCTL VIDIOC_DQBUF to dequeue buffers.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following table lists the source and header files associated with the V4L2 drivers.
These files are available in drivers/media/platform/mxc
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.6.1 Introduction
The video analog-to-digital converter (VADC) consists of an analog video front end
(AFE), and a digital video decoder. The AFE accepts NTSC or PAL input from a device,
such as an analog camera.
The two parts are configured in the VADC driver. The video decoder outputs the
YUV444-formatted data.
The Video ADC has the following features:
• Internal voltage and current reference generator
• 10-bit resolution (9.5 bit ENOB at 66.5 Msps)
• 4 analog inputs, with all inputs available for CVBS
• Programmable anti-aliasing filter, gain, and clamp
The video decoder has the following features:
• NTSC/PAL decoder
• Direct data path (no complex resampling)
• Automatic standards detection
• 2D adaptive comb filter
• Datapath/clocking architecture encompasses a time base corrector for VCR signals
• Luma passband is flat to > 6 MHz
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The VADC input selected to vin1 and CSI2 is used to capture the VADC data.
6.7.1 Introduction
The VPU hardware performs all of the codec computation and most of the bitstream
parsing/packeting. Therefore, the software takes advantage of less control and effort to
implement a complex and efficient multimedia codec system.
Different VPUs are supported on i.MX 6 and i.MX 8 SoC. The following table lists the
different VPUs.
Note:
Malone is decoder while Windsor is encoder. Both comes from Amphion.
Hantro stands for the following providers:
• hantro/ (8mq/8mp decoder)
• hantro_845/ (8mini decoder)
• hantro_845_h1/ (8mini encoder)
• hantro_vc8000e (8mp encoder)
in user-space calls related IOCTLs and codec library functions to implement a complex
codec system.
The VPU kernel driver includes the following functions:
• Module initialization which initializes the module with the device-specific structure
• Device initialization which initializes the VPU clock and hardware and request the IRQ
• Interrupt servicing routine which supports events that one frame has been finished
• File operation routine which provides the following interfaces to user space:
• File open
• File release
• File IOCTL to provide interface for memory allocating and releasing
• Memory map for register and memory accessing in user space
The VPU user space driver has the following functions:
• Codec lib
• Initializes codec system
• Sets codec system configuration
• Controls codec system by command
• Reports codec status and result
• System I/O operation
• Requests and frees memory
• Maps and unmaps memory/register to user space
• Device management
User space application for simple verification:
• Read video raw data
• YUV file dump
• General options to configure the codec behavior
The following figure shows a simple workflow shown in the H.264 example.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
There is only a user-space programming interface for the VPU module. A user in the
application layer cannot access the kernel driver interface directly. The VPU library
accesses the kernel driver interface for users.
There is one unified interface to wrap all different video formats. The following are the
related APIs:
CODEC_STATE decoder_decode_xxx(CODEC_PROTOTYPE *
arg,STREAM_BUFFER * buf, OMX_U32 * consumed,FRAME * frame);
CODEC_STATE decoder_getinfo_xxx(CODEC_PROTOTYPE *
arg,STREAM_INFO * pkg);
CODEC_STATE decoder_setppargs_xxx(CODEC_PROTOTYPE *
codec,PP_ARGS * args);
CODEC_STATE decoder_setframebuffer_xxx(CODEC_PROTOTYPE * arg,
BUFFER *buff,OMX_U32 available_buffers);
CODEC_STATE decoder_pictureconsumed_xxx(CODEC_PROTOTYPE * arg,
BUFFER *buff);
CODEC_STATE decoder_getframe_mpeg4(CODEC_PROTOTYPE * arg, FRAME
* frame,OMX_BOOL eos);
FRAME_BUFFER_INFO
decoder_getframebufferinfo_xxx(CODEC_PROTOTYPE * arg);
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Table below lists the user-space library source files available in the i.MX 6
imx-vpu-(version)/vpu
directory:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Table below lists the firmware files available in the following directories:
firmware-imx-(version)/lib/firmware/vpu/ directory
6.8.1 Introduction
The JPEG Encoder consists of a JPEG-E-X core and a JPEG Encoder Wrapper
(JPGENCWRP). Similarly, the JPEG Decoder consists of a JPEG decoder core (JPEG-
D-X) and its corresponding wrapper.
The JPEG cores are compliant with the industry standards Baseline and Extended
ISO/IEC 10918-1 JPEG, with some limitations documented in the i.MX 8DualXPlus
Applications Processor Reference Manual (IMX8DQXPRM).
The JPEG encoder wrapper (JPGENCWRP) is used to work with the Cast JPEG
Encoder Core. It has a configuration mode and an encoding mode.
• In configuration mode, it can fetch the configuration bitstream from the system memory
and feed it to the encoder.
• In encoding mode, it can fetch the image pixel data through the AXI bus interface and
feed to the Encoder Core for encoding.
Similarly, the JPEG Decoder Wrapper provides the interface for Cast JPEG Decoder
core.
The JPEG wrappers supports multiple image encoding through context switching, by
the encoding descriptors. There are four bitstream slots. Each one can be enabled
independently by chained descriptors.
The JPEG encoder and decoder support a maximum horizontal resolution of 8K (0x2000)
pixels. The horizontal resolution needs to be integer times of 8. It is the same for the
vertical resolution. For YUV422 and YUV420, the resolution must be multiple of 16. The
image size may be up to 64K x 64K.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The hardware has the limitation that the decoded image should have at least a default
Huffman table (DHT marker section should be present in the jpeg input stream).
7 Audio
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
– SNDRV_PCM_FMTBIT_S24_LE
– Playback(ASRC enabled):
– SNDRV_PCM_FMTBIT_S16_LE
– SNDRV_PCM_FMTBIT_S24_LE
– Capture:
– SNDRV_PCM_FMTBIT_S16_LE
– SNDRV_PCM_FMTBIT_S20_3LE
– SNDRV_PCM_FMTBIT_S24_LE
The registered sound card information can be listed as follows using the commands
aplay -l and arecord -l. For example, the stereo sound card is registered as card 0.
root@ /$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2
The WM8958, WM8960, and WM8962 CODEC are registered as an I C client when
the module initializes. The 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.
The 7.1 audio codec includes 8-channel DAC and 4-channel ADC, which are controlled
by the I2C interface. The audio data is transferred from the user data buffer to the ESAI
fifo, through a DMA channel. The DMA channel is selected according to audio sample
bits. The codec works in slave mode as the ESAI provides the BCLK and LRCLK. The
BCLK and LRCLK can be configured according to the audio sample rate. The ESAI
supports up to eight audio output ports. While enabling ASRC, 7.1 audio codec supports
2 or 6 channel playback through ASRC. On the i.MX 6 Sabre ARD board, a CS42888
codec with 4 audio in port is used, each port receive two channels of data in the I2S
format(network mode), providing 8-channel of playback functionality. This codec also has
2 audio output port connected with ESAI, providing 4-channel of recording functionality.
The codec driver is generic and hardware independent code that configures the codec to
provide audio capture and playback. It does not contain code that is specific to the target
platform or machine. The codec driver handles:
• Codec DAI and PCM configuration
• Codec control I/O-using I2C
• Mixers and audio controls
• Codec audio operations
• DAI Digital mute control
The CS42888 codec is registered as an I2C client when the module initializes. The APIs
are exported to the upper layer by the structure snd_soc_dai_ops.
The AM/FM codec is a virtual codec, it only has a PCM interface connected to the Tuner
device. The audio data is transferred from the user data buffer to or from the SSI FIFO
through the DMA channel. The DMA channel is selected according to the audio sample
bits. AUDMUX is used to set up the path between the SSI port and the output port which
connects with the codec. The codec works in master mode as it provides the BCLK and
LRCLK. The BCLK and LRCLK can be configured according to the audio sample rate.
File imx-pcm-dma.c is shared by the stereo ALSA SoC driver, the 7.1 ALSA SoC driver
and other CODEC driver. This file is responsible for preallocating DMA buffers and
managing DMA channels.
The stereo CODEC is connected to the CPU through the SSI interface. fsl_ssi.c registers
the CPU DAI driver for the stereo ALSA SoC and configures the on-chip SSI interface.
wm8962.c registers the stereo CODEC and hifi DAI drivers. The direct hardware
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
operations on the stereo codec are in wm8994.c, wm8960.c, and wm8962.c. imx-
wm8958.c, imx-wm8960.c and imx-wm8962.c are the machine layer codes, which create
the driver device and register the stereo sound card.
The multichannel codec is connected to the CPU through the ESAI interface. fsl_esai.c
registers the CPU DAI driver for the stereo ALSA SoC and configures the on-chip ESAI
interface. cs42888.c registers the multichannel CODEC and hifi DAI drivers. The direct
hardware operations on the multichannel CODEC are in cs42888.c. imx-cs42888.c is the
machine layer code which creates the driver device and registers the stereo sound card.
The AM/FM CODEC is connected to the CPU through the SSI interface. fsl_ssi.c
registers the CPU DAI driver for the stereo ALSA SoC and configures the on-chip
SSI interface. si476x.c registers the Tuner CODEC and Tuner DAI drivers. The direct
hardware operations on the CODEC are in si476x.c. imx-si476x.c is the machine layer
code which creates the driver device and registers the sound card.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Documentation/devicetree/bindings/sound/imx-audmux.txt
• Documentation/devicetree/bindings/sound/imx-audio-wm8962.txt
• Documentation/devicetree/bindings/sound/imx-audio-cs42888.txt
• Documentation/devicetree/bindings/sound/imx-audio-si476x.txt
The following table shows the stereo codec SoC driver source in sound/soc/fsl.
Table below lists the AM/FM codec SoC driver source files. These files are under
sound/soc.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Table below shows the multiple-channel ADC SoC driver source files.
The following Linux kernel configuration options are provided for this module.
• SoC Audio supports for WM8958, WM8960, and WM8962 CODEC. In menuconfig, this
option is available:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
7.2.1 Introduction
The Asynchronous Sample Rate Converter (ASRC) converts the sampling rate of a
signal to a signal of different sampling rate. The ASRC supports concurrent sample
rate conversion of up to 10 channels. The sample rate conversion of each channel is
associated to a pair of incoming and outgoing sampling rates. The ASRC supports up to
three sampling rate pairs simultaneously.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
As illustrated in the figure above, the ASRC stream interface provides the interface for
the user space. The ASRC registers itself under /dev/mxc_asrc and creates proc file /
proc/driver/asrc when the module is inserted. proc is used to track the channel number
for each pair. If all the pairs are not used, users can adjust the channel number through
the proc file. The number of the total channels should be ten, or else the adjusted value
cannot be saved properly.
Memory to ASRC to peripheral audio path is involved in 7.1 audio codec driver. In 7.1
audio sound card, a new device with the name "cs42888audio [cs42888-audio], device
1: HiFi-ASRC-FE (*)" is specified for playback and capture with ASRC. The steps below
show the flow of calling ASRC to memory to peripheral:
• The sound device(PCM) has been registered and start to enable the DMA channel in
ALSA driver
• Request ASRC pair - fsl_asrc_request_pair
• Configure ASRC pair - fsl_asrc_config_pair
• Enable the DMA channel from Memory to ASRC and from ASRC to Memory
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Then the ASRC driver can only be configured with the build-in module.
The functions of device tree bindings for ASRC M2M are as follows:
• compatible: Compatible list, must contain "fsl,imx6q-asrc".
• reg: Offset and length of the register set for the device.
• interrupts: Contains the asrc interrupt.
• clocks: Contains an entry for each entry in clock-names.
• clock-names: Must contain "mem", "ipg", "asrck", and "dma". (Generally, "dma" is used
for SPBA clock.)
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The ASRC Exported API allows the ALSA driver to use ASRC services.
The ASRC IOCTLs below are used for user space applications:
ASRC_REQ_PAIR:
Apply a pair from ASRC driver. Once a pair is allocated, ASRC core clock is enabled.
ASRC_CONFIG_PAIR:
Configure ASRC pair allocated. User is responsible for providing parameters defined in
struct asrc_config. Items in asrc_config is listed below:
• pair: ASRC pair allocated by the IOCTL(ASRC_REQ_PAIR).
• channel_num: channel number.
• buffer_num: buffer number need for input and output buffer use.The input/output
buffers are allocated inside ASRC driver. User is responsible for remap it into user
space.
• dma_buffer_size: buffer size for input and output buffers. The buffer size should be in
the unit of page size. Usually, 4k bytes is used.
• input_sample_rate: input sampling rate. Input sample rate should be in 5.512k, 8k,
11.025k, 16k, 22k, 32k, 44.1k, 48k, 64k, 88.2k 96k, 176.4k, 192k.
• output_sample_rate: output sampling rate. Output sampling rate should be in 32k,
44.1k, 48k, 64k, 88.2k, 96k, 176.4k 192k.
• input_word_width: word width of input audio data. The input data word width can be 16
bit or 24 bit.
• output_word_width: word width of output audio data. The output data word width can
be 16 bit or 24 bit.
• inclk: the input clock source can be ESAI RX clock, SSI1 RX clock, SSI2 RX clock,
SPDIF RX clock, MLB_clock, ESAI TX clock, SSI1 TX clock, SSI2 TX clock, SPDIF TX
clock, ASRCLK1 clock, NONE. If using clock except NONE, user should make sure
that the clock is available.
• outclk: the output clock source is the same as the input clock source.
ASRC_CONVERT:
Convert the input data into output data according to the parameters set by
ASRC_CONFIG_PAIR. Driver would copy input_buffer_length bytes data from the
input_buffer_vaddr for convert. After convert, driver fill the output_buffer_length
according to data number generated by ASRC and copy output_buffer_length to
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
7.3.1 Introduction
HDMI Audio is covered in the HDMI overview chapter in video. See HDMI Audio for
more details.
7.4.1 Introduction
The Sony/Philips Digital Interface (S/PDIF) audio module is a stereo transceiver that
allows the processor to receive and transmit digital audio. The S/PDIF transceiver allows
the handling of both S/PDIF channel status (CS) and User (U) data. The frequency
measurement block allows the S/PDIF RX section to derive the receive clock from the
incoming S/PDIF stream.
The figure below shows the block diagram of the S/PDIF interface.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The S/PDIF driver is designed under ALSA System on Chip (ASoC) layer. The ASoC
driver for S/PDIF provides one playback device for Tx and one capture device for Rx.
The playback output audio format can be linear PCM data or compressed data with 16-
bit, 20-bit, and 24-bit audio. The allowed sampling bit rates are 44.1, 48 or 32 KHz. The
capture input audio format can be linear PCM data or compressed 24-bit data and the
allowed sampling bit rates are from 16 to 96 KHz. The driver provides the same interface
for PCM and compressed data transmission.
The ASoC layer divides audio drivers for embedded platforms into separate layers that
can be reused. ASoC divides an audio driver into a codec driver, a machine layer, a DAI
(digital audio interface) layer, and a platform layer. The Linux kernel documentation has
some concise description of these layers in linux/Documentation/sound/alsa/soc. In the
case of the S/PDIF driver, we are able to reuse the platform layer (imx-pcm-dma.c) that
is used by the ssi stereo codec driver and also the generic dummy codec driver useful for
DAI links creation without a real codec.
Subdevices: 1/1
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The "iecset" utility provides a common method to set or dump the IEC958 status bits.
#iecset -c 0
Before S/PDIF playback, the configuration, interrupt, clock and channel registers are
initialized. During S/PDIF playback, the channel status bits are fixed. The DMA and
interrupts are enabled. S/PDIF has 16 TX sample FIFOs on Left and Right channel
respectively. When both FIFOs are empty, an empty interrupt is generated if the empty
interrupt is enabled. If no data are refilled in the 20.8 μs (1/48000), an underrun interrupt
is generated. Overrun is avoided if only 16 sample FIFOs are filled for each channel
every time. If auto re-synchronization is enabled, the hardware checks if the left and right
FIFO are in sync, and if not, it sets the filling pointer of the right FIFO to be equal to the
filling pointer of the left FIFO and an interrupt is generated.
The S/PDIF transmitter driver provides one ALSA mixer sound control interface to the
user besides the common PCM operations interface. It provides the interface for the user
to write S/PDIF channel status codes into the driver so they can be sent in the S/PDIF
stream. The input parameter of this interface is the IEC958 digital audio structure shown
below, and only status member is used:
struct snd_aes_iec958 {
unsigned char status[24]; /* AES/IEC958 channel status
bits */
unsigned char subcode[147]; /* AES/IEC958 subcode bits */
unsigned char pad; /* nothing */
unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
};
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For example:
root@ ~$ arecord -l
Subdevices: 1/1
Subdevices: 1/1
#iecset -c 1
Before the driver can read a data frame from the S/PDIF receiver FIFO, it must wait for
the internal DPLL to be locked. Using the high-speed system clock, the internal DPLL
can extract the bit clock (advanced pulse) from the input bit stream. When this internal
DPLL is locked, the LOCK bit of PhaseConfig Register is set and the driver configures
the interrupt, clock and SDMA channel. After that, the driver can receive audio data,
channel status, user bits and valid bits concurrently.
For channel status reception, a total of 48 channel status bits are received in two
registers. The driver reads them out when a user application makes a request.
For user bits reception, there are two modes for User Channel reception: CD and non-
CD. The mode is determined by the USyncMode (bit 1 of CDText_Control register). User
can call the sound control interface to set the mode (see Table 82), but no matter what
the mode is, the driver handles the user bits in the same way. For the S/PDIF Rx, the
hardware block copies the Q bits from the user bits to the QChannel registers and puts
the user bits in UChannel registers. The driver allocates two queue buffers for both U
bits and Q bits. The U bits queue buffer is 96x2 bytes in size, the Q bits queue buffer is
12x2 bytes in size, and queue buffers are filled in the U/Q Full, Err and Sync interrupt
handlers. This means that the user can get the previous ready U/Q bits while S/PDIF
driver is reading new U/Q bits.
For valid bit reception, S/PDIF Rx hardware block triggers an interrupt and set interrupt
status upon reception. A sound control interface is provided for the user to get the status
of this valid bit.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The S/PDIF Rx driver provides interfaces for user application as shown in table below.
[1] The mode column shows the interface attribute: r (read) or w (write)
[2] The sound control type of interface is called by the snd_ctl_xxx() alsa-lib function
The user application can follow the program flow from Figure 31 to use the S/PDIF Rx
driver. First, the application opens the S/PDIF Rx PCM device, waits for the DPLL to lock
the input bit stream, and gets the input sample rate. If the USyncMode needs to be set,
set it before reading the U/Q bits. Next, set the hardware parameters, including channel
number, format and capture sample rate which is obtained from the driver. Then, call
prepare and trigger to startup S/PDIF Rx stream read. Finally, call the read function to
get the data. During the reading process, applications can read the U/Q bits and channel
status from the driver and valid the no good bit.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following Linux kernel configurations are provided for this module:
In menu configuration enable the following module:
• CONFIG_SND_IMX_SPDIF - Configuration option for the S/PDIF driver:
• Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA
for SoC audio support -> SoC Audio for Freescale i.MX CPUs -> SoC Audio support for
i.MX boards with S/PDIF
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
S/PDIF Tx/Rx hardware block has many interrupts to indicate the success, exception and
event.
The driver handles the following interrupts:
• DPLL Lock and Loss Lock-Saves the DPLL lock status; this is used when getting the
Rx sample rate
• U/Q Channel Full and overrun/underrun-Puts the U/Q channel register data into queue
buffer, and update the queue buffer write pointer
• U/Q Channel Sync-Saves the ID of the buffer whose U/Q data is ready for read out
• U/Q Channel Error-Resets the U/Q queue buffer
Note: The sample rate argument in the arecord command must be consistent with the
WAV file playing on WaveLab.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
7.5.1 Introduction
Many applications require mixing of two or more audios to take different effects. Mixing
of two audio streams into a single stream can be done with Audio Mixer. Audio Mixer has
two input serial audio interfaces. These are driven by two Synchronous Audio Interface
(SAI) modules. Each input serial interface carries 8 audio channels in its frame in TDM
manner. Mixer mixes audio samples of corresponding channels from two interfaces into
a single sample. Before mixing, audio samples of two inputs can be attenuated based
on configuration. The output of the Audio Mixer is also a serial audio interface. Like input
interfaces, it has the same TDM frame format. This output is used to drive the serial DAC
TDM interface of audio codec and also sent to the external pins along with the receive
path of normal audio SAI module for readback by the CPU.
The output of Audio mixer can be selected from any of the three streams:
• Serial audio input 1
• Serial audio input 2
• Mixed audio
Mixing operation is independent of audio sample rate, but the two audio input streams
must have the same audio sample rate with the same number of channels in TDM frame
to be eligible for mixing.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Input TDM frame is de-serialized as 32 bit samples starting from frame pulse in its own
interface bit clock. Each sample passes through the attenuator. Attenuator reduces the
level of audio signal. This process is called attenuation. Attenuation of signal is done by
multiplying the audio sample with an attenuation value. The attenuation value defines the
level of audio signal at the output of attenuator. Attenuation can be enabled or disabled.
If disabled, the audio sample is passed without modification. If enabled, attenuation is
done as per the configuration that defines the attenuation value at different time (called
as attenuation profile).
There are two independent attenuators for two audio streams. Output of two attenuators
are used for mixing. Mixing is done by adding samples of corresponding channels
from two attenuators. The result gives the mixed sample value. It is then quantized to
get the desired width of audio sample. The quantized sample is rounded to form the
output sample. Rounding is done on LSB of quantized sample. The final sample is then
serialized and transmitted in the same frame format like input interfaces with selected bit
clock.
Audio Mixer interface is accessible from user space by using the amixer -c <audio
mixer card> tool. The following Audio Mixer controls are exposed to user space.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following table lists the source files for the driver.
The following Linux kernel configurations are provided for this module:
• CONFIG_SND_IMX_AMIX - Configuration option for the Audio Mixer Driver
• Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA
for SoC audio support -> SoC Audio for Freescale i.MX CPUs -> SoC Audio support for
i.MX boards with AMIX
7.6.1 Introduction
PDM is a popular way to deliver audio from microphones to the processor in several
applications, such as mobile telephones. However, current digital-audio systems use
multibit audio signal (also known as multibit PCM) to represent the signal. For this
purpose, a set of FIR, CIC or/and Half Band filters are usually implemented on DSPs or
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
software. This module implements the required digital interface to provide a 16-bit audio
signal from a PDM microphone bitstream in a configurable output sampling rate.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The Time Generator unit generates the PDM clock to the microphones. This clock is the
same for all the PDM microphones and it is active for all the microphones, i.e. there is not
possibility to turn off the PDM clock for one microphone only. It also generates the timing
signals and controls for all the filter blocks. The decimation in the filters is also controlled
by this block. It activates each block and channel and gives the start signal to FIR FSM
and Half Band FSM.
Finally, the output of each Decimation Filter is stored in a FIFO buffer. Each FIFO is
mapped in the DATACHn registers. It is possible to generate either an interrupt or a
DMA request, when in each FIFO of all enabled channels, the number of data stored
surpasses a configured watermark.
PDM Microphone interface is accessible from user space by using the amixer -c
<pdm mic card> tool. Controls are listed in the following table.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
The following table lists the source files for the driver.
The following Linux kernel configurations are provided for this module:
• CONFIG_SND_IMX_MICFIL - Configuration option for PDM Microphone Driver
• Device Drivers -> Sound card support -> Advanced Linux Sound Architecture > ALSA
for SoC audio support -> SoC Audio for Freescale i.MX CPUs -> SoC Audio support for
i.MX boards with micfil
8 Security
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Pointer to the struct device associated with the job ring for use. In the current
configuration, one or more struct device entries exist in the controller's private data block,
one for each ring.
desc Pointer to a CAAM job descriptor to be executed. The driver will map the descriptor
prior to execution, and unmap it upon completion. However, since the driver can't
reasonably know anything about the data referenced by the descriptor, it is the caller's
responsibility to map/flush any of this data prior to submission, and to unmap/invalidate
data after the request completes.
cbk Pointer to a callback function that will be called when the job has completed
processing.
areq Pointer to metadata or context data associated with this request. Often, this
can contain referenced data mapping information that request postprocessing (via the
callback) can use to clean up or release resources once complete.
Callback Function Arguments:
dev Pointer to the struct device associated with the job ring for use.
desc Pointer to the original descriptor submitted for execution.
status Completion status received back from the CAAM DECO that executed the
request. Nonzero only if an error occurred. Strings describing each error are enumerated
in error.c.
areq Metadata/context pointer passed to the original request.
Returns:
• Zero on successful job submission
• -EBUSY if the input ring was full
• -EIO if driver could not map the job descriptor
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
This table lists all installed symmetric key blockcipher algorithms by their common name,
driver name, and purpose.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Use of these services through the API is exemplified in the common conformance/
performance testing module in the kernel's crypto subsystem, known as tcrypt, visible in
the kernel source tree at crypto/tcrypt.c.
The caamhashmodule provides a connection through the Scatterlist Crypto API both for
common asynchronous hashes.
This table lists all installed asynchronous hashes by their common name, driver name,
and purpose. Note that certain platforms, such as i.MX 6, contain a low-power MDHA
accelerator, which cannot support SHA384 or SHA512.
Use of these services through the API is exemplified in the common conformance/
performance testing module in the kernel's crypto subsystem, known as tcrypt, visible in
the kernel source tree at crypto/tcrypt.c.
The caamrng module installs a mechanism to use CAAM's random number generator to
feed random data into a pair of buffers that can be accessed through /dev/random.
/dev/random is commonly used to feed the kernel's own entropy pool, which can be
used internally, as an entropy source for other random data "devices".
For more information regarding support for this service, see rng-tools available in
sourceforge.net/projects/gkernel/files/rng-tools.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
CRYPTO_DEV_FSL_CAAM
Enables building the base controller driver and the job ring backend.
CRYPTO_DEV_FSL_CAAM_RINGSIZE
Selects the size (e.g., the maximum number of entries) of job rings. This is selectable as
a power of 2 in the range of 2-9, allowing selection of a ring depth ranging from 4 to 512
entries.
The default selection is 9, resulting in a ring depth of 512 job entries.
CRYPTO_DEV_FSL_CAAM_INTC
Enables the use of the hardware's interrupt coalescing feature, which can reduce the
amount of interrupt overhead the system incurs during periods of high utilization. Leaving
this disabled forces a single interrupt for each job completion, simplifying operation, but
increasing overhead.
CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD
CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD
If coalescing is enabled, selects the count of bus clocks (divided by 64) before a
coalescing timeout where, if the count threshold has not been met, an interrupt is raised
at the end of the time period. The selection range is an integer from 1 to 65535.
The default selection is 2048.
CRYPTO_DEV_FSL_CAAM_CRYPTO_API
Enables Scatterlist Crypto API support for asynchronous blockciphers and for single-
pass autentication-encryption operations through the API using CAAM hardware for
acceleration.
CRYPTO_DEV_FSL_CAAM_AHASH_API
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Enables Scatterlist Crypto API support for asynchronous hashing through the API using
CAAM hardware for acceleration.
CRYPTO_DEV_FSL_CAAM_RNG_API
Enables use of the CAAM Random Number generator through the hwrng API. This can
be used to generate random data to feed an entropy pool for the kernels pseudo-random
number generator.
CRYPTO_DEV_FSL_CAAM_RNG_TEST
Enables a captive test to ensure that the CAAM RNG driver is operating and buffering
random data.
8.1.7 Limitations
• Components of the driver do not currently build and run as modules. This may be
rectified in a future version.
• Interdependencies exist between the controller and job ring backends, therefore they
all must run in the same system partition. Future versions of the driver may separate
out the job ring back-end as a standalone module that can run independently (and
support independent API and SM instances) in its own system partition.
• The full CAAM register page is mapped by the controller driver, and derived pointers
to selected subsystems are calculated and passed to higher-layer driver components.
Partition-independent configurations will have to map their own subsystem pointers
instead.
• Upstream variants of this driver support only Power architecture. This Arm architecture-
specific port is not upstreamed at this time, although portions may be upstreamed at
some point.
• TRNG kickstart may need to be moved to the bootloader in a future release, so that the
RNG can be used earlier.
• The Job Ring driver has a registration and de-registration functions that are not
currently necessary (and may be rewritten in future editions to provide for shutdown
notifications to higher layers.
• The full CAAM function is exclusive with the Mega/Fast mix off feature in DSM.
If CAAM is enabled, the Mega/Fast mix off feature needs to be disabled, and the
user should "echo enabled > /sys/bus/platform/devices/2100000.aips-bus/2100000.
caam/2101000.jr0/power/wakeup" after the kernel boots up, and then Mega/Fast mix
will keep the power on in DSM.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
This driver, with its kernel-level API, exposes a basic interface to allow kernel-level
services access to secure memory functionality. It is split into two pieces:
• Keystore Initialization and Maintenance Interfaces
• Keystore Access Interface
The initialization and maintenance services exist to initialize and define the instance of a
keystore interface. Likewise, the access interface allows kernel-level services to use the
API for management of security parameters.
Arguments:
dev points to a struct device established to manage resources for the secure
memory subsystem.
Arguments:
dev Points to a struct device established to manage resources for the secure
memory subsystem.
Returns: Number of detected units available for use, 0 through n - 1 may be used with
subsequent calls to all other API functions.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
Returns:
• Zero on successful return
• -EINVAL if the keystore subsystem was not initialized
• -ENOSPC if no memory was available for the allocation table and associated context
data.
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
size Desired size of data for storage in the allocated slot.
slot Pointer to the variable to receive the allocated slot number, once known.
Returns:
• Zero for successful completion.
• -EKEYREJECTED if the requested size exceeds the selected slot size.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
key_length Length (in bytes) of information to write to the slot.
key_data Pointer to buffer with the data to be loaded. Must be a contiguous buffer.
Returns:
• Zero for successful completion.
• -EFBIG if the requested size exceeds that which the slot can hold.
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
inslot Slot holding the input secret, loaded into that slot by sm_keystore_slot_load().
Note that the slot containing this secret should be overwritten or deallocated as soon as
practical, since it contains cleartext at this point.
outslot Allocated slot to hold the encapsulated output as a Secure Memory Blob.
secretlen Length of the secret to be encapsulated, not including any blob storage
overhead (blob key, MAC, etc.).
keymod Key modifier component to be used for encapsulation. The key modifier allows
an extra secret to be used in the encapsulation process. The same modifier will also be
required for decapsulation.
keymodlen Lenth of key modifier in bytes.
Returns:
• Zero on success
• CAAM job status if a failure occurs
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Points to a struct device established to manage resourcesfor the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
inslot Slot holding the input data, processed by a prior call to
sm_keystore_slot_encapsulate(), and containing a Secure Memory Blob.
outslot Allocated slot to hold the decapsulated output data in the form of a Black Key
Blob.
secretlen Length of the secret to be decapsulated, without any blob storage overhead.
keymod Key modified component specified at the time of encapsulation.
keymodlen Lenth of key modifier in bytes.
Returns:
• Zero on success
• CAAM job status if a failure occurs
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
slot Allocated slot to read from.
key_length Length (in bytes) of information to read from the slot.
key_data Pointer to buffer to hold the extracted data. Must be a contiguous buffer.
Returns:
• Zero for successful completion.
• -EFBIG if the requested size exceeds that which the slot can hold.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Points to a struct device established to manage resources for the secure memory
subsystem.
unit One of the units detected with a call to sm_detect_keystore_units().
slot Number of the allocated slot to be released back to the store.
Returns:
• Zero for successful completion.
• -EINVAL if an unallocated slot is specified.
Configuration of the Secure Memory Driver / Keystore API is dependent on the following
kernel configuration parameters:
CRYPTO_DEV_FSL_CAAM_SM
CRYPTO_DEV_FSL_CAAM_SM_SLOTSIZE
CRYPTO_DEV_FSL_CAAM_SM_TEST
Enables operation of a captive test / example module that shows how one might use the
API, while verifying its functionality. The test module works along this flow:
• Creates a number of known clear keys (3 sizes).
• Allocated secure memory slots.
• Inserts those keys into secure memory slots and encapsulates.
• Decapsulates those keys into black keys.
• Enrcrypts DES, AES128, and AES256 plaintext with black keys. Since this uses
symmetric ciphers, same-key encryption/decryption results will be equivalent.
• Decrypts enciphered buffers with equivalent clear keys.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Compares decrypted results with original ciphertext and compares. If they match, the
test reports OK for each key case tested.
Normal output is reported at the console as follows:
• The secure memory driver is not implemented as a kernel module at this point in time.
• Implementation is presently limited to kernel-mode operations.
• One instance is possible at the present time. In the future, when job rings can run
independently in different system partitions, a multiple instance secure memory driver
should be considered.
• All storage requests are limited to the storage size of a single slot (which is of a build-
time configurable length). It may be possible to allow a secret to span multiple slots so
long as those slots can be allocated contiguously.
• Slot size is fixed across all pages/partitions.
• Encapsulation/Decapsulation interfaces could allow for authentication to be specified;
the underlying interface does not request it.
• Encapsulation/Decapsulation interfaces return a job status; this status should be
translated into a meaningful error from errno.h
8.1.20 Operation
For existing platforms, 6 security violation interrupt causes are possible within SNVS. 5 of
these violation causes are normally wired for use, and these causes are defined as:
• SECVIO_CAUSE_CAAM_VIOLATION - Violation detected inside CAAM/SNVS
• SECVIO_CAUSE JTAG_ALARM - JTAG activity detected
• SECVIO_CAUSE_WATCHDOG - Watchdog expiration
• SECVIO_CAUSE_EXTERNAL_BOOT - External bootload activity
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Arguments:
dev Points to SNVS-owning device.
cause Interrupt source cause from the above list of enumerated causes.
handler Application-defined handler, gets called with dev, source cause, and locally-
defined handler argument
cause_description Points to a string to override the default cause name, this can be
used as an alternate for error messages and such. If left NULL, the default description
string is used. ext pointer to any extra data needed by the handler.
Returns:
• Zero on success.
• -EINVAL if an argument was invalid or unusable.
Arguments:
dev Points to SNVS-owning device.
cause Interrupt source cause.
Returns:
• Zero on success.
• -EINVAL if an argument was invalid or unusable.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
CRYPTO_DEV_FSL_CAAM_SECVIO
Enables inclusion of Security Violation driver and configuration interface as part of the
build configuration. The driver is not buildable as a module in its present form.
8.2.1 Introduction
The goal of the DCIC is to verify that a safety-critical information sent to a display is not
corrupted.
The DCIC has the following features:
• Pixel clock up to 148.5 MHz
• Configurable polarity of Display Interface control signals
• 24-bit pixel data bus
• Up to 16 rectangular ROIs with a configurable location and size
• Independent CRC32 signature calculation for each ROI
• External controller mismatch indication signal
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
8.2.6 Structures
struct roi_params {
unsigned int roi_n; /* ROI index */
unsigned int ref_sig; /* Reference CRC32 */
unsigned int start_y; /* start vertical lines of ROI */
unsigned int start_x; /* start horizon lines of ROI */
unsigned int end_y; /* end vertical lines of ROI */
unsigned int end_x; /* end horizon lines of ROI */
char freeze; /* state of ROI */
};
DCIC calculates CRC according to the display bus width, but the display bus width
does not always align with bytes per pixel (bpp), and the four functions above can cover
different display bus widths and bpps.
8.3.1 Introduction
The Subscriber Identification Module (SIM) is designed to facilitate communication to SIM
cards or Eurochip prepaid phone cards, and compatible with ISO/IEC 7816-3 standards.
The SIM module has one port that can be used to interface with various cards. The
interface with the Micro Controller Unit (MCU) is a 32-bit connection as described in the
reference document IP Bus Specification.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
8.4.1 Introduction
For more information on Secure Non-Volatile Storage (SNVS), see the i.MX Security
Manual for the associated SoC.
SNVS is a block that interfaces with CAAM and SRTC.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For SNVS services related to CAAM, see Section Driver Configuration CAAM/SNVS.
For SNVS services related to srtc, see Section SRTC Introduction
8.5.1 Introduction
The Real Time Clock (RTC) module is used to keep the time and date. It provides a
certifiable time to the user and can raise an alarm if tampering with counters is detected.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
9.1.2 OpenCV
OpenCV is an open source computer vision library and one of its modules, called ML,
provides traditional machine learning algorithms. Another important module in OpenCV is
DNN; it provides support for neural network algorithms.
OpenCV offers a unified solution for both neural network inference (DNN module) and
classic machine learning algorithms (ML module). By including many computer vision
functions OpenCV makes it easier to build complex machine learning applications in a
short amount of time and without having dependencies on other libraries.
OpenCV has wide adoption in the Computer Vision field and is supported by a strong and
very active community. Key algorithms are specifically optimized for various devices and
instructions sets. For i.MX, OpenCV uses Arm NEON acceleration. Arm Neon technology
is an advanced SIMD (single instruction multiple data) architecture extension for the Arm
Cortex-A series. Neon technology is intended to improve the multimedia user experience
by accelerating audio and video encoding/decoding, user interface, 2D/3D graphics
or gaming. Neon can also accelerate signal processing algorithms and functions to
speed up applications such as audio and video processing, voice and facial recognition,
computer vision and deep learning.
At its core, the OpenCV DNN module implements an inference engine and does not
provide any functionalities for neural network training. For more details about supported
models and supported layers, check the official OpenCV Deep Learning page.
The OpenCV ML module contains classes and functions for solving machine learning
problems e.g. classification, regression or clustering. It involves algorithms such as
support vector machine (SVM), decision trees, random trees, expectation maximization,
k-nearest neighbors, classic Bayes classifier, logistic regression, and boosted trees.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
9.1.6 PyTorch
PyTorch is an open source machine learning library used for applications, such as
computer vision and natural language processing. It is free and open-source software.
PyTorch provides a Python package for high-level features like tensor computation. For
more details about PyTorch, check the official webpage www.pytorch.org.
TM
9.1.7 DeepViewRT
DeepViewRT is a proprietary neural network inference engine optimized for NXP
microprocessors and microcontrollers, which not
only implements its own compute engine, but is also able to leverage popular 3rd-party
ones.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
9.1.8 TVM
TVM is an open deep learning compiler stack for CPUs, GPUs, and specialized
accelerators. It aims to close the gap between the productivity-focused deep learning
frameworks, and the performance-oriented or efficiency-oriented hardware backends.
10.1 Introduction
Data Plane Development Kit (DPDK) is a user space packet processing framework.
The following section contains instructions for installing and configuring the user
space DPDK v21.11 software. Besides highlighting the applicable platforms, this guide
describes steps for compiling and executing sample DPDK applications in a Linux
application (linuxapp) environment over i.MX boards.
8MM refers to the i.MX 8M Mini platform. For more information on i.MX 8MM, see
nxp.com/imx8; i.MX 8M Mini | Arm Cortex A53 | Cortex M4 | NXP Semiconductors.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
8MP refers to the i.MX 8M Plus platform. For more information on i.MX 8MP, see
nxp.com/imx8; i.MX 8M Plus | Cortex-A53/M7 | NXP Semiconductors.
10.1.2 References
Table 92. DPDK Application References
Sample Applications DPDK Web Manual Link Description
Layer-2 Forwarding (l2fwd) l2fwd usage Layer 2 Forwarding sample
application setup and usage guide.
Layer-3 Forwarding (l3fwd) l3fwd usage Layer 3 Forwarding sample
application setup and usage guide.
PMD Test Application (testpmd) testpmd_usage Guide for test application which can
be used to test all PMD supported
features.
DPDK Web Guide DPDK documentation Link to DPDK Web Manual
containing information about all
supported PMD and Applications.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
/usr/bin/dpdk-testpmd
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For instructions on how to build DPDK using Yocto system, see Section 10.3.1.
Obtain the DPDK source code
The DPDK source code contains all the necessary libraries for build example applications
as well as test applications. The source code also includes various configuration and
scripts for supporting build and execution. Obtain the DPDK source code using the link
below:
Once the above repository has been cloned, DPDK source code is available for
compilation. This source is common for Layerscape and ENETFEC platforms.
Prerequisites before compiling DPDK
Before compiling DPDK as a standalone build, following dependencies need to be
resolved independently:
• Platform compliant and compiled Linux Kernel source code so that KNI modules can be
built.
– This is optional and if KNI module support is not required, this can be ignored.
– For details of compiling platform-compliant Linux kernel, see Download Yocto layers
and Build Yocto images
– For disabling KNI module, see notes below
• OpenSSL libraries required for building software crypto driver (OpenSSL PMD).
– OpenSSL package needs to be separately compiled and libraries installed at a
known path before DPDK build can be done
– This is optional and if software crypto driver support is not required, this dependency
can be ignored. Follow the steps below to build OpenSSL as a standalone package.
Export the Cross Compilation tool chain for building OpenSSL for target. The following
step for exporting cross compilation toolchain is required only when compiling on Host.
On a target board, it is assumed default build toolchain would be used.
Configure the OpenSSL build system with following command. The --prefix argument
specifies a path where OpenSSL libraries would be deployed after build completes. This
is also a path which would be provided to DPDK build system for accessing the compiled
OpenSSL libraries.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Note:
When building DPDK on target board, it is possible that OpenSSL libraries required by
DPDK are already available as part of the rootfs, in which case external compilation of
OpenSSL package would not be required.
To disable OpenSSL PMD support, see notes below.
Compiling DPDK using meson
Follow the steps below to compile DPDK once the above prerequisites are resolved.
These steps are common for all platforms and are needed only when cross compiling
on a host for all boards as target. In case of direct compilation on target boards, it is
assumed that prerequisites would be satisfied using the root filesystem.
1. Set up the environment for compilation:
a. This step is required only in the host environment where default toolchain is not
for target boards. When compiling on a target board, this step can be skipped.
export CROSS_PATH=<path to cross-compile toolchain>
export PATH=$PATH:$CROSS_PATH
b. Set up OpenSSL path for software crypto drivers (OpenSSL PMD). This is
optional and can be skipped in case software crypto driver (OpenSSL PMD)
support is not required. These external variables can also be used to pass other
required libraries for example libpcap.
2. Use DPDK build system for compiling DPDK.
Note: DPDK binaries generated using below steps are compatible for Layerscape
and ENETFEC platforms. This is also valid when DPDK is build through Yocto build
system.
a. Execute the following command:
meson arm64-build --cross-file config/arm/
arm64_dpaa_linux_gcc -Dexamples = <list of example
applications to be compiled separated by commas> -
Dprefix=<location to install DPDK> ninja -C arm64-build
Here, -Dprefix and -Dexamples are optional parameters. Dprefix
parameter is used to deploy all the DPDK binaries (libraries and example
applications) to a standard Linux package-specific layout within a directory
represented by this parameter. Alternatively, a directory dpdk/arm64-build/
is also created and binaries and libraries are also available in it. install
parameter is also not required in the ninja command, if installation is not
required. Dexamples is used to compile required examples. In case you need to
compile only drivers, this parameter is not needed.
b. Once the example applications are compiled, the binaries are available in the
DPDK build directory with prefix “dpdk”-:
dpdk/arm64-build/examples/*
Besides the example application above, DPDK also provides a testpmd binary,
which can be used for comprehensive verification of the DPDK driver (PMD)
features for available and compatible devices. This binary is compiled by default
during the DPDK source compilation. It is available in the dpdk/arm64-build/
examples/ directory.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Note:
Depend on the available memory, add hugepage to the system from the command line:
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• Generic Setup contains common steps to be executed before executing any of DPDK
sample application or external DPDK applications.
• Application-specific sections contain steps on how to execute the DPDK example and
related applications.
For more details, see the following sections:
– Test Environment Setup
– Troubleshooting
Test Environment Setup
Various sample application execution steps are described in the following sections. The
following figure shows the setup containing the DUT (Device Under Test) and the Packet
Generator (Spirent packet generator). This is applicable for the commands provided
in following section. The setup includes a one-to-one link between DUT and Packet
generator unit. DPDK application running on the DUT is expected to forward the traffic.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
In the command above: -c refers to the core mask for cores to be assigned to DPDK; -p
is the port mask for ports to be used by application. Other command line parameters may
also be provided - for a complete list, see L2 Forwarding Sample Application (in Real and
Virtualized Environments).
Note:
DPDK L2fwd application periodically prints the I/O stats. To avoid CPU core to be
interrupted because of these scheduled prints, -T 0 option can be appended at the end
of the command line.
dpdk-l3fwd – Layer 3 forwarding application
Sample application to show forwarding between multiple ports based on the Layer 3
information.
In the command above: -c refers to the core mask for cores to be assigned to DPDK; -
p is the port mask for ports to be used by application; --config is (Port, Queue, Core)
configuration used by application for attaching cores to queues on each port. Other
command-line parameters may also be provided - for a complete list, refer L3 Forwarding
Sample Application.
dpdk-testpmd
Sample application used for functionality test, it ensures that traffic generator to board
connectivity is proper. You may run testpmd in tx_only mode to validate if the packets
are going out on specific interfaces. For information about testpmd application and its
supported arguments, see the web documentation.
• For TX only:
dpdk-testpmd -c 0x1 -n 1 --vdev='net_enetfec' -- -i --
portmask=0x1 –n b ports=1 --forward-mode=rxonly
• For RX only:
dpdk-testpmd -c 0x1 -n 1 --vdev='net_enetfec' -- -i --
portmask=0x1 –n b ports=1 --forward-mode=txonly
• For IO:
dpdk-testpmd -c 0x1 -n 1 --vdev=’net_enetfec’ -- -i --
portmask=0x1 –nb ports=1 --forward-mode=io
10.5 Troubleshooting
• If DPDK example applications are not found in rootfs, ensure you are using the correct
rootfs (rootfs.wic.zst), which integrates the DPDK.
• If applications are not initialized properly, ensure HugePages are added as mentioned
in the sections above.
• If Ethernet port is not found, ensure that you are using the correct DTB.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11 Unit Tests
11.1 System
11.1.1 OProfile
• autorun-oprofile.sh
11.1.1.1.1 Location
/unit_tests/OProfile/
11.1.1.1.2 Functionality
OProfile is a system-wide profiler capable of profiling all running code at low overhead.
OProfile consists of a kernel driver, a daemon for collecting sample data, and several
post-profiling tools for turning data into information.
11.1.1.1.3 Configuration
None
./autorun-oprofile.sh
11.1.2 Owire
• autorun-owire.sh
11.1.2.1.1 Location
/unit_tests/OWire/
11.1.2.1.2 Functionality
11.1.2.1.3 Configuration
None
./autorun-owire.sh
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• /unit_tests/Power_Management/suspend_random_auto.sh
• /unit_tests/Power_Management/suspend_quick_auto.sh
11.1.3.1.1 Location
/unit_tests/Power_Management/
11.1.3.1.2 Functionality
Enables low power mode on and wakes up the different cores on all i.MX boards..
11.1.3.1.3 Configuration
None
$ /unit_tests/Power_Management/suspend_random_auto.sh
or
$ /unit_tests/Power_Management/suspend_quick_auto.sh
# /unit_tests/Power_Management/suspend_random_auto.sh
rtcwakeup.out: wakeup from "mem" using rtc0 at Wed Feb 22
22:55:29 2017
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds)
done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 632.862 msecs
PM: suspend devices took 0.640 seconds
PM: late suspend of devices complete after 1.258 msecs
PM: noirq suspend of devices complete after 1.198 msecs
Disabling non-boot CPUs ...
CPU1: shutdown
Turn off Mega/Fast mix in DSM
Enabling non-boot CPUs ...
CPU1 is up
PM: noirq resume of devices complete after 0.832 msecs
imx-sdma 30bd0000.sdma: loaded firmware 4.2
PM: early resume of devices complete after 0.930 msecs
PM: resume of devices complete after 483.310 msecs
PM: resume devices took 0.480 seconds
Restarting tasks ... done.
=============================
suspend 0 times
=============================
wakeup 7 seconds, sleep 16 seconds
rtcwakeup.out: wakeup from "mem" using rtc0 at Wed Feb 22
22:55:42 2017
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
# /unit_tests/Power_Management/suspend_quick_auto.sh
rtcwakeup.out: wakeup from "mem" using rtc0 at Wed Feb 22
23:01:16 2017
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds)
done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 632.891 msecs
PM: suspend devices took 0.640 seconds
PM: late suspend of devices complete after 1.254 msecs
PM: noirq suspend of devices complete after 1.200 msecs
Disabling non-boot CPUs ...
CPU1: shutdown
Turn off Mega/Fast mix in DSM
Enabling non-boot CPUs ...
CPU1 is up
PM: noirq resume of devices complete after 0.734 msecs
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• mxc_mcc_tty_test.out
11.1.4.1.1 Location
/unit_tests/Remote_Processor_Messaging
11.1.4.1.2 Functionality
11.1.4.1.3 Configuration
To run the i.MX RPMsg test program, perform the following operations: Make sure that
the proper Cortex-M4 processor RTOS and Linux images are used. The following are
examples for the i.MX7Dual board:
• rpmsg_pingpong_sdk_7dsdb.bin → ping-pong test used on the i.MX7Dual SDB board
• rpmsg_str_echo_sdk_7dsdb.bin → tty string echo test used on the i.MX7Dual SDB
board
• rpmsg_pingpong_sdk_7dval.bin → ping-pong test used on the i.MX7Dual 12x12
LPDDR3 ARM2 board
• rpmsg_str_echo_sdk_7dval.bin → tty string echo test used on the i.MX7Dual 12x12
LPDDR3 ARM2 board
Load the Cortex-M4 processor RTOS image, and kick it off in U-Boot. Load the Cortex-
M4 processor RTOS image by the TFTP server or by the bootable SD card in U-Boot.
• Load the Cortex-M4 processor RTOS image by the TFTP server:
– Boot into U-Boot and stop.
– Use the following command to TFTP the responding Cortex-M4 processor RTOS
image and boot it.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Note: NOTE “uart_from_osc” is required by i.MX 6SoloX when the Cortex-M4 processor
RTOS image is running. Therefore, the mmcargs of U-Boot should be modified on i.MX
6SoloX.
Run the RPMsg test program. * Make sure that imx_rpmsg_pingpong.ko and
imx_rpmsg_tty.ko are built out. * Use insmod imx_rpmsg_pingpong.ko or insmod
imx_rpmsg_tty.ko to run the test program.
Note: NOTE Do not run different test programs at the same time.
Run the following command and ensure that the RPMsg TTY receiving program is
running at the backend when starting RPMsg TTY tests.
• autorun-wdog.sh
• wdt_driver_test.out
11.1.5.1.1 Location
/unit_tests/Watchdog/
11.1.5.1.2 Functionality
Tests the Watchdog Timer module which protects against system failures by providing an
escape from unexpected hang, infinite loop situations or programming errors.
11.1.5.1.3 Configuration
None
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Use case
./autorun-wdog.sh
or
./wdt_driver_test.out 1 2 0 &
Expected output
This should generate a reset after 3 seconds (a 1 second time-
out and a 2 second sleep).
or
./wdt_driver_test.out 2 1 0
The system should keep running without being reset. This test
requires the kernel to be executed
with the "jtag=on" on some platforms. Press "Ctrl+C" to
terminate this test program.
11.2 Storage
• mxc_mlb150_test
11.2.1.1.1 Location
/unit_tests/Media_Local_Bus/
11.2.1.1.2 Functionality
11.2.1.1.3 Configuration
Device Drivers > MXC support drivers > MXC Media Local Bus
Driver > MLB support
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• autorun-mmc-blockrw.sh
• autorun-mmc-fdisk.sh
• autorun-mmc-fs.sh
• autorun-mmc-mkfs.sh
• autorun-mmc.sh
11.2.2.1.1 Location
/unit_tests/MMC_SD_SDIO/
11.2.2.1.2 Functionality
11.2.2.1.3 Configuration
None
./autorun-mmc-blockrw.sh
./autorun-mmc-fdisk.sh
./autorun-mmc-fs.sh
./autorun-mmc-mkfs.sh
./autorun-mmc.sh
11.2.3 MMDC
• mmdc2
11.2.3.1.1 Location
/unit_tests/MMDC/
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.2.3.1.2 Functionality
11.2.3.1.3 Configuration
./mmdc2
[ARM:DSP1:DSP2:GPU2D:GPU2D1:GPU2D2:GPU3D:GPU3D2:GPUVG:VPU:M4:PXP:USB:SUM]
11.2.4 SATA
• autorun-ata.sh
11.2.4.1.1 Location
/unit_tests/SATA/
11.2.4.1.2 Functionality
This test writes data to the SATA drive connected to the SATA connector on the i.MX
board. The data is then read back and compared to what was written.
11.2.4.1.3 Configuration
Module required: pata_fsl.ko. Hardware required: SATA drive. Only i.MX 6 Quad and
QuadPlus have SATA support.
./autorun-ata.sh
Expected output
Test should return "HDD test passes" if successful.
11.3 Connectivity
• mxc_spi_test1.out
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.3.1.1.1 Location
/unit_tests/ECSPI/
11.3.1.1.2 Functionality
This test sends bytes of the last parameter to a specific SPI device. The maximum
transfer bytes are 4096 bytes for bits per word less than 8(including 8), 2048 bytes for
bits per word between 9 and 16, 1024 bytes for bits per word larger than 17(including
17). SPI writes data received data from the user into Tx FIFO and waits for the data in
the Rx FIFO. Once the data is ready in the Rx FIFO, it is read and sent to user.
11.3.1.1.3 Configuration
For the i.MX 6QuadPlus/Quad/Dual auto boards this requires the ecspi device tree. This
feature is disabled with default device tree.
11.3.2 ETM
• etm
11.3.2.1.1 Location
/unit_tests/ETM/
11.3.2.1.2 Functionality
Embedded Trace Macrocell, The ETM is an optional debug component that enables
reconstruction of program execution. The ETM is designed as a high-speed, low-power
debug tool that only supports instruction trace. This ensures that area is minimized, and
that gate count is reduced.
11.3.2.1.3 Configuration
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
# ./etm -h
Usage: ./etm [options]
Options:
--etm-3.3 ETM v3.3 trace data
--etm-3.4-alt-branch ETM v3.4 trace data with alternative
branch encoding
--pft-1.1 PFT v1.1 trace data
--cycle-accurate Cycle-accurate tracing was enabled (Default 1)
--contextid-bytes Number of Context ID bytes (Default 4)
--formatter Enable Formatter Unpacking
--sourceid-match Enable Source ID from formatter. Also enables
formatter
--print-long-waits Highlight long waits
--print-input Print input data
--print-config Print configuration data
--help Print usage information
• mxc_i2c_slave_test.out
11.3.3.1.1 Location
/unit_tests/I2C/
11.3.3.1.2 Functionality
11.3.3.1.3 Configuration
None
11.3.4 IIM
• mxc_iim_test.out
11.3.4.1.1 Location
/unit_tests/IIM_Driver/
11.3.4.1.2 Functionality
This test can read an iim value from a bank or fuse a value to a bank
11.3.4.1.3 Configuration
None
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
For both read and fuse test input values should be in hex format.
11.3.5 Keyboard
• autorun-keypad.sh
• mxc_keyb_test.sh
11.3.5.1.1 Location
/unit_tests/Keyboard/
11.3.5.1.2 Functionality
11.3.5.1.3 Configuration
./autorun-keypad.sh
Outputs:
Print "PASS" status
./mxc_keyb_test.sh
Output:
An event will occur when a key is pressed
• autorun-mxc_uart.sh
• mxc_uart_stress_test.out
• mxc_uart_test.out
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• mxc_uart_xmit_test.out
11.3.6.1.1 Location
/unit_tests/UART/
11.3.6.1.2 Functionality
These tests excercise the low-level UART driver whihc is responsible for supplying
information such as the UART port information and a set of control functions to the core
UART driver.
11.3.6.1.3 Configuration
None
./autorun-mxc_uart.sh
./mxc_uart_stress_test.out /dev/ttymxc#
./mxc_uart_test.out /dev/ttymxc#
./mxc_uart_xmit_test.out /dev/ttymxc#
11.3.7 USB
• autorun-usb-gadget.sh
• autorun-usb-host.sh
11.3.7.1.1 Location
/unit_tests/USB/
11.3.7.1.2 Functionality
This tests excerise the universal serial bus (USB) driver which implements a standard
Linux driver interface to the CHIPIDEA USB-HS OTG controller. The USB provides a
universal link that can be used across a wide range of PC-to-peripheral interconnects. It
supports plug-and-play, port expansion, and any new USB peripheral that uses the same
type of port.
11.3.7.1.3 Configuration
Modules required:
• /lib/modules/$(kernel_version)/kernel/drivers/usb/gadget/g_ether.ko
• /lib/modules/$(kernel_version)/kernel/drivers/usb/gadget/arcotg_udc.ko
• /lib/modules/$(kernel_version)/kernel/drivers/usb/host/ehci-hcd.ko
./autorun-usb-gadget.sh
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
or
./autorun-usb-host.sh
11.4 Graphics
• gpu.sh
• gpuinfo.sh
11.4.1.1.1 Location
/unit_tests/GPU
11.4.1.1.2 Functionality
11.4.1.1.3 Configuration
For gpu.sh and gpuinfo.sh to work add the following line to the target board defconfig file:
• CONFIG_MXC_GPU_VIV=y
Hardware required: LVDS Display Panel and i.MX SoC with a GPU
./gpu.sh
# ./gpu.sh
---- Running < gpu.sh > test ----
/unit_tests/GPU /unit_tests/GPU
Rendered 100 frames in 624 milliseconds: 160.26 fps
id=43, a,b,g,r=0,8,8,8, d,s=16,0, AA=0,openvgbit=71
frames:100 -- fps:58.997051
press ESC to escape...
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
./gpuinfo.sh
# ./gpuinfo.sh
---- Running < gpuinfo.sh > test ----
GPU Info
gpu : 0
model : 2000
revision : 5108
product : 0
eco : 0
gpu : 8
model : 320
revision : 5007
product : 0
eco : 0
gpu : 9
model : 355
revision : 1215
product : 0
eco : 0
VIDEO MEMORY:
gcvPOOL_SYSTEM:
Free : 134217728 B
Used : 0 B
Total : 134217728 B
gcvPOOL_CONTIGUOUS:
Used : 0 B
gcvPOOL_VIRTUAL:
Used : 0 B
NON PAGED MEMORY:
Used : 0 B
Paged memory Info
lowMem: 0 bytes
highMem: 0 bytes
CMA memory info
cma: 138485760 bytes
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Idle percentage:0.000.000.000.000.000.00%
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
---- Test < gpuinfo.sh > ended ----
11.5 Video
11.5.1 Display
• autorun-fb.sh
• mxc_tve_test.sh
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• mxc_fb_test.out
• mxc_epdc_fb_test.out
• mxc_epdc_v2_fb_test.out
• mxc_spdc_fb_test.out
• mxc_fb_vsync_test.out
11.5.1.1.1 Location
/unit_tests/Display/
11.5.1.1.2 Functionality
The tests under the display directory test some of the display options that are available
with the i.MX family of boards. Some of the devices that can be tested include LVDS,
HDMI and EPDC panels.
Specifically the 'mxc_fb_test.out' tests the following features:
• Basic fb operation
• Set background/foreground to 16 bpp fb
• Global alpha blending
• Color key test
• Framebuffer Panning
• Gamma test
Aditionally, the EPDC tests 'mxc_epdc_fb_test.out' and 'mxc_epdc_v2_fb_test.out' test
the following features:
• Basic Updates
• Rotation Updates
• Grayscale Framebuffer Updates
• Auto-waveform Selection Updates
• Panning Updates
• Overlay Updates
• Auto-Updates
• Animation Mode Updates
• Fast Updates
• Partial to Full Update Transitions
• Test Pixel Shifting Effect
• Colormap Updates
• Collision Test Mode
• Stress Test
• RGB565, Y8 framebuffer format
• 0, 90, 180, 270 degree framebuffer rotation
• Framebuffer panning
• Use of the alternate framebuffer
• Auto-waveform mode selection
• Automatic update mode
• The force-monochrome update feature and animation mode updates
• Support for using a grayscale colormap
• Snapshot, Queue, and Queue and Merge update schemes
• The EPDC Collision Test mode
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.5.1.1.3 Configuration
In order to run some tests, changes to the defconfig file for the target board are required.
These changes will add functionality in which the following tests depend upon.
For autorun-fb.sh, 'mxc_fb_test.out' and 'mxc_fb_vsync_test.out' add the following to the
target board defconfig file:
CONFIG_FB=y
CONFIG_FB_MXC=y
CONFIG_FB_MXC_EDID=y
CONFIG_FB_MXC_SYNC_PANEL=y
CONFIG_FB_MXC_LDB=y
CONFIG_FB_MXC_HDMI=y
CONFIG_FB=y
CONFIG_FB_MXC=y
CONFIG_FB_MXC_EINK_PANEL=y
CONFIG_MFD_MAX17135=y
CONFIG_REGULATOR_MAX17135=y
CONFIG_MXC_PXP=y
CONFIG_DMA_ENGINE=y
# ./autorun-fb.sh
# ./mxc_tve_test.sh
# ./mxc_fb_test.out
Expected Output is shown below. The test should pass without any failure messages,
and the display on panel should be correct. For each test, a sequence of updates should
be reflected on the screen. For almost all tests, the text printed out in the debug console
describes the image that should be observed on the screen. For i.MX6Quad fb0 and
fb1 are used for tests, fb0 is background framebuffer, and fb1 is foreground overlay
framebuffer.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Gamma 1.000000
Gamma 1.500000
Gamma 2.200000
Gamma 2.400000
Gamma test end.
Test bpp start
@DISP4 BG - DI1: Set colorspace to 32-bpp
@DISP4 BG - DI1: Fill the screen in red
@DISP4 BG - DI1: Set colorspace to 24-bpp
@DISP4 BG - DI1: Fill the screen in blue
@DISP4 BG - DI1: Set colorspace to 16-bpp
@DISP4 BG - DI1: Fill the screen in green
Test bpp end
The full set of tests should pass without any failure messages. For each test, a sequence
of updates should be reflected on the screen. For almost all tests, the text printed out
in the debug console describes the image that should be observed on the screen.
mxc_epdc_v2_fb_test.out: The full set of tests should pass without any failure messages.
For each test, a sequence of updates should be reflected on the screen. For almost
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
all tests, the text printed out in the debug console describes the image that should be
observed on the screen.
# ./mxc_spdc_fb_test.out
---- Running < ./mxc_spdc_fb_test.out > test ----
Unable to open /dev/fb5
# ./mxc_fb_vsync_test.out
Usage:
/unit_tests/Display# ./mxc_fb_vsync_test.out <fb #> <count>
<fb #> the framebuffer number
<count> the frames to be rendered
Example:
/unit_tests/Display# echo 0 > /sys/class/graphics/fb0/blank
/unit_tests/Display# ./mxc_fb_vsync_test.out 0 100
Expected output is the following when using 100 for the < count > argument
11.5.2 High-Definition Multimedia Interface (HDMI) and Display Port (DP) Overview
• mxc_cec_test.out
11.5.2.1.1 Location
/unit_tests/HDMI/
11.5.2.1.2 Functionality
Verify HDMI CEC function and send poweroff command to HDMI sink.
11.5.2.1.3 Configuration
For mxc_cec_test.out to work add the following line to the target board defconfig file:
CONFIG_MXC_HDMI_CEC=y
The hardware should support HDMI and TV should support HDMI CEC
./mxc_cec_test.out
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
• autorun-vpu.sh
• mxc_vpu_test.out
11.5.3.1.1 Location
/unit_tests/VPU/
11.5.3.1.2 Functionality
The VPU test exercises the following options on the Video Processing Unit (VPU):
• Decode one stream and display on the LCD.
• Decode a stream and save to a file.
• Decode a stream using a config file.
• Encode a YUV stream and save to a file.
• Encode an image from the camera and decode it to display on the LCD.
• Decode multiple streams with different formats simultaneously.
• Decode and encode simultaneously.
• Output to TV out.
• Test VPU with VDI (HW deinterlace via IPU).
11.5.3.1.3 Configuration
This tests require libvpu.so under /usr/lib/ and LCD display. This test requires i.MX
6QuadPlus/Quad/Dual SoC.
./autorun-vpu.sh
Decode one stream and display on the LCD.
To test MPEG-4 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.m4v -f 0"
To test H.263 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.263 -f 1"
To test H.264 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.264 -f 2"
You can get the mp4 test file from the imx-test.git server.
It is located under test/mxc_vpu_test/configs/akiyo.mp4.
Decode a stream and save to a file.
To test MPEG-4 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.m4v -f 0 -o
out.yuv"
To test H.263 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.263 -f 1 -o
out.yuv"
To test H.264 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.264 -f 2 -o
out.yuv"
Decode a stream using a config file.
Change options in config file, e.g, config_dec. Input correct
input filename, output filename, format,
./mxc_vpu_test.out -C config_dec
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.5.3.2.1 Location
/unit_tests/VPU/hantro
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.5.3.2.2 Functionality
11.5.3.3.1 Location
/unit_tests/VPU/hantro
11.5.3.3.2 Functionality
11.5.3.4.1 Location
/unit_tests/V4L2_VPU/
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.5.3.4.2 Functionality
Example for decoder, which helps to list the 'ifmt' value for different codecs:
• encoder_test
• decoder_test
11.5.4.1.1 Location
/unit_tests/JPEG
11.5.4.1.2 Functionality
The encoder_test receives a raw file in one of the supported formats as input and
produces a JPEG file as output, with the same resolution and pixel format as the input.
The application fills the raw file in one V4L2 output buffer, enqueues it into the driver, and
expects to dequeue the JPEG image in one capture buffer.
The decoder_test receives a JPEG file in one of the supported formats as input and
produces a raw file as output, with the same resolution and pixel format as the input. The
application fills the jpeg file in one V4L2 output buffer, enqueues it into the driver, and
expects to dequeue the raw image in one capture buffer.
11.5.4.1.3 Configuration
No special configuration.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
./decoder_test.out
Usage:
Supported formats:
The input file has to be a JPEG file that matches the specified width, height, and pixel
format. The output is a raw file called "outfile" in the current folder, with the same width,
height, and pixel format as the input.
./encoder_test.out
Usage:
Supported formats:
The input file has to be a raw file that matches the specified width, height, and pixel
format. The output is a JPEG file called "outfile.jpeg" in the current folder, with the same
width, height, and pixel format as the input.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.6 Audio
• mxc_tuner_test.out
11.6.1.1.1 Location
/unit_tests/ALSA/
11.6.1.1.2 Functionality
11.6.1.1.3 Configuration
ALSA is supported on all i.MX for test aplay, arecord and speaker-test. To use this tuner
test it requires tuner hardware available only on the i.MX 6 auto reference boards
• mxc_asrc_test.out
11.6.2.1.1 Location
/unit_tests/ASRC
11.6.2.1.2 Functionality
11.6.2.1.3 Configuration
None
#/unit_tests/ASRC/mxc_asrc_test.out -h
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
11.7 Security
• mxc_dcic_test.out
11.7.1.1.1 Location
/unit_tests/DCIC/
11.7.1.1.2 Functionality
The goal of the DCIC is to verify that a safety-critical information sent to a display is not
corrupted.
11.7.1.1.3 Configuration
None
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Opened fb0
open /dev/dcic1
bpp=16, bus_width=18
Config ROI=1
Config ROI=3
Config ROI=5
ROI=0,crcRS=0x0, crcCS=0x0
ROI=1,crcRS=0x6cd6b18d, crcCS=0x6cd6b18d
ROI=2,crcRS=0x0, crcCS=0x0
ROI=3,crcRS=0xc9da7ae6, crcCS=0xc9da7ae6
ROI=4,crcRS=0x0, crcCS=0x0
ROI=5,crcRS=0xb5ba1453, crcCS=0xb5ba1453
ROI=6,crcRS=0x0, crcCS=0x0
ROI=7,crcRS=0x0, crcCS=0x0
ROI=8,crcRS=0x0, crcCS=0x0
ROI=9,crcRS=0x0, crcCS=0x0
ROI=10,crcRS=0x0, crcCS=0x0
ROI=11,crcRS=0x0, crcCS=0x0
ROI=12,crcRS=0x0, crcCS=0x0
ROI=13,crcRS=0x0, crcCS=0x0
ROI=14,crcRS=0x0, crcCS=0x0
ROI=15,crcRS=0x0, crcCS=0x0
All ROI CRC check success!
11.7.2 SIM
• mxc_sim_test.out
11.7.2.1.1 Location
/unit_tests/SIM/
11.7.2.1.2 Functionality
11.7.2.1.3 Configuration
None
/unit_tests/mxc_sim_test.out
Expected output
atr[0]= 0x3b atr[1]= 0x68 atr[2]= 0x0 atr[3]= 0x0 atr[4]= 0x0
atr[5]= 0x73 atr[6]=
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
0xc8
atr[7]= 0x40 atr[8]= 0x0 atr[9]= 0x0 atr[10]= 0x90 atr[11]= 0x0
rx[0] = 0x6e rx[1] = 0x0
rx[0] = 0x6d rx[1] = 0x0
rx[0] = 0x6e rx[1] = 0x0
• autorun-rtc.sh
• rtctest.out
• rtcwakeup.out
11.7.3.1.1 Location
/unit_tests/SRTC/
11.7.3.1.2 Functionality
These tests check the Real Time Clock (RTC) module which is used to keep the time and
date. It provides a certifiable time to the user and can raise an alarm if tampering with
counters is detected.
11.7.3.1.3 Configuration
For autorun-rtc.sh, rtctest.out and rtcwakeup.out to work add the following line to the
target board defconfig file:
CONFIG_RTC_DRV_SNVS=y
./autorun-rtc.sh
or
./rtctest.out $lt;arg>
--full run all tests
--no-periodic don't run periodic interrupt tests
or
./rtcwakeup.out -d rtc0 -m mem -s 10
Expected output
autorun-rtc.sh: Exit with PASS results.
rtctest.out: The program ends with "Test complete" status.
rtcwakeup.out: System is wakeup after 10s.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
13 Revision History
Revision history
Revision number Date Substantive changes
L4.9.51_imx8qxp-alpha 11/2017 Initial release
L4.9.51_imx8qm-beta1 12/2017 Added i.MX 8QuadMax
L4.9.51_imx8mq-beta 12/2017 Added i.MX 8M Quad
L4.9.51_8qm-beta2/ 02/2018 Added i.MX 8QuadMax Beta2 and i.MX 8QuadXPlus
8qxp-beta Beta
L4.9.51_imx8mq-ga 03/2018 Added i.MX 8M Quad GA
L4.9.88_2.0.0-ga 05/2018 i.MX 7ULP and i.MX 8M Quad GA release
L4.9.88_2.1.0_8mm- 06/2018 i.MX 8M Mini Alpha release
alpha
L4.9.88_2.2.0_8qxp- 07/2018 i.MX 8QuadXPlus Beta2 release
beta2
L4.9.123_2.3.0_8mm 09/2018 i.MX 8M Mini GA release
L4.14.62_1.0.0_beta 11/2018 i.MX 4.14 Kernel Upgrade, Yocto Project Sumo upgrade
L4.14.78_1.0.0_ga 01/2019 i.MX6, i.MX7, i.MX8 family GA release
L4.14.98_2.0.0_ga 04/2019 i.MX 4.14 Kernel upgrade and board updates
L4.19.35_1.0.0 07/2019 i.MX 4.19 Beta Kernel and Yocto Project Upgrades
L4.19.35_1.1.0 10/2019 i.MX 4.19 Kernel and Yocto Project Upgrades
L5.4.3_1.0.0 03/2020 i.MX 5.4 Kernel and Yocto Project Upgrades
Linux LF5.4.3_2.0.0 04/2020 i.MX 5.4 Alpha release for i.MX 8M Plus and 8DXL EVK
boards
L5.4.24_2.1.0 06/2020 i.MX 5.4 Beta release for i.MX 8M Plus, Alpha2 for
8DXL, and consolidated GA for released i.MX boards
L5.4.47_2.2.0 09/2020 i.MX 5.4 Beta2 release for i.MX 8M Plus, Beta for 8DXL,
and consolidated GA for released i.MX boards
L5.4.70_2.3.0 12/2020 i.MX 5.4 consolidated GA for release i.MX boards
including i.MX 8M Plus and i.MX 8DXL
L5.4.70_2.3.0 01/2021 Updated the command lines in Section "Running the
Arm Cortex-M4 image"
LF5.10.9_1.0.0 03/2021 Upgraded to 5.10.9 kernel
LF5.10.35_2.0.0 06/2021 Upgraded to 5.10.35 kernel
LF5.10.52_2.1.0 09/2021 Updated for i.MX 8ULP Alpha and the kernel upgraded
to 5.10.52
LF5.10.72_2.2.0 12/2021 Upgraded the kernel to 5.10.72 and updated the BSP
LF5.15.5_1.0.0 03/2022 Upgraded to the 5.15.5 kernel, Honister Yocto, and Qt6
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Revision history...continued
Revision number Date Substantive changes
LF5.15.32_2.0.0 06/2022 Upgraded to the 5.15.32 kernel, U-Boot 2022.04, and
Kirkstone Yocto
LF5.15.52_2.1.0 09/2022 Upgraded to the 5.15.52 kernel, and added the i.MX 93.
LF5.15.71_2.2.0 12/2022 Upgraded to the 5.15.71 kernel.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
14 Legal information
14.1 Definitions Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
sale, as published at http://www.nxp.com/profile/terms, unless otherwise
Draft — A draft status on a document indicates that the content is still agreed in a valid written individual agreement. In case an individual
under internal review and subject to formal approval, which may result agreement is concluded only the terms and conditions of the respective
in modifications or additions. NXP Semiconductors does not give any agreement shall apply. NXP Semiconductors hereby expressly objects to
representations or warranties as to the accuracy or completeness of applying the customer’s general terms and conditions with regard to the
information included in a draft version of a document and shall have no purchase of NXP Semiconductors products by customer.
liability for the consequences of use of such information.
Export control — This document as well as the item(s) described herein
may be subject to export control regulations. Export might require a prior
14.2 Disclaimers authorization from competent authorities.
Limited warranty and liability — Information in this document is believed Suitability for use in non-automotive qualified products — Unless
to be accurate and reliable. However, NXP Semiconductors does not give this data sheet expressly states that this specific NXP Semiconductors
any representations or warranties, expressed or implied, as to the accuracy product is automotive qualified, the product is not suitable for automotive
or completeness of such information and shall have no liability for the use. It is neither qualified nor tested in accordance with automotive testing
consequences of use of such information. NXP Semiconductors takes no or application requirements. NXP Semiconductors accepts no liability for
responsibility for the content in this document if provided by an information inclusion and/or use of non-automotive qualified products in automotive
source outside of NXP Semiconductors. equipment or applications.
In no event shall NXP Semiconductors be liable for any indirect, incidental, In the event that customer uses the product for design-in and use in
punitive, special or consequential damages (including - without limitation - automotive applications to automotive specifications and standards,
lost profits, lost savings, business interruption, costs related to the removal customer (a) shall use the product without NXP Semiconductors’ warranty
or replacement of any products or rework charges) whether or not such of the product for such automotive applications, use and specifications, and
damages are based on tort (including negligence), warranty, breach of (b) whenever customer uses the product for automotive applications beyond
contract or any other legal theory. NXP Semiconductors’ specifications such use shall be solely at customer’s
own risk, and (c) customer fully indemnifies NXP Semiconductors for any
Notwithstanding any damages that customer might incur for any reason
liability, damages or failed product claims resulting from customer design and
whatsoever, NXP Semiconductors’ aggregate and cumulative liability
use of the product for automotive applications beyond NXP Semiconductors’
towards customer for the products described herein shall be limited in
standard warranty and NXP Semiconductors’ product specifications.
accordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Translations — A non-English (translated) version of a document, including
the legal information in that document, is for reference only. The English
Right to make changes — NXP Semiconductors reserves the right to
version shall prevail in case of any discrepancy between the translated and
make changes to information published in this document, including without
English versions.
limitation specifications and product descriptions, at any time and without
notice. This document supersedes and replaces all information supplied prior
Security — Customer understands that all NXP products may be subject to
to the publication hereof.
unidentified vulnerabilities or may support established security standards or
specifications with known limitations. Customer is responsible for the design
Suitability for use — NXP Semiconductors products are not designed,
and operation of its applications and products throughout their lifecycles
authorized or warranted to be suitable for use in life support, life-critical or
to reduce the effect of these vulnerabilities on customer’s applications
safety-critical systems or equipment, nor in applications where failure or
and products. Customer’s responsibility also extends to other open and/or
malfunction of an NXP Semiconductors product can reasonably be expected
proprietary technologies supported by NXP products for use in customer’s
to result in personal injury, death or severe property or environmental
applications. NXP accepts no liability for any vulnerability. Customer should
damage. NXP Semiconductors and its suppliers accept no liability for
regularly check security updates from NXP and follow up appropriately.
inclusion and/or use of NXP Semiconductors products in such equipment or
applications and therefore such inclusion and/or use is at the customer’s own Customer shall select products with security features that best meet rules,
risk. regulations, and standards of the intended application and make the
ultimate design decisions regarding its products and is solely responsible
for compliance with all legal, regulatory, and security related requirements
Applications — Applications that are described herein for any of these
concerning its products, regardless of any information or support that may be
products are for illustrative purposes only. NXP Semiconductors makes no
provided by NXP.
representation or warranty that such applications will be suitable for the
specified use without further testing or modification. NXP has a Product Security Incident Response Team (PSIRT) (reachable
at [email protected]) that manages the investigation, reporting, and solution
Customers are responsible for the design and operation of their
release to security vulnerabilities of NXP products.
applications and products using NXP Semiconductors products, and NXP
Semiconductors accepts no liability for any assistance with applications or
customer product design. It is customer’s sole responsibility to determine
whether the NXP Semiconductors product is suitable and fit for the
customer’s applications and products planned, as well as for the planned
14.3 Trademarks
application and use of customer’s third party customer(s). Customers should
Notice: All referenced brands, product names, service names, and
provide appropriate design and operating safeguards to minimize the risks
trademarks are the property of their respective owners.
associated with their applications and products.
NXP Semiconductors does not accept any liability related to any default, NXP — wordmark and logo are trademarks of NXP B.V.
damage, costs or problem which is based on any weakness or default
in the customer’s applications or products, or the application or use by
customer’s third party customer(s). Customer is responsible for doing all
necessary testing for the customer’s applications and products using NXP
Semiconductors products in order to avoid a default of the applications
and the products or of the application or use by customer’s third party
customer(s). NXP does not accept any liability in this respect.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Contents
1 Introduction ......................................................... 2 2.5.1 Low Level Power Management (PM) ...............26
1.1 Overview ............................................................ 2 2.5.1.1 Introduction ...................................................... 26
1.1.1 Software Base ................................................... 2 2.5.1.2 Software Operation ..........................................26
1.1.2 Features .............................................................2 2.5.1.3 Source Code Structure .................................... 28
1.2 Audience ............................................................ 6 2.5.1.4 Menu Configuration Options ............................ 29
1.2.1 Conventions ....................................................... 6 2.5.1.5 Programming Interface .................................... 29
1.2.2 Definitions, Acronyms, and Abbreviations ......... 7 2.5.2 PMIC PF Regulator ......................................... 29
1.3 References .......................................................10 2.5.2.1 Introduction ...................................................... 29
2 System ................................................................12 2.5.2.2 Hardware Operation ........................................ 29
2.1 Machine-Specific Layer (MSL) .........................12 2.5.2.3 Software Operation ..........................................30
2.1.1 Introduction ...................................................... 12 2.5.2.4 Driver Features ................................................ 30
2.1.2 Interrupts (Operation) ...................................... 12 2.5.2.5 Regulator APIs ................................................ 30
2.1.2.1 Interrupt Hardware Operation .......................... 12 2.5.2.6 Driver Architecture ........................................... 31
2.1.2.2 Interrupt Software Operation ........................... 12 2.5.2.7 Driver Interface Details .................................... 31
2.1.2.3 Interrupt Features ............................................ 13 2.5.2.8 Source Code Structure .................................... 32
2.1.2.4 Interrupt Source Code Structure ......................13 2.5.2.9 Menu Configuration Options ............................ 32
2.1.2.5 Interrupt Programming Interface ...................... 13 2.5.3 CPU Frequency Scaling (CPUFREQ) ..............32
2.1.3 Timer ................................................................14 2.5.3.1 Introduction ...................................................... 32
2.1.3.1 Timer Software Operation ................................14 2.5.3.2 Software Operation ..........................................32
2.1.3.2 Timer Features ................................................ 14 2.5.3.3 Source Code Structure .................................... 33
2.1.3.3 Timer Source Code Structure .......................... 14 2.5.3.4 Menu Configuration Options ............................ 34
2.1.3.4 Timer Programming Interface .......................... 15 2.5.4 Dynamic Bus Frequency ................................. 34
2.1.4 Memory Map ....................................................15 2.5.4.1 Introduction ...................................................... 34
2.1.4.1 Memory Map Hardware Operation .................. 15 2.5.4.2 Operation ......................................................... 34
2.1.4.2 Memory Map Features .................................... 15 2.5.4.3 Software Operation ..........................................34
2.1.5 IOMUX ............................................................. 15 2.5.4.4 Source Code Structure .................................... 35
2.1.5.1 IOMUX Hardware Operation ............................16 2.5.4.5 Menu Configuration Options ............................ 36
2.1.5.2 IOMUX Software Operation ............................. 16 2.5.5 Battery Charging ..............................................36
2.1.5.3 IOMUX Features ..............................................16 2.5.5.1 Introduction ...................................................... 36
2.1.5.4 IOMUX Source Code Structure ....................... 16 2.5.5.2 Software Operation ..........................................36
2.1.5.5 IOMUX Programming Interface ....................... 17 2.5.5.3 Source Code Structure .................................... 37
2.1.5.6 IOMUX Control Through GPIO Module ........... 17 2.5.5.4 Menu Configuration Options ............................ 37
2.1.6 General Purpose Input/Output (GPIO) .............18 2.6 OProfile ............................................................ 37
2.1.6.1 GPIO Software Operation ................................18 2.6.1 Introduction ...................................................... 37
2.1.6.2 GPIO Features ................................................ 19 2.6.1.1 Overview .......................................................... 37
2.1.6.3 GPIO Module Source Code Structure ............. 19 2.6.1.2 Features ...........................................................37
2.1.6.4 GPIO Programming Interface 2 ....................... 19 2.6.1.3 Hardware Operation ........................................ 37
2.1.7 Clock ................................................................ 19 2.6.1.4 Architecture-specific Components ................... 38
2.1.7.1 Clock Software Operation ................................19 2.6.1.5 oprofilefs Pseudo Filesystem ...........................38
2.1.7.2 Clock Features ................................................ 19 2.6.1.6 Generic Kernel Driver ...................................... 38
2.1.7.3 Source Code Structure .................................... 20 2.6.1.7 OProfile Daemon ............................................. 38
2.1.7.4 .......................................................................... 20 2.6.1.8 Post Profiling Tools ..........................................39
2.2 System Controller ............................................ 20 2.6.1.9 Interrupt Requirements .................................... 39
2.2.1 Introduction ...................................................... 20 2.6.2 Software Operation ..........................................39
2.3 Boot Image ...................................................... 23 2.6.2.1 Source Code Structure .................................... 39
2.3.1 Introduction ...................................................... 23 2.6.2.2 Menu Configuration Options ............................ 39
2.4 Anatop Regulator Driver .................................. 24 2.6.2.3 Programming Interface .................................... 39
2.4.1 Introduction ...................................................... 24 2.6.2.4 Example Software Configuration ..................... 40
2.4.2 Hardware Operation ........................................ 24 2.7 Pulse-Width Modulator (PWM) ........................ 40
2.4.3 Software Operation ..........................................24 2.7.1 Introduction ...................................................... 40
2.4.4 Driver Features ................................................ 24 2.7.2 Hardware Operation ........................................ 41
2.4.5 Driver Interface Details .................................... 24 2.7.3 Clocks .............................................................. 41
2.4.6 Regulator APIs ................................................ 25 2.7.4 Software Operation ..........................................42
2.4.7 Source Code Structure .................................... 25 2.7.5 Driver Features ................................................ 42
2.4.8 Menu Configuration Options ............................ 26 2.7.6 Source Code Structure .................................... 42
2.5 Power Management .........................................26 2.7.7 Menu Configuration Options ............................ 42
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
2.8 Remote Processor Messaging .........................43 3.4.9 Source Code Structure .................................... 60
2.8.1 Introduction ...................................................... 43 3.4.10 Menu Configuration Options ............................ 60
2.8.2 Features ...........................................................44 3.5 Quad Serial Peripheral Interface (QuadSPI) ....61
2.8.3 Source Code ....................................................44 3.5.1 Introduction ...................................................... 61
2.8.4 Menu Configuration Options ............................ 45 3.5.2 Hardware Operation ........................................ 61
2.8.5 Running i.MX RPMsg Test Programs .............. 45 3.5.3 Software Operation ..........................................61
2.9 Thermal ............................................................46 3.5.4 Driver Features ................................................ 62
2.9.1 Introduction ...................................................... 46 3.5.5 Source Code Structure .................................... 62
2.9.2 Software Operation ..........................................47 3.5.6 Menu Configuration Options ............................ 62
2.9.3 Source Code Structure .................................... 47 3.6 SATA ................................................................ 63
2.9.4 Menu Configuration Options ............................ 47 3.6.1 Introduction ...................................................... 63
2.10 Sensors ............................................................47 3.6.2 Board Configuration Options ........................... 63
2.10.1 Introduction ...................................................... 47 3.6.3 Software Operation ..........................................63
2.10.2 Sensor Driver Software Operation ...................48 3.6.4 Source Code Structure .................................... 63
2.10.3 Source Code Structure .................................... 48 3.6.5 Menu Configuration Options ............................ 63
2.10.4 Menu Configuration Options ............................ 48 3.6.6 Programming Interface .................................... 64
2.11 Watchdog (WDOG) ..........................................49 3.6.7 Usage Example ............................................... 64
2.11.1 Introduction ...................................................... 49 3.6.8 Usage Example ............................................... 64
2.11.2 Hardware Operation ........................................ 49 3.7 Smart Direct Memory Access (SDMA) API ...... 66
2.11.3 Software Operation ..........................................49 3.7.1 Overview .......................................................... 66
2.11.4 Generic WDOG ............................................... 49 3.7.2 Hardware Operation ........................................ 66
2.11.5 Driver Features ................................................ 49 3.7.3 Software Operation ..........................................66
2.11.6 Source Code Structure .................................... 49 3.7.4 Source Code Structure .................................... 67
2.11.7 Menu Configuration Options ............................ 50 3.7.5 Special peripheral with SDMA cases ...............67
2.11.8 Programming Interface .................................... 50 3.7.5.1 I2C in i.MX 6/7Dual/8M ................................... 67
3 Storage ............................................................... 50 3.8 SPI NOR Flash Memory Technology Device
3.1 AHB-to-APBH Bridge with DMA (APBH- (MTD) ...............................................................68
Bridge-DMA) .................................................... 50 3.8.1 Introduction ...................................................... 68
3.1.1 Overview .......................................................... 50 3.8.2 Hardware Operation ........................................ 68
3.1.1.1 Hardware Operation ........................................ 51 3.8.3 Software Operation ..........................................68
3.1.1.2 Software Operation ..........................................51 3.8.4 Source Code Structure .................................... 69
3.1.1.3 Source Code Structure .................................... 51 3.8.5 Menu Configuration Options ............................ 69
3.1.1.4 Menu Configuration Options ............................ 52 4 Connectivity .......................................................69
3.1.1.5 Programming Interface .................................... 52 4.1 ADC ................................................................. 69
3.2 EIM NOR ......................................................... 52 4.1.1 ADC Introduction ............................................. 69
3.2.1 Introduction ...................................................... 52 4.1.2 ADC External Signals ...................................... 70
3.2.2 Hardware Operation ........................................ 52 4.1.3 ADC Driver Overview ...................................... 70
3.2.3 Software Operation ..........................................52 4.1.4 Source Code Structure .................................... 70
3.2.4 Source Code ....................................................52 4.1.5 Menu Configuration Options ............................ 71
3.2.5 Enabling the EIM NOR .................................... 52 4.1.6 Programming Interface .................................... 71
3.3 MMC/SD/SDIO Host ........................................ 52 4.2 ENET IEEE-1588 .............................................71
3.3.1 Introduction ...................................................... 52 4.2.1 Introduction ...................................................... 71
3.3.2 Hardware Operation ........................................ 53 4.2.1.1 Transmit Timestamping ................................... 72
3.3.3 Software Operation ..........................................54 4.2.1.2 Receive Timestamping .................................... 72
3.3.4 Driver Features ................................................ 55 4.2.2 Software Operation ..........................................73
3.3.5 Source Code Structure .................................... 55 4.2.2.1 Source Code Structure .................................... 73
3.3.6 Menu Configuration Options ............................ 55 4.2.2.2 Menu Configuration Options ............................ 73
3.3.7 Device Tree Binding ........................................ 56 4.2.2.3 Programming Interface .................................... 73
3.3.8 Programming Interface .................................... 57 4.2.3 1588 Stack Introduction ...................................73
3.3.9 Loadable Module Operations ...........................57 4.2.3.1 Linuxptp Stack Features ..................................73
3.4 NAND GPMI Flash .......................................... 57 4.2.3.2 Using Linuxptp .................................................73
3.4.1 Introduction ...................................................... 57 4.3 Enhanced Configurable Serial Peripheral
3.4.2 Hardware Operation ........................................ 58 Interface (ECSPI) .............................................74
3.4.3 Software Operation ..........................................58 4.3.1 Introduction ...................................................... 74
3.4.4 Basic Operations: Read/Write ......................... 58 4.3.2 Software Operation ..........................................74
3.4.5 Backward Compatibility ................................... 59 4.3.3 SPI Sub-System in Linux OS .......................... 75
3.4.6 Error Correction ............................................... 59 4.3.4 Software Limitations ........................................ 75
3.4.7 Boot Control Block Management ..................... 60 4.3.5 Standard Operations ........................................76
3.4.8 Bad Block Handling ......................................... 60 4.3.6 ECSPI Synchronous Operation ....................... 76
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
6.5.4.2 Menu Configuration Options .......................... 180 7.4.2 S/PDIF Tx Driver ........................................... 203
6.6 Video Analog-to-Digital Converter (VADC) .....181 7.4.2.1 Driver Design .................................................204
6.6.1 Introduction .................................................... 181 7.4.2.2 Provided User Interface .................................204
6.6.2 Software Operation ........................................181 7.4.3 S/PDIF Rx Driver ...........................................204
6.6.3 Source Code Structure .................................. 181 7.4.3.1 Driver Design .................................................205
6.6.4 Menu Configuration Options .......................... 182 7.4.3.2 Provided User Interface .................................206
6.6.5 DTS Configuration ......................................... 182 7.4.4 Source Code Structure .................................. 207
6.7 Video Processing Unit (VPU) .........................182 7.4.4.1 Menu Configuration Options .......................... 207
6.7.1 Introduction .................................................... 182 7.4.4.2 Device Tree Bindings .................................... 208
6.7.2 Software Operation ........................................182 7.4.4.3 Interrupts and Exceptions .............................. 208
6.7.3 Source Code Structure .................................. 186 7.4.5 Unit Test Preparation ..................................... 208
6.7.4 Menu Configuration Options .......................... 187 7.4.5.1 Tx test step ....................................................208
6.8 JPEG Encoder and Decoder ......................... 187 7.4.5.2 Rx test step ................................................... 208
6.8.1 Introduction .................................................... 187 7.5 Audio Mixer (AUDMIX) .................................. 209
6.8.2 Overview of the JPEG Encoder and 7.5.1 Introduction .................................................... 209
Decoder Driver .............................................. 188 7.5.2 Block diagram ................................................209
6.8.3 Limitations of the JPEG Encoder/Decoder 7.5.3 Hardware Overview ....................................... 210
Driver ............................................................. 188 7.5.4 Software Overview .........................................210
7 Audio ................................................................ 189 7.5.4.1 User Interface ................................................ 210
7.1 Advanced Linux Sound Architecture (ALSA) 7.5.4.2 Source Code Structure .................................. 212
System on a Chip (ASoC) Sound .................. 189 7.5.4.3 Menu Configuration Options .......................... 212
7.1.1 ALSA Sound Driver Introduction ....................189 7.6 PDM Microphone Interface (MICFIL) ............. 212
7.1.2 SoC Sound Card ........................................... 191 7.6.1 Introduction .................................................... 212
7.1.2.1 Stereo CODEC Features ............................... 191 7.6.2 Block diagram ................................................213
7.1.2.2 7.1 Audio Codec Features .............................191 7.6.3 Hardware Overview ....................................... 213
7.1.2.3 AM/FM Codec Features ................................ 192 7.6.4 Software Overview .........................................214
7.1.2.4 Sound Card Information ................................ 192 7.6.4.1 User Interface ................................................ 214
7.1.3 Hardware Operation ...................................... 192 7.6.4.2 Source Code Structure .................................. 216
7.1.3.1 Stereo Audio CODEC ....................................192 7.6.4.3 Menu Configuration Options .......................... 216
7.1.3.2 7.1 Audio Codec ............................................193 8 Security ............................................................ 216
7.1.3.3 AM/FM Codec ................................................193 8.1 Cryptographic Acceleration and Assurance
7.1.4 Software Operation ........................................193 Module (CAAM) ............................................. 216
7.1.4.1 ASoC Driver Source Architecture .................. 193 8.1.1 CAAM Device Driver Overview ......................216
7.1.4.2 Sound Card Registration ............................... 194 8.1.2 Configuration and Job Execution Level ......... 217
7.1.4.3 Device Open ..................................................194 8.1.3 Control/Configuration Driver .......................... 217
7.1.4.4 Device Tree Binding ...................................... 194 8.1.4 Job Ring Driver ..............................................217
7.1.4.5 Source Code Structure .................................. 195 8.1.5 API Interface Level ........................................ 218
7.1.4.6 Menu Configuration Options .......................... 196 8.1.6 Driver Configuration .......................................221
7.2 Asynchronous Sample Rate Converter 8.1.7 Limitations ......................................................222
(ASRC) ...........................................................197 8.1.8 Limitations in the Existing Implementation
7.2.1 Introduction .................................................... 197 Overview ........................................................ 222
7.2.1.1 Hardware Operation ...................................... 197 8.1.9 Initialize Keystore Management Interface ...... 223
7.2.2 Software Operation ........................................197 8.1.10 Detect Available Secure Memory Storage
7.2.2.1 Sequence for Memory to ASRC to Memory ...198 Units ...............................................................223
7.2.2.2 Sequence for Memory to ASRC to 8.1.11 Establish Keystore in Detected Unit .............. 223
Peripheral .......................................................198 8.1.12 Release Keystore .......................................... 224
7.2.2.3 Source Code Structure .................................. 199 8.1.13 Allocate a Slot from the Keystore .................. 224
7.2.2.4 Menu Configuration Options .......................... 199 8.1.14 Load Data into a Keystore Slot ......................225
7.2.2.5 Device Tree Binding ...................................... 199 8.1.15 Demo Image Update ..................................... 225
7.2.2.6 Programming Interface (Exported API and 8.1.16 Decapsulate Data in the Keystore ................. 226
IOCTLs) ......................................................... 200 8.1.17 Read Data From a Keystore Slot ...................226
7.3 HDMI Audio ................................................... 201 8.1.18 Release a Slot back to the Keystore ..............227
7.3.1 Introduction .................................................... 201 8.1.19 CAAM/SNVS - Security Violation Handling
7.4 The Sony/Philips Digital Interface (S/PDIF) ... 201 Interface Overview .........................................228
7.4.1 Introduction .................................................... 201 8.1.20 Operation ....................................................... 228
7.4.1.1 S/PDIF Overview ........................................... 201 8.1.21 Configuration Interface .................................. 229
7.4.1.2 Hardware Overview ....................................... 202 8.1.22 Install a Handler ............................................ 229
7.4.1.3 Software Overview .........................................203 8.1.23 Remove an Installed Driver ........................... 229
7.4.1.4 ASoC Layer ................................................... 203 8.1.24 Driver Configuration CAAM/SNVS .................230
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
8.2 Display Content Integrity Checker (DCIC) ..... 230 11.1.2 Owire ..............................................................248
8.2.1 Introduction .................................................... 230 11.1.2.1 Test Name ..................................................... 248
8.2.2 Source Code Structure .................................. 230 11.1.3 Power Management .......................................249
8.2.3 Menu Configuration Options .......................... 230 11.1.3.1 Test Name ..................................................... 249
8.2.4 DTS Configuration ......................................... 230 11.1.4 Remote Processor Messaging .......................253
8.2.5 IOCTLs Functions ..........................................231 11.1.4.1 Test Name ..................................................... 253
8.2.6 Structures .......................................................231 11.1.5 Watchdog (WDOG) ........................................254
8.2.7 DCIC CRC Calculation Functions ..................231 11.1.5.1 Test Name ..................................................... 254
8.3 Smart Card Interface - Subscriber 11.2 Storage .......................................................... 255
Identification Module (SIM) ............................ 231 11.2.1 Media Local Bus ............................................255
8.3.1 Introduction .................................................... 231 11.2.1.1 Test Name ..................................................... 255
8.3.2 Modes of Operation ....................................... 232 11.2.2 MMC/SD/SDIO Host ...................................... 256
8.3.3 External Signal Description ............................232 11.2.2.1 Test Name ..................................................... 256
8.3.4 Source Code Structure .................................. 232 11.2.3 MMDC ............................................................256
8.3.5 Menu Configuration Options .......................... 232 11.2.3.1 Test Name ..................................................... 256
8.3.6 Software Framework ......................................232 11.2.4 SATA .............................................................. 257
8.4 Secure Non-Volatile Storage (SNVS) ............ 234 11.2.4.1 Test Name ..................................................... 257
8.4.1 Introduction .................................................... 234 11.3 Connectivity ................................................... 257
8.5 SNVS Real Time Clock (SRTC) .................... 235 11.3.1 Enhanced Configurable Serial Peripheral
8.5.1 Introduction .................................................... 235 Interface (ECSPI) ...........................................257
8.5.2 Hardware Operation ...................................... 235 11.3.1.1 Test Name ..................................................... 257
8.5.3 Software Operation ........................................235 11.3.2 ETM ............................................................... 258
8.5.4 Driver Features .............................................. 235 11.3.2.1 Test Name ..................................................... 258
8.5.5 Source Code Structure .................................. 235 11.3.3 Inter-IC (I2C) ..................................................259
8.5.6 Menu Configuration Options .......................... 235 11.3.3.1 Test Name ..................................................... 259
9 NXP eIQ Machine Learning ............................ 236 11.3.4 IIM .................................................................. 259
9.1 Overview of NXP eIQ Machine Learning ....... 236 11.3.4.1 Test Name ..................................................... 259
9.1.1 Introduction (ML) ............................................236 11.3.5 Keyboard ........................................................260
9.1.2 OpenCV ......................................................... 236 11.3.5.1 Test Name ..................................................... 260
9.1.3 Arm Compute ................................................ 237 11.3.6 Low Power Universal Asynchronous
9.1.4 TensorFlow Lite ............................................. 237 Receiver/Transmitter (LPUART) .................... 260
9.1.5 ONNX Runtime .............................................. 237 11.3.6.1 Test Name ..................................................... 260
9.1.6 PyTorch .......................................................... 237 11.3.7 USB ................................................................261
9.1.7 DeepViewRTTM .............................................237 11.3.7.1 Test Name ..................................................... 261
9.1.8 TVM ............................................................... 238 11.4 Graphics .........................................................262
10 Data Plane Development Kit (DPDK) ............. 238 11.4.1 Graphics Processing Unit (GPU) ................... 262
10.1 Introduction .................................................... 238 11.4.1.1 Test Name ..................................................... 262
10.1.1 Supported Platforms and Platform-Specific 11.5 Video ..............................................................263
Details ............................................................ 238 11.5.1 Display ........................................................... 263
10.1.1.1 i.MX 8M Mini EVK (i.MX 8MM) ...................... 238 11.5.1.1 Test Name ..................................................... 263
10.1.1.2 i.MX 8M Plus EVK (i.MX 8MP) ...................... 239 11.5.2 High-Definition Multimedia Interface (HDMI)
10.1.2 References .....................................................239 and Display Port (DP) Overview .................... 268
10.2 DPDK Overview .............................................240 11.5.2.1 Test Name ..................................................... 268
10.2.1 DPDK Platform Support .................................240 11.5.3 Video Processing Unit (VPU) .........................269
10.2.2 ENETFEC: Supported DPDK Features ......... 241 11.5.3.1 Test for i.MX 6 ............................................... 269
10.3 Build DPDK ....................................................241 11.5.3.2 Test for i.MX 8M Quad .................................. 270
10.3.1 Build DPDK Using Yocto ............................... 242 11.5.3.3 Test for i.MX 8M Mini .................................... 271
10.3.2 Standalone Build of DPDK Libraries and 11.5.3.4 Test for i.MX 8QuadXPlus and 8QuadMax .... 271
Applications ....................................................242 11.5.4 JPEG Encoder and Decoder ......................... 272
10.4 Executing DPDK Applications on Host .......... 245 11.5.4.1 Test Name ..................................................... 272
10.4.1 Booting up the Target board .......................... 245 11.6 Audio ..............................................................274
10.4.2 Device tree file ...............................................245 11.6.1 Advanced Linux Sound Architecture (ALSA)
10.4.3 Prerequisite for running DPDK applications ...245 System on a Chip (ASoC) Sound .................. 274
10.4.4 DPDK Example Applications ......................... 246 11.6.1.1 Test Name ..................................................... 274
10.5 Troubleshooting ............................................. 247 11.6.2 Asynchronous Sample Rate Converter
11 Unit Tests ......................................................... 248 (ASRC) ...........................................................274
11.1 System ........................................................... 248 11.6.2.1 Test Name ..................................................... 274
11.1.1 OProfile .......................................................... 248 11.7 Security .......................................................... 275
11.1.1.1 Test Name ..................................................... 248 11.7.1 Display Content Integrity Checker (DCIC) ..... 275
IMXLXRM All information provided in this document is subject to legal disclaimers. © 2022 NXP B.V. All rights reserved.
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.