Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
davinci_cpdma.c File Reference
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include "davinci_cpdma.h"

Go to the source code of this file.

Data Structures

struct  cpdma_desc
 
struct  cpdma_desc_pool
 
struct  cpdma_ctlr
 
struct  cpdma_chan
 
struct  cpdma_control_info
 

Macros

#define CPDMA_TXIDVER   0x00
 
#define CPDMA_TXCONTROL   0x04
 
#define CPDMA_TXTEARDOWN   0x08
 
#define CPDMA_RXIDVER   0x10
 
#define CPDMA_RXCONTROL   0x14
 
#define CPDMA_SOFTRESET   0x1c
 
#define CPDMA_RXTEARDOWN   0x18
 
#define CPDMA_TXINTSTATRAW   0x80
 
#define CPDMA_TXINTSTATMASKED   0x84
 
#define CPDMA_TXINTMASKSET   0x88
 
#define CPDMA_TXINTMASKCLEAR   0x8c
 
#define CPDMA_MACINVECTOR   0x90
 
#define CPDMA_MACEOIVECTOR   0x94
 
#define CPDMA_RXINTSTATRAW   0xa0
 
#define CPDMA_RXINTSTATMASKED   0xa4
 
#define CPDMA_RXINTMASKSET   0xa8
 
#define CPDMA_RXINTMASKCLEAR   0xac
 
#define CPDMA_DMAINTSTATRAW   0xb0
 
#define CPDMA_DMAINTSTATMASKED   0xb4
 
#define CPDMA_DMAINTMASKSET   0xb8
 
#define CPDMA_DMAINTMASKCLEAR   0xbc
 
#define CPDMA_DMAINT_HOSTERR   BIT(1)
 
#define CPDMA_DMACONTROL   0x20
 
#define CPDMA_DMASTATUS   0x24
 
#define CPDMA_RXBUFFOFS   0x28
 
#define CPDMA_EM_CONTROL   0x2c
 
#define CPDMA_DESC_SOP   BIT(31)
 
#define CPDMA_DESC_EOP   BIT(30)
 
#define CPDMA_DESC_OWNER   BIT(29)
 
#define CPDMA_DESC_EOQ   BIT(28)
 
#define CPDMA_DESC_TD_COMPLETE   BIT(27)
 
#define CPDMA_DESC_PASS_CRC   BIT(26)
 
#define CPDMA_TEARDOWN_VALUE   0xfffffffc
 
#define dmaregs   params.dmaregs
 
#define num_chan   params.num_chan
 
#define dma_reg_read(ctlr, ofs)   __raw_readl((ctlr)->dmaregs + (ofs))
 
#define chan_read(chan, fld)   __raw_readl((chan)->fld)
 
#define desc_read(desc, fld)   __raw_readl(&(desc)->fld)
 
#define dma_reg_write(ctlr, ofs, v)   __raw_writel(v, (ctlr)->dmaregs + (ofs))
 
#define chan_write(chan, fld, v)   __raw_writel(v, (chan)->fld)
 
#define desc_write(desc, fld, v)   __raw_writel((u32)(v), &(desc)->fld)
 
#define ACCESS_RO   BIT(0)
 
#define ACCESS_WO   BIT(1)
 
#define ACCESS_RW   (ACCESS_RO | ACCESS_WO)
 

Enumerations

enum  cpdma_state { CPDMA_STATE_IDLE, CPDMA_STATE_ACTIVE, CPDMA_STATE_TEARDOWN }
 

Functions

struct cpdma_ctlrcpdma_ctlr_create (struct cpdma_params *params)
 
 EXPORT_SYMBOL_GPL (cpdma_ctlr_create)
 
int cpdma_ctlr_start (struct cpdma_ctlr *ctlr)
 
 EXPORT_SYMBOL_GPL (cpdma_ctlr_start)
 
int cpdma_ctlr_stop (struct cpdma_ctlr *ctlr)
 
 EXPORT_SYMBOL_GPL (cpdma_ctlr_stop)
 
int cpdma_ctlr_dump (struct cpdma_ctlr *ctlr)
 
 EXPORT_SYMBOL_GPL (cpdma_ctlr_dump)
 
int cpdma_ctlr_destroy (struct cpdma_ctlr *ctlr)
 
 EXPORT_SYMBOL_GPL (cpdma_ctlr_destroy)
 
int cpdma_ctlr_int_ctrl (struct cpdma_ctlr *ctlr, bool enable)
 
void cpdma_ctlr_eoi (struct cpdma_ctlr *ctlr)
 
struct cpdma_chancpdma_chan_create (struct cpdma_ctlr *ctlr, int chan_num, cpdma_handler_fn handler)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_create)
 
int cpdma_chan_destroy (struct cpdma_chan *chan)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_destroy)
 
int cpdma_chan_get_stats (struct cpdma_chan *chan, struct cpdma_chan_stats *stats)
 
int cpdma_chan_dump (struct cpdma_chan *chan)
 
