Brian Swetland | 8a0f6f1 | 2008-09-10 14:58:25 -0700 | [diff] [blame] | 1 | /* linux/include/asm-arm/arch-msm/dma.h |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 2 | * |
| 3 | * Copyright (C) 2007 Google, Inc. |
Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 4 | * Copyright (c) 2008-2012, The Linux Foundation. All rights reserved. |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #ifndef __ASM_ARCH_MSM_DMA_H |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | #define __ASM_ARCH_MSM_DMA_H |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 19 | |
| 20 | #include <linux/list.h> |
| 21 | #include <mach/msm_iomap.h> |
| 22 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | #if defined(CONFIG_ARCH_FSM9XXX) |
| 24 | #include <mach/dma-fsm9xxx.h> |
| 25 | #endif |
| 26 | |
Brian Swetland | 8a0f6f1 | 2008-09-10 14:58:25 -0700 | [diff] [blame] | 27 | struct msm_dmov_errdata { |
| 28 | uint32_t flush[6]; |
| 29 | }; |
| 30 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 31 | struct msm_dmov_cmd { |
| 32 | struct list_head list; |
| 33 | unsigned int cmdptr; |
Brian Swetland | 8a0f6f1 | 2008-09-10 14:58:25 -0700 | [diff] [blame] | 34 | void (*complete_func)(struct msm_dmov_cmd *cmd, |
| 35 | unsigned int result, |
| 36 | struct msm_dmov_errdata *err); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | void (*exec_func)(struct msm_dmov_cmd *cmd); |
Jeff Ohlstein | a530a7b | 2012-06-28 19:42:03 -0700 | [diff] [blame] | 38 | struct work_struct work; |
| 39 | unsigned id; /* For internal use */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | void *user; /* Pointer for caller's reference */ |
Jeff Ohlstein | a530a7b | 2012-06-28 19:42:03 -0700 | [diff] [blame] | 41 | u8 toflush; |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 42 | }; |
| 43 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 44 | struct msm_dmov_pdata { |
| 45 | int sd; |
| 46 | size_t sd_size; |
| 47 | }; |
| 48 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 49 | void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 50 | void msm_dmov_enqueue_cmd_ext(unsigned id, struct msm_dmov_cmd *cmd); |
Jeff Ohlstein | 6bf7b3a | 2012-04-27 12:27:53 -0700 | [diff] [blame] | 51 | void msm_dmov_flush(unsigned int id, int graceful); |
Jeff Ohlstein | dc39f97 | 2011-09-02 13:55:16 -0700 | [diff] [blame] | 52 | int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr); |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 53 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 54 | #define DMOV_CRCIS_PER_CONF 10 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 55 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 56 | #define DMOV_ADDR(off, ch) ((off) + ((ch) << 2)) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 57 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 58 | #define DMOV_CMD_PTR(ch) DMOV_ADDR(0x000, ch) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 59 | #define DMOV_CMD_LIST (0 << 29) /* does not work */ |
| 60 | #define DMOV_CMD_PTR_LIST (1 << 29) /* works */ |
| 61 | #define DMOV_CMD_INPUT_CFG (2 << 29) /* untested */ |
| 62 | #define DMOV_CMD_OUTPUT_CFG (3 << 29) /* untested */ |
| 63 | #define DMOV_CMD_ADDR(addr) ((addr) >> 3) |
| 64 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 65 | #define DMOV_RSLT(ch) DMOV_ADDR(0x040, ch) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 66 | #define DMOV_RSLT_VALID (1 << 31) /* 0 == host has empties result fifo */ |
| 67 | #define DMOV_RSLT_ERROR (1 << 3) |
| 68 | #define DMOV_RSLT_FLUSH (1 << 2) |
| 69 | #define DMOV_RSLT_DONE (1 << 1) /* top pointer done */ |
| 70 | #define DMOV_RSLT_USER (1 << 0) /* command with FR force result */ |
| 71 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 72 | #define DMOV_FLUSH0(ch) DMOV_ADDR(0x080, ch) |
| 73 | #define DMOV_FLUSH1(ch) DMOV_ADDR(0x0C0, ch) |
| 74 | #define DMOV_FLUSH2(ch) DMOV_ADDR(0x100, ch) |
| 75 | #define DMOV_FLUSH3(ch) DMOV_ADDR(0x140, ch) |
| 76 | #define DMOV_FLUSH4(ch) DMOV_ADDR(0x180, ch) |
| 77 | #define DMOV_FLUSH5(ch) DMOV_ADDR(0x1C0, ch) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 78 | #define DMOV_FLUSH_TYPE (1 << 31) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 79 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 80 | #define DMOV_STATUS(ch) DMOV_ADDR(0x200, ch) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 81 | #define DMOV_STATUS_RSLT_COUNT(n) (((n) >> 29)) |
| 82 | #define DMOV_STATUS_CMD_COUNT(n) (((n) >> 27) & 3) |
| 83 | #define DMOV_STATUS_RSLT_VALID (1 << 1) |
| 84 | #define DMOV_STATUS_CMD_PTR_RDY (1 << 0) |
| 85 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 86 | #define DMOV_CONF(ch) DMOV_ADDR(0x240, ch) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 87 | #define DMOV_CONF_SD(sd) (((sd & 4) << 11) | ((sd & 3) << 4)) |
| 88 | #define DMOV_CONF_IRQ_EN (1 << 6) |
| 89 | #define DMOV_CONF_FORCE_RSLT_EN (1 << 7) |
| 90 | #define DMOV_CONF_SHADOW_EN (1 << 12) |
| 91 | #define DMOV_CONF_MPU_DISABLE (1 << 11) |
| 92 | #define DMOV_CONF_PRIORITY(n) (n << 0) |
| 93 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 94 | #define DMOV_DBG_ERR(ci) DMOV_ADDR(0x280, ci) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 95 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 96 | #define DMOV_RSLT_CONF(ch) DMOV_ADDR(0x300, ch) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 97 | #define DMOV_RSLT_CONF_FORCE_TOP_PTR_RSLT (1 << 2) |
| 98 | #define DMOV_RSLT_CONF_FORCE_FLUSH_RSLT (1 << 1) |
| 99 | #define DMOV_RSLT_CONF_IRQ_EN (1 << 0) |
| 100 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 101 | #define DMOV_ISR DMOV_ADDR(0x380, 0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 102 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 103 | #define DMOV_CI_CONF(ci) DMOV_ADDR(0x390, ci) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 104 | #define DMOV_CI_CONF_RANGE_END(n) ((n) << 24) |
| 105 | #define DMOV_CI_CONF_RANGE_START(n) ((n) << 16) |
| 106 | #define DMOV_CI_CONF_MAX_BURST(n) ((n) << 0) |
| 107 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 108 | #define DMOV_CI_DBG_ERR(ci) DMOV_ADDR(0x3B0, ci) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 109 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 110 | #define DMOV_CRCI_CONF0 DMOV_ADDR(0x3D0, 0) |
| 111 | #define DMOV_CRCI_CONF1 DMOV_ADDR(0x3D4, 0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 112 | #define DMOV_CRCI_CONF0_SD(crci, sd) (sd << (crci*3)) |
| 113 | #define DMOV_CRCI_CONF1_SD(crci, sd) (sd << ((crci-DMOV_CRCIS_PER_CONF)*3)) |
| 114 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 115 | #define DMOV_CRCI_CTL(crci) DMOV_ADDR(0x400, crci) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 116 | #define DMOV_CRCI_CTL_BLK_SZ(n) ((n) << 0) |
| 117 | #define DMOV_CRCI_CTL_RST (1 << 17) |
| 118 | #define DMOV_CRCI_MUX (1 << 18) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 119 | |
| 120 | /* channel assignments */ |
| 121 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 122 | /* |
| 123 | * Format of CRCI numbers: crci number + (muxsel << 4) |
| 124 | */ |
| 125 | |
| 126 | #if defined(CONFIG_ARCH_MSM8X60) |
| 127 | #define DMOV_GP_CHAN 15 |
| 128 | |
| 129 | #define DMOV_NAND_CHAN 17 |
| 130 | #define DMOV_NAND_CHAN_MODEM 26 |
| 131 | #define DMOV_NAND_CHAN_Q6 27 |
| 132 | #define DMOV_NAND_CRCI_CMD 15 |
| 133 | #define DMOV_NAND_CRCI_DATA 3 |
| 134 | |
| 135 | #define DMOV_CE_IN_CHAN 2 |
| 136 | #define DMOV_CE_IN_CRCI 4 |
| 137 | |
| 138 | #define DMOV_CE_OUT_CHAN 3 |
| 139 | #define DMOV_CE_OUT_CRCI 5 |
| 140 | |
| 141 | #define DMOV_CE_HASH_CRCI 15 |
| 142 | |
| 143 | #define DMOV_SDC1_CHAN 18 |
| 144 | #define DMOV_SDC1_CRCI 1 |
| 145 | |
| 146 | #define DMOV_SDC2_CHAN 19 |
| 147 | #define DMOV_SDC2_CRCI 4 |
| 148 | |
| 149 | #define DMOV_SDC3_CHAN 20 |
| 150 | #define DMOV_SDC3_CRCI 2 |
| 151 | |
| 152 | #define DMOV_SDC4_CHAN 21 |
| 153 | #define DMOV_SDC4_CRCI 5 |
| 154 | |
| 155 | #define DMOV_SDC5_CHAN 21 |
| 156 | #define DMOV_SDC5_CRCI 14 |
| 157 | |
| 158 | #define DMOV_TSIF_CHAN 4 |
| 159 | #define DMOV_TSIF_CRCI 6 |
| 160 | |
| 161 | #define DMOV_HSUART1_TX_CHAN 22 |
| 162 | #define DMOV_HSUART1_TX_CRCI 8 |
| 163 | |
| 164 | #define DMOV_HSUART1_RX_CHAN 23 |
| 165 | #define DMOV_HSUART1_RX_CRCI 9 |
| 166 | |
| 167 | #define DMOV_HSUART2_TX_CHAN 8 |
| 168 | #define DMOV_HSUART2_TX_CRCI 13 |
| 169 | |
| 170 | #define DMOV_HSUART2_RX_CHAN 8 |
| 171 | #define DMOV_HSUART2_RX_CRCI 14 |
| 172 | |
| 173 | #elif defined(CONFIG_ARCH_MSM8960) |
Jeff Ohlstein | 6698730 | 2011-08-26 11:59:40 -0700 | [diff] [blame] | 174 | #define DMOV_GP_CHAN 9 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 175 | |
| 176 | #define DMOV_CE_IN_CHAN 0 |
| 177 | #define DMOV_CE_IN_CRCI 2 |
| 178 | |
| 179 | #define DMOV_CE_OUT_CHAN 1 |
| 180 | #define DMOV_CE_OUT_CRCI 3 |
| 181 | |
Joel Nider | a126194 | 2011-09-12 16:30:09 +0300 | [diff] [blame] | 182 | #define DMOV_TSIF_CHAN 2 |
| 183 | #define DMOV_TSIF_CRCI 11 |
| 184 | |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 185 | #define DMOV_HSUART_GSBI6_TX_CHAN 7 |
| 186 | #define DMOV_HSUART_GSBI6_TX_CRCI 6 |
| 187 | |
| 188 | #define DMOV_HSUART_GSBI6_RX_CHAN 8 |
| 189 | #define DMOV_HSUART_GSBI6_RX_CRCI 11 |
| 190 | |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 191 | #define DMOV_HSUART_GSBI8_TX_CHAN 7 |
| 192 | #define DMOV_HSUART_GSBI8_TX_CRCI 10 |
| 193 | |
| 194 | #define DMOV_HSUART_GSBI8_RX_CHAN 8 |
| 195 | #define DMOV_HSUART_GSBI8_RX_CRCI 9 |
| 196 | |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 197 | #define DMOV_HSUART_GSBI9_TX_CHAN 4 |
| 198 | #define DMOV_HSUART_GSBI9_TX_CRCI 13 |
| 199 | |
| 200 | #define DMOV_HSUART_GSBI9_RX_CHAN 3 |
| 201 | #define DMOV_HSUART_GSBI9_RX_CRCI 12 |
| 202 | |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 203 | #elif defined(CONFIG_ARCH_MSM9615) |
| 204 | |
| 205 | #define DMOV_GP_CHAN 4 |
| 206 | |
| 207 | #define DMOV_CE_IN_CHAN 0 |
| 208 | #define DMOV_CE_IN_CRCI 12 |
| 209 | |
| 210 | #define DMOV_CE_OUT_CHAN 1 |
| 211 | #define DMOV_CE_OUT_CRCI 13 |
| 212 | |
| 213 | #define DMOV_NAND_CHAN 3 |
| 214 | #define DMOV_NAND_CRCI_CMD 15 |
| 215 | #define DMOV_NAND_CRCI_DATA 3 |
| 216 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 217 | #elif defined(CONFIG_ARCH_FSM9XXX) |
| 218 | /* defined in dma-fsm9xxx.h */ |
| 219 | |
| 220 | #else |
| 221 | #define DMOV_GP_CHAN 4 |
| 222 | |
| 223 | #define DMOV_CE_IN_CHAN 5 |
| 224 | #define DMOV_CE_IN_CRCI 1 |
| 225 | |
| 226 | #define DMOV_CE_OUT_CHAN 6 |
| 227 | #define DMOV_CE_OUT_CRCI 2 |
| 228 | |
| 229 | #define DMOV_CE_HASH_CRCI 3 |
| 230 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 231 | #define DMOV_NAND_CHAN 7 |
| 232 | #define DMOV_NAND_CRCI_CMD 5 |
| 233 | #define DMOV_NAND_CRCI_DATA 4 |
| 234 | |
| 235 | #define DMOV_SDC1_CHAN 8 |
| 236 | #define DMOV_SDC1_CRCI 6 |
| 237 | |
| 238 | #define DMOV_SDC2_CHAN 8 |
| 239 | #define DMOV_SDC2_CRCI 7 |
| 240 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 241 | #define DMOV_SDC3_CHAN 8 |
| 242 | #define DMOV_SDC3_CRCI 12 |
| 243 | |
| 244 | #define DMOV_SDC4_CHAN 8 |
| 245 | #define DMOV_SDC4_CRCI 13 |
| 246 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 247 | #define DMOV_TSIF_CHAN 10 |
| 248 | #define DMOV_TSIF_CRCI 10 |
| 249 | |
| 250 | #define DMOV_USB_CHAN 11 |
| 251 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 252 | #define DMOV_HSUART1_TX_CHAN 4 |
| 253 | #define DMOV_HSUART1_TX_CRCI 8 |
| 254 | |
| 255 | #define DMOV_HSUART1_RX_CHAN 9 |
| 256 | #define DMOV_HSUART1_RX_CRCI 9 |
| 257 | |
| 258 | #define DMOV_HSUART2_TX_CHAN 4 |
| 259 | #define DMOV_HSUART2_TX_CRCI 14 |
| 260 | |
| 261 | #define DMOV_HSUART2_RX_CHAN 11 |
| 262 | #define DMOV_HSUART2_RX_CRCI 15 |
| 263 | #endif |
| 264 | |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 265 | /* channels for APQ8064 */ |
Jeff Ohlstein | 1d1172b | 2012-04-09 19:49:04 -0700 | [diff] [blame] | 266 | #define DMOV8064_CE_IN_CHAN 0 |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 267 | #define DMOV8064_CE_IN_CRCI 14 |
| 268 | |
Jeff Ohlstein | 1d1172b | 2012-04-09 19:49:04 -0700 | [diff] [blame] | 269 | #define DMOV8064_CE_OUT_CHAN 1 |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 270 | #define DMOV8064_CE_OUT_CRCI 15 |
| 271 | |
Liron Kuch | 43e8f9b | 2012-11-12 19:43:19 +0200 | [diff] [blame] | 272 | #define DMOV8064_TSIF_CHAN 4 |
Joel Nider | 67deb3c | 2012-06-28 16:08:46 +0300 | [diff] [blame] | 273 | #define DMOV8064_TSIF_CRCI 1 |
| 274 | |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 275 | /* channels for MPQ8064 */ |
| 276 | #define DMOV_MPQ8064_HSUART_GSBI6_TX_CHAN 7 |
| 277 | #define DMOV_MPQ8064_HSUART_GSBI6_TX_CRCI 6 |
| 278 | |
| 279 | #define DMOV_MPQ8064_HSUART_GSBI6_RX_CHAN 6 |
| 280 | #define DMOV_MPQ8064_HSUART_GSBI6_RX_CRCI 11 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 281 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 282 | /* no client rate control ifc (eg, ram) */ |
| 283 | #define DMOV_NONE_CRCI 0 |
| 284 | |
| 285 | |
| 286 | /* If the CMD_PTR register has CMD_PTR_LIST selected, the data mover |
| 287 | * is going to walk a list of 32bit pointers as described below. Each |
| 288 | * pointer points to a *array* of dmov_s, etc structs. The last pointer |
| 289 | * in the list is marked with CMD_PTR_LP. The last struct in each array |
| 290 | * is marked with CMD_LC (see below). |
| 291 | */ |
| 292 | #define CMD_PTR_ADDR(addr) ((addr) >> 3) |
| 293 | #define CMD_PTR_LP (1 << 31) /* last pointer */ |
| 294 | #define CMD_PTR_PT (3 << 29) /* ? */ |
| 295 | |
| 296 | /* Single Item Mode */ |
| 297 | typedef struct { |
| 298 | unsigned cmd; |
| 299 | unsigned src; |
| 300 | unsigned dst; |
| 301 | unsigned len; |
| 302 | } dmov_s; |
| 303 | |
| 304 | /* Scatter/Gather Mode */ |
| 305 | typedef struct { |
| 306 | unsigned cmd; |
| 307 | unsigned src_dscr; |
| 308 | unsigned dst_dscr; |
| 309 | unsigned _reserved; |
| 310 | } dmov_sg; |
| 311 | |
Brian Swetland | 8a0f6f1 | 2008-09-10 14:58:25 -0700 | [diff] [blame] | 312 | /* Box mode */ |
| 313 | typedef struct { |
| 314 | uint32_t cmd; |
| 315 | uint32_t src_row_addr; |
| 316 | uint32_t dst_row_addr; |
| 317 | uint32_t src_dst_len; |
| 318 | uint32_t num_rows; |
| 319 | uint32_t row_offset; |
| 320 | } dmov_box; |
| 321 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 322 | /* bits for the cmd field of the above structures */ |
| 323 | |
| 324 | #define CMD_LC (1 << 31) /* last command */ |
| 325 | #define CMD_FR (1 << 22) /* force result -- does not work? */ |
| 326 | #define CMD_OCU (1 << 21) /* other channel unblock */ |
| 327 | #define CMD_OCB (1 << 20) /* other channel block */ |
| 328 | #define CMD_TCB (1 << 19) /* ? */ |
| 329 | #define CMD_DAH (1 << 18) /* destination address hold -- does not work?*/ |
| 330 | #define CMD_SAH (1 << 17) /* source address hold -- does not work? */ |
| 331 | |
| 332 | #define CMD_MODE_SINGLE (0 << 0) /* dmov_s structure used */ |
| 333 | #define CMD_MODE_SG (1 << 0) /* untested */ |
| 334 | #define CMD_MODE_IND_SG (2 << 0) /* untested */ |
| 335 | #define CMD_MODE_BOX (3 << 0) /* untested */ |
| 336 | |
| 337 | #define CMD_DST_SWAP_BYTES (1 << 14) /* exchange each byte n with byte n+1 */ |
| 338 | #define CMD_DST_SWAP_SHORTS (1 << 15) /* exchange each short n with short n+1 */ |
| 339 | #define CMD_DST_SWAP_WORDS (1 << 16) /* exchange each word n with word n+1 */ |
| 340 | |
| 341 | #define CMD_SRC_SWAP_BYTES (1 << 11) /* exchange each byte n with byte n+1 */ |
| 342 | #define CMD_SRC_SWAP_SHORTS (1 << 12) /* exchange each short n with short n+1 */ |
| 343 | #define CMD_SRC_SWAP_WORDS (1 << 13) /* exchange each word n with word n+1 */ |
| 344 | |
| 345 | #define CMD_DST_CRCI(n) (((n) & 15) << 7) |
| 346 | #define CMD_SRC_CRCI(n) (((n) & 15) << 3) |
| 347 | |
| 348 | #endif |