Data Structures | Defines | Typedefs | Enumerations | Functions

sdma.h File Reference


Detailed Description

Describes the interface to the SDMA manager.

The sdma user interface library wraps file system calls to an associated kernel module (sdmak.ko), which needs to be loaded in order for calls to to this library to succeed.

To install sdmak.ko, enter % insmod sdmak.ko on a Linux command line.

SDMA channels are allocated (requested) from within the sdmak kernel driver through the SDMA_getChannels() API. This request is granted by way of the kernel's request_dma() functionality (omap_request_dma() for the OMAP35x), so it will work in conjuntion with independent kernel DMA usage without conflict or custom kernel configuration. The granted channel's registers are memory-mapped into the calling user address space to allow the application to directly access the DMA registers for that channel.

A DMA callback ISR is registered within the stock kernel DMA manager, and this ISR is used for completion notification (although it could be customized to handle any DMA-generated interrupt). Notification to the user interface layer is accomplished by way of a user state structure whose address is passed to the sdmak kernel driver and which is directly written upon completion. Atomic hand-shaking allows the kernel driver to know if the application is going to wait for the completion by way of the corresponding sdmak ioctl(), as opposed to just checking the user state structure, and post a channel-specific mutex only when needed (otherwise just the completion flag in the state structure is set).

Since the SDMA interface library doesn't use the GT tracing facility, there is one configuration option available for the SDMA module to control whether the debug or release interface library is used for building the application. This config parameter is named 'debug' and is of type bool, and the default value is 'false'.

The following line is an example of enabling usage of the debug interface library: var sdma = xdc.useModule('ti.sdo.linuxutils.sdma.SDMA'); sdma.debug = true; This will enable "SDMA Debug" statements to be printed to stdout.

Go to the source code of this file.

Data Structures

struct  SDMA_transferState
 State structure shared between SDMAK and SDMA user layers. More...
union  SDMA_requestDmaParams
 SDMAK ioctl input/output parameters. More...
struct  SDMA_ChannelDescriptor
 Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl(). More...

Defines

#define SDMA_VERSION   0x01010000U
#define SDMA_IOCMAGIC   0x0000fb00
 SDMAK ioctl() commands.
#define SDMA_IOCCMDMASK   0x000000ff
#define SDMA_IOCREQUESTDMA   1
#define SDMA_IOCRELEASEDMA   2
#define SDMA_IOCWAITFORCOMPLETION   3
#define SDMA_IOCGETVERSION   4

Typedefs

typedef struct
SDMA_ChannelDescriptor 
SDMA_ChannelDescriptor
 Descriptor for a channel granted with a SDMA_IOCREQUESTDMA ioctl().
typedef enum SDMA_Status SDMA_Status
 Status codes for SDMA API return values.

Enumerations

enum  SDMA_Status {
  SDMA_OK = 0,
  SDMA_EFAIL,
  SDMA_ENOCHANNEL,
  SDMA_ENOINIT
}
 

Status codes for SDMA API return values.

More...

Functions

int SDMA_init (void)
 SDMA initialization API.
int SDMA_exit (void)
 SDMA finalization API.
SDMA_Status SDMA_getChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
 Returns available logical channels.
SDMA_Status SDMA_freeChannels (int numChannels, SDMA_ChannelDescriptor chanArray[])
 Frees previously requested logical channels.
SDMA_Status SDMA_wait (SDMA_ChannelDescriptor *channel)
 Waits for the transfer corresponding to this descriptor to complete.
SDMA_Status SDMA_check (SDMA_ChannelDescriptor *channel, int *pcompleted)
 Checks the status of the transfer corresponding to this descriptor and returns it in the *pcompleted field.
int SDMA_getVersion (void)
 Retrieve version from SDMA driver.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Copyright 2011, Texas Instruments Incorporated