Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pch_dma.c File Reference
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pch_dma.h>
#include "dmaengine.h"

Go to the source code of this file.

Data Structures

struct  pch_dma_desc_regs
 
struct  pch_dma_regs
 
struct  pch_dma_desc
 
struct  pch_dma_chan
 
struct  pch_dma
 

Macros

#define DRV_NAME   "pch-dma"
 
#define DMA_CTL0_DISABLE   0x0
 
#define DMA_CTL0_SG   0x1
 
#define DMA_CTL0_ONESHOT   0x2
 
#define DMA_CTL0_MODE_MASK_BITS   0x3
 
#define DMA_CTL0_DIR_SHIFT_BITS   2
 
#define DMA_CTL0_BITS_PER_CH   4
 
#define DMA_CTL2_START_SHIFT_BITS   8
 
#define DMA_CTL2_IRQ_ENABLE_MASK   ((1UL << DMA_CTL2_START_SHIFT_BITS) - 1)
 
#define DMA_STATUS_IDLE   0x0
 
#define DMA_STATUS_DESC_READ   0x1
 
#define DMA_STATUS_WAIT   0x2
 
#define DMA_STATUS_ACCESS   0x3
 
#define DMA_STATUS_BITS_PER_CH   2
 
#define DMA_STATUS_MASK_BITS   0x3
 
#define DMA_STATUS_SHIFT_BITS   16
 
#define DMA_STATUS_IRQ(x)   (0x1 << (x))
 
#define DMA_STATUS0_ERR(x)   (0x1 << ((x) + 8))
 
#define DMA_STATUS2_ERR(x)   (0x1 << (x))
 
#define DMA_DESC_WIDTH_SHIFT_BITS   12
 
#define DMA_DESC_WIDTH_1_BYTE   (0x3 << DMA_DESC_WIDTH_SHIFT_BITS)
 
#define DMA_DESC_WIDTH_2_BYTES   (0x2 << DMA_DESC_WIDTH_SHIFT_BITS)
 
#define DMA_DESC_WIDTH_4_BYTES   (0x0 << DMA_DESC_WIDTH_SHIFT_BITS)
 
#define DMA_DESC_MAX_COUNT_1_BYTE   0x3FF
 
#define DMA_DESC_MAX_COUNT_2_BYTES   0x3FF
 
#define DMA_DESC_MAX_COUNT_4_BYTES   0x7FF
 
#define DMA_DESC_END_WITHOUT_IRQ   0x0
 
#define DMA_DESC_END_WITH_IRQ   0x1
 
#define DMA_DESC_FOLLOW_WITHOUT_IRQ   0x2
 
#define DMA_DESC_FOLLOW_WITH_IRQ   0x3
 
#define MAX_CHAN_NR   12
 
#define DMA_MASK_CTL0_MODE   0x33333333
 
#define DMA_MASK_CTL2_MODE   0x00003333
 
#define PDC_DEV_ADDR   0x00
 
#define PDC_MEM_ADDR   0x04
 
#define PDC_SIZE   0x08
 
#define PDC_NEXT   0x0C
 
#define channel_readl(pdc, name)   readl((pdc)->membase + PDC_##name)
 
#define channel_writel(pdc, name, val)   writel((val), (pdc)->membase + PDC_##name)
 
#define PCH_DMA_CTL0   0x00
 
#define PCH_DMA_CTL1   0x04
 
#define PCH_DMA_CTL2   0x08
 
#define PCH_DMA_CTL3   0x0C
 
#define PCH_DMA_STS0   0x10
 
#define PCH_DMA_STS1   0x14
 
#define PCH_DMA_STS2   0x18
 
#define dma_readl(pd, name)   readl((pd)->membase + PCH_DMA_##name)
 
#define dma_writel(pd, name, val)   writel((val), (pd)->membase + PCH_DMA_##name)
 
#define PCI_VENDOR_ID_ROHM   0x10DB
 
#define PCI_DEVICE_ID_EG20T_PCH_DMA_8CH   0x8810
 
#define PCI_DEVICE_ID_EG20T_PCH_DMA_4CH   0x8815
 
#define PCI_DEVICE_ID_ML7213_DMA1_8CH   0x8026
 
#define PCI_DEVICE_ID_ML7213_DMA2_8CH   0x802B
 
#define PCI_DEVICE_ID_ML7213_DMA3_4CH   0x8034
 
