hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/dma/dw/regs.h
....@@ -1,13 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Driver for the Synopsys DesignWare AHB DMA Controller
34 *
45 * Copyright (C) 2005-2007 Atmel Corporation
56 * Copyright (C) 2010-2011 ST Microelectronics
67 * Copyright (C) 2016 Intel Corporation
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/bitops.h>
....@@ -128,6 +125,8 @@
128125
129126 /* Bitfields in DWC_PARAMS */
130127 #define DWC_PARAMS_MBLK_EN 11 /* multi block transfer */
128
+#define DWC_PARAMS_HC_LLP 13 /* set LLP register to zero */
129
+#define DWC_PARAMS_MSIZE 16 /* max group transaction size */
131130
132131 /* bursts size */
133132 enum dw_dma_msize {
....@@ -222,6 +221,16 @@
222221
223222 /* iDMA 32-bit support */
224223
224
+/* bursts size */
225
+enum idma32_msize {
226
+ IDMA32_MSIZE_1,
227
+ IDMA32_MSIZE_2,
228
+ IDMA32_MSIZE_4,
229
+ IDMA32_MSIZE_8,
230
+ IDMA32_MSIZE_16,
231
+ IDMA32_MSIZE_32,
232
+};
233
+
225234 /* Bitfields in CTL_HI */
226235 #define IDMA32C_CTLH_BLOCK_TS_MASK GENMASK(16, 0)
227236 #define IDMA32C_CTLH_BLOCK_TS(x) ((x) & IDMA32C_CTLH_BLOCK_TS_MASK)
....@@ -276,6 +285,7 @@
276285 /* hardware configuration */
277286 unsigned int block_size;
278287 bool nollp;
288
+ u32 max_burst;
279289
280290 /* custom slave configuration */
281291 struct dw_dma_slave dws;
....@@ -312,6 +322,21 @@
312322 u8 all_chan_mask;
313323 u8 in_use;
314324
325
+ /* Channel operations */
326
+ void (*initialize_chan)(struct dw_dma_chan *dwc);
327
+ void (*suspend_chan)(struct dw_dma_chan *dwc, bool drain);
328
+ void (*resume_chan)(struct dw_dma_chan *dwc, bool drain);
329
+ u32 (*prepare_ctllo)(struct dw_dma_chan *dwc);
330
+ void (*encode_maxburst)(struct dw_dma_chan *dwc, u32 *maxburst);
331
+ u32 (*bytes2block)(struct dw_dma_chan *dwc, size_t bytes,
332
+ unsigned int width, size_t *len);
333
+ size_t (*block2bytes)(struct dw_dma_chan *dwc, u32 block, u32 width);
334
+
335
+ /* Device operations */
336
+ void (*set_device_name)(struct dw_dma *dw, int id);
337
+ void (*disable)(struct dw_dma *dw);
338
+ void (*enable)(struct dw_dma *dw);
339
+
315340 /* platform data */
316341 struct dw_dma_platform_data *pdata;
317342 };