iWave Japan      Welcome to iWave Systems

SDMA usage in i.MX6

The SDMA controller in the i.MX6 is a simple RISC processor core, with its private memory space and some specialized functional units. The SDMA controller is responsible to perform data transfer inside a multi-core platform. It works side-by-side with the main ARM processor, detached from it. Special registers in the ARM processor controls the SDMA’s sub system, and special commands on the SDMA’s controller allow it to access the ARM processor’s memory space and send interrupts.

SDMA Software Structure

The table below shows the software source files of SDMA controller.

File

Description

dmaengine.c

SDMA management routine and API’s

imx-sdma.c

SDMA implement driver

sdma-mx6q-to1.bin.ihex

SDMA RAM scripts

SDMA API Driver

The SDMA API driver provides APIs for other drivers to control SDMA channels. SDMA channels run dedicated scripts according to peripheral and transfer types. The SDMA API driver is responsible for loading the scripts into SDMA memory, initializing the channel descriptors, and controlling the buffer descriptors and SDMA registers.

The SDMA driver 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
  • Call-back mechanism at the end of script execution

A driver can specify the SDMA channel number that it wishes to use, static channel allocation, or can have the SDMA driver provide a free SDMA channel for the driver to use, dynamic channel allocation. For dynamic channel allocation, the list of SDMA channels is scanned from channel 32 to channel 1. Upon finding a free channel, that channel is allocated for the requested DMA transfers.

SDMA Script

The SDMA controller executes short routines that perform necessary DMA transfers; these routines are called SDMA scripts. The scripts are written in SDMA assembly, and developed to use with many kinds of data transfer. All the scripts of the SDMA scripts library are platform independent but they need parameters to work - it can be seen as the arguments of a C function – and the parameters are platform dependent. These scripts are executed either by some internal event or directly by the main processor’s software.

The execution of an SDMA script depends on both the instructions that make up the script and the data context upon which it operates. Both must be initialized before the script is allowed to execute which is taken care by SDMA driver. These SDMA scripts are grouped together and is available in sdma-mx6q-to1.bin.ihex file. The SDMA scripts available for use and its start address can be referred from the imx-sdma.c file.

For further information or enquiries please write to mktg@iwavesystems.com or contact our Regional Partners.