int cpdma_chan_submit (struct cpdma_chan *chan, void *token, void *data, int len, gfp_t gfp_mask)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_submit)
 
int cpdma_chan_process (struct cpdma_chan *chan, int quota)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_process)
 
int cpdma_chan_start (struct cpdma_chan *chan)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_start)
 
int cpdma_chan_stop (struct cpdma_chan *chan)
 
 EXPORT_SYMBOL_GPL (cpdma_chan_stop)
 
int cpdma_chan_int_ctrl (struct cpdma_chan *chan, bool enable)
 
int cpdma_control_get (struct cpdma_ctlr *ctlr, int control)
 
int cpdma_control_set (struct cpdma_ctlr *ctlr, int control, int value)
 

Variables

struct cpdma_control_info controls []
 

Macro Definition Documentation

#define ACCESS_RO   BIT(0)

Definition at line 902 of file davinci_cpdma.c.

#define ACCESS_RW   (ACCESS_RO | ACCESS_WO)

Definition at line 904 of file davinci_cpdma.c.

#define ACCESS_WO   BIT(1)

Definition at line 903 of file davinci_cpdma.c.

#define chan_read (   chan,
  fld 
)    __raw_readl((chan)->fld)

Definition at line 129 of file davinci_cpdma.c.

#define chan_write (   chan,
  fld,
  v 
)    __raw_writel(v, (chan)->fld)

Definition at line 132 of file davinci_cpdma.c.

#define CPDMA_DESC_EOP   BIT(30)

Definition at line 58 of file davinci_cpdma.c.

#define CPDMA_DESC_EOQ   BIT(28)

Definition at line 60 of file davinci_cpdma.c.

#define CPDMA_DESC_OWNER   BIT(29)

Definition at line 59 of file davinci_cpdma.c.

#define CPDMA_DESC_PASS_CRC   BIT(26)

Definition at line 62 of file davinci_cpdma.c.

#define CPDMA_DESC_SOP   BIT(31)

Definition at line 57 of file davinci_cpdma.c.

#define CPDMA_DESC_TD_COMPLETE   BIT(27)

Definition at line 61 of file davinci_cpdma.c.

#define CPDMA_DMACONTROL   0x20

Definition at line 51 of file davinci_cpdma.c.

#define CPDMA_DMAINT_HOSTERR   BIT(1)

Definition at line 48 of file davinci_cpdma.c.

#define CPDMA_DMAINTMASKCLEAR   0xbc

Definition at line 47 of file davinci_cpdma.c.

#define CPDMA_DMAINTMASKSET   0xb8

Definition at line 46 of file davinci_cpdma.c.

#define CPDMA_DMAINTSTATMASKED   0xb4

Definition at line 45 of file davinci_cpdma.c.

#define CPDMA_DMAINTSTATRAW   0xb0

Definition at line 44 of file davinci_cpdma.c.

#define CPDMA_DMASTATUS   0x24

Definition at line 52 of file davinci_cpdma.c.

#define CPDMA_EM_CONTROL   0x2c

Definition at line 54 of file davinci_cpdma.c.

#define CPDMA_MACEOIVECTOR   0x94

Definition at line 39 of file davinci_cpdma.c.

#define CPDMA_MACINVECTOR   0x90

Definition at line 38 of file davinci_cpdma.c.

#define CPDMA_RXBUFFOFS   0x28

Definition at line 53 of file davinci_cpdma.c.

#define CPDMA_RXCONTROL   0x14

Definition at line 31 of file davinci_cpdma.c.

#define CPDMA_RXIDVER   0x10

Definition at line 30 of file davinci_cpdma.c.

#define CPDMA_RXINTMASKCLEAR   0xac

Definition at line 43 of file davinci_cpdma.c.

#define CPDMA_RXINTMASKSET   0xa8

Definition at line 42 of file davinci_cpdma.c.

#define CPDMA_RXINTSTATMASKED   0xa4

Definition at line 41 of file davinci_cpdma.c.

#define CPDMA_RXINTSTATRAW   0xa0

Definition at line 40 of file davinci_cpdma.c.

#define CPDMA_RXTEARDOWN   0x18

Definition at line 33 of file davinci_cpdma.c.

#define CPDMA_SOFTRESET   0x1c

Definition at line 32 of file davinci_cpdma.c.

#define CPDMA_TEARDOWN_VALUE   0xfffffffc

Definition at line 64 of file davinci_cpdma.c.

#define CPDMA_TXCONTROL   0x04

Definition at line 28 of file davinci_cpdma.c.

#define CPDMA_TXIDVER   0x00

Definition at line 27 of file davinci_cpdma.c.

#define CPDMA_TXINTMASKCLEAR   0x8c

Definition at line 37 of file davinci_cpdma.c.

#define CPDMA_TXINTMASKSET   0x88

Definition at line 36 of file davinci_cpdma.c.

#define CPDMA_TXINTSTATMASKED   0x84

