|
11 | 11 |
|
12 | 12 | #include <linux/interrupt.h> |
13 | 13 | #include <linux/dmaengine.h> |
14 | | -#include <linux/platform_data/dma-dw.h> |
15 | 14 |
|
16 | 15 | #define DW_DMA_MAX_NR_CHANNELS 8 |
17 | 16 | #define DW_DMA_MAX_NR_REQUESTS 16 |
@@ -132,6 +131,18 @@ struct dw_dma_regs { |
132 | 131 | /* Bitfields in DWC_PARAMS */ |
133 | 132 | #define DWC_PARAMS_MBLK_EN 11 /* multi block transfer */ |
134 | 133 |
|
| 134 | +/* bursts size */ |
| 135 | +enum dw_dma_msize { |
| 136 | + DW_DMA_MSIZE_1, |
| 137 | + DW_DMA_MSIZE_4, |
| 138 | + DW_DMA_MSIZE_8, |
| 139 | + DW_DMA_MSIZE_16, |
| 140 | + DW_DMA_MSIZE_32, |
| 141 | + DW_DMA_MSIZE_64, |
| 142 | + DW_DMA_MSIZE_128, |
| 143 | + DW_DMA_MSIZE_256, |
| 144 | +}; |
| 145 | + |
135 | 146 | /* Bitfields in CTL_LO */ |
136 | 147 | #define DWC_CTLL_INT_EN (1 << 0) /* irqs enabled? */ |
137 | 148 | #define DWC_CTLL_DST_WIDTH(n) ((n)<<1) /* bytes per element */ |
@@ -161,20 +172,35 @@ struct dw_dma_regs { |
161 | 172 | #define DWC_CTLH_DONE 0x00001000 |
162 | 173 | #define DWC_CTLH_BLOCK_TS_MASK 0x00000fff |
163 | 174 |
|
164 | | -/* Bitfields in CFG_LO. Platform-configurable bits are in <linux/platform_data/dma-dw.h> */ |
| 175 | +/* Bitfields in CFG_LO */ |
165 | 176 | #define DWC_CFGL_CH_PRIOR_MASK (0x7 << 5) /* priority mask */ |
166 | 177 | #define DWC_CFGL_CH_PRIOR(x) ((x) << 5) /* priority */ |
167 | 178 | #define DWC_CFGL_CH_SUSP (1 << 8) /* pause xfer */ |
168 | 179 | #define DWC_CFGL_FIFO_EMPTY (1 << 9) /* pause xfer */ |
169 | 180 | #define DWC_CFGL_HS_DST (1 << 10) /* handshake w/dst */ |
170 | 181 | #define DWC_CFGL_HS_SRC (1 << 11) /* handshake w/src */ |
| 182 | +#define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */ |
| 183 | +#define DWC_CFGL_LOCK_CH_BLOCK (1 << 12) |
| 184 | +#define DWC_CFGL_LOCK_CH_XACT (2 << 12) |
| 185 | +#define DWC_CFGL_LOCK_BUS_XFER (0 << 14) /* scope of LOCK_BUS */ |
| 186 | +#define DWC_CFGL_LOCK_BUS_BLOCK (1 << 14) |
| 187 | +#define DWC_CFGL_LOCK_BUS_XACT (2 << 14) |
| 188 | +#define DWC_CFGL_LOCK_CH (1 << 15) /* channel lockout */ |
| 189 | +#define DWC_CFGL_LOCK_BUS (1 << 16) /* busmaster lockout */ |
| 190 | +#define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */ |
| 191 | +#define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */ |
171 | 192 | #define DWC_CFGL_MAX_BURST(x) ((x) << 20) |
172 | 193 | #define DWC_CFGL_RELOAD_SAR (1 << 30) |
173 | 194 | #define DWC_CFGL_RELOAD_DAR (1 << 31) |
174 | 195 |
|
175 | | -/* Bitfields in CFG_HI. Platform-configurable bits are in <linux/platform_data/dma-dw.h> */ |
| 196 | +/* Bitfields in CFG_HI */ |
| 197 | +#define DWC_CFGH_FCMODE (1 << 0) |
| 198 | +#define DWC_CFGH_FIFO_MODE (1 << 1) |
| 199 | +#define DWC_CFGH_PROTCTL(x) ((x) << 2) |
176 | 200 | #define DWC_CFGH_DS_UPD_EN (1 << 5) |
177 | 201 | #define DWC_CFGH_SS_UPD_EN (1 << 6) |
| 202 | +#define DWC_CFGH_SRC_PER(x) ((x) << 7) |
| 203 | +#define DWC_CFGH_DST_PER(x) ((x) << 11) |
178 | 204 |
|
179 | 205 | /* Bitfields in SGR */ |
180 | 206 | #define DWC_SGR_SGI(x) ((x) << 0) |
|
0 commit comments