aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dw_dmac.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index c8aad713a046..6998d9376ef9 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -16,9 +16,18 @@
16/** 16/**
17 * struct dw_dma_platform_data - Controller configuration parameters 17 * struct dw_dma_platform_data - Controller configuration parameters
18 * @nr_channels: Number of channels supported by hardware (max 8) 18 * @nr_channels: Number of channels supported by hardware (max 8)
19 * @is_private: The device channels should be marked as private and not for
20 * by the general purpose DMA channel allocator.
19 */ 21 */
20struct dw_dma_platform_data { 22struct dw_dma_platform_data {
21 unsigned int nr_channels; 23 unsigned int nr_channels;
24 bool is_private;
25#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
26#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
27 unsigned char chan_allocation_order;
28#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
29#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
30 unsigned char chan_priority;
22}; 31};
23 32
24/** 33/**
@@ -33,6 +42,30 @@ enum dw_dma_slave_width {
33 DW_DMA_SLAVE_WIDTH_32BIT, 42 DW_DMA_SLAVE_WIDTH_32BIT,
34}; 43};
35 44
45/* bursts size */
46enum dw_dma_msize {
47 DW_DMA_MSIZE_1,
48 DW_DMA_MSIZE_4,
49 DW_DMA_MSIZE_8,
50 DW_DMA_MSIZE_16,
51 DW_DMA_MSIZE_32,
52 DW_DMA_MSIZE_64,
53 DW_DMA_MSIZE_128,
54 DW_DMA_MSIZE_256,
55};
56
57/* flow controller */
58enum dw_dma_fc {
59 DW_DMA_FC_D_M2M,
60 DW_DMA_FC_D_M2P,
61 DW_DMA_FC_D_P2M,
62 DW_DMA_FC_D_P2P,
63 DW_DMA_FC_P_P2M,
64 DW_DMA_FC_SP_P2P,
65 DW_DMA_FC_P_M2P,
66 DW_DMA_FC_DP_P2P,
67};
68
36/** 69/**
37 * struct dw_dma_slave - Controller-specific information about a slave 70 * struct dw_dma_slave - Controller-specific information about a slave
38 * 71 *
@@ -44,6 +77,11 @@ enum dw_dma_slave_width {
44 * @reg_width: peripheral register width 77 * @reg_width: peripheral register width
45 * @cfg_hi: Platform-specific initializer for the CFG_HI register 78 * @cfg_hi: Platform-specific initializer for the CFG_HI register
46 * @cfg_lo: Platform-specific initializer for the CFG_LO register 79 * @cfg_lo: Platform-specific initializer for the CFG_LO register
80 * @src_master: src master for transfers on allocated channel.
81 * @dst_master: dest master for transfers on allocated channel.
82 * @src_msize: src burst size.
83 * @dst_msize: dest burst size.
84 * @fc: flow controller for DMA transfer
47 */ 85 */
48struct dw_dma_slave { 86struct dw_dma_slave {
49 struct device *dma_dev; 87 struct device *dma_dev;
@@ -52,6 +90,11 @@ struct dw_dma_slave {
52 enum dw_dma_slave_width reg_width; 90 enum dw_dma_slave_width reg_width;
53 u32 cfg_hi; 91 u32 cfg_hi;
54 u32 cfg_lo; 92 u32 cfg_lo;
93 u8 src_master;
94 u8 dst_master;
95 u8 src_msize;
96 u8 dst_msize;
97 u8 fc;
55}; 98};
56 99
57/* Platform-configurable bits in CFG_HI */ 100/* Platform-configurable bits in CFG_HI */
@@ -62,7 +105,6 @@ struct dw_dma_slave {
62#define DWC_CFGH_DST_PER(x) ((x) << 11) 105#define DWC_CFGH_DST_PER(x) ((x) << 11)
63 106
64/* Platform-configurable bits in CFG_LO */ 107/* Platform-configurable bits in CFG_LO */
65#define DWC_CFGL_PRIO(x) ((x) << 5) /* priority */
66#define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */ 108#define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */
67#define DWC_CFGL_LOCK_CH_BLOCK (1 << 12) 109#define DWC_CFGL_LOCK_CH_BLOCK (1 << 12)
68#define DWC_CFGL_LOCK_CH_XACT (2 << 12) 110#define DWC_CFGL_LOCK_CH_XACT (2 << 12)