1*5113495bSYour Name /* 2*5113495bSYour Name * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 3*5113495bSYour Name * 4*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any 5*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above 6*5113495bSYour Name * copyright notice and this permission notice appear in all copies. 7*5113495bSYour Name * 8*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15*5113495bSYour Name */ 16*5113495bSYour Name 17*5113495bSYour Name 18*5113495bSYour Name #ifndef _CE_STAT_DESC_H_ 19*5113495bSYour Name #define _CE_STAT_DESC_H_ 20*5113495bSYour Name #if !defined(__ASSEMBLER__) 21*5113495bSYour Name #endif 22*5113495bSYour Name 23*5113495bSYour Name #define NUM_OF_DWORDS_CE_STAT_DESC 4 24*5113495bSYour Name 25*5113495bSYour Name 26*5113495bSYour Name struct ce_stat_desc { 27*5113495bSYour Name #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 28*5113495bSYour Name uint32_t ce_res_5 : 8, // [7:0] 29*5113495bSYour Name toeplitz_en : 1, // [8:8] 30*5113495bSYour Name src_swap : 1, // [9:9] 31*5113495bSYour Name dest_swap : 1, // [10:10] 32*5113495bSYour Name gather : 1, // [11:11] 33*5113495bSYour Name barrier_read : 1, // [12:12] 34*5113495bSYour Name ce_res_6 : 3, // [15:13] 35*5113495bSYour Name length : 16; // [31:16] 36*5113495bSYour Name uint32_t toeplitz_hash_0 : 32; // [31:0] 37*5113495bSYour Name uint32_t toeplitz_hash_1 : 32; // [31:0] 38*5113495bSYour Name uint32_t fw_metadata : 16, // [15:0] 39*5113495bSYour Name ce_res_7 : 4, // [19:16] 40*5113495bSYour Name ring_id : 8, // [27:20] 41*5113495bSYour Name looping_count : 4; // [31:28] 42*5113495bSYour Name #else 43*5113495bSYour Name uint32_t length : 16, // [31:16] 44*5113495bSYour Name ce_res_6 : 3, // [15:13] 45*5113495bSYour Name barrier_read : 1, // [12:12] 46*5113495bSYour Name gather : 1, // [11:11] 47*5113495bSYour Name dest_swap : 1, // [10:10] 48*5113495bSYour Name src_swap : 1, // [9:9] 49*5113495bSYour Name toeplitz_en : 1, // [8:8] 50*5113495bSYour Name ce_res_5 : 8; // [7:0] 51*5113495bSYour Name uint32_t toeplitz_hash_0 : 32; // [31:0] 52*5113495bSYour Name uint32_t toeplitz_hash_1 : 32; // [31:0] 53*5113495bSYour Name uint32_t looping_count : 4, // [31:28] 54*5113495bSYour Name ring_id : 8, // [27:20] 55*5113495bSYour Name ce_res_7 : 4, // [19:16] 56*5113495bSYour Name fw_metadata : 16; // [15:0] 57*5113495bSYour Name #endif 58*5113495bSYour Name }; 59*5113495bSYour Name 60*5113495bSYour Name 61*5113495bSYour Name /* Description CE_RES_5 62*5113495bSYour Name 63*5113495bSYour Name Reserved 64*5113495bSYour Name <legal all> 65*5113495bSYour Name */ 66*5113495bSYour Name 67*5113495bSYour Name #define CE_STAT_DESC_CE_RES_5_OFFSET 0x00000000 68*5113495bSYour Name #define CE_STAT_DESC_CE_RES_5_LSB 0 69*5113495bSYour Name #define CE_STAT_DESC_CE_RES_5_MSB 7 70*5113495bSYour Name #define CE_STAT_DESC_CE_RES_5_MASK 0x000000ff 71*5113495bSYour Name 72*5113495bSYour Name 73*5113495bSYour Name /* Description TOEPLITZ_EN 74*5113495bSYour Name 75*5113495bSYour Name 32-bit Toeplitz-LFSR hash for the data transfer, Enabled 76*5113495bSYour Name 77*5113495bSYour Name <legal all> 78*5113495bSYour Name */ 79*5113495bSYour Name 80*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_EN_OFFSET 0x00000000 81*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_EN_LSB 8 82*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_EN_MSB 8 83*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_EN_MASK 0x00000100 84*5113495bSYour Name 85*5113495bSYour Name 86*5113495bSYour Name /* Description SRC_SWAP 87*5113495bSYour Name 88*5113495bSYour Name Source memory buffer swapped 89*5113495bSYour Name <legal all> 90*5113495bSYour Name */ 91*5113495bSYour Name 92*5113495bSYour Name #define CE_STAT_DESC_SRC_SWAP_OFFSET 0x00000000 93*5113495bSYour Name #define CE_STAT_DESC_SRC_SWAP_LSB 9 94*5113495bSYour Name #define CE_STAT_DESC_SRC_SWAP_MSB 9 95*5113495bSYour Name #define CE_STAT_DESC_SRC_SWAP_MASK 0x00000200 96*5113495bSYour Name 97*5113495bSYour Name 98*5113495bSYour Name /* Description DEST_SWAP 99*5113495bSYour Name 100*5113495bSYour Name Destination memory buffer swapped 101*5113495bSYour Name <legal all> 102*5113495bSYour Name */ 103*5113495bSYour Name 104*5113495bSYour Name #define CE_STAT_DESC_DEST_SWAP_OFFSET 0x00000000 105*5113495bSYour Name #define CE_STAT_DESC_DEST_SWAP_LSB 10 106*5113495bSYour Name #define CE_STAT_DESC_DEST_SWAP_MSB 10 107*5113495bSYour Name #define CE_STAT_DESC_DEST_SWAP_MASK 0x00000400 108*5113495bSYour Name 109*5113495bSYour Name 110*5113495bSYour Name /* Description GATHER 111*5113495bSYour Name 112*5113495bSYour Name Gather of multiple copy engine source descriptors to one 113*5113495bSYour Name destination enabled 114*5113495bSYour Name <legal all> 115*5113495bSYour Name */ 116*5113495bSYour Name 117*5113495bSYour Name #define CE_STAT_DESC_GATHER_OFFSET 0x00000000 118*5113495bSYour Name #define CE_STAT_DESC_GATHER_LSB 11 119*5113495bSYour Name #define CE_STAT_DESC_GATHER_MSB 11 120*5113495bSYour Name #define CE_STAT_DESC_GATHER_MASK 0x00000800 121*5113495bSYour Name 122*5113495bSYour Name 123*5113495bSYour Name /* Description BARRIER_READ 124*5113495bSYour Name 125*5113495bSYour Name Barrier read enabled 126*5113495bSYour Name <legal all> 127*5113495bSYour Name */ 128*5113495bSYour Name 129*5113495bSYour Name #define CE_STAT_DESC_BARRIER_READ_OFFSET 0x00000000 130*5113495bSYour Name #define CE_STAT_DESC_BARRIER_READ_LSB 12 131*5113495bSYour Name #define CE_STAT_DESC_BARRIER_READ_MSB 12 132*5113495bSYour Name #define CE_STAT_DESC_BARRIER_READ_MASK 0x00001000 133*5113495bSYour Name 134*5113495bSYour Name 135*5113495bSYour Name /* Description CE_RES_6 136*5113495bSYour Name 137*5113495bSYour Name Reserved 138*5113495bSYour Name <legal all> 139*5113495bSYour Name */ 140*5113495bSYour Name 141*5113495bSYour Name #define CE_STAT_DESC_CE_RES_6_OFFSET 0x00000000 142*5113495bSYour Name #define CE_STAT_DESC_CE_RES_6_LSB 13 143*5113495bSYour Name #define CE_STAT_DESC_CE_RES_6_MSB 15 144*5113495bSYour Name #define CE_STAT_DESC_CE_RES_6_MASK 0x0000e000 145*5113495bSYour Name 146*5113495bSYour Name 147*5113495bSYour Name /* Description LENGTH 148*5113495bSYour Name 149*5113495bSYour Name Sum of all the Lengths of the source descriptor in the gather 150*5113495bSYour Name chain 151*5113495bSYour Name <legal all> 152*5113495bSYour Name */ 153*5113495bSYour Name 154*5113495bSYour Name #define CE_STAT_DESC_LENGTH_OFFSET 0x00000000 155*5113495bSYour Name #define CE_STAT_DESC_LENGTH_LSB 16 156*5113495bSYour Name #define CE_STAT_DESC_LENGTH_MSB 31 157*5113495bSYour Name #define CE_STAT_DESC_LENGTH_MASK 0xffff0000 158*5113495bSYour Name 159*5113495bSYour Name 160*5113495bSYour Name /* Description TOEPLITZ_HASH_0 161*5113495bSYour Name 162*5113495bSYour Name 32 LS bits of 64 bit Toeplitz LFSR hash result 163*5113495bSYour Name <legal all> 164*5113495bSYour Name */ 165*5113495bSYour Name 166*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_0_OFFSET 0x00000004 167*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_0_LSB 0 168*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_0_MSB 31 169*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_0_MASK 0xffffffff 170*5113495bSYour Name 171*5113495bSYour Name 172*5113495bSYour Name /* Description TOEPLITZ_HASH_1 173*5113495bSYour Name 174*5113495bSYour Name 32 MS bits of 64 bit Toeplitz LFSR hash result 175*5113495bSYour Name <legal all> 176*5113495bSYour Name */ 177*5113495bSYour Name 178*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_1_OFFSET 0x00000008 179*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_1_LSB 0 180*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_1_MSB 31 181*5113495bSYour Name #define CE_STAT_DESC_TOEPLITZ_HASH_1_MASK 0xffffffff 182*5113495bSYour Name 183*5113495bSYour Name 184*5113495bSYour Name /* Description FW_METADATA 185*5113495bSYour Name 186*5113495bSYour Name Meta data used by FW 187*5113495bSYour Name In case of gather field in first source ring entry of the 188*5113495bSYour Name gather copy cycle in taken into account. 189*5113495bSYour Name <legal all> 190*5113495bSYour Name */ 191*5113495bSYour Name 192*5113495bSYour Name #define CE_STAT_DESC_FW_METADATA_OFFSET 0x0000000c 193*5113495bSYour Name #define CE_STAT_DESC_FW_METADATA_LSB 0 194*5113495bSYour Name #define CE_STAT_DESC_FW_METADATA_MSB 15 195*5113495bSYour Name #define CE_STAT_DESC_FW_METADATA_MASK 0x0000ffff 196*5113495bSYour Name 197*5113495bSYour Name 198*5113495bSYour Name /* Description CE_RES_7 199*5113495bSYour Name 200*5113495bSYour Name Reserved 201*5113495bSYour Name <legal all> 202*5113495bSYour Name */ 203*5113495bSYour Name 204*5113495bSYour Name #define CE_STAT_DESC_CE_RES_7_OFFSET 0x0000000c 205*5113495bSYour Name #define CE_STAT_DESC_CE_RES_7_LSB 16 206*5113495bSYour Name #define CE_STAT_DESC_CE_RES_7_MSB 19 207*5113495bSYour Name #define CE_STAT_DESC_CE_RES_7_MASK 0x000f0000 208*5113495bSYour Name 209*5113495bSYour Name 210*5113495bSYour Name /* Description RING_ID 211*5113495bSYour Name 212*5113495bSYour Name The buffer pointer ring ID. 213*5113495bSYour Name 0 refers to the IDLE ring 214*5113495bSYour Name 1 - N refers to other rings 215*5113495bSYour Name 216*5113495bSYour Name Helps with debugging when dumping ring contents. 217*5113495bSYour Name <legal all> 218*5113495bSYour Name */ 219*5113495bSYour Name 220*5113495bSYour Name #define CE_STAT_DESC_RING_ID_OFFSET 0x0000000c 221*5113495bSYour Name #define CE_STAT_DESC_RING_ID_LSB 20 222*5113495bSYour Name #define CE_STAT_DESC_RING_ID_MSB 27 223*5113495bSYour Name #define CE_STAT_DESC_RING_ID_MASK 0x0ff00000 224*5113495bSYour Name 225*5113495bSYour Name 226*5113495bSYour Name /* Description LOOPING_COUNT 227*5113495bSYour Name 228*5113495bSYour Name A count value that indicates the number of times the producer 229*5113495bSYour Name of entries into the Ring has looped around the ring. 230*5113495bSYour Name At initialization time, this value is set to 0. On the first 231*5113495bSYour Name loop, this value is set to 1. After the max value is reached 232*5113495bSYour Name allowed by the number of bits for this field, the count 233*5113495bSYour Name value continues with 0 again. 234*5113495bSYour Name In case SW is the consumer of the ring entries, it can use 235*5113495bSYour Name this field to figure out up to where the producer of entries 236*5113495bSYour Name has created new entries. This eliminates the need to check 237*5113495bSYour Name where the "head pointer' of the ring is located once the 238*5113495bSYour Name SW starts processing an interrupt indicating that new entries 239*5113495bSYour Name have been put into this ring... 240*5113495bSYour Name Also note that SW if it wants only needs to look at the 241*5113495bSYour Name LSB bit of this count value. 242*5113495bSYour Name <legal all> 243*5113495bSYour Name */ 244*5113495bSYour Name 245*5113495bSYour Name #define CE_STAT_DESC_LOOPING_COUNT_OFFSET 0x0000000c 246*5113495bSYour Name #define CE_STAT_DESC_LOOPING_COUNT_LSB 28 247*5113495bSYour Name #define CE_STAT_DESC_LOOPING_COUNT_MSB 31 248*5113495bSYour Name #define CE_STAT_DESC_LOOPING_COUNT_MASK 0xf0000000 249*5113495bSYour Name 250*5113495bSYour Name 251*5113495bSYour Name 252*5113495bSYour Name #endif // CE_STAT_DESC 253