xref: /wlan-driver/fw-api/hw/kiwi/v2/ce_src_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name 
2*5113495bSYour Name /*
3*5113495bSYour Name  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name 
21*5113495bSYour Name 
22*5113495bSYour Name #ifndef _CE_SRC_DESC_H_
23*5113495bSYour Name #define _CE_SRC_DESC_H_
24*5113495bSYour Name #if !defined(__ASSEMBLER__)
25*5113495bSYour Name #endif
26*5113495bSYour Name 
27*5113495bSYour Name #define NUM_OF_DWORDS_CE_SRC_DESC 4
28*5113495bSYour Name 
29*5113495bSYour Name struct ce_src_desc {
30*5113495bSYour Name #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
31*5113495bSYour Name              uint32_t src_buffer_low                                          : 32;
32*5113495bSYour Name              uint32_t src_buffer_high                                         :  8,
33*5113495bSYour Name                       toeplitz_en                                             :  1,
34*5113495bSYour Name                       src_swap                                                :  1,
35*5113495bSYour Name                       dest_swap                                               :  1,
36*5113495bSYour Name                       gather                                                  :  1,
37*5113495bSYour Name                       ce_res_0                                                :  1,
38*5113495bSYour Name                       barrier_read                                            :  1,
39*5113495bSYour Name                       ce_res_1                                                :  2,
40*5113495bSYour Name                       length                                                  : 16;
41*5113495bSYour Name              uint32_t fw_metadata                                             : 16,
42*5113495bSYour Name                       ce_res_2                                                : 16;
43*5113495bSYour Name              uint32_t ce_res_3                                                : 20,
44*5113495bSYour Name                       ring_id                                                 :  8,
45*5113495bSYour Name                       looping_count                                           :  4;
46*5113495bSYour Name #else
47*5113495bSYour Name              uint32_t src_buffer_low                                          : 32;
48*5113495bSYour Name              uint32_t length                                                  : 16,
49*5113495bSYour Name                       ce_res_1                                                :  2,
50*5113495bSYour Name                       barrier_read                                            :  1,
51*5113495bSYour Name                       ce_res_0                                                :  1,
52*5113495bSYour Name                       gather                                                  :  1,
53*5113495bSYour Name                       dest_swap                                               :  1,
54*5113495bSYour Name                       src_swap                                                :  1,
55*5113495bSYour Name                       toeplitz_en                                             :  1,
56*5113495bSYour Name                       src_buffer_high                                         :  8;
57*5113495bSYour Name              uint32_t ce_res_2                                                : 16,
58*5113495bSYour Name                       fw_metadata                                             : 16;
59*5113495bSYour Name              uint32_t looping_count                                           :  4,
60*5113495bSYour Name                       ring_id                                                 :  8,
61*5113495bSYour Name                       ce_res_3                                                : 20;
62*5113495bSYour Name #endif
63*5113495bSYour Name };
64*5113495bSYour Name 
65*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_LOW_OFFSET                                           0x00000000
66*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_LOW_LSB                                              0
67*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_LOW_MSB                                              31
68*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_LOW_MASK                                             0xffffffff
69*5113495bSYour Name 
70*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_HIGH_OFFSET                                          0x00000004
71*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_HIGH_LSB                                             0
72*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_HIGH_MSB                                             7
73*5113495bSYour Name #define CE_SRC_DESC_SRC_BUFFER_HIGH_MASK                                            0x000000ff
74*5113495bSYour Name 
75*5113495bSYour Name #define CE_SRC_DESC_TOEPLITZ_EN_OFFSET                                              0x00000004
76*5113495bSYour Name #define CE_SRC_DESC_TOEPLITZ_EN_LSB                                                 8
77*5113495bSYour Name #define CE_SRC_DESC_TOEPLITZ_EN_MSB                                                 8
78*5113495bSYour Name #define CE_SRC_DESC_TOEPLITZ_EN_MASK                                                0x00000100
79*5113495bSYour Name 
80*5113495bSYour Name #define CE_SRC_DESC_SRC_SWAP_OFFSET                                                 0x00000004
81*5113495bSYour Name #define CE_SRC_DESC_SRC_SWAP_LSB                                                    9
82*5113495bSYour Name #define CE_SRC_DESC_SRC_SWAP_MSB                                                    9
83*5113495bSYour Name #define CE_SRC_DESC_SRC_SWAP_MASK                                                   0x00000200
84*5113495bSYour Name 
85*5113495bSYour Name #define CE_SRC_DESC_DEST_SWAP_OFFSET                                                0x00000004
86*5113495bSYour Name #define CE_SRC_DESC_DEST_SWAP_LSB                                                   10
87*5113495bSYour Name #define CE_SRC_DESC_DEST_SWAP_MSB                                                   10
88*5113495bSYour Name #define CE_SRC_DESC_DEST_SWAP_MASK                                                  0x00000400
89*5113495bSYour Name 
90*5113495bSYour Name #define CE_SRC_DESC_GATHER_OFFSET                                                   0x00000004
91*5113495bSYour Name #define CE_SRC_DESC_GATHER_LSB                                                      11
92*5113495bSYour Name #define CE_SRC_DESC_GATHER_MSB                                                      11
93*5113495bSYour Name #define CE_SRC_DESC_GATHER_MASK                                                     0x00000800
94*5113495bSYour Name 
95*5113495bSYour Name #define CE_SRC_DESC_CE_RES_0_OFFSET                                                 0x00000004
96*5113495bSYour Name #define CE_SRC_DESC_CE_RES_0_LSB                                                    12
97*5113495bSYour Name #define CE_SRC_DESC_CE_RES_0_MSB                                                    12
98*5113495bSYour Name #define CE_SRC_DESC_CE_RES_0_MASK                                                   0x00001000
99*5113495bSYour Name 
100*5113495bSYour Name #define CE_SRC_DESC_BARRIER_READ_OFFSET                                             0x00000004
101*5113495bSYour Name #define CE_SRC_DESC_BARRIER_READ_LSB                                                13
102*5113495bSYour Name #define CE_SRC_DESC_BARRIER_READ_MSB                                                13
103*5113495bSYour Name #define CE_SRC_DESC_BARRIER_READ_MASK                                               0x00002000
104*5113495bSYour Name 
105*5113495bSYour Name #define CE_SRC_DESC_CE_RES_1_OFFSET                                                 0x00000004
106*5113495bSYour Name #define CE_SRC_DESC_CE_RES_1_LSB                                                    14
107*5113495bSYour Name #define CE_SRC_DESC_CE_RES_1_MSB                                                    15
108*5113495bSYour Name #define CE_SRC_DESC_CE_RES_1_MASK                                                   0x0000c000
109*5113495bSYour Name 
110*5113495bSYour Name #define CE_SRC_DESC_LENGTH_OFFSET                                                   0x00000004
111*5113495bSYour Name #define CE_SRC_DESC_LENGTH_LSB                                                      16
112*5113495bSYour Name #define CE_SRC_DESC_LENGTH_MSB                                                      31
113*5113495bSYour Name #define CE_SRC_DESC_LENGTH_MASK                                                     0xffff0000
114*5113495bSYour Name 
115*5113495bSYour Name #define CE_SRC_DESC_FW_METADATA_OFFSET                                              0x00000008
116*5113495bSYour Name #define CE_SRC_DESC_FW_METADATA_LSB                                                 0
117*5113495bSYour Name #define CE_SRC_DESC_FW_METADATA_MSB                                                 15
118*5113495bSYour Name #define CE_SRC_DESC_FW_METADATA_MASK                                                0x0000ffff
119*5113495bSYour Name 
120*5113495bSYour Name #define CE_SRC_DESC_CE_RES_2_OFFSET                                                 0x00000008
121*5113495bSYour Name #define CE_SRC_DESC_CE_RES_2_LSB                                                    16
122*5113495bSYour Name #define CE_SRC_DESC_CE_RES_2_MSB                                                    31
123*5113495bSYour Name #define CE_SRC_DESC_CE_RES_2_MASK                                                   0xffff0000
124*5113495bSYour Name 
125*5113495bSYour Name #define CE_SRC_DESC_CE_RES_3_OFFSET                                                 0x0000000c
126*5113495bSYour Name #define CE_SRC_DESC_CE_RES_3_LSB                                                    0
127*5113495bSYour Name #define CE_SRC_DESC_CE_RES_3_MSB                                                    19
128*5113495bSYour Name #define CE_SRC_DESC_CE_RES_3_MASK                                                   0x000fffff
129*5113495bSYour Name 
130*5113495bSYour Name #define CE_SRC_DESC_RING_ID_OFFSET                                                  0x0000000c
131*5113495bSYour Name #define CE_SRC_DESC_RING_ID_LSB                                                     20
132*5113495bSYour Name #define CE_SRC_DESC_RING_ID_MSB                                                     27
133*5113495bSYour Name #define CE_SRC_DESC_RING_ID_MASK                                                    0x0ff00000
134*5113495bSYour Name 
135*5113495bSYour Name #define CE_SRC_DESC_LOOPING_COUNT_OFFSET                                            0x0000000c
136*5113495bSYour Name #define CE_SRC_DESC_LOOPING_COUNT_LSB                                               28
137*5113495bSYour Name #define CE_SRC_DESC_LOOPING_COUNT_MSB                                               31
138*5113495bSYour Name #define CE_SRC_DESC_LOOPING_COUNT_MASK                                              0xf0000000
139*5113495bSYour Name 
140*5113495bSYour Name #endif
141