1 /* 2 * Copyright (c) 2016 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 // $ATH_LICENSE_HW_HDR_C$ 20 // 21 // DO NOT EDIT! This file is automatically generated 22 // These definitions are tied to a particular hardware layout 23 24 25 #ifndef _CE_STAT_DESC_H_ 26 #define _CE_STAT_DESC_H_ 27 #if !defined(__ASSEMBLER__) 28 #endif 29 30 31 // ################ START SUMMARY ################# 32 // 33 // Dword Fields 34 // 0 ce_res_5[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_6[15:12], length[31:16] 35 // 1 toeplitz_hash_0[31:0] 36 // 2 toeplitz_hash_1[31:0] 37 // 3 fw_metadata[15:0], ce_res_7[19:16], ring_id[27:20], looping_count[31:28] 38 // 39 // ################ END SUMMARY ################# 40 41 #define NUM_OF_DWORDS_CE_STAT_DESC 4 42 43 struct ce_stat_desc { 44 uint32_t ce_res_5 : 8, //[7:0] 45 toeplitz_en : 1, //[8] 46 src_swap : 1, //[9] 47 dest_swap : 1, //[10] 48 gather : 1, //[11] 49 ce_res_6 : 4, //[15:12] 50 length : 16; //[31:16] 51 uint32_t toeplitz_hash_0 : 32; //[31:0] 52 uint32_t toeplitz_hash_1 : 32; //[31:0] 53 uint32_t fw_metadata : 16, //[15:0] 54 ce_res_7 : 4, //[19:16] 55 ring_id : 8, //[27:20] 56 looping_count : 4; //[31:28] 57 }; 58 59 /* 60 61 ce_res_5 62 63 Reserved 64 65 <legal all> 66 67 toeplitz_en 68 69 70 <legal all> 71 72 src_swap 73 74 Source memory buffer swapped 75 76 <legal all> 77 78 dest_swap 79 80 Destination memory buffer swapped 81 82 <legal all> 83 84 gather 85 86 Gather of multiple copy engine source descriptors to one 87 destination enabled 88 89 <legal all> 90 91 ce_res_6 92 93 Reserved 94 95 <legal all> 96 97 length 98 99 Sum of all the Lengths of the source descriptor in the 100 gather chain 101 102 <legal all> 103 104 toeplitz_hash_0 105 106 32 LS bits of 64 bit Toeplitz LFSR hash result 107 108 <legal all> 109 110 toeplitz_hash_1 111 112 32 MS bits of 64 bit Toeplitz LFSR hash result 113 114 <legal all> 115 116 fw_metadata 117 118 Meta data used by FW 119 120 In case of gather field in first source ring entry of 121 the gather copy cycle in taken into account. 122 123 <legal all> 124 125 ce_res_7 126 127 Reserved 128 129 <legal all> 130 131 ring_id 132 133 The buffer pointer ring ID. 134 135 0 refers to the IDLE ring 136 137 1 - N refers to other rings 138 139 140 141 Helps with debugging when dumping ring contents. 142 143 <legal all> 144 145 looping_count 146 147 A count value that indicates the number of times the 148 producer of entries into the Ring has looped around the 149 ring. 150 151 At initialization time, this value is set to 0. On the 152 first loop, this value is set to 1. After the max value is 153 reached allowed by the number of bits for this field, the 154 count value continues with 0 again. 155 156 In case SW is the consumer of the ring entries, it can 157 use this field to figure out up to where the producer of 158 entries has created new entries. This eliminates the need to 159 check where the head pointer' of the ring is located once 160 the SW starts processing an interrupt indicating that new 161 entries have been put into this ring... 162 163 Also note that SW if it wants only needs to look at the 164 LSB bit of this count value. 165 166 <legal all> 167 */ 168 169 170 /* Description CE_STAT_DESC_0_CE_RES_5 171 172 Reserved 173 174 <legal all> 175 */ 176 #define CE_STAT_DESC_0_CE_RES_5_OFFSET 0x00000000 177 #define CE_STAT_DESC_0_CE_RES_5_LSB 0 178 #define CE_STAT_DESC_0_CE_RES_5_MASK 0x000000ff 179 180 /* Description CE_STAT_DESC_0_TOEPLITZ_EN 181 182 183 <legal all> 184 */ 185 #define CE_STAT_DESC_0_TOEPLITZ_EN_OFFSET 0x00000000 186 #define CE_STAT_DESC_0_TOEPLITZ_EN_LSB 8 187 #define CE_STAT_DESC_0_TOEPLITZ_EN_MASK 0x00000100 188 189 /* Description CE_STAT_DESC_0_SRC_SWAP 190 191 Source memory buffer swapped 192 193 <legal all> 194 */ 195 #define CE_STAT_DESC_0_SRC_SWAP_OFFSET 0x00000000 196 #define CE_STAT_DESC_0_SRC_SWAP_LSB 9 197 #define CE_STAT_DESC_0_SRC_SWAP_MASK 0x00000200 198 199 /* Description CE_STAT_DESC_0_DEST_SWAP 200 201 Destination memory buffer swapped 202 203 <legal all> 204 */ 205 #define CE_STAT_DESC_0_DEST_SWAP_OFFSET 0x00000000 206 #define CE_STAT_DESC_0_DEST_SWAP_LSB 10 207 #define CE_STAT_DESC_0_DEST_SWAP_MASK 0x00000400 208 209 /* Description CE_STAT_DESC_0_GATHER 210 211 Gather of multiple copy engine source descriptors to one 212 destination enabled 213 214 <legal all> 215 */ 216 #define CE_STAT_DESC_0_GATHER_OFFSET 0x00000000 217 #define CE_STAT_DESC_0_GATHER_LSB 11 218 #define CE_STAT_DESC_0_GATHER_MASK 0x00000800 219 220 /* Description CE_STAT_DESC_0_CE_RES_6 221 222 Reserved 223 224 <legal all> 225 */ 226 #define CE_STAT_DESC_0_CE_RES_6_OFFSET 0x00000000 227 #define CE_STAT_DESC_0_CE_RES_6_LSB 12 228 #define CE_STAT_DESC_0_CE_RES_6_MASK 0x0000f000 229 230 /* Description CE_STAT_DESC_0_LENGTH 231 232 Sum of all the Lengths of the source descriptor in the 233 gather chain 234 235 <legal all> 236 */ 237 #define CE_STAT_DESC_0_LENGTH_OFFSET 0x00000000 238 #define CE_STAT_DESC_0_LENGTH_LSB 16 239 #define CE_STAT_DESC_0_LENGTH_MASK 0xffff0000 240 241 /* Description CE_STAT_DESC_1_TOEPLITZ_HASH_0 242 243 32 LS bits of 64 bit Toeplitz LFSR hash result 244 245 <legal all> 246 */ 247 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_OFFSET 0x00000004 248 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_LSB 0 249 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_MASK 0xffffffff 250 251 /* Description CE_STAT_DESC_2_TOEPLITZ_HASH_1 252 253 32 MS bits of 64 bit Toeplitz LFSR hash result 254 255 <legal all> 256 */ 257 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_OFFSET 0x00000008 258 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_LSB 0 259 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_MASK 0xffffffff 260 261 /* Description CE_STAT_DESC_3_FW_METADATA 262 263 Meta data used by FW 264 265 In case of gather field in first source ring entry of 266 the gather copy cycle in taken into account. 267 268 <legal all> 269 */ 270 #define CE_STAT_DESC_3_FW_METADATA_OFFSET 0x0000000c 271 #define CE_STAT_DESC_3_FW_METADATA_LSB 0 272 #define CE_STAT_DESC_3_FW_METADATA_MASK 0x0000ffff 273 274 /* Description CE_STAT_DESC_3_CE_RES_7 275 276 Reserved 277 278 <legal all> 279 */ 280 #define CE_STAT_DESC_3_CE_RES_7_OFFSET 0x0000000c 281 #define CE_STAT_DESC_3_CE_RES_7_LSB 16 282 #define CE_STAT_DESC_3_CE_RES_7_MASK 0x000f0000 283 284 /* Description CE_STAT_DESC_3_RING_ID 285 286 The buffer pointer ring ID. 287 288 0 refers to the IDLE ring 289 290 1 - N refers to other rings 291 292 293 294 Helps with debugging when dumping ring contents. 295 296 <legal all> 297 */ 298 #define CE_STAT_DESC_3_RING_ID_OFFSET 0x0000000c 299 #define CE_STAT_DESC_3_RING_ID_LSB 20 300 #define CE_STAT_DESC_3_RING_ID_MASK 0x0ff00000 301 302 /* Description CE_STAT_DESC_3_LOOPING_COUNT 303 304 A count value that indicates the number of times the 305 producer of entries into the Ring has looped around the 306 ring. 307 308 At initialization time, this value is set to 0. On the 309 first loop, this value is set to 1. After the max value is 310 reached allowed by the number of bits for this field, the 311 count value continues with 0 again. 312 313 In case SW is the consumer of the ring entries, it can 314 use this field to figure out up to where the producer of 315 entries has created new entries. This eliminates the need to 316 check where the head pointer' of the ring is located once 317 the SW starts processing an interrupt indicating that new 318 entries have been put into this ring... 319 320 Also note that SW if it wants only needs to look at the 321 LSB bit of this count value. 322 323 <legal all> 324 */ 325 #define CE_STAT_DESC_3_LOOPING_COUNT_OFFSET 0x0000000c 326 #define CE_STAT_DESC_3_LOOPING_COUNT_LSB 28 327 #define CE_STAT_DESC_3_LOOPING_COUNT_MASK 0xf0000000 328 329 330 #endif // _CE_STAT_DESC_H_ 331