AM335x EDMA Drivers Guide
AM335x EDMA Drivers Guide
php/AM335x_EDMA_Driver's_Guide
Contents
1 Introduction
2 Driver Configuration
2.1 Building into Kernel
3 How to reserve different EDMA3 resources (DMA channels, TCCs, PaRAM Sets) on ARM side (region 0)
3.1 DMA Channels
3.2 TCCs (i.e Interrupt channels)
3.3 PaRAM Sets
4 How to change various other global settings
4.1 How to change default event queue (or Transfer Controller, TC) priorities?
5 Present configuration of EDMA3 resources on AM335x platform
6 How to Program the Cross bar events
7 Sample test application for EDMA Driver
Introduction
The enhanced direct memory access (EDMA3) controller’s primary purpose is to service programmed data transfers
between two memory-mapped slave endpoints on the device.
The EDMA3 channel controller serves as the user interface for the EDMA3 controller. The EDMA3CC includes parameter
RAM (PaRAM), channel control registers, and interrupt control registers. The EDMA3CC serves to prioritize incoming
software requests or events from peripherals, and submits transfer requests (TR) to the transfer controller.
The EDMA3 transfer controllers are slaves to the EDMA3 channel controller responsible for data movement. The transfer
controller issues read/write commands to the source and destination addresses programmed for a given transfer. The
operation is transparent to you.
Driver Configuration
EDMA3 could be disabled/enabled from the following location during menuconfig.
1 de 5 24/05/2016 09:47
AM335x EDMA Driver's Guide - Texas Instruments Wiki http://processors.wiki.ti.com/index.php/AM335x_EDMA_Driver's_Guide
support
CAUTION
As many modules use EDMA for data transfer, do not disable this option. Disabling this will break the compilation.
DMA Channels
In the source file arch/arm/mach-omap2/devices.c, array am33xx_dma_rsv_chans[][2] is used to reserve various DMA
channels to the shadow regions of all other masters other than ARM. The first dimension is to mention the channel which is
going to be reserved and the second dimension is to mention how many channels from that channel number will be reserved.
So all other channels that are not reserved in this section can be used in the ARM side. See the code snippet below:
The first entry means 2 channels from channel '0' i.e. channels '0-1' will be reserved for usage of other masters.
To reserve/un-reserve the DMA channels, one has to modify this array accordingly, such that the reserved DMA channel(s)
should NOT be used in the present core. All masters should work upon ONLY their subset of resources. In case of a conflict
(different masters working on same set of resources), the system behavior is unpredictable.
PaRAM Sets
In the source file arch/arm/mach-omap2/devices.c, array am33xx_dma_rsv_slots[][2] is used to reserve various PARAM
sets (slot) to the shadow regions of all other masters other than ARM. The first dimension is to mention the slot which is
going to be reserved and the second dimension is to mention how many slots from that slot number will be reserved. So all
other slots that are not reserved in this section can be used in the ARM side. See the code snippet below:
2 de 5 24/05/2016 09:47
AM335x EDMA Driver's Guide - Texas Instruments Wiki http://processors.wiki.ti.com/index.php/AM335x_EDMA_Driver's_Guide
{26, 6},
{48, 4},
{56, 8},
{64, 127},
{-1, -1}
};
The first entry means 2 slots from slot '0' i.e. slots '0-1' will be reserved for usage of other masters.
To reserve/un-reserve the PARAM sets, one has to modify this array accordingly, such that the reserved slot(s) should NOT
be used in the present core. All masters should work upon ONLY their subset of resources. In case of a conflict (different
masters working on same set of resources), the system behavior is unpredictable.
Note 1: DMA channels and PaRAM Sets are one-to-one mapped, meaning thereby DMA channel X can ONLY use PaRAM
Set X for its working. The system integrator should make sure that the DMA channels reserved to ARM side should also
have the corresponding PaRAM Sets (at least) reserved to ARM side. Other PaRAM Sets available on the ARM side (lying
between 64-255) could be used for link purpose. So they can be independently reserved/unreserved to ARM side.
Note 2: A DMA/QDMA channel also require a TCC for correct functioning. By default, DMA channels and TCCs are
one-to-one mapped, meaning thereby DMA channel Y can ONLY use TCC Y for its working. (No such constraint is there
for QDMA channels.) The system integrator should assume that the DMA channels reserved to ARM side, also have the
corresponding TCCs (at least) reserved to ARM side. In case user passes a specific TCC to be used by the DMA/QDMA
channel, he/she should first check its availability on ARM side.
The system integrator can appropriately modify this array, keeping bandwidth limitations (for different users and whole
system in general) in mind.
DMA Channel 2-13, 16-24, 36-47, 52-55 0-1, 14-13, 26-31, 48-51, 56-63
QDMA Channel 0,1 2-7
TCC 2-13, 16-24, 36-47, 52-55 0-1, 14-13, 26-31, 48-51, 56-63
PaRAM Set 2-13, 16-24, 36-47, 52-55, 64-127 0-1, 14-13, 26-31, 48-51, 56-63 , 128 - 255
3 de 5 24/05/2016 09:47
AM335x EDMA Driver's Guide - Texas Instruments Wiki http://processors.wiki.ti.com/index.php/AM335x_EDMA_Driver's_Guide
cross bar events) are routed to any of the 64 channels by a cross bar switch. Programming of the cross bar is available at
the system control module level.
EDMA driver takes care of this routing via the array am33xx_xbar_event_mapping[]. When a request for a channel
is made for an event of event number > 63, then the channel allocation is based on the below mentioned array. The
first dimension is the cross bar event number which is essentially the actual event number - 63. The second dimension is the
channel number to which you want the event to be routed. See the code snippet below:
To route the event 81 through channel 16, one has to modify the above array as {18,16}, instead of {18,-1}.(81-63=18)
The system integrator has to modify this array, keeping in mind that the second dimension should be an integer between
0-63. He should also make sure that if channel x is used for cross bar events then its default event, event x is not required.
The sample EDMA application is available along with other Module examples as a tar archive in src directory of PSP
release package (Directory Structure of PSP release package can be seen here AM335x PSP Package Contents)
Copy this sample application file in a location (preferably not inside the kernel source code) and build it as a kernel module
using a make file similar to one shown below
obj-m = edma_test.o
KDIR = "../linux-kernel"
all:
make -C $(KDIR) M=$(PWD) ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- modules
clean:
make -C $(KDIR) M=$(PWD) clean
Insert this kernel module once the kernel is up, to see the sample application working.
For technical support please post your questions at http://e2e.ti.com. Please post only
comments about the article AM335x EDMA Driver's Guide here.
Links
4 de 5 24/05/2016 09:47
AM335x EDMA Driver's Guide - Texas Instruments Wiki http://processors.wiki.ti.com/index.php/AM335x_EDMA_Driver's_Guide
Amplifiers & Linear DLP & MEMS Processors (http://www.ti.com Switches & Multiplexers (http://www.ti.com
(http://www.ti.com/lsds/ti (http://www.ti.com /lsds/ti /lsds/ti/analog
/analog /lsds/ti/analog /dsp/embedded_processor.page) /switches_and_multiplexers.page)
/amplifier_and_linear.page) /mems/mems.page) Temperature Sensors & Control ICs
Audio (http://www.ti.com High-Reliability ARM Processors (http://www.ti.com/lsds/ti/analog
/lsds/ti/analog/audio (http://www.ti.com (http://www.ti.com/lsds/ti /temperature_sensor.page)
/audio_overview.page) /lsds/ti/analog /dsp/arm.page) Wireless Connectivity (http://focus.ti.com
Broadband RF/IF & Digital /high_reliability.page) Digital Signal Processors /wireless
Radio (http://www.ti.com Interface (DSP) (http://www.ti.com /docs/wirelessoverview.tsp?familyId=2003&
/lsds/ti/analog/rfif.page) (http://www.ti.com /lsds/ti/dsp/home.page) sectionId=646&tabId=2735)
Clocks & Timers /lsds/ti/analog Microcontrollers (MCU)
(http://www.ti.com/lsds/ti /interface (http://www.ti.com/lsds/ti
/analog/clocksandtimers /interface.page) /microcontroller
/clocks_and_timers.page) Logic /home.page)
Data Converters (http://www.ti.com OMAP Applications
(http://www.ti.com/lsds/ti /lsds/ti/logic Processors
/analog/dataconverters /home_overview.page) (http://www.ti.com/lsds/ti
/data_converter.page) Power Management /omap-applications-
(http://www.ti.com
processors/the-omap-
/lsds/ti/analog
experience.page)
/powermanagement
/power_portal.page)
5 de 5 24/05/2016 09:47