#define PCI_DEVICE_ID_ML7213_DMA4_12CH   0x8032
 
#define PCI_DEVICE_ID_ML7223_DMA1_4CH   0x800B
 
#define PCI_DEVICE_ID_ML7223_DMA2_4CH   0x800E
 
#define PCI_DEVICE_ID_ML7223_DMA3_4CH   0x8017
 
#define PCI_DEVICE_ID_ML7223_DMA4_4CH   0x803B
 
#define PCI_DEVICE_ID_ML7831_DMA1_8CH   0x8810
 
#define PCI_DEVICE_ID_ML7831_DMA2_4CH   0x8815
 

Functions

 module_param (init_nr_desc_per_channel, uint, 0644)
 
 MODULE_PARM_DESC (init_nr_desc_per_channel,"initial descriptors per channel (default: 64)")
 
 DEFINE_PCI_DEVICE_TABLE (pch_dma_id_table)
 
 module_init (pch_dma_init)
 
 module_exit (pch_dma_exit)
 
 MODULE_DESCRIPTION ("Intel EG20T PCH / LAPIS Semicon ML7213/ML7223/ML7831 IOH ""DMA controller driver")
 
 MODULE_AUTHOR ("Yong Wang <[email protected]>")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define channel_readl (   pdc,
  name 
)    readl((pdc)->membase + PDC_##name)

Definition at line 121 of file pch_dma.c.

#define channel_writel (   pdc,
  name,
  val 
)    writel((val), (pdc)->membase + PDC_##name)

Definition at line 123 of file pch_dma.c.

#define DMA_CTL0_BITS_PER_CH   4

Definition at line 37 of file pch_dma.c.

#define DMA_CTL0_DIR_SHIFT_BITS   2

Definition at line 36 of file pch_dma.c.

#define DMA_CTL0_DISABLE   0x0

Definition at line 32 of file pch_dma.c.

#define DMA_CTL0_MODE_MASK_BITS   0x3

Definition at line 35 of file pch_dma.c.

#define DMA_CTL0_ONESHOT   0x2

Definition at line 34 of file pch_dma.c.

#define DMA_CTL0_SG   0x1

Definition at line 33 of file pch_dma.c.

#define DMA_CTL2_IRQ_ENABLE_MASK   ((1UL << DMA_CTL2_START_SHIFT_BITS) - 1)

Definition at line 40 of file pch_dma.c.

#define DMA_CTL2_START_SHIFT_BITS   8

Definition at line 39 of file pch_dma.c.

#define DMA_DESC_END_WITH_IRQ   0x1

Definition at line 61 of file pch_dma.c.

#define DMA_DESC_END_WITHOUT_IRQ   0x0

Definition at line 60 of file pch_dma.c.

#define DMA_DESC_FOLLOW_WITH_IRQ   0x3

Definition at line 63 of file pch_dma.c.

#define DMA_DESC_FOLLOW_WITHOUT_IRQ   0x2

Definition at line 62 of file pch_dma.c.

#define DMA_DESC_MAX_COUNT_1_BYTE   0x3FF

Definition at line 57 of file pch_dma.c.

#define DMA_DESC_MAX_COUNT_2_BYTES   0x3FF

Definition at line 58 of file pch_dma.c.

#define DMA_DESC_MAX_COUNT_4_BYTES   0x7FF

Definition at line 59 of file pch_dma.c.

#define DMA_DESC_WIDTH_1_BYTE   (0x3 << DMA_DESC_WIDTH_SHIFT_BITS)

Definition at line 54 of file pch_dma.c.

#define DMA_DESC_WIDTH_2_BYTES   (0x2 << DMA_DESC_WIDTH_SHIFT_BITS)

Definition at line 55 of file pch_dma.c.

#define DMA_DESC_WIDTH_4_BYTES   (0x0 << DMA_DESC_WIDTH_SHIFT_BITS)

Definition at line 56 of file pch_dma.c.

#define DMA_DESC_WIDTH_SHIFT_BITS   12

Definition at line 53 of file pch_dma.c.

#define DMA_MASK_CTL0_MODE   0x33333333

Definition at line 67 of file pch_dma.c.

#define DMA_MASK_CTL2_MODE   0x00003333

Definition at line 68 of file pch_dma.c.

#define dma_readl (   pd,
  name 
)    readl((pd)->membase + PCH_DMA_##name)

Definition at line 143 of file pch_dma.c.

#define DMA_STATUS0_ERR (   x)    (0x1 << ((x) + 8))

Definition at line 50 of file pch_dma.c.

#define DMA_STATUS2_ERR (   x)    (0x1 << (x))

Definition at line 51 of file pch_dma.c.

#define DMA_STATUS_ACCESS   0x3

Definition at line 45 of file pch_dma.c.

#define DMA_STATUS_BITS_PER_CH   2

Definition at line 46 of file pch_dma.c.

#define DMA_STATUS_DESC_READ   0x1

Definition at line 43 of file pch_dma.c.

#define DMA_STATUS_IDLE   0x0

Definition at line 42 of file pch_dma.c.

#define DMA_STATUS_IRQ (   x)    (0x1 << (x))

Definition at line 49 of file pch_dma.c.

#define DMA_STATUS_MASK_BITS   0x3

Definition at line 47 of file pch_dma.c.

#define DMA_STATUS_SHIFT_BITS   16

Definition at line 48 of file pch_dma.c.

#define DMA_STATUS_WAIT   0x2

Definition at line 44 of file pch_dma.c.

#define dma_writel (   pd,
  name,
  val 
)    writel((val), (pd)->membase + PCH_DMA_##name)

Definition at line 145 of file pch_dma.c.

#define DRV_NAME   "pch-dma"

Definition at line 30 of file pch_dma.c.

#define MAX_CHAN_NR   12

Definition at line 65 of file pch_dma.c.

#define PCH_DMA_CTL0   0x00

Definition at line 135 of file pch_dma.c.

#define PCH_DMA_CTL1   0x04

Definition at line 136 of file pch_dma.c.

#define PCH_DMA_CTL2   0x08

Definition at line 137 of file pch_dma.c.

#define PCH_DMA_CTL3   0x0C

Definition at line 138 of file pch_dma.c.

#define PCH_DMA_STS0   0x10

Definition at line 139 of file pch_dma.c.

#define PCH_DMA_STS1   0x14

Definition at line 140 of file pch_dma.c.

#define PCH_DMA_STS2   0x18

Definition at line 141 of file pch_dma.c.

#define PCI_DEVICE_ID_EG20T_PCH_DMA_4CH   0x8815

Definition at line 993 of file pch_dma.c.

#define PCI_DEVICE_ID_EG20T_PCH_DMA_8CH   0x8810

Definition at line 992 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7213_DMA1_8CH   0x8026

Definition at line 994 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7213_DMA2_8CH   0x802B

Definition at line 995 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7213_DMA3_4CH   0x8034

Definition at line 996 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7213_DMA4_12CH   0x8032

Definition at line 997 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7223_DMA1_4CH   0x800B

Definition at line 998 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7223_DMA2_4CH   0x800E

Definition at line 999 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7223_DMA3_4CH   0x8017

Definition at line 1000 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7223_DMA4_4CH   0x803B

Definition at line 1001 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7831_DMA1_8CH   0x8810

Definition at line 1002 of file pch_dma.c.

#define PCI_DEVICE_ID_ML7831_DMA2_4CH   0x8815

Definition at line 1003 of file pch_dma.c.

#define PCI_VENDOR_ID_ROHM   0x10DB

Definition at line 991 of file pch_dma.c.

#define PDC_DEV_ADDR   0x00

Definition at line 116 of file pch_dma.c.

#define PDC_MEM_ADDR   0x04

Definition at line 117 of file pch_dma.c.

#define PDC_NEXT   0x0C

Definition at line 119 of file pch_dma.c.

#define PDC_SIZE   0x08

Definition at line 118 of file pch_dma.c.

Function Documentation

DEFINE_PCI_DEVICE_TABLE ( pch_dma_id_table  )
MODULE_AUTHOR ( "Yong Wang <[email protected]>"  )
MODULE_DESCRIPTION ( "Intel EG20T PCH / LAPIS Semicon ML7213/ML7223/ML7831 IOH ""DMA controller driver )
module_exit ( pch_dma_exit  )
module_init ( pch_dma_init  )
MODULE_LICENSE ( "GPL v2 )
module_param ( init_nr_desc_per_channel  ,
uint  ,
0644   
)
MODULE_PARM_DESC ( init_nr_desc_per_channel  ,
"initial descriptors per channel (default: 64)"   
)