xref: /wlan-driver/fw-api/hw/qcn9224/v2/ce_src_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. 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 
18 
19 
20 
21 
22 
23 
24 
25 
26 #ifndef _CE_SRC_DESC_H_
27 #define _CE_SRC_DESC_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_CE_SRC_DESC 4
32 
33 
34 struct ce_src_desc {
35 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
36              uint32_t src_buffer_low                                          : 32;
37              uint32_t src_buffer_high                                         :  8,
38                       toeplitz_en                                             :  1,
39                       src_swap                                                :  1,
40                       dest_swap                                               :  1,
41                       gather                                                  :  1,
42                       ce_res_0                                                :  1,
43                       barrier_read                                            :  1,
44                       ce_res_1                                                :  2,
45                       length                                                  : 16;
46              uint32_t fw_metadata                                             : 16,
47                       ce_res_2                                                : 16;
48              uint32_t ce_res_3                                                : 20,
49                       ring_id                                                 :  8,
50                       looping_count                                           :  4;
51 #else
52              uint32_t src_buffer_low                                          : 32;
53              uint32_t length                                                  : 16,
54                       ce_res_1                                                :  2,
55                       barrier_read                                            :  1,
56                       ce_res_0                                                :  1,
57                       gather                                                  :  1,
58                       dest_swap                                               :  1,
59                       src_swap                                                :  1,
60                       toeplitz_en                                             :  1,
61                       src_buffer_high                                         :  8;
62              uint32_t ce_res_2                                                : 16,
63                       fw_metadata                                             : 16;
64              uint32_t looping_count                                           :  4,
65                       ring_id                                                 :  8,
66                       ce_res_3                                                : 20;
67 #endif
68 };
69 
70 
71 
72 
73 #define CE_SRC_DESC_SRC_BUFFER_LOW_OFFSET                                           0x00000000
74 #define CE_SRC_DESC_SRC_BUFFER_LOW_LSB                                              0
75 #define CE_SRC_DESC_SRC_BUFFER_LOW_MSB                                              31
76 #define CE_SRC_DESC_SRC_BUFFER_LOW_MASK                                             0xffffffff
77 
78 
79 
80 
81 #define CE_SRC_DESC_SRC_BUFFER_HIGH_OFFSET                                          0x00000004
82 #define CE_SRC_DESC_SRC_BUFFER_HIGH_LSB                                             0
83 #define CE_SRC_DESC_SRC_BUFFER_HIGH_MSB                                             7
84 #define CE_SRC_DESC_SRC_BUFFER_HIGH_MASK                                            0x000000ff
85 
86 
87 
88 
89 #define CE_SRC_DESC_TOEPLITZ_EN_OFFSET                                              0x00000004
90 #define CE_SRC_DESC_TOEPLITZ_EN_LSB                                                 8
91 #define CE_SRC_DESC_TOEPLITZ_EN_MSB                                                 8
92 #define CE_SRC_DESC_TOEPLITZ_EN_MASK                                                0x00000100
93 
94 
95 
96 
97 #define CE_SRC_DESC_SRC_SWAP_OFFSET                                                 0x00000004
98 #define CE_SRC_DESC_SRC_SWAP_LSB                                                    9
99 #define CE_SRC_DESC_SRC_SWAP_MSB                                                    9
100 #define CE_SRC_DESC_SRC_SWAP_MASK                                                   0x00000200
101 
102 
103 
104 
105 #define CE_SRC_DESC_DEST_SWAP_OFFSET                                                0x00000004
106 #define CE_SRC_DESC_DEST_SWAP_LSB                                                   10
107 #define CE_SRC_DESC_DEST_SWAP_MSB                                                   10
108 #define CE_SRC_DESC_DEST_SWAP_MASK                                                  0x00000400
109 
110 
111 
112 
113 #define CE_SRC_DESC_GATHER_OFFSET                                                   0x00000004
114 #define CE_SRC_DESC_GATHER_LSB                                                      11
115 #define CE_SRC_DESC_GATHER_MSB                                                      11
116 #define CE_SRC_DESC_GATHER_MASK                                                     0x00000800
117 
118 
119 
120 
121 #define CE_SRC_DESC_CE_RES_0_OFFSET                                                 0x00000004
122 #define CE_SRC_DESC_CE_RES_0_LSB                                                    12
123 #define CE_SRC_DESC_CE_RES_0_MSB                                                    12
124 #define CE_SRC_DESC_CE_RES_0_MASK                                                   0x00001000
125 
126 
127 
128 
129 #define CE_SRC_DESC_BARRIER_READ_OFFSET                                             0x00000004
130 #define CE_SRC_DESC_BARRIER_READ_LSB                                                13
131 #define CE_SRC_DESC_BARRIER_READ_MSB                                                13
132 #define CE_SRC_DESC_BARRIER_READ_MASK                                               0x00002000
133 
134 
135 
136 
137 #define CE_SRC_DESC_CE_RES_1_OFFSET                                                 0x00000004
138 #define CE_SRC_DESC_CE_RES_1_LSB                                                    14
139 #define CE_SRC_DESC_CE_RES_1_MSB                                                    15
140 #define CE_SRC_DESC_CE_RES_1_MASK                                                   0x0000c000
141 
142 
143 
144 
145 #define CE_SRC_DESC_LENGTH_OFFSET                                                   0x00000004
146 #define CE_SRC_DESC_LENGTH_LSB                                                      16
147 #define CE_SRC_DESC_LENGTH_MSB                                                      31
148 #define CE_SRC_DESC_LENGTH_MASK                                                     0xffff0000
149 
150 
151 
152 
153 #define CE_SRC_DESC_FW_METADATA_OFFSET                                              0x00000008
154 #define CE_SRC_DESC_FW_METADATA_LSB                                                 0
155 #define CE_SRC_DESC_FW_METADATA_MSB                                                 15
156 #define CE_SRC_DESC_FW_METADATA_MASK                                                0x0000ffff
157 
158 
159 
160 
161 #define CE_SRC_DESC_CE_RES_2_OFFSET                                                 0x00000008
162 #define CE_SRC_DESC_CE_RES_2_LSB                                                    16
163 #define CE_SRC_DESC_CE_RES_2_MSB                                                    31
164 #define CE_SRC_DESC_CE_RES_2_MASK                                                   0xffff0000
165 
166 
167 
168 
169 #define CE_SRC_DESC_CE_RES_3_OFFSET                                                 0x0000000c
170 #define CE_SRC_DESC_CE_RES_3_LSB                                                    0
171 #define CE_SRC_DESC_CE_RES_3_MSB                                                    19
172 #define CE_SRC_DESC_CE_RES_3_MASK                                                   0x000fffff
173 
174 
175 
176 
177 #define CE_SRC_DESC_RING_ID_OFFSET                                                  0x0000000c
178 #define CE_SRC_DESC_RING_ID_LSB                                                     20
179 #define CE_SRC_DESC_RING_ID_MSB                                                     27
180 #define CE_SRC_DESC_RING_ID_MASK                                                    0x0ff00000
181 
182 
183 
184 
185 #define CE_SRC_DESC_LOOPING_COUNT_OFFSET                                            0x0000000c
186 #define CE_SRC_DESC_LOOPING_COUNT_LSB                                               28
187 #define CE_SRC_DESC_LOOPING_COUNT_MSB                                               31
188 #define CE_SRC_DESC_LOOPING_COUNT_MASK                                              0xf0000000
189 
190 
191 
192 #endif
193