| Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
| Mona Hossain | b43e94b | 2012-05-07 08:52:06 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _DRIVERS_CRYPTO_MSM_QCRYPTOHW_50_H_ |
| 14 | #define _DRIVERS_CRYPTO_MSM_QCRYPTOHW_50_H_ |
| 15 | |
| 16 | |
| 17 | #define QCE_AUTH_REG_BYTE_COUNT 4 |
| 18 | #define CRYPTO_VERSION_REG 0x1A000 |
| 19 | |
| 20 | #define CRYPTO_DATA_IN0_REG 0x1A010 |
| 21 | #define CRYPTO_DATA_IN1_REG 0x1A014 |
| 22 | #define CRYPTO_DATA_IN2_REG 0x1A018 |
| 23 | #define CRYPTO_DATA_IN3_REG 0x1A01C |
| 24 | |
| 25 | #define CRYPTO_DATA_OUT0_REG 0x1A020 |
| 26 | #define CRYPTO_DATA_OUT1_REG 0x1A024 |
| 27 | #define CRYPTO_DATA_OUT2_REG 0x1A028 |
| 28 | #define CRYPTO_DATA_OUT3_REG 0x1A02C |
| 29 | |
| 30 | #define CRYPTO_STATUS_REG 0x1A100 |
| 31 | #define CRYPTO_STATUS2_REG 0x1A100 |
| 32 | #define CRYPTO_ENGINES_AVAIL 0x1A108 |
| 33 | #define CRYPTO_FIFO_SIZES_REG 0x1A10C |
| 34 | |
| 35 | #define CRYPTO_SEG_SIZE_REG 0x1A110 |
| 36 | #define CRYPTO_GOPROC_REG 0x1A120 |
| 37 | #define CRYPTO_GOPROC_QC_KEY_REG 0x1B000 |
| 38 | #define CRYPTO_GOPROC_OEM_KEY_REG 0x1C000 |
| 39 | |
| 40 | #define CRYPTO_ENCR_SEG_CFG_REG 0x1A200 |
| 41 | #define CRYPTO_ENCR_SEG_SIZE_REG 0x1A204 |
| 42 | #define CRYPTO_ENCR_SEG_START_REG 0x1A208 |
| 43 | |
| 44 | #define CRYPTO_ENCR_KEY0_REG 0x1D000 |
| 45 | #define CRYPTO_ENCR_KEY1_REG 0x1D004 |
| 46 | #define CRYPTO_ENCR_KEY2_REG 0x1D008 |
| 47 | #define CRYPTO_ENCR_KEY3_REG 0x1D00C |
| 48 | #define CRYPTO_ENCR_KEY4_REG 0x1D010 |
| 49 | #define CRYPTO_ENCR_KEY5_REG 0x1D014 |
| 50 | #define CRYPTO_ENCR_KEY6_REG 0x1D018 |
| 51 | #define CRYPTO_ENCR_KEY7_REG 0x1D01C |
| 52 | |
| 53 | #define CRYPTO_ENCR_XTS_KEY0_REG 0x1D020 |
| 54 | #define CRYPTO_ENCR_XTS_KEY1_REG 0x1D024 |
| 55 | #define CRYPTO_ENCR_XTS_KEY2_REG 0x1D028 |
| 56 | #define CRYPTO_ENCR_XTS_KEY3_REG 0x1D02C |
| 57 | #define CRYPTO_ENCR_XTS_KEY4_REG 0x1D030 |
| 58 | #define CRYPTO_ENCR_XTS_KEY5_REG 0x1D034 |
| 59 | #define CRYPTO_ENCR_XTS_KEY6_REG 0x1D038 |
| 60 | #define CRYPTO_ENCR_XTS_KEY7_REG 0x1D03C |
| 61 | |
| 62 | #define CRYPTO_ENCR_PIP0_KEY0_REG 0x1E000 |
| 63 | #define CRYPTO_ENCR_PIP0_KEY1_REG 0x1E004 |
| 64 | #define CRYPTO_ENCR_PIP0_KEY2_REG 0x1E008 |
| 65 | #define CRYPTO_ENCR_PIP0_KEY3_REG 0x1E00C |
| 66 | #define CRYPTO_ENCR_PIP0_KEY4_REG 0x1E010 |
| 67 | #define CRYPTO_ENCR_PIP0_KEY5_REG 0x1E004 |
| 68 | #define CRYPTO_ENCR_PIP0_KEY6_REG 0x1E008 |
| 69 | #define CRYPTO_ENCR_PIP0_KEY7_REG 0x1E00C |
| 70 | |
| 71 | #define CRYPTO_ENCR_PIP1_KEY0_REG 0x1E000 |
| 72 | #define CRYPTO_ENCR_PIP1_KEY1_REG 0x1E004 |
| 73 | #define CRYPTO_ENCR_PIP1_KEY2_REG 0x1E008 |
| 74 | #define CRYPTO_ENCR_PIP1_KEY3_REG 0x1E00C |
| 75 | #define CRYPTO_ENCR_PIP1_KEY4_REG 0x1E010 |
| 76 | #define CRYPTO_ENCR_PIP1_KEY5_REG 0x1E014 |
| 77 | #define CRYPTO_ENCR_PIP1_KEY6_REG 0x1E018 |
| 78 | #define CRYPTO_ENCR_PIP1_KEY7_REG 0x1E01C |
| 79 | |
| 80 | #define CRYPTO_ENCR_PIP2_KEY0_REG 0x1E020 |
| 81 | #define CRYPTO_ENCR_PIP2_KEY1_REG 0x1E024 |
| 82 | #define CRYPTO_ENCR_PIP2_KEY2_REG 0x1E028 |
| 83 | #define CRYPTO_ENCR_PIP2_KEY3_REG 0x1E02C |
| 84 | #define CRYPTO_ENCR_PIP2_KEY4_REG 0x1E030 |
| 85 | #define CRYPTO_ENCR_PIP2_KEY5_REG 0x1E034 |
| 86 | #define CRYPTO_ENCR_PIP2_KEY6_REG 0x1E038 |
| 87 | #define CRYPTO_ENCR_PIP2_KEY7_REG 0x1E03C |
| 88 | |
| 89 | #define CRYPTO_ENCR_PIP3_KEY0_REG 0x1E040 |
| 90 | #define CRYPTO_ENCR_PIP3_KEY1_REG 0x1E044 |
| 91 | #define CRYPTO_ENCR_PIP3_KEY2_REG 0x1E048 |
| 92 | #define CRYPTO_ENCR_PIP3_KEY3_REG 0x1E04C |
| 93 | #define CRYPTO_ENCR_PIP3_KEY4_REG 0x1E050 |
| 94 | #define CRYPTO_ENCR_PIP3_KEY5_REG 0x1E054 |
| 95 | #define CRYPTO_ENCR_PIP3_KEY6_REG 0x1E058 |
| 96 | #define CRYPTO_ENCR_PIP3_KEY7_REG 0x1E05C |
| 97 | |
| 98 | #define CRYPTO_ENCR_PIP0_XTS_KEY0_REG 0x1E200 |
| 99 | #define CRYPTO_ENCR_PIP0_XTS_KEY1_REG 0x1E204 |
| 100 | #define CRYPTO_ENCR_PIP0_XTS_KEY2_REG 0x1E208 |
| 101 | #define CRYPTO_ENCR_PIP0_XTS_KEY3_REG 0x1E20C |
| 102 | #define CRYPTO_ENCR_PIP0_XTS_KEY4_REG 0x1E210 |
| 103 | #define CRYPTO_ENCR_PIP0_XTS_KEY5_REG 0x1E214 |
| 104 | #define CRYPTO_ENCR_PIP0_XTS_KEY6_REG 0x1E218 |
| 105 | #define CRYPTO_ENCR_PIP0_XTS_KEY7_REG 0x1E21C |
| 106 | |
| 107 | #define CRYPTO_ENCR_PIP1_XTS_KEY0_REG 0x1E220 |
| 108 | #define CRYPTO_ENCR_PIP1_XTS_KEY1_REG 0x1E224 |
| 109 | #define CRYPTO_ENCR_PIP1_XTS_KEY2_REG 0x1E228 |
| 110 | #define CRYPTO_ENCR_PIP1_XTS_KEY3_REG 0x1E22C |
| 111 | #define CRYPTO_ENCR_PIP1_XTS_KEY4_REG 0x1E230 |
| 112 | #define CRYPTO_ENCR_PIP1_XTS_KEY5_REG 0x1E234 |
| 113 | #define CRYPTO_ENCR_PIP1_XTS_KEY6_REG 0x1E238 |
| 114 | #define CRYPTO_ENCR_PIP1_XTS_KEY7_REG 0x1E23C |
| 115 | |
| 116 | #define CRYPTO_ENCR_PIP2_XTS_KEY0_REG 0x1E240 |
| 117 | #define CRYPTO_ENCR_PIP2_XTS_KEY1_REG 0x1E244 |
| 118 | #define CRYPTO_ENCR_PIP2_XTS_KEY2_REG 0x1E248 |
| 119 | #define CRYPTO_ENCR_PIP2_XTS_KEY3_REG 0x1E24C |
| 120 | #define CRYPTO_ENCR_PIP2_XTS_KEY4_REG 0x1E250 |
| 121 | #define CRYPTO_ENCR_PIP2_XTS_KEY5_REG 0x1E254 |
| 122 | #define CRYPTO_ENCR_PIP2_XTS_KEY6_REG 0x1E258 |
| 123 | #define CRYPTO_ENCR_PIP2_XTS_KEY7_REG 0x1E25C |
| 124 | |
| 125 | #define CRYPTO_ENCR_PIP3_XTS_KEY0_REG 0x1E260 |
| 126 | #define CRYPTO_ENCR_PIP3_XTS_KEY1_REG 0x1E264 |
| 127 | #define CRYPTO_ENCR_PIP3_XTS_KEY2_REG 0x1E268 |
| 128 | #define CRYPTO_ENCR_PIP3_XTS_KEY3_REG 0x1E26C |
| 129 | #define CRYPTO_ENCR_PIP3_XTS_KEY4_REG 0x1E270 |
| 130 | #define CRYPTO_ENCR_PIP3_XTS_KEY5_REG 0x1E274 |
| 131 | #define CRYPTO_ENCR_PIP3_XTS_KEY6_REG 0x1E278 |
| 132 | #define CRYPTO_ENCR_PIP3_XTS_KEY7_REG 0x1E27C |
| 133 | |
| 134 | |
| 135 | #define CRYPTO_CNTR0_IV0_REG 0x1A20C |
| 136 | #define CRYPTO_CNTR1_IV1_REG 0x1A210 |
| 137 | #define CRYPTO_CNTR2_IV2_REG 0x1A214 |
| 138 | #define CRYPTO_CNTR3_IV3_REG 0x1A218 |
| 139 | |
| 140 | #define CRYPTO_CNTR_MASK_REG 0x1A21C |
| 141 | |
| 142 | #define CRYPTO_ENCR_CCM_INT_CNTR0_REG 0x1A220 |
| 143 | #define CRYPTO_ENCR_CCM_INT_CNTR1_REG 0x1A224 |
| 144 | #define CRYPTO_ENCR_CCM_INT_CNTR2_REG 0x1A228 |
| 145 | #define CRYPTO_ENCR_CCM_INT_CNTR3_REG 0x1A22C |
| 146 | |
| 147 | #define CRYPTO_ENCR_XTS_DU_SIZE_REG 0xA1230 |
| 148 | |
| 149 | #define CRYPTO_AUTH_SEG_CFG_REG 0x1A300 |
| 150 | #define CRYPTO_AUTH_SEG_SIZE_REG 0x1A304 |
| 151 | #define CRYPTO_AUTH_SEG_START_REG 0x1A308 |
| 152 | |
| 153 | #define CRYPTO_AUTH_KEY0_REG 0x1D040 |
| 154 | #define CRYPTO_AUTH_KEY1_REG 0x1D044 |
| 155 | #define CRYPTO_AUTH_KEY2_REG 0x1D048 |
| 156 | #define CRYPTO_AUTH_KEY3_REG 0x1D04C |
| 157 | #define CRYPTO_AUTH_KEY4_REG 0x1D050 |
| 158 | #define CRYPTO_AUTH_KEY5_REG 0x1D054 |
| 159 | #define CRYPTO_AUTH_KEY6_REG 0x1D058 |
| 160 | #define CRYPTO_AUTH_KEY7_REG 0x1D05C |
| 161 | #define CRYPTO_AUTH_KEY8_REG 0x1D060 |
| 162 | #define CRYPTO_AUTH_KEY9_REG 0x1D064 |
| 163 | #define CRYPTO_AUTH_KEY10_REG 0x1D068 |
| 164 | #define CRYPTO_AUTH_KEY11_REG 0x1D06C |
| 165 | #define CRYPTO_AUTH_KEY12_REG 0x1D070 |
| 166 | #define CRYPTO_AUTH_KEY13_REG 0x1D074 |
| 167 | #define CRYPTO_AUTH_KEY14_REG 0x1D078 |
| 168 | #define CRYPTO_AUTH_KEY15_REG 0x1D07C |
| 169 | |
| 170 | #define CRYPTO_AUTH_PIPE0_KEY0_REG 0x1E800 |
| 171 | #define CRYPTO_AUTH_PIPE0_KEY1_REG 0x1E804 |
| 172 | #define CRYPTO_AUTH_PIPE0_KEY2_REG 0x1E808 |
| 173 | #define CRYPTO_AUTH_PIPE0_KEY3_REG 0x1E80C |
| 174 | #define CRYPTO_AUTH_PIPE0_KEY4_REG 0x1E810 |
| 175 | #define CRYPTO_AUTH_PIPE0_KEY5_REG 0x1E814 |
| 176 | #define CRYPTO_AUTH_PIPE0_KEY6_REG 0x1E818 |
| 177 | #define CRYPTO_AUTH_PIPE0_KEY7_REG 0x1E81C |
| 178 | #define CRYPTO_AUTH_PIPE0_KEY8_REG 0x1E820 |
| 179 | #define CRYPTO_AUTH_PIPE0_KEY9_REG 0x1E824 |
| 180 | #define CRYPTO_AUTH_PIPE0_KEY10_REG 0x1E828 |
| 181 | #define CRYPTO_AUTH_PIPE0_KEY11_REG 0x1E82C |
| 182 | #define CRYPTO_AUTH_PIPE0_KEY12_REG 0x1E830 |
| 183 | #define CRYPTO_AUTH_PIPE0_KEY13_REG 0x1E834 |
| 184 | #define CRYPTO_AUTH_PIPE0_KEY14_REG 0x1E838 |
| 185 | #define CRYPTO_AUTH_PIPE0_KEY15_REG 0x1E83C |
| 186 | |
| 187 | #define CRYPTO_AUTH_PIPE1_KEY0_REG 0x1E800 |
| 188 | #define CRYPTO_AUTH_PIPE1_KEY1_REG 0x1E804 |
| 189 | #define CRYPTO_AUTH_PIPE1_KEY2_REG 0x1E808 |
| 190 | #define CRYPTO_AUTH_PIPE1_KEY3_REG 0x1E80C |
| 191 | #define CRYPTO_AUTH_PIPE1_KEY4_REG 0x1E810 |
| 192 | #define CRYPTO_AUTH_PIPE1_KEY5_REG 0x1E814 |
| 193 | #define CRYPTO_AUTH_PIPE1_KEY6_REG 0x1E818 |
| 194 | #define CRYPTO_AUTH_PIPE1_KEY7_REG 0x1E81C |
| 195 | #define CRYPTO_AUTH_PIPE1_KEY8_REG 0x1E820 |
| 196 | #define CRYPTO_AUTH_PIPE1_KEY9_REG 0x1E824 |
| 197 | #define CRYPTO_AUTH_PIPE1_KEY10_REG 0x1E828 |
| 198 | #define CRYPTO_AUTH_PIPE1_KEY11_REG 0x1E82C |
| 199 | #define CRYPTO_AUTH_PIPE1_KEY12_REG 0x1E830 |
| 200 | #define CRYPTO_AUTH_PIPE1_KEY13_REG 0x1E834 |
| 201 | #define CRYPTO_AUTH_PIPE1_KEY14_REG 0x1E838 |
| 202 | #define CRYPTO_AUTH_PIPE1_KEY15_REG 0x1E83C |
| 203 | |
| 204 | #define CRYPTO_AUTH_PIPE2_KEY0_REG 0x1E840 |
| 205 | #define CRYPTO_AUTH_PIPE2_KEY1_REG 0x1E844 |
| 206 | #define CRYPTO_AUTH_PIPE2_KEY2_REG 0x1E848 |
| 207 | #define CRYPTO_AUTH_PIPE2_KEY3_REG 0x1E84C |
| 208 | #define CRYPTO_AUTH_PIPE2_KEY4_REG 0x1E850 |
| 209 | #define CRYPTO_AUTH_PIPE2_KEY5_REG 0x1E854 |
| 210 | #define CRYPTO_AUTH_PIPE2_KEY6_REG 0x1E858 |
| 211 | #define CRYPTO_AUTH_PIPE2_KEY7_REG 0x1E85C |
| 212 | #define CRYPTO_AUTH_PIPE2_KEY8_REG 0x1E860 |
| 213 | #define CRYPTO_AUTH_PIPE2_KEY9_REG 0x1E864 |
| 214 | #define CRYPTO_AUTH_PIPE2_KEY10_REG 0x1E868 |
| 215 | #define CRYPTO_AUTH_PIPE2_KEY11_REG 0x1E86C |
| 216 | #define CRYPTO_AUTH_PIPE2_KEY12_REG 0x1E870 |
| 217 | #define CRYPTO_AUTH_PIPE2_KEY13_REG 0x1E874 |
| 218 | #define CRYPTO_AUTH_PIPE2_KEY14_REG 0x1E878 |
| 219 | #define CRYPTO_AUTH_PIPE2_KEY15_REG 0x1E87C |
| 220 | |
| 221 | #define CRYPTO_AUTH_PIPE3_KEY0_REG 0x1E880 |
| 222 | #define CRYPTO_AUTH_PIPE3_KEY1_REG 0x1E884 |
| 223 | #define CRYPTO_AUTH_PIPE3_KEY2_REG 0x1E888 |
| 224 | #define CRYPTO_AUTH_PIPE3_KEY3_REG 0x1E88C |
| 225 | #define CRYPTO_AUTH_PIPE3_KEY4_REG 0x1E890 |
| 226 | #define CRYPTO_AUTH_PIPE3_KEY5_REG 0x1E894 |
| 227 | #define CRYPTO_AUTH_PIPE3_KEY6_REG 0x1E898 |
| 228 | #define CRYPTO_AUTH_PIPE3_KEY7_REG 0x1E89C |
| 229 | #define CRYPTO_AUTH_PIPE3_KEY8_REG 0x1E8A0 |
| 230 | #define CRYPTO_AUTH_PIPE3_KEY9_REG 0x1E8A4 |
| 231 | #define CRYPTO_AUTH_PIPE3_KEY10_REG 0x1E8A8 |
| 232 | #define CRYPTO_AUTH_PIPE3_KEY11_REG 0x1E8AC |
| 233 | #define CRYPTO_AUTH_PIPE3_KEY12_REG 0x1E8B0 |
| 234 | #define CRYPTO_AUTH_PIPE3_KEY13_REG 0x1E8B4 |
| 235 | #define CRYPTO_AUTH_PIPE3_KEY14_REG 0x1E8B8 |
| 236 | #define CRYPTO_AUTH_PIPE3_KEY15_REG 0x1E8BC |
| 237 | |
| 238 | |
| 239 | #define CRYPTO_AUTH_IV0_REG 0x1A310 |
| 240 | #define CRYPTO_AUTH_IV1_REG 0x1A314 |
| 241 | #define CRYPTO_AUTH_IV2_REG 0x1A318 |
| 242 | #define CRYPTO_AUTH_IV3_REG 0x1A31C |
| 243 | #define CRYPTO_AUTH_IV4_REG 0x1A320 |
| 244 | #define CRYPTO_AUTH_IV5_REG 0x1A324 |
| 245 | #define CRYPTO_AUTH_IV6_REG 0x1A328 |
| 246 | #define CRYPTO_AUTH_IV7_REG 0x1A32C |
| 247 | #define CRYPTO_AUTH_IV8_REG 0x1A330 |
| 248 | #define CRYPTO_AUTH_IV9_REG 0x1A334 |
| 249 | #define CRYPTO_AUTH_IV10_REG 0x1A338 |
| 250 | #define CRYPTO_AUTH_IV11_REG 0x1A33C |
| 251 | #define CRYPTO_AUTH_IV12_REG 0x1A340 |
| 252 | #define CRYPTO_AUTH_IV13_REG 0x1A344 |
| 253 | #define CRYPTO_AUTH_IV14_REG 0x1A348 |
| 254 | #define CRYPTO_AUTH_IV15_REG 0x1A34C |
| 255 | |
| 256 | #define CRYPTO_AUTH_INFO_NONCE0_REG 0x1A350 |
| 257 | #define CRYPTO_AUTH_INFO_NONCE1_REG 0x1A354 |
| 258 | #define CRYPTO_AUTH_INFO_NONCE2_REG 0x1A358 |
| 259 | #define CRYPTO_AUTH_INFO_NONCE3_REG 0x1A35C |
| 260 | |
| 261 | #define CRYPTO_AUTH_BYTECNT0_REG 0x1A390 |
| 262 | #define CRYPTO_AUTH_BYTECNT1_REG 0x1A394 |
| 263 | #define CRYPTO_AUTH_BYTECNT2_REG 0x1A398 |
| 264 | #define CRYPTO_AUTH_BYTECNT3_REG 0x1A39C |
| 265 | |
| 266 | #define CRYPTO_AUTH_EXP_MAC0_REG 0x1A3A0 |
| 267 | #define CRYPTO_AUTH_EXP_MAC1_REG 0x1A3A4 |
| 268 | #define CRYPTO_AUTH_EXP_MAC2_REG 0x1A3A8 |
| 269 | #define CRYPTO_AUTH_EXP_MAC3_REG 0x1A3AC |
| 270 | #define CRYPTO_AUTH_EXP_MAC4_REG 0x1A3B0 |
| 271 | #define CRYPTO_AUTH_EXP_MAC5_REG 0x1A3B4 |
| 272 | #define CRYPTO_AUTH_EXP_MAC6_REG 0x1A3B8 |
| 273 | #define CRYPTO_AUTH_EXP_MAC7_REG 0x1A3BC |
| 274 | |
| 275 | #define CRYPTO_CONFIG_REG 0x1A400 |
| 276 | #define CRYPTO_DEBUG_ENABLE_REG 0x1AF00 |
| 277 | #define CRYPTO_DEBUG_REG 0x1AF04 |
| 278 | |
| 279 | |
| 280 | |
| 281 | /* Register bits */ |
| 282 | #define CRYPTO_CORE_STEP_REV_MASK 0xFFFF |
| 283 | #define CRYPTO_CORE_STEP_REV 0 /* bit 15-0 */ |
| 284 | #define CRYPTO_CORE_MAJOR_REV_MASK 0xFF000000 |
| 285 | #define CRYPTO_CORE_MAJOR_REV 24 /* bit 31-24 */ |
| 286 | #define CRYPTO_CORE_MINOR_REV_MASK 0xFF0000 |
| 287 | #define CRYPTO_CORE_MINOR_REV 16 /* bit 23-16 */ |
| 288 | |
| 289 | /* status reg */ |
| 290 | #define CRYPTO_MAC_FAILED 31 |
| 291 | #define CRYPTO_DOUT_SIZE_AVAIL 26 /* bit 30-26 */ |
| 292 | #define CRYPTO_DOUT_SIZE_AVAIL_MASK (0x1F << CRYPTO_DOUT_SIZE_AVAIL) |
| 293 | #define CRYPTO_DIN_SIZE_AVAIL 21 /* bit 21-25 */ |
| 294 | #define CRYPTO_DIN_SIZE_AVAIL_MASK (0x1F << CRYPTO_DIN_SIZE_AVAIL) |
| 295 | #define CRYPTO_ACCESS_VIOL 19 |
| 296 | #define CRYPTO_PIPE_ACTIVE_ERR 18 |
| 297 | #define CRYPTO_CFG_CHNG_ERR 17 |
| 298 | #define CRYPTO_DOUT_ERR 16 |
| 299 | #define CRYPTO_DIN_ERR 15 |
| 300 | #define CRYPTO_AXI_ERR 14 |
| 301 | #define CRYPTO_CRYPTO_STATE 10 /* bit 13-10 */ |
| 302 | #define CRYPTO_CRYPTO_STATE_MASK (0xF << CRYPTO_CRYPTO_STATE) |
| 303 | #define CRYPTO_ENCR_BUSY 9 |
| 304 | #define CRYPTO_AUTH_BUSY 8 |
| 305 | #define CRYPTO_DOUT_INTR 7 |
| 306 | #define CRYPTO_DIN_INTR 6 |
| 307 | #define CRYPTO_OP_DONE_INTR 5 |
| 308 | #define CRYPTO_ERR_INTR 4 |
| 309 | #define CRYPTO_DOUT_RDY 3 |
| 310 | #define CRYPTO_DIN_RDY 2 |
| 311 | #define CRYPTO_OPERATION_DONE 1 |
| 312 | #define CRYPTO_SW_ERR 0 |
| 313 | |
| 314 | /* status2 reg */ |
| 315 | #define CRYPTO_AXI_EXTRA 1 |
| 316 | #define CRYPTO_LOCKED 2 |
| 317 | |
| 318 | /* config reg */ |
| 319 | #define CRYPTO_REQ_SIZE 17 /* bit 20-17 */ |
| 320 | #define CRYPTO_REQ_SIZE_MASK (0xF << CRYPTO_REQ_SIZE) |
| 321 | #define CRYPTO_REQ_SIZE_ENUM_1_BEAT 0 |
| 322 | #define CRYPTO_REQ_SIZE_ENUM_2_BEAT 1 |
| 323 | #define CRYPTO_REQ_SIZE_ENUM_3_BEAT 2 |
| 324 | #define CRYPTO_REQ_SIZE_ENUM_4_BEAT 3 |
| 325 | #define CRYPTO_REQ_SIZE_ENUM_5_BEAT 4 |
| 326 | #define CRYPTO_REQ_SIZE_ENUM_6_BEAT 5 |
| 327 | #define CRYPTO_REQ_SIZE_ENUM_7_BEAT 6 |
| 328 | #define CRYPTO_REQ_SIZE_ENUM_8_BEAT 7 |
| 329 | #define CRYPTO_REQ_SIZE_ENUM_9_BEAT 8 |
| 330 | #define CRYPTO_REQ_SIZE_ENUM_10_BEAT 9 |
| 331 | #define CRYPTO_REQ_SIZE_ENUM_11_BEAT 10 |
| 332 | #define CRYPTO_REQ_SIZE_ENUM_12_BEAT 11 |
| 333 | #define CRYPTO_REQ_SIZE_ENUM_13_BEAT 12 |
| 334 | #define CRYPTO_REQ_SIZE_ENUM_14_BEAT 13 |
| 335 | #define CRYPTO_REQ_SIZE_ENUM_15_BEAT 14 |
| 336 | #define CRYPTO_REQ_SIZE_ENUM_16_BEAT 15 |
| 337 | |
| 338 | #define CRYPTO_MAX_QUEUED_REQ 14 /* bit 16-14 */ |
| 339 | #define CRYPTO_MAX_QUEUED_REQ_MASK (0x7 << CRYPTO_MAX_QUEUED_REQ) |
| 340 | #define CRYPTO_ENUM_1_QUEUED_REQS 0 |
| 341 | #define CRYPTO_ENUM_2_QUEUED_REQS 1 |
| 342 | #define CRYPTO_ENUM_3_QUEUED_REQS 2 |
| 343 | |
| 344 | #define CRYPTO_IRQ_ENABLES 10 /* bit 13-10 */ |
| 345 | #define CRYPTO_IRQ_ENABLES_MASK (0xF << CRYPTO_IRQ_ENABLES) |
| 346 | |
| 347 | #define CRYPTO_LITTLE_ENDIAN_MODE 9 |
| 348 | #define CRYPTO_PIPE_SET_SELECT 5 /* bit 8-5 */ |
| 349 | #define CRYPTO_PIPE_SET_SELECT_MASK (0xF << CRYPTO_PIPE_SET_SELECT) |
| 350 | |
| 351 | #define CRYPTO_HIGH_SPD_EN_N 4 |
| 352 | |
| 353 | #define CRYPTO_MASK_DOUT_INTR 3 |
| 354 | #define CRYPTO_MASK_DIN_INTR 2 |
| 355 | #define CRYPTO_MASK_OP_DONE_INTR 1 |
| 356 | #define CRYPTO_MASK_ERR_INTR 0 |
| 357 | |
| 358 | /* auth_seg_cfg reg */ |
| 359 | #define CRYPTO_COMP_EXP_MAC 24 |
| 360 | #define CRYPTO_COMP_EXP_MAC_DISABLED 0 |
| 361 | #define CRYPTO_COMP_EXP_MAC_ENABLED 1 |
| 362 | |
| 363 | #define CRYPTO_F9_DIRECTION 23 |
| 364 | #define CRYPTO_F9_DIRECTION_UPLINK 0 |
| 365 | #define CRYPTO_F9_DIRECTION_DOWNLINK 1 |
| 366 | |
| 367 | #define CRYPTO_AUTH_NONCE_NUM_WORDS 20 /* bit 22-20 */ |
| 368 | #define CRYPTO_AUTH_NONCE_NUM_WORDS_MASK \ |
| 369 | (0x7 << CRYPTO_AUTH_NONCE_NUM_WORDS) |
| 370 | |
| 371 | #define CRYPTO_USE_PIPE_KEY_AUTH 19 |
| 372 | #define CRYPTO_USE_HW_KEY_AUTH 18 |
| 373 | #define CRYPTO_FIRST 17 |
| 374 | #define CRYPTO_LAST 16 |
| 375 | |
| 376 | #define CRYPTO_AUTH_POS 15 /* bit 15 .. 14*/ |
| 377 | #define CRYPTO_AUTH_POS_MASK (0x3 << CRYPTO_AUTH_POS) |
| 378 | #define CRYPTO_AUTH_POS_BEFORE 0 |
| 379 | #define CRYPTO_AUTH_POS_AFTER 1 |
| 380 | |
| 381 | #define CRYPTO_AUTH_SIZE 9 /* bits 13 .. 9*/ |
| 382 | #define CRYPTO_AUTH_SIZE_MASK (0x1F << CRYPTO_AUTH_SIZE) |
| 383 | #define CRYPTO_AUTH_SIZE_SHA1 0 |
| 384 | #define CRYPTO_AUTH_SIZE_SHA256 1 |
| 385 | #define CRYPTO_AUTH_SIZE_ENUM_1_BYTES 0 |
| 386 | #define CRYPTO_AUTH_SIZE_ENUM_2_BYTES 1 |
| 387 | #define CRYPTO_AUTH_SIZE_ENUM_3_BYTES 2 |
| 388 | #define CRYPTO_AUTH_SIZE_ENUM_4_BYTES 3 |
| 389 | #define CRYPTO_AUTH_SIZE_ENUM_5_BYTES 4 |
| 390 | #define CRYPTO_AUTH_SIZE_ENUM_6_BYTES 5 |
| 391 | #define CRYPTO_AUTH_SIZE_ENUM_7_BYTES 6 |
| 392 | #define CRYPTO_AUTH_SIZE_ENUM_8_BYTES 7 |
| 393 | #define CRYPTO_AUTH_SIZE_ENUM_9_BYTES 8 |
| 394 | #define CRYPTO_AUTH_SIZE_ENUM_10_BYTES 9 |
| 395 | #define CRYPTO_AUTH_SIZE_ENUM_11_BYTES 10 |
| 396 | #define CRYPTO_AUTH_SIZE_ENUM_12_BYTES 11 |
| 397 | #define CRYPTO_AUTH_SIZE_ENUM_13_BYTES 12 |
| 398 | #define CRYPTO_AUTH_SIZE_ENUM_14_BYTES 13 |
| 399 | #define CRYPTO_AUTH_SIZE_ENUM_15_BYTES 14 |
| 400 | #define CRYPTO_AUTH_SIZE_ENUM_16_BYTES 15 |
| 401 | |
| 402 | |
| 403 | #define CRYPTO_AUTH_MODE 6 /* bit 8 .. 6*/ |
| 404 | #define CRYPTO_AUTH_MODE_MASK (0x7 << CRYPTO_AUTH_MODE) |
| 405 | #define CRYPTO_AUTH_MODE_HASH 0 |
| 406 | #define CRYPTO_AUTH_MODE_HMAC 1 |
| 407 | #define CRYPTO_AUTH_MODE_CCM 0 |
| 408 | #define CRYPTO_AUTH_MODE_CMAC 1 |
| 409 | |
| 410 | #define CRYPTO_AUTH_KEY_SIZE 3 /* bit 5 .. 3*/ |
| 411 | #define CRYPTO_AUTH_KEY_SIZE_MASK (0x7 << CRYPTO_AUTH_KEY_SIZE) |
| 412 | #define CRYPTO_AUTH_KEY_SZ_AES128 0 |
| 413 | #define CRYPTO_AUTH_KEY_SZ_AES256 2 |
| 414 | |
| 415 | #define CRYPTO_AUTH_ALG 0 /* bit 2 .. 0*/ |
| 416 | #define CRYPTO_AUTH_ALG_MASK 7 |
| 417 | #define CRYPTO_AUTH_ALG_NONE 0 |
| 418 | #define CRYPTO_AUTH_ALG_SHA 1 |
| 419 | #define CRYPTO_AUTH_ALG_AES 2 |
| 420 | #define CRYPTO_AUTH_ALG_KASUMI 3 |
| 421 | #define CRYPTO_AUTH_ALG_SNOW3G 4 |
| 422 | |
| 423 | /* encr_xts_du_size reg */ |
| 424 | #define CRYPTO_ENCR_XTS_DU_SIZE 0 /* bit 19-0 */ |
| 425 | #define CRYPTO_ENCR_XTS_DU_SIZE_MASK 0xfffff |
| 426 | |
| 427 | /* encr_seg_cfg reg */ |
| 428 | #define CRYPTO_F8_KEYSTREAM_ENABLE 17/* bit */ |
| 429 | #define CRYPTO_F8_KEYSTREAM_DISABLED 0 |
| 430 | #define CRYPTO_F8_KEYSTREAM_ENABLED 1 |
| 431 | |
| 432 | #define CRYPTO_F8_DIRECTION 16 /* bit */ |
| 433 | #define CRYPTO_F8_DIRECTION_UPLINK 0 |
| 434 | #define CRYPTO_F8_DIRECTION_DOWNLINK 1 |
| 435 | |
| 436 | |
| 437 | #define CRYPTO_USE_PIPE_KEY_ENCR 15 /* bit */ |
| 438 | #define CRYPTO_USE_PIPE_KEY_ENCR_ENABLED 1 |
| 439 | #define CRYPTO_USE_KEY_REGISTERS 0 |
| 440 | |
| 441 | |
| 442 | #define CRYPTO_USE_HW_KEY_ENCR 14 |
| 443 | #define CRYPTO_USE_KEY_REG 0 |
| 444 | #define CRYPTO_USE_HW_KEY 1 |
| 445 | |
| 446 | #define CRYPTO_LAST_CCM 13 |
| 447 | #define CRYPTO_LAST_CCM_XFR 1 |
| 448 | #define CRYPTO_INTERM_CCM_XFR 0 |
| 449 | |
| 450 | |
| 451 | #define CRYPTO_CNTR_ALG 11 /* bit 12-11 */ |
| 452 | #define CRYPTO_CNTR_ALG_MASK (3 << CRYPTO_CNTR_ALG) |
| 453 | #define CRYPTO_CNTR_ALG_NIST 0 |
| 454 | |
| 455 | #define CRYPTO_ENCODE 10 |
| 456 | |
| 457 | #define CRYPTO_ENCR_MODE 6 /* bit 9-6 */ |
| 458 | #define CRYPTO_ENCR_MODE_MASK (0xF << CRYPTO_ENCR_MODE) |
| 459 | /* only valid when AES */ |
| 460 | #define CRYPTO_ENCR_MODE_ECB 0 |
| 461 | #define CRYPTO_ENCR_MODE_CBC 1 |
| 462 | #define CRYPTO_ENCR_MODE_CTR 2 |
| 463 | #define CRYPTO_ENCR_MODE_XTS 3 |
| 464 | #define CRYPTO_ENCR_MODE_CCM 4 |
| 465 | |
| 466 | #define CRYPTO_ENCR_KEY_SZ 3 /* bit 5-3 */ |
| 467 | #define CRYPTO_ENCR_KEY_SZ_MASK (7 << CRYPTO_ENCR_KEY_SZ) |
| 468 | #define CRYPTO_ENCR_KEY_SZ_DES 0 |
| 469 | #define CRYPTO_ENCR_KEY_SZ_3DES 1 |
| 470 | #define CRYPTO_ENCR_KEY_SZ_AES128 0 |
| 471 | #define CRYPTO_ENCR_KEY_SZ_AES256 2 |
| 472 | #define CRYPTO_ENCR_KEY_SZ_UEA1 0 |
| 473 | #define CRYPTO_ENCR_KEY_SZ_UEA2 1 |
| 474 | |
| 475 | #define CRYPTO_ENCR_ALG 0 /* bit 2-0 */ |
| 476 | #define CRYPTO_ENCR_ALG_MASK (7 << CRYPTO_ENCR_ALG) |
| 477 | #define CRYPTO_ENCR_ALG_NONE 0 |
| 478 | #define CRYPTO_ENCR_ALG_DES 1 |
| 479 | #define CRYPTO_ENCR_ALG_AES 2 |
| 480 | #define CRYPTO_ENCR_ALG_KASUMI 3 |
| 481 | #define CRYPTO_ENCR_ALG_SNOW_3G 5 |
| 482 | |
| 483 | /* goproc reg */ |
| 484 | #define CRYPTO_GO 0 |
| 485 | #define CRYPTO_CLR_CNTXT 1 |
| 486 | #define CRYPTO_RESULTS_DUMP 2 |
| 487 | |
| 488 | |
| 489 | /* engines_avail */ |
| 490 | #define CRYPTO_ENCR_AES_SEL 0 |
| 491 | #define CRYPTO_DES_SEL 3 |
| 492 | #define CRYPTO_ENCR_SNOW3G_SEL 4 |
| 493 | #define CRYPTO_ENCR_KASUMI_SEL 5 |
| 494 | #define CRYPTO_SHA_SEL 6 |
| 495 | #define CRYPTO_SHA512_SEL 7 |
| 496 | #define CRYPTO_AUTH_AES_SEL 8 |
| 497 | #define CRYPTO_AUTH_SNOW3G_SEL 9 |
| 498 | #define CRYPTO_AUTH_KASUMI_SEL 10 |
| 499 | #define CRYPTO_BAM_SEL 11 |
| 500 | |
| 501 | #endif /* _DRIVERS_CRYPTO_MSM_QCRYPTOHW_50_H_ */ |