Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mxs-dma.c File Reference
#include <linux/init.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/dmaengine.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/fsl/mxs-dma.h>
#include <linux/stmp_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/irq.h>
#include "dmaengine.h"

Go to the source code of this file.

Data Structures

struct  mxs_dma_ccw
 
struct  mxs_dma_chan
 
struct  mxs_dma_engine
 
struct  mxs_dma_type
 

Macros

#define dma_is_apbh(mxs_dma)   ((mxs_dma)->type == MXS_DMA_APBH)
 
#define apbh_is_old(mxs_dma)   ((mxs_dma)->dev_id == IMX23_DMA)
 
#define HW_APBHX_CTRL0   0x000
 
#define BM_APBH_CTRL0_APB_BURST8_EN   (1 << 29)
 
#define BM_APBH_CTRL0_APB_BURST_EN   (1 << 28)
 
#define BP_APBH_CTRL0_RESET_CHANNEL   16
 
#define HW_APBHX_CTRL1   0x010
 
#define HW_APBHX_CTRL2   0x020
 
#define HW_APBHX_CHANNEL_CTRL   0x030
 
#define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL   16
 
#define HW_APBHX_CHn_NXTCMDAR(d, n)   (((dma_is_apbh(d) && apbh_is_old(d)) ? 0x050 : 0x110) + (n) * 0x70)
 
#define HW_APBHX_CHn_SEMA(d, n)   (((dma_is_apbh(d) && apbh_is_old(d)) ? 0x080 : 0x140) + (n) * 0x70)
 
#define BP_CCW_COMMAND   0
 
#define BM_CCW_COMMAND   (3 << 0)
 
#define CCW_CHAIN   (1 << 2)
 
#define CCW_IRQ   (1 << 3)
 
#define CCW_DEC_SEM   (1 << 6)
 
#define CCW_WAIT4END   (1 << 7)
 
#define CCW_HALT_ON_TERM   (1 << 8)
 
#define CCW_TERM_FLUSH   (1 << 9)
 
#define BP_CCW_PIO_NUM   12
 
#define BM_CCW_PIO_NUM   (0xf << 12)
 
#define BF_CCW(value, field)   (((value) << BP_CCW_##field) & BM_CCW_##field)
 
#define MXS_DMA_CMD_NO_XFER   0
 
#define MXS_DMA_CMD_WRITE   1
 
#define MXS_DMA_CMD_READ   2
 
#define MXS_DMA_CMD_DMA_SENSE   3 /* not implemented */
 
#define MAX_XFER_BYTES   0xff00
 
#define MXS_PIO_WORDS   16
 
#define CCW_BLOCK_SIZE   (4 * PAGE_SIZE)
 
#define NUM_CCW   (int)(CCW_BLOCK_SIZE / sizeof(struct mxs_dma_ccw))
 
#define MXS_DMA_SG_LOOP   (1 << 0)
 
#define MXS_DMA_CHANNELS   16
 
#define MXS_DMA_CHANNELS_MASK   0xffff
 

Enumerations

enum  mxs_dma_devtype { MXS_DMA_APBH, MXS_DMA_APBX }
 
enum  mxs_dma_id { IMX23_DMA, IMX28_DMA }
 

Functions

 MODULE_DEVICE_TABLE (of, mxs_dma_dt_ids)
 
int mxs_dma_is_apbh (struct dma_chan *chan)
 
 EXPORT_SYMBOL_GPL (mxs_dma_is_apbh)
 
int mxs_dma_is_apbx (struct dma_chan *chan)
 
 EXPORT_SYMBOL_GPL (mxs_dma_is_apbx)
 
 subsys_initcall (mxs_dma_module_init)
 

Macro Definition Documentation

#define apbh_is_old (   mxs_dma)    ((mxs_dma)->dev_id == IMX23_DMA)

Definition at line 42 of file mxs-dma.c.