Definition at line 35 of file davinci_cpdma.c.

#define CPDMA_TXINTSTATRAW   0x80

Definition at line 34 of file davinci_cpdma.c.

#define CPDMA_TXTEARDOWN   0x08

Definition at line 29 of file davinci_cpdma.c.

#define desc_read (   desc,
  fld 
)    __raw_readl(&(desc)->fld)

Definition at line 130 of file davinci_cpdma.c.

#define desc_write (   desc,
  fld,
  v 
)    __raw_writel((u32)(v), &(desc)->fld)

Definition at line 133 of file davinci_cpdma.c.

#define dma_reg_read (   ctlr,
  ofs 
)    __raw_readl((ctlr)->dmaregs + (ofs))

Definition at line 128 of file davinci_cpdma.c.

#define dma_reg_write (   ctlr,
  ofs,
  v 
)    __raw_writel(v, (ctlr)->dmaregs + (ofs))

Definition at line 131 of file davinci_cpdma.c.

#define dmaregs   params.dmaregs

Definition at line 124 of file davinci_cpdma.c.

#define num_chan   params.num_chan

Definition at line 125 of file davinci_cpdma.c.

Enumeration Type Documentation

Enumerator:
CPDMA_STATE_IDLE 
CPDMA_STATE_ACTIVE 
CPDMA_STATE_TEARDOWN 

Definition at line 90 of file davinci_cpdma.c.

Function Documentation

struct cpdma_chan* cpdma_chan_create ( struct cpdma_ctlr ctlr,
int  chan_num,
cpdma_handler_fn  handler 
)
read

Definition at line 482 of file davinci_cpdma.c.

int cpdma_chan_destroy ( struct cpdma_chan chan)

Definition at line 539 of file davinci_cpdma.c.

int cpdma_chan_dump ( struct cpdma_chan chan)

Definition at line 570 of file davinci_cpdma.c.

int cpdma_chan_get_stats ( struct cpdma_chan chan,
struct cpdma_chan_stats stats 
)

Definition at line 558 of file davinci_cpdma.c.

int cpdma_chan_int_ctrl ( struct cpdma_chan chan,
bool  enable 
)

Definition at line 881 of file davinci_cpdma.c.

int cpdma_chan_process ( struct cpdma_chan chan,
int  quota 
)

Definition at line 774 of file davinci_cpdma.c.

int cpdma_chan_start ( struct cpdma_chan chan)

Definition at line 791 of file davinci_cpdma.c.

int cpdma_chan_stop ( struct cpdma_chan chan)

Definition at line 819 of file davinci_cpdma.c.

int cpdma_chan_submit ( struct cpdma_chan chan,
void token,
void data,
int  len,
gfp_t  gfp_mask 
)

Definition at line 654 of file davinci_cpdma.c.

int cpdma_control_get ( struct cpdma_ctlr ctlr,
int  control 
)

Definition at line 921 of file davinci_cpdma.c.

int cpdma_control_set ( struct cpdma_ctlr ctlr,
int  control,
int  value 
)

Definition at line 952 of file davinci_cpdma.c.

struct cpdma_ctlr* cpdma_ctlr_create ( struct cpdma_params params)
read

Definition at line 253 of file davinci_cpdma.c.

int cpdma_ctlr_destroy ( struct cpdma_ctlr ctlr)

Definition at line 430 of file davinci_cpdma.c.

int cpdma_ctlr_dump ( struct cpdma_ctlr ctlr)

Definition at line 359 of file davinci_cpdma.c.

void cpdma_ctlr_eoi ( struct cpdma_ctlr ctlr)

Definition at line 477 of file davinci_cpdma.c.

int cpdma_ctlr_int_ctrl ( struct cpdma_ctlr ctlr,
bool  enable 
)

Definition at line 454 of file davinci_cpdma.c.

int cpdma_ctlr_start ( struct cpdma_ctlr ctlr)

Definition at line 282 of file davinci_cpdma.c.

int cpdma_ctlr_stop ( struct cpdma_ctlr ctlr)

Definition at line 328 of file davinci_cpdma.c.

EXPORT_SYMBOL_GPL ( cpdma_ctlr_create  )
EXPORT_SYMBOL_GPL ( cpdma_ctlr_start  )
EXPORT_SYMBOL_GPL ( cpdma_ctlr_stop  )
EXPORT_SYMBOL_GPL ( cpdma_ctlr_dump  )
EXPORT_SYMBOL_GPL ( cpdma_ctlr_destroy  )
EXPORT_SYMBOL_GPL ( cpdma_chan_create  )
EXPORT_SYMBOL_GPL ( cpdma_chan_destroy  )
EXPORT_SYMBOL_GPL ( cpdma_chan_submit  )
EXPORT_SYMBOL_GPL ( cpdma_chan_process  )
EXPORT_SYMBOL_GPL ( cpdma_chan_start  )
EXPORT_SYMBOL_GPL ( cpdma_chan_stop  )

Variable Documentation