aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dw_dmac.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/dw_dmac.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/linux/dw_dmac.h')
-rw-r--r--include/linux/dw_dmac.h47
1 files changed, 39 insertions, 8 deletions
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index e1c8c9e919a..4bfe0a2f7d5 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -19,10 +19,6 @@
19 * @nr_channels: Number of channels supported by hardware (max 8) 19 * @nr_channels: Number of channels supported by hardware (max 8)
20 * @is_private: The device channels should be marked as private and not for 20 * @is_private: The device channels should be marked as private and not for
21 * by the general purpose DMA channel allocator. 21 * by the general purpose DMA channel allocator.
22 * @block_size: Maximum block size supported by the controller
23 * @nr_masters: Number of AHB masters supported by the controller
24 * @data_width: Maximum data width supported by hardware per AHB master
25 * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits)
26 */ 22 */
27struct dw_dma_platform_data { 23struct dw_dma_platform_data {
28 unsigned int nr_channels; 24 unsigned int nr_channels;
@@ -33,9 +29,18 @@ struct dw_dma_platform_data {
33#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */ 29#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
34#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */ 30#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
35 unsigned char chan_priority; 31 unsigned char chan_priority;
36 unsigned short block_size; 32};
37 unsigned char nr_masters; 33
38 unsigned char data_width[4]; 34/**
35 * enum dw_dma_slave_width - DMA slave register access width.
36 * @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses
37 * @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses
38 * @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses
39 */
40enum dw_dma_slave_width {
41 DW_DMA_SLAVE_WIDTH_8BIT,
42 DW_DMA_SLAVE_WIDTH_16BIT,
43 DW_DMA_SLAVE_WIDTH_32BIT,
39}; 44};
40 45
41/* bursts size */ 46/* bursts size */
@@ -50,21 +55,47 @@ enum dw_dma_msize {
50 DW_DMA_MSIZE_256, 55 DW_DMA_MSIZE_256,
51}; 56};
52 57
58/* flow controller */
59enum dw_dma_fc {
60 DW_DMA_FC_D_M2M,
61 DW_DMA_FC_D_M2P,
62 DW_DMA_FC_D_P2M,
63 DW_DMA_FC_D_P2P,
64 DW_DMA_FC_P_P2M,
65 DW_DMA_FC_SP_P2P,
66 DW_DMA_FC_P_M2P,
67 DW_DMA_FC_DP_P2P,
68};
69
53/** 70/**
54 * struct dw_dma_slave - Controller-specific information about a slave 71 * struct dw_dma_slave - Controller-specific information about a slave
55 * 72 *
56 * @dma_dev: required DMA master device 73 * @dma_dev: required DMA master device
74 * @tx_reg: physical address of data register used for
75 * memory-to-peripheral transfers
76 * @rx_reg: physical address of data register used for
77 * peripheral-to-memory transfers
78 * @reg_width: peripheral register width
57 * @cfg_hi: Platform-specific initializer for the CFG_HI register 79 * @cfg_hi: Platform-specific initializer for the CFG_HI register
58 * @cfg_lo: Platform-specific initializer for the CFG_LO register 80 * @cfg_lo: Platform-specific initializer for the CFG_LO register
59 * @src_master: src master for transfers on allocated channel. 81 * @src_master: src master for transfers on allocated channel.
60 * @dst_master: dest master for transfers on allocated channel. 82 * @dst_master: dest master for transfers on allocated channel.
83 * @src_msize: src burst size.
84 * @dst_msize: dest burst size.
85 * @fc: flow controller for DMA transfer
61 */ 86 */
62struct dw_dma_slave { 87struct dw_dma_slave {
63 struct device *dma_dev; 88 struct device *dma_dev;
89 dma_addr_t tx_reg;
90 dma_addr_t rx_reg;
91 enum dw_dma_slave_width reg_width;
64 u32 cfg_hi; 92 u32 cfg_hi;
65 u32 cfg_lo; 93 u32 cfg_lo;
66 u8 src_master; 94 u8 src_master;
67 u8 dst_master; 95 u8 dst_master;
96 u8 src_msize;
97 u8 dst_msize;
98 u8 fc;
68}; 99};
69 100
70/* Platform-configurable bits in CFG_HI */ 101/* Platform-configurable bits in CFG_HI */
@@ -96,7 +127,7 @@ struct dw_cyclic_desc {
96 127
97struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, 128struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
98 dma_addr_t buf_addr, size_t buf_len, size_t period_len, 129 dma_addr_t buf_addr, size_t buf_len, size_t period_len,
99 enum dma_transfer_direction direction); 130 enum dma_data_direction direction);
100void dw_dma_cyclic_free(struct dma_chan *chan); 131void dw_dma_cyclic_free(struct dma_chan *chan);
101int dw_dma_cyclic_start(struct dma_chan *chan); 132int dw_dma_cyclic_start(struct dma_chan *chan);
102void dw_dma_cyclic_stop(struct dma_chan *chan); 133void dw_dma_cyclic_stop(struct dma_chan *chan);