diff options
author | Ramesh Babu K V <ramesh.b.k.v@intel.com> | 2010-10-04 06:37:53 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-10-07 18:03:43 -0400 |
commit | 576e3c394a6c427c9a1378ec88ef7eb97e731992 (patch) | |
tree | 55cfcf13ac594a63d1f8056bca08c6db66edcb3e /drivers/dma/intel_mid_dma_regs.h | |
parent | 03b96dca010145f3896abcd443b7fddb9813a0e6 (diff) |
intel_mid_dma: Add sg list support to DMA driver
For a very high speed DMA various periphral devices need
scatter-gather list support. The DMA hardware support link list items.
This list can be circular also (adding new flag DMA_PREP_CIRCULAR_LIST)
Right now this flag is in driver header and should be moved to
dmaengine header file eventually
Signed-off-by: Ramesh Babu K V <ramesh.b.k.v@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/intel_mid_dma_regs.h')
-rw-r--r-- | drivers/dma/intel_mid_dma_regs.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h index a12dd2572dc3..7a5ac56d1324 100644 --- a/drivers/dma/intel_mid_dma_regs.h +++ b/drivers/dma/intel_mid_dma_regs.h | |||
@@ -29,11 +29,12 @@ | |||
29 | #include <linux/dmapool.h> | 29 | #include <linux/dmapool.h> |
30 | #include <linux/pci_ids.h> | 30 | #include <linux/pci_ids.h> |
31 | 31 | ||
32 | #define INTEL_MID_DMA_DRIVER_VERSION "1.0.6" | 32 | #define INTEL_MID_DMA_DRIVER_VERSION "1.1.0" |
33 | 33 | ||
34 | #define REG_BIT0 0x00000001 | 34 | #define REG_BIT0 0x00000001 |
35 | #define REG_BIT8 0x00000100 | 35 | #define REG_BIT8 0x00000100 |
36 | 36 | #define INT_MASK_WE 0x8 | |
37 | #define CLEAR_DONE 0xFFFFEFFF | ||
37 | #define UNMASK_INTR_REG(chan_num) \ | 38 | #define UNMASK_INTR_REG(chan_num) \ |
38 | ((REG_BIT0 << chan_num) | (REG_BIT8 << chan_num)) | 39 | ((REG_BIT0 << chan_num) | (REG_BIT8 << chan_num)) |
39 | #define MASK_INTR_REG(chan_num) (REG_BIT8 << chan_num) | 40 | #define MASK_INTR_REG(chan_num) (REG_BIT8 << chan_num) |
@@ -41,6 +42,9 @@ | |||
41 | #define ENABLE_CHANNEL(chan_num) \ | 42 | #define ENABLE_CHANNEL(chan_num) \ |
42 | ((REG_BIT0 << chan_num) | (REG_BIT8 << chan_num)) | 43 | ((REG_BIT0 << chan_num) | (REG_BIT8 << chan_num)) |
43 | 44 | ||
45 | #define DISABLE_CHANNEL(chan_num) \ | ||
46 | (REG_BIT8 << chan_num) | ||
47 | |||
44 | #define DESCS_PER_CHANNEL 16 | 48 | #define DESCS_PER_CHANNEL 16 |
45 | /*DMA Registers*/ | 49 | /*DMA Registers*/ |
46 | /*registers associated with channel programming*/ | 50 | /*registers associated with channel programming*/ |
@@ -50,6 +54,7 @@ | |||
50 | /*CH X REG = (DMA_CH_SIZE)*CH_NO + REG*/ | 54 | /*CH X REG = (DMA_CH_SIZE)*CH_NO + REG*/ |
51 | #define SAR 0x00 /* Source Address Register*/ | 55 | #define SAR 0x00 /* Source Address Register*/ |
52 | #define DAR 0x08 /* Destination Address Register*/ | 56 | #define DAR 0x08 /* Destination Address Register*/ |
57 | #define LLP 0x10 /* Linked List Pointer Register*/ | ||
53 | #define CTL_LOW 0x18 /* Control Register*/ | 58 | #define CTL_LOW 0x18 /* Control Register*/ |
54 | #define CTL_HIGH 0x1C /* Control Register*/ | 59 | #define CTL_HIGH 0x1C /* Control Register*/ |
55 | #define CFG_LOW 0x40 /* Configuration Register Low*/ | 60 | #define CFG_LOW 0x40 /* Configuration Register Low*/ |
@@ -112,8 +117,8 @@ union intel_mid_dma_ctl_lo { | |||
112 | union intel_mid_dma_ctl_hi { | 117 | union intel_mid_dma_ctl_hi { |
113 | struct { | 118 | struct { |
114 | u32 block_ts:12; /*block transfer size*/ | 119 | u32 block_ts:12; /*block transfer size*/ |
115 | /*configured by DMAC*/ | 120 | u32 done:1; /*Done - updated by DMAC*/ |
116 | u32 reser:20; | 121 | u32 reser:19; /*configured by DMAC*/ |
117 | } ctlx; | 122 | } ctlx; |
118 | u32 ctl_hi; | 123 | u32 ctl_hi; |
119 | 124 | ||
@@ -169,6 +174,8 @@ union intel_mid_dma_cfg_hi { | |||
169 | * @dma: dma device struture pointer | 174 | * @dma: dma device struture pointer |
170 | * @busy: bool representing if ch is busy (active txn) or not | 175 | * @busy: bool representing if ch is busy (active txn) or not |
171 | * @in_use: bool representing if ch is in use or not | 176 | * @in_use: bool representing if ch is in use or not |
177 | * @raw_tfr: raw trf interrupt recieved | ||
178 | * @raw_block: raw block interrupt recieved | ||
172 | */ | 179 | */ |
173 | struct intel_mid_dma_chan { | 180 | struct intel_mid_dma_chan { |
174 | struct dma_chan chan; | 181 | struct dma_chan chan; |
@@ -185,6 +192,8 @@ struct intel_mid_dma_chan { | |||
185 | struct middma_device *dma; | 192 | struct middma_device *dma; |
186 | bool busy; | 193 | bool busy; |
187 | bool in_use; | 194 | bool in_use; |
195 | u32 raw_tfr; | ||
196 | u32 raw_block; | ||
188 | }; | 197 | }; |
189 | 198 | ||
190 | static inline struct intel_mid_dma_chan *to_intel_mid_dma_chan( | 199 | static inline struct intel_mid_dma_chan *to_intel_mid_dma_chan( |
@@ -247,6 +256,11 @@ struct intel_mid_dma_desc { | |||
247 | u32 cfg_lo; | 256 | u32 cfg_lo; |
248 | u32 ctl_lo; | 257 | u32 ctl_lo; |
249 | u32 ctl_hi; | 258 | u32 ctl_hi; |
259 | struct pci_pool *lli_pool; | ||
260 | struct intel_mid_dma_lli *lli; | ||
261 | dma_addr_t lli_phys; | ||
262 | unsigned int lli_length; | ||
263 | unsigned int current_lli; | ||
250 | dma_addr_t next; | 264 | dma_addr_t next; |
251 | enum dma_data_direction dirn; | 265 | enum dma_data_direction dirn; |
252 | enum dma_status status; | 266 | enum dma_status status; |
@@ -255,6 +269,14 @@ struct intel_mid_dma_desc { | |||
255 | 269 | ||
256 | }; | 270 | }; |
257 | 271 | ||
272 | struct intel_mid_dma_lli { | ||
273 | dma_addr_t sar; | ||
274 | dma_addr_t dar; | ||
275 | dma_addr_t llp; | ||
276 | u32 ctl_lo; | ||
277 | u32 ctl_hi; | ||
278 | } __attribute__ ((packed)); | ||
279 | |||
258 | static inline int test_ch_en(void __iomem *dma, u32 ch_no) | 280 | static inline int test_ch_en(void __iomem *dma, u32 ch_no) |
259 | { | 281 | { |
260 | u32 en_reg = ioread32(dma + DMA_CHAN_EN); | 282 | u32 en_reg = ioread32(dma + DMA_CHAN_EN); |