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