#define BF_CCW (   value,
  field 
)    (((value) << BP_CCW_##field) & BM_CCW_##field)

Definition at line 87 of file mxs-dma.c.

#define BM_APBH_CTRL0_APB_BURST8_EN   (1 << 29)

Definition at line 45 of file mxs-dma.c.

#define BM_APBH_CTRL0_APB_BURST_EN   (1 << 28)

Definition at line 46 of file mxs-dma.c.

#define BM_CCW_COMMAND   (3 << 0)

Definition at line 77 of file mxs-dma.c.

#define BM_CCW_PIO_NUM   (0xf << 12)

Definition at line 85 of file mxs-dma.c.

#define BP_APBH_CTRL0_RESET_CHANNEL   16

Definition at line 47 of file mxs-dma.c.

#define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL   16

Definition at line 51 of file mxs-dma.c.

#define BP_CCW_COMMAND   0

Definition at line 76 of file mxs-dma.c.

#define BP_CCW_PIO_NUM   12

Definition at line 84 of file mxs-dma.c.

#define CCW_BLOCK_SIZE   (4 * PAGE_SIZE)

Definition at line 104 of file mxs-dma.c.

#define CCW_CHAIN   (1 << 2)

Definition at line 78 of file mxs-dma.c.

#define CCW_DEC_SEM   (1 << 6)

Definition at line 80 of file mxs-dma.c.

#define CCW_HALT_ON_TERM   (1 << 8)

Definition at line 82 of file mxs-dma.c.

#define CCW_IRQ   (1 << 3)

Definition at line 79 of file mxs-dma.c.

#define CCW_TERM_FLUSH   (1 << 9)

Definition at line 83 of file mxs-dma.c.

#define CCW_WAIT4END   (1 << 7)

Definition at line 81 of file mxs-dma.c.

#define dma_is_apbh (   mxs_dma)    ((mxs_dma)->type == MXS_DMA_APBH)

Definition at line 41 of file mxs-dma.c.

#define HW_APBHX_CHANNEL_CTRL   0x030

Definition at line 50 of file mxs-dma.c.

#define HW_APBHX_CHn_NXTCMDAR (   d,
  n 
)    (((dma_is_apbh(d) && apbh_is_old(d)) ? 0x050 : 0x110) + (n) * 0x70)

Definition at line 56 of file mxs-dma.c.

#define HW_APBHX_CHn_SEMA (   d,
  n 
)    (((dma_is_apbh(d) && apbh_is_old(d)) ? 0x080 : 0x140) + (n) * 0x70)

Definition at line 58 of file mxs-dma.c.

#define HW_APBHX_CTRL0   0x000

Definition at line 44 of file mxs-dma.c.

#define HW_APBHX_CTRL1   0x010

Definition at line 48 of file mxs-dma.c.

#define HW_APBHX_CTRL2   0x020

Definition at line 49 of file mxs-dma.c.

#define MAX_XFER_BYTES   0xff00

Definition at line 98 of file mxs-dma.c.

#define MXS_DMA_CHANNELS   16

Definition at line 121 of file mxs-dma.c.

#define MXS_DMA_CHANNELS_MASK   0xffff

Definition at line 122 of file mxs-dma.c.

#define MXS_DMA_CMD_DMA_SENSE   3 /* not implemented */

Definition at line 92 of file mxs-dma.c.

#define MXS_DMA_CMD_NO_XFER   0

Definition at line 89 of file mxs-dma.c.

#define MXS_DMA_CMD_READ   2

Definition at line 91 of file mxs-dma.c.

#define MXS_DMA_CMD_WRITE   1

Definition at line 90 of file mxs-dma.c.

#define MXS_DMA_SG_LOOP   (1 << 0)

Definition at line 118 of file mxs-dma.c.

#define MXS_PIO_WORDS   16

Definition at line 100 of file mxs-dma.c.

#define NUM_CCW   (int)(CCW_BLOCK_SIZE / sizeof(struct mxs_dma_ccw))

Definition at line 105 of file mxs-dma.c.

Enumeration Type Documentation

Enumerator:
MXS_DMA_APBH 
MXS_DMA_APBX 

Definition at line 124 of file mxs-dma.c.

enum mxs_dma_id
Enumerator:
IMX23_DMA 
IMX28_DMA 

Definition at line 129 of file mxs-dma.c.

Function Documentation

EXPORT_SYMBOL_GPL ( mxs_dma_is_apbh  )
EXPORT_SYMBOL_GPL ( mxs_dma_is_apbx  )
MODULE_DEVICE_TABLE ( of  ,
mxs_dma_dt_ids   
)
int mxs_dma_is_apbh ( struct dma_chan chan)

Definition at line 197 of file mxs-dma.c.

int mxs_dma_is_apbx ( struct dma_chan chan)

Definition at line 206 of file mxs-dma.c.

subsys_initcall ( mxs_dma_module_init  )