diff options
Diffstat (limited to 'include/linux/dw_dmac.h')
-rw-r--r-- | include/linux/dw_dmac.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index c8aad713a046..4bfe0a2f7d50 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * AVR32 systems.) | 3 | * AVR32 systems.) |
4 | * | 4 | * |
5 | * Copyright (C) 2007 Atmel Corporation | 5 | * Copyright (C) 2007 Atmel Corporation |
6 | * Copyright (C) 2010-2011 ST Microelectronics | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -16,9 +17,18 @@ | |||
16 | /** | 17 | /** |
17 | * struct dw_dma_platform_data - Controller configuration parameters | 18 | * struct dw_dma_platform_data - Controller configuration parameters |
18 | * @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 | ||
21 | * by the general purpose DMA channel allocator. | ||
19 | */ | 22 | */ |
20 | struct dw_dma_platform_data { | 23 | struct dw_dma_platform_data { |
21 | unsigned int nr_channels; | 24 | unsigned int nr_channels; |
25 | bool is_private; | ||
26 | #define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */ | ||
27 | #define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */ | ||
28 | unsigned char chan_allocation_order; | ||
29 | #define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */ | ||
30 | #define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */ | ||
31 | unsigned char chan_priority; | ||
22 | }; | 32 | }; |
23 | 33 | ||
24 | /** | 34 | /** |
@@ -33,6 +43,30 @@ enum dw_dma_slave_width { | |||
33 | DW_DMA_SLAVE_WIDTH_32BIT, | 43 | DW_DMA_SLAVE_WIDTH_32BIT, |
34 | }; | 44 | }; |
35 | 45 | ||
46 | /* bursts size */ | ||
47 | enum dw_dma_msize { | ||
48 | DW_DMA_MSIZE_1, | ||
49 | DW_DMA_MSIZE_4, | ||
50 | DW_DMA_MSIZE_8, | ||
51 | DW_DMA_MSIZE_16, | ||
52 | DW_DMA_MSIZE_32, | ||
53 | DW_DMA_MSIZE_64, | ||
54 | DW_DMA_MSIZE_128, | ||
55 | DW_DMA_MSIZE_256, | ||
56 | }; | ||
57 | |||
58 | /* flow controller */ | ||
59 | enum 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 | |||
36 | /** | 70 | /** |
37 | * struct dw_dma_slave - Controller-specific information about a slave | 71 | * struct dw_dma_slave - Controller-specific information about a slave |
38 | * | 72 | * |
@@ -44,6 +78,11 @@ enum dw_dma_slave_width { | |||
44 | * @reg_width: peripheral register width | 78 | * @reg_width: peripheral register width |
45 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | 79 | * @cfg_hi: Platform-specific initializer for the CFG_HI register |
46 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | 80 | * @cfg_lo: Platform-specific initializer for the CFG_LO register |
81 | * @src_master: src 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 | ||
47 | */ | 86 | */ |
48 | struct dw_dma_slave { | 87 | struct dw_dma_slave { |
49 | struct device *dma_dev; | 88 | struct device *dma_dev; |
@@ -52,6 +91,11 @@ struct dw_dma_slave { | |||
52 | enum dw_dma_slave_width reg_width; | 91 | enum dw_dma_slave_width reg_width; |
53 | u32 cfg_hi; | 92 | u32 cfg_hi; |
54 | u32 cfg_lo; | 93 | u32 cfg_lo; |
94 | u8 src_master; | ||
95 | u8 dst_master; | ||
96 | u8 src_msize; | ||
97 | u8 dst_msize; | ||
98 | u8 fc; | ||
55 | }; | 99 | }; |
56 | 100 | ||
57 | /* Platform-configurable bits in CFG_HI */ | 101 | /* Platform-configurable bits in CFG_HI */ |
@@ -62,7 +106,6 @@ struct dw_dma_slave { | |||
62 | #define DWC_CFGH_DST_PER(x) ((x) << 11) | 106 | #define DWC_CFGH_DST_PER(x) ((x) << 11) |
63 | 107 | ||
64 | /* Platform-configurable bits in CFG_LO */ | 108 | /* 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 */ | 109 | #define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */ |
67 | #define DWC_CFGL_LOCK_CH_BLOCK (1 << 12) | 110 | #define DWC_CFGL_LOCK_CH_BLOCK (1 << 12) |
68 | #define DWC_CFGL_LOCK_CH_XACT (2 << 12) | 111 | #define DWC_CFGL_LOCK_CH_XACT (2 << 12) |