xref: /freebsd/sys/dev/aq/aq_hw_llh.c (revision 493d26c58e732dcfcdd87993ef71880adfe9d0cb)
1*493d26c5SEd Maste /*
2*493d26c5SEd Maste  * aQuantia Corporation Network Driver
3*493d26c5SEd Maste  * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved
4*493d26c5SEd Maste  *
5*493d26c5SEd Maste  * Redistribution and use in source and binary forms, with or without
6*493d26c5SEd Maste  * modification, are permitted provided that the following conditions
7*493d26c5SEd Maste  * are met:
8*493d26c5SEd Maste  *
9*493d26c5SEd Maste  *   (1) Redistributions of source code must retain the above
10*493d26c5SEd Maste  *   copyright notice, this list of conditions and the following
11*493d26c5SEd Maste  *   disclaimer.
12*493d26c5SEd Maste  *
13*493d26c5SEd Maste  *   (2) Redistributions in binary form must reproduce the above
14*493d26c5SEd Maste  *   copyright notice, this list of conditions and the following
15*493d26c5SEd Maste  *   disclaimer in the documentation and/or other materials provided
16*493d26c5SEd Maste  *   with the distribution.
17*493d26c5SEd Maste  *
18*493d26c5SEd Maste  *   (3)The name of the author may not be used to endorse or promote
19*493d26c5SEd Maste  *   products derived from this software without specific prior
20*493d26c5SEd Maste  *   written permission.
21*493d26c5SEd Maste  *
22*493d26c5SEd Maste  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
23*493d26c5SEd Maste  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24*493d26c5SEd Maste  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25*493d26c5SEd Maste  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
26*493d26c5SEd Maste  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27*493d26c5SEd Maste  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28*493d26c5SEd Maste  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29*493d26c5SEd Maste  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30*493d26c5SEd Maste  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31*493d26c5SEd Maste  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32*493d26c5SEd Maste  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33*493d26c5SEd Maste  */
34*493d26c5SEd Maste 
35*493d26c5SEd Maste /* File aq_hw_llh.c: Definitions of bitfield and register access functions for
36*493d26c5SEd Maste  * Atlantic registers.
37*493d26c5SEd Maste  */
38*493d26c5SEd Maste 
39*493d26c5SEd Maste #include "aq_hw.h"
40*493d26c5SEd Maste #include "aq_hw_llh.h"
41*493d26c5SEd Maste #include "aq_hw_llh_internal.h"
42*493d26c5SEd Maste 
43*493d26c5SEd Maste 
44*493d26c5SEd Maste /* global */
45*493d26c5SEd Maste 
reg_glb_fw_image_id1_set(struct aq_hw * hw,u32 value)46*493d26c5SEd Maste void reg_glb_fw_image_id1_set(struct aq_hw* hw, u32 value)
47*493d26c5SEd Maste {
48*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_fw_image_id1_adr, value);
49*493d26c5SEd Maste }
reg_glb_fw_image_id1_get(struct aq_hw * hw)50*493d26c5SEd Maste u32 reg_glb_fw_image_id1_get(struct aq_hw* hw)
51*493d26c5SEd Maste {
52*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_fw_image_id1_adr);
53*493d26c5SEd Maste }
54*493d26c5SEd Maste 
reg_glb_cpu_sem_set(struct aq_hw * aq_hw,u32 sem_value,u32 sem_index)55*493d26c5SEd Maste void reg_glb_cpu_sem_set(struct aq_hw *aq_hw, u32 sem_value, u32 sem_index)
56*493d26c5SEd Maste {
57*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, glb_cpu_sem_adr(sem_index), sem_value);
58*493d26c5SEd Maste }
59*493d26c5SEd Maste 
reg_glb_cpu_sem_get(struct aq_hw * aq_hw,u32 sem_index)60*493d26c5SEd Maste u32 reg_glb_cpu_sem_get(struct aq_hw *aq_hw, u32 sem_index)
61*493d26c5SEd Maste {
62*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, glb_cpu_sem_adr(sem_index));
63*493d26c5SEd Maste }
64*493d26c5SEd Maste 
reg_glb_standard_ctl1_get(struct aq_hw * hw)65*493d26c5SEd Maste u32 reg_glb_standard_ctl1_get(struct aq_hw* hw)
66*493d26c5SEd Maste {
67*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_standard_ctl1_adr);
68*493d26c5SEd Maste }
reg_glb_standard_ctl1_set(struct aq_hw * hw,u32 glb_standard_ctl1)69*493d26c5SEd Maste void reg_glb_standard_ctl1_set(struct aq_hw* hw, u32 glb_standard_ctl1)
70*493d26c5SEd Maste {
71*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_standard_ctl1_adr, glb_standard_ctl1);
72*493d26c5SEd Maste }
73*493d26c5SEd Maste 
reg_global_ctl2_set(struct aq_hw * hw,u32 global_ctl2)74*493d26c5SEd Maste void reg_global_ctl2_set(struct aq_hw* hw, u32 global_ctl2)
75*493d26c5SEd Maste {
76*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_ctl2_adr, global_ctl2);
77*493d26c5SEd Maste }
reg_global_ctl2_get(struct aq_hw * hw)78*493d26c5SEd Maste u32 reg_global_ctl2_get(struct aq_hw* hw)
79*493d26c5SEd Maste {
80*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_ctl2_adr);
81*493d26c5SEd Maste }
82*493d26c5SEd Maste 
reg_glb_daisy_chain_status1_set(struct aq_hw * hw,u32 glb_daisy_chain_status1)83*493d26c5SEd Maste void reg_glb_daisy_chain_status1_set(struct aq_hw* hw, u32 glb_daisy_chain_status1)
84*493d26c5SEd Maste {
85*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_daisy_chain_status1_adr, glb_daisy_chain_status1);
86*493d26c5SEd Maste }
reg_glb_daisy_chain_status1_get(struct aq_hw * hw)87*493d26c5SEd Maste u32 reg_glb_daisy_chain_status1_get(struct aq_hw* hw)
88*493d26c5SEd Maste {
89*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_daisy_chain_status1_adr);
90*493d26c5SEd Maste }
91*493d26c5SEd Maste 
glb_glb_reg_res_dis_set(struct aq_hw * aq_hw,u32 glb_reg_res_dis)92*493d26c5SEd Maste void glb_glb_reg_res_dis_set(struct aq_hw *aq_hw, u32 glb_reg_res_dis)
93*493d26c5SEd Maste {
94*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, glb_reg_res_dis_adr,
95*493d26c5SEd Maste                 glb_reg_res_dis_msk,
96*493d26c5SEd Maste                 glb_reg_res_dis_shift,
97*493d26c5SEd Maste                 glb_reg_res_dis);
98*493d26c5SEd Maste }
99*493d26c5SEd Maste 
glb_soft_res_set(struct aq_hw * aq_hw,u32 soft_res)100*493d26c5SEd Maste void glb_soft_res_set(struct aq_hw *aq_hw, u32 soft_res)
101*493d26c5SEd Maste {
102*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, glb_soft_res_adr, glb_soft_res_msk,
103*493d26c5SEd Maste                 glb_soft_res_shift, soft_res);
104*493d26c5SEd Maste }
105*493d26c5SEd Maste 
glb_soft_res_get(struct aq_hw * aq_hw)106*493d26c5SEd Maste u32 glb_soft_res_get(struct aq_hw *aq_hw)
107*493d26c5SEd Maste {
108*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, glb_soft_res_adr,
109*493d26c5SEd Maste                   glb_soft_res_msk,
110*493d26c5SEd Maste                   glb_soft_res_shift);
111*493d26c5SEd Maste }
112*493d26c5SEd Maste 
reg_rx_dma_stat_counter7get(struct aq_hw * aq_hw)113*493d26c5SEd Maste u32 reg_rx_dma_stat_counter7get(struct aq_hw *aq_hw)
114*493d26c5SEd Maste {
115*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, rx_dma_stat_counter7_adr);
116*493d26c5SEd Maste }
117*493d26c5SEd Maste 
reg_glb_mif_id_get(struct aq_hw * aq_hw)118*493d26c5SEd Maste u32 reg_glb_mif_id_get(struct aq_hw *aq_hw)
119*493d26c5SEd Maste {
120*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, glb_mif_id_adr);
121*493d26c5SEd Maste }
122*493d26c5SEd Maste 
123*493d26c5SEd Maste 
mpi_tx_reg_res_dis_set(struct aq_hw * hw,u32 mpi_tx_reg_res_dis)124*493d26c5SEd Maste void mpi_tx_reg_res_dis_set(struct aq_hw* hw, u32 mpi_tx_reg_res_dis)
125*493d26c5SEd Maste {
126*493d26c5SEd Maste     AQ_WRITE_REG_BIT(hw, mpi_tx_reg_res_dis_adr,
127*493d26c5SEd Maste         mpi_tx_reg_res_dis_msk, mpi_tx_reg_res_dis_shift, mpi_tx_reg_res_dis);
128*493d26c5SEd Maste }
mpi_tx_reg_res_dis_get(struct aq_hw * hw)129*493d26c5SEd Maste u32 mpi_tx_reg_res_dis_get(struct aq_hw* hw)
130*493d26c5SEd Maste {
131*493d26c5SEd Maste     return AQ_READ_REG_BIT(hw, mpi_tx_reg_res_dis_adr,
132*493d26c5SEd Maste         mpi_tx_reg_res_dis_msk, mpi_tx_reg_res_dis_shift);
133*493d26c5SEd Maste }
134*493d26c5SEd Maste 
135*493d26c5SEd Maste 
136*493d26c5SEd Maste /* stats */
rpb_rx_dma_drop_pkt_cnt_get(struct aq_hw * aq_hw)137*493d26c5SEd Maste u32 rpb_rx_dma_drop_pkt_cnt_get(struct aq_hw *aq_hw)
138*493d26c5SEd Maste {
139*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, rpb_rx_dma_drop_pkt_cnt_adr);
140*493d26c5SEd Maste }
141*493d26c5SEd Maste 
stats_rx_dma_good_octet_counterlsw_get(struct aq_hw * aq_hw)142*493d26c5SEd Maste u32 stats_rx_dma_good_octet_counterlsw_get(struct aq_hw *aq_hw)
143*493d26c5SEd Maste {
144*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_rx_dma_good_octet_counterlsw__adr);
145*493d26c5SEd Maste }
146*493d26c5SEd Maste 
stats_rx_dma_good_pkt_counterlsw_get(struct aq_hw * aq_hw)147*493d26c5SEd Maste u32 stats_rx_dma_good_pkt_counterlsw_get(struct aq_hw *aq_hw)
148*493d26c5SEd Maste {
149*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_rx_dma_good_pkt_counterlsw__adr);
150*493d26c5SEd Maste }
151*493d26c5SEd Maste 
stats_tx_dma_good_octet_counterlsw_get(struct aq_hw * aq_hw)152*493d26c5SEd Maste u32 stats_tx_dma_good_octet_counterlsw_get(struct aq_hw *aq_hw)
153*493d26c5SEd Maste {
154*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_tx_dma_good_octet_counterlsw__adr);
155*493d26c5SEd Maste }
156*493d26c5SEd Maste 
stats_tx_dma_good_pkt_counterlsw_get(struct aq_hw * aq_hw)157*493d26c5SEd Maste u32 stats_tx_dma_good_pkt_counterlsw_get(struct aq_hw *aq_hw)
158*493d26c5SEd Maste {
159*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_tx_dma_good_pkt_counterlsw__adr);
160*493d26c5SEd Maste }
161*493d26c5SEd Maste 
stats_rx_dma_good_octet_countermsw_get(struct aq_hw * aq_hw)162*493d26c5SEd Maste u32 stats_rx_dma_good_octet_countermsw_get(struct aq_hw *aq_hw)
163*493d26c5SEd Maste {
164*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_rx_dma_good_octet_countermsw__adr);
165*493d26c5SEd Maste }
166*493d26c5SEd Maste 
stats_rx_dma_good_pkt_countermsw_get(struct aq_hw * aq_hw)167*493d26c5SEd Maste u32 stats_rx_dma_good_pkt_countermsw_get(struct aq_hw *aq_hw)
168*493d26c5SEd Maste {
169*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_rx_dma_good_pkt_countermsw__adr);
170*493d26c5SEd Maste }
171*493d26c5SEd Maste 
stats_tx_dma_good_octet_countermsw_get(struct aq_hw * aq_hw)172*493d26c5SEd Maste u32 stats_tx_dma_good_octet_countermsw_get(struct aq_hw *aq_hw)
173*493d26c5SEd Maste {
174*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_tx_dma_good_octet_countermsw__adr);
175*493d26c5SEd Maste }
176*493d26c5SEd Maste 
stats_tx_dma_good_pkt_countermsw_get(struct aq_hw * aq_hw)177*493d26c5SEd Maste u32 stats_tx_dma_good_pkt_countermsw_get(struct aq_hw *aq_hw)
178*493d26c5SEd Maste {
179*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_tx_dma_good_pkt_countermsw__adr);
180*493d26c5SEd Maste }
181*493d26c5SEd Maste 
stats_rx_lro_coalesced_pkt_count0_get(struct aq_hw * aq_hw)182*493d26c5SEd Maste u32 stats_rx_lro_coalesced_pkt_count0_get(struct aq_hw *aq_hw)
183*493d26c5SEd Maste {
184*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, stats_rx_lo_coalesced_pkt_count0__addr);
185*493d26c5SEd Maste }
186*493d26c5SEd Maste 
187*493d26c5SEd Maste /* interrupt */
itr_irq_auto_masklsw_set(struct aq_hw * aq_hw,u32 irq_auto_masklsw)188*493d26c5SEd Maste void itr_irq_auto_masklsw_set(struct aq_hw *aq_hw, u32 irq_auto_masklsw)
189*493d26c5SEd Maste {
190*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, itr_iamrlsw_adr, irq_auto_masklsw);
191*493d26c5SEd Maste }
192*493d26c5SEd Maste 
itr_irq_map_en_rx_set(struct aq_hw * aq_hw,u32 irq_map_en_rx,u32 rx)193*493d26c5SEd Maste void itr_irq_map_en_rx_set(struct aq_hw *aq_hw, u32 irq_map_en_rx, u32 rx)
194*493d26c5SEd Maste {
195*493d26c5SEd Maste /* register address for bitfield imr_rx{r}_en */
196*493d26c5SEd Maste     static u32 itr_imr_rxren_adr[32] = {
197*493d26c5SEd Maste             0x00002100U, 0x00002100U, 0x00002104U, 0x00002104U,
198*493d26c5SEd Maste             0x00002108U, 0x00002108U, 0x0000210cU, 0x0000210cU,
199*493d26c5SEd Maste             0x00002110U, 0x00002110U, 0x00002114U, 0x00002114U,
200*493d26c5SEd Maste             0x00002118U, 0x00002118U, 0x0000211cU, 0x0000211cU,
201*493d26c5SEd Maste             0x00002120U, 0x00002120U, 0x00002124U, 0x00002124U,
202*493d26c5SEd Maste             0x00002128U, 0x00002128U, 0x0000212cU, 0x0000212cU,
203*493d26c5SEd Maste             0x00002130U, 0x00002130U, 0x00002134U, 0x00002134U,
204*493d26c5SEd Maste             0x00002138U, 0x00002138U, 0x0000213cU, 0x0000213cU
205*493d26c5SEd Maste         };
206*493d26c5SEd Maste 
207*493d26c5SEd Maste /* bitmask for bitfield imr_rx{r}_en */
208*493d26c5SEd Maste     static u32 itr_imr_rxren_msk[32] = {
209*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
210*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
211*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
212*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
213*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
214*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
215*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U,
216*493d26c5SEd Maste             0x00008000U, 0x00000080U, 0x00008000U, 0x00000080U
217*493d26c5SEd Maste         };
218*493d26c5SEd Maste 
219*493d26c5SEd Maste /* lower bit position of bitfield imr_rx{r}_en */
220*493d26c5SEd Maste     static u32 itr_imr_rxren_shift[32] = {
221*493d26c5SEd Maste             15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
222*493d26c5SEd Maste             15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
223*493d26c5SEd Maste             15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
224*493d26c5SEd Maste             15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U
225*493d26c5SEd Maste         };
226*493d26c5SEd Maste 
227*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_imr_rxren_adr[rx],
228*493d26c5SEd Maste                 itr_imr_rxren_msk[rx],
229*493d26c5SEd Maste                 itr_imr_rxren_shift[rx],
230*493d26c5SEd Maste                 irq_map_en_rx);
231*493d26c5SEd Maste }
232*493d26c5SEd Maste 
itr_irq_map_en_tx_set(struct aq_hw * aq_hw,u32 irq_map_en_tx,u32 tx)233*493d26c5SEd Maste void itr_irq_map_en_tx_set(struct aq_hw *aq_hw, u32 irq_map_en_tx, u32 tx)
234*493d26c5SEd Maste {
235*493d26c5SEd Maste /* register address for bitfield imr_tx{t}_en */
236*493d26c5SEd Maste     static u32 itr_imr_txten_adr[32] = {
237*493d26c5SEd Maste             0x00002100U, 0x00002100U, 0x00002104U, 0x00002104U,
238*493d26c5SEd Maste             0x00002108U, 0x00002108U, 0x0000210cU, 0x0000210cU,
239*493d26c5SEd Maste             0x00002110U, 0x00002110U, 0x00002114U, 0x00002114U,
240*493d26c5SEd Maste             0x00002118U, 0x00002118U, 0x0000211cU, 0x0000211cU,
241*493d26c5SEd Maste             0x00002120U, 0x00002120U, 0x00002124U, 0x00002124U,
242*493d26c5SEd Maste             0x00002128U, 0x00002128U, 0x0000212cU, 0x0000212cU,
243*493d26c5SEd Maste             0x00002130U, 0x00002130U, 0x00002134U, 0x00002134U,
244*493d26c5SEd Maste             0x00002138U, 0x00002138U, 0x0000213cU, 0x0000213cU
245*493d26c5SEd Maste         };
246*493d26c5SEd Maste 
247*493d26c5SEd Maste /* bitmask for bitfield imr_tx{t}_en */
248*493d26c5SEd Maste     static u32 itr_imr_txten_msk[32] = {
249*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
250*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
251*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
252*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
253*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
254*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
255*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U,
256*493d26c5SEd Maste             0x80000000U, 0x00800000U, 0x80000000U, 0x00800000U
257*493d26c5SEd Maste         };
258*493d26c5SEd Maste 
259*493d26c5SEd Maste /* lower bit position of bitfield imr_tx{t}_en */
260*493d26c5SEd Maste     static u32 itr_imr_txten_shift[32] = {
261*493d26c5SEd Maste             31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
262*493d26c5SEd Maste             31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
263*493d26c5SEd Maste             31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
264*493d26c5SEd Maste             31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U
265*493d26c5SEd Maste         };
266*493d26c5SEd Maste 
267*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_imr_txten_adr[tx],
268*493d26c5SEd Maste                 itr_imr_txten_msk[tx],
269*493d26c5SEd Maste                 itr_imr_txten_shift[tx],
270*493d26c5SEd Maste                 irq_map_en_tx);
271*493d26c5SEd Maste }
272*493d26c5SEd Maste 
itr_irq_map_rx_set(struct aq_hw * aq_hw,u32 irq_map_rx,u32 rx)273*493d26c5SEd Maste void itr_irq_map_rx_set(struct aq_hw *aq_hw, u32 irq_map_rx, u32 rx)
274*493d26c5SEd Maste {
275*493d26c5SEd Maste /* register address for bitfield imr_rx{r}[4:0] */
276*493d26c5SEd Maste     static u32 itr_imr_rxr_adr[32] = {
277*493d26c5SEd Maste             0x00002100U, 0x00002100U, 0x00002104U, 0x00002104U,
278*493d26c5SEd Maste             0x00002108U, 0x00002108U, 0x0000210cU, 0x0000210cU,
279*493d26c5SEd Maste             0x00002110U, 0x00002110U, 0x00002114U, 0x00002114U,
280*493d26c5SEd Maste             0x00002118U, 0x00002118U, 0x0000211cU, 0x0000211cU,
281*493d26c5SEd Maste             0x00002120U, 0x00002120U, 0x00002124U, 0x00002124U,
282*493d26c5SEd Maste             0x00002128U, 0x00002128U, 0x0000212cU, 0x0000212cU,
283*493d26c5SEd Maste             0x00002130U, 0x00002130U, 0x00002134U, 0x00002134U,
284*493d26c5SEd Maste             0x00002138U, 0x00002138U, 0x0000213cU, 0x0000213cU
285*493d26c5SEd Maste         };
286*493d26c5SEd Maste 
287*493d26c5SEd Maste /* bitmask for bitfield imr_rx{r}[4:0] */
288*493d26c5SEd Maste     static u32 itr_imr_rxr_msk[32] = {
289*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
290*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
291*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
292*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
293*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
294*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
295*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU,
296*493d26c5SEd Maste             0x00001f00U, 0x0000001fU, 0x00001f00U, 0x0000001fU
297*493d26c5SEd Maste         };
298*493d26c5SEd Maste 
299*493d26c5SEd Maste /* lower bit position of bitfield imr_rx{r}[4:0] */
300*493d26c5SEd Maste     static u32 itr_imr_rxr_shift[32] = {
301*493d26c5SEd Maste             8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
302*493d26c5SEd Maste             8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
303*493d26c5SEd Maste             8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
304*493d26c5SEd Maste             8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U
305*493d26c5SEd Maste         };
306*493d26c5SEd Maste 
307*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_imr_rxr_adr[rx],
308*493d26c5SEd Maste                 itr_imr_rxr_msk[rx],
309*493d26c5SEd Maste                 itr_imr_rxr_shift[rx],
310*493d26c5SEd Maste                 irq_map_rx);
311*493d26c5SEd Maste }
312*493d26c5SEd Maste 
itr_irq_map_tx_set(struct aq_hw * aq_hw,u32 irq_map_tx,u32 tx)313*493d26c5SEd Maste void itr_irq_map_tx_set(struct aq_hw *aq_hw, u32 irq_map_tx, u32 tx)
314*493d26c5SEd Maste {
315*493d26c5SEd Maste /* register address for bitfield imr_tx{t}[4:0] */
316*493d26c5SEd Maste     static u32 itr_imr_txt_adr[32] = {
317*493d26c5SEd Maste             0x00002100U, 0x00002100U, 0x00002104U, 0x00002104U,
318*493d26c5SEd Maste             0x00002108U, 0x00002108U, 0x0000210cU, 0x0000210cU,
319*493d26c5SEd Maste             0x00002110U, 0x00002110U, 0x00002114U, 0x00002114U,
320*493d26c5SEd Maste             0x00002118U, 0x00002118U, 0x0000211cU, 0x0000211cU,
321*493d26c5SEd Maste             0x00002120U, 0x00002120U, 0x00002124U, 0x00002124U,
322*493d26c5SEd Maste             0x00002128U, 0x00002128U, 0x0000212cU, 0x0000212cU,
323*493d26c5SEd Maste             0x00002130U, 0x00002130U, 0x00002134U, 0x00002134U,
324*493d26c5SEd Maste             0x00002138U, 0x00002138U, 0x0000213cU, 0x0000213cU
325*493d26c5SEd Maste         };
326*493d26c5SEd Maste 
327*493d26c5SEd Maste /* bitmask for bitfield imr_tx{t}[4:0] */
328*493d26c5SEd Maste     static u32 itr_imr_txt_msk[32] = {
329*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
330*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
331*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
332*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
333*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
334*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
335*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U,
336*493d26c5SEd Maste             0x1f000000U, 0x001f0000U, 0x1f000000U, 0x001f0000U
337*493d26c5SEd Maste         };
338*493d26c5SEd Maste 
339*493d26c5SEd Maste /* lower bit position of bitfield imr_tx{t}[4:0] */
340*493d26c5SEd Maste     static u32 itr_imr_txt_shift[32] = {
341*493d26c5SEd Maste             24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
342*493d26c5SEd Maste             24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
343*493d26c5SEd Maste             24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
344*493d26c5SEd Maste             24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U
345*493d26c5SEd Maste         };
346*493d26c5SEd Maste 
347*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_imr_txt_adr[tx],
348*493d26c5SEd Maste                 itr_imr_txt_msk[tx],
349*493d26c5SEd Maste                 itr_imr_txt_shift[tx],
350*493d26c5SEd Maste                 irq_map_tx);
351*493d26c5SEd Maste }
352*493d26c5SEd Maste 
itr_irq_msk_clearlsw_set(struct aq_hw * aq_hw,u32 irq_msk_clearlsw)353*493d26c5SEd Maste void itr_irq_msk_clearlsw_set(struct aq_hw *aq_hw, u32 irq_msk_clearlsw)
354*493d26c5SEd Maste {
355*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, itr_imcrlsw_adr, irq_msk_clearlsw);
356*493d26c5SEd Maste }
357*493d26c5SEd Maste 
itr_irq_msk_setlsw_set(struct aq_hw * aq_hw,u32 irq_msk_setlsw)358*493d26c5SEd Maste void itr_irq_msk_setlsw_set(struct aq_hw *aq_hw, u32 irq_msk_setlsw)
359*493d26c5SEd Maste {
360*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, itr_imsrlsw_adr, irq_msk_setlsw);
361*493d26c5SEd Maste }
362*493d26c5SEd Maste 
itr_irq_reg_res_dis_set(struct aq_hw * aq_hw,u32 irq_reg_res_dis)363*493d26c5SEd Maste void itr_irq_reg_res_dis_set(struct aq_hw *aq_hw, u32 irq_reg_res_dis)
364*493d26c5SEd Maste {
365*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_reg_res_dsbl_adr,
366*493d26c5SEd Maste                 itr_reg_res_dsbl_msk,
367*493d26c5SEd Maste                 itr_reg_res_dsbl_shift, irq_reg_res_dis);
368*493d26c5SEd Maste }
369*493d26c5SEd Maste 
itr_irq_status_clearlsw_set(struct aq_hw * aq_hw,u32 irq_status_clearlsw)370*493d26c5SEd Maste void itr_irq_status_clearlsw_set(struct aq_hw *aq_hw,
371*493d26c5SEd Maste                  u32 irq_status_clearlsw)
372*493d26c5SEd Maste {
373*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, itr_iscrlsw_adr, irq_status_clearlsw);
374*493d26c5SEd Maste }
375*493d26c5SEd Maste 
itr_irq_statuslsw_get(struct aq_hw * aq_hw)376*493d26c5SEd Maste u32 itr_irq_statuslsw_get(struct aq_hw *aq_hw)
377*493d26c5SEd Maste {
378*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, itr_isrlsw_adr);
379*493d26c5SEd Maste }
380*493d26c5SEd Maste 
itr_res_irq_get(struct aq_hw * aq_hw)381*493d26c5SEd Maste u32 itr_res_irq_get(struct aq_hw *aq_hw)
382*493d26c5SEd Maste {
383*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, itr_res_adr, itr_res_msk,
384*493d26c5SEd Maste                   itr_res_shift);
385*493d26c5SEd Maste }
386*493d26c5SEd Maste 
itr_res_irq_set(struct aq_hw * aq_hw,u32 res_irq)387*493d26c5SEd Maste void itr_res_irq_set(struct aq_hw *aq_hw, u32 res_irq)
388*493d26c5SEd Maste {
389*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itr_res_adr, itr_res_msk,
390*493d26c5SEd Maste                 itr_res_shift, res_irq);
391*493d26c5SEd Maste }
392*493d26c5SEd Maste 
itr_link_int_map_en_set(struct aq_hw * aq_hw,u32 link_int_en_map_en)393*493d26c5SEd Maste void itr_link_int_map_en_set(struct aq_hw *aq_hw, u32 link_int_en_map_en)
394*493d26c5SEd Maste {
395*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrImrLinkEn_ADR, itrImrLinkEn_MSK, itrImrLinkEn_SHIFT, link_int_en_map_en);
396*493d26c5SEd Maste }
397*493d26c5SEd Maste 
itr_link_int_map_en_get(struct aq_hw * aq_hw)398*493d26c5SEd Maste u32 itr_link_int_map_en_get(struct aq_hw *aq_hw)
399*493d26c5SEd Maste {
400*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, itrImrLinkEn_ADR, itrImrLinkEn_MSK, itrImrLinkEn_SHIFT);
401*493d26c5SEd Maste }
402*493d26c5SEd Maste 
itr_link_int_map_set(struct aq_hw * aq_hw,u32 link_int_map)403*493d26c5SEd Maste void itr_link_int_map_set(struct aq_hw *aq_hw, u32 link_int_map)
404*493d26c5SEd Maste {
405*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrImrLink_ADR, itrImrLink_MSK, itrImrLink_SHIFT, link_int_map);
406*493d26c5SEd Maste }
407*493d26c5SEd Maste 
itr_link_int_map_get(struct aq_hw * aq_hw)408*493d26c5SEd Maste u32 itr_link_int_map_get(struct aq_hw *aq_hw)
409*493d26c5SEd Maste {
410*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, itrImrLink_ADR, itrImrLink_MSK, itrImrLink_SHIFT);
411*493d26c5SEd Maste }
412*493d26c5SEd Maste 
itr_mif_int_map_en_set(struct aq_hw * aq_hw,u32 mifInterruptMappingEnable,u32 mif)413*493d26c5SEd Maste void itr_mif_int_map_en_set(struct aq_hw *aq_hw, u32 mifInterruptMappingEnable, u32 mif)
414*493d26c5SEd Maste {
415*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrImrMifMEn_ADR(mif), itrImrMifMEn_MSK(mif), itrImrMifMEn_SHIFT(mif), mifInterruptMappingEnable);
416*493d26c5SEd Maste }
417*493d26c5SEd Maste 
itr_mif_int_map_en_get(struct aq_hw * aq_hw,u32 mif)418*493d26c5SEd Maste u32 itr_mif_int_map_en_get(struct aq_hw *aq_hw, u32 mif)
419*493d26c5SEd Maste {
420*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, itrImrMifMEn_ADR(mif), itrImrMifMEn_MSK(mif), itrImrMifMEn_SHIFT(mif));
421*493d26c5SEd Maste }
422*493d26c5SEd Maste 
itr_mif_int_map_set(struct aq_hw * aq_hw,u32 mifInterruptMapping,u32 mif)423*493d26c5SEd Maste void itr_mif_int_map_set(struct aq_hw *aq_hw, u32 mifInterruptMapping, u32 mif)
424*493d26c5SEd Maste {
425*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrImrMifM_ADR(mif), itrImrMifM_MSK(mif), itrImrMifM_SHIFT(mif), mifInterruptMapping);
426*493d26c5SEd Maste }
427*493d26c5SEd Maste 
itr_mif_int_map_get(struct aq_hw * aq_hw,u32 mif)428*493d26c5SEd Maste u32 itr_mif_int_map_get(struct aq_hw *aq_hw, u32 mif)
429*493d26c5SEd Maste {
430*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, itrImrMifM_ADR(mif), itrImrMifM_MSK(mif), itrImrMifM_SHIFT(mif));
431*493d26c5SEd Maste }
432*493d26c5SEd Maste 
itr_irq_mode_set(struct aq_hw * aq_hw,u32 irq_mode)433*493d26c5SEd Maste void itr_irq_mode_set(struct aq_hw *aq_hw, u32 irq_mode)
434*493d26c5SEd Maste {
435*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrIntMode_ADR, itrIntMode_MSK, itrIntMode_SHIFT, irq_mode);
436*493d26c5SEd Maste }
437*493d26c5SEd Maste 
itr_irq_status_cor_en_set(struct aq_hw * aq_hw,u32 irq_status_cor_en)438*493d26c5SEd Maste void itr_irq_status_cor_en_set(struct aq_hw *aq_hw, u32 irq_status_cor_en)
439*493d26c5SEd Maste {
440*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrIsrCorEn_ADR, itrIsrCorEn_MSK, itrIsrCorEn_SHIFT, irq_status_cor_en);
441*493d26c5SEd Maste }
442*493d26c5SEd Maste 
itr_irq_auto_mask_clr_en_set(struct aq_hw * aq_hw,u32 irq_auto_mask_clr_en)443*493d26c5SEd Maste void itr_irq_auto_mask_clr_en_set(struct aq_hw *aq_hw, u32 irq_auto_mask_clr_en)
444*493d26c5SEd Maste {
445*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, itrIamrClrEn_ADR, itrIamrClrEn_MSK, itrIamrClrEn_SHIFT, irq_auto_mask_clr_en);
446*493d26c5SEd Maste }
447*493d26c5SEd Maste 
448*493d26c5SEd Maste /* rdm */
rdm_cpu_id_set(struct aq_hw * aq_hw,u32 cpuid,u32 dca)449*493d26c5SEd Maste void rdm_cpu_id_set(struct aq_hw *aq_hw, u32 cpuid, u32 dca)
450*493d26c5SEd Maste {
451*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dcadcpuid_adr(dca),
452*493d26c5SEd Maste                 rdm_dcadcpuid_msk,
453*493d26c5SEd Maste                 rdm_dcadcpuid_shift, cpuid);
454*493d26c5SEd Maste }
455*493d26c5SEd Maste 
rdm_rx_dca_en_set(struct aq_hw * aq_hw,u32 rx_dca_en)456*493d26c5SEd Maste void rdm_rx_dca_en_set(struct aq_hw *aq_hw, u32 rx_dca_en)
457*493d26c5SEd Maste {
458*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dca_en_adr, rdm_dca_en_msk,
459*493d26c5SEd Maste                 rdm_dca_en_shift, rx_dca_en);
460*493d26c5SEd Maste }
461*493d26c5SEd Maste 
rdm_rx_dca_mode_set(struct aq_hw * aq_hw,u32 rx_dca_mode)462*493d26c5SEd Maste void rdm_rx_dca_mode_set(struct aq_hw *aq_hw, u32 rx_dca_mode)
463*493d26c5SEd Maste {
464*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dca_mode_adr, rdm_dca_mode_msk,
465*493d26c5SEd Maste                 rdm_dca_mode_shift, rx_dca_mode);
466*493d26c5SEd Maste }
467*493d26c5SEd Maste 
rdm_rx_desc_data_buff_size_set(struct aq_hw * aq_hw,u32 rx_desc_data_buff_size,u32 descriptor)468*493d26c5SEd Maste void rdm_rx_desc_data_buff_size_set(struct aq_hw *aq_hw,
469*493d26c5SEd Maste                     u32 rx_desc_data_buff_size, u32 descriptor)
470*493d26c5SEd Maste {
471*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descddata_size_adr(descriptor),
472*493d26c5SEd Maste                 rdm_descddata_size_msk,
473*493d26c5SEd Maste                 rdm_descddata_size_shift,
474*493d26c5SEd Maste                 rx_desc_data_buff_size);
475*493d26c5SEd Maste }
476*493d26c5SEd Maste 
rdm_rx_desc_dca_en_set(struct aq_hw * aq_hw,u32 rx_desc_dca_en,u32 dca)477*493d26c5SEd Maste void rdm_rx_desc_dca_en_set(struct aq_hw *aq_hw, u32 rx_desc_dca_en, u32 dca)
478*493d26c5SEd Maste {
479*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dcaddesc_en_adr(dca),
480*493d26c5SEd Maste                 rdm_dcaddesc_en_msk,
481*493d26c5SEd Maste                 rdm_dcaddesc_en_shift,
482*493d26c5SEd Maste                 rx_desc_dca_en);
483*493d26c5SEd Maste }
484*493d26c5SEd Maste 
rdm_rx_desc_en_set(struct aq_hw * aq_hw,u32 rx_desc_en,u32 descriptor)485*493d26c5SEd Maste void rdm_rx_desc_en_set(struct aq_hw *aq_hw, u32 rx_desc_en, u32 descriptor)
486*493d26c5SEd Maste {
487*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descden_adr(descriptor),
488*493d26c5SEd Maste                 rdm_descden_msk,
489*493d26c5SEd Maste                 rdm_descden_shift,
490*493d26c5SEd Maste                 rx_desc_en);
491*493d26c5SEd Maste }
492*493d26c5SEd Maste 
rdm_rx_desc_head_buff_size_set(struct aq_hw * aq_hw,u32 rx_desc_head_buff_size,u32 descriptor)493*493d26c5SEd Maste void rdm_rx_desc_head_buff_size_set(struct aq_hw *aq_hw,
494*493d26c5SEd Maste                     u32 rx_desc_head_buff_size, u32 descriptor)
495*493d26c5SEd Maste {
496*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descdhdr_size_adr(descriptor),
497*493d26c5SEd Maste                 rdm_descdhdr_size_msk,
498*493d26c5SEd Maste                 rdm_descdhdr_size_shift,
499*493d26c5SEd Maste                 rx_desc_head_buff_size);
500*493d26c5SEd Maste }
501*493d26c5SEd Maste 
rdm_rx_desc_head_splitting_set(struct aq_hw * aq_hw,u32 rx_desc_head_splitting,u32 descriptor)502*493d26c5SEd Maste void rdm_rx_desc_head_splitting_set(struct aq_hw *aq_hw,
503*493d26c5SEd Maste                     u32 rx_desc_head_splitting, u32 descriptor)
504*493d26c5SEd Maste {
505*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descdhdr_split_adr(descriptor),
506*493d26c5SEd Maste                 rdm_descdhdr_split_msk,
507*493d26c5SEd Maste                 rdm_descdhdr_split_shift,
508*493d26c5SEd Maste                 rx_desc_head_splitting);
509*493d26c5SEd Maste }
510*493d26c5SEd Maste 
rdm_rx_desc_head_ptr_get(struct aq_hw * aq_hw,u32 descriptor)511*493d26c5SEd Maste u32 rdm_rx_desc_head_ptr_get(struct aq_hw *aq_hw, u32 descriptor)
512*493d26c5SEd Maste {
513*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, rdm_descdhd_adr(descriptor),
514*493d26c5SEd Maste                   rdm_descdhd_msk, rdm_descdhd_shift);
515*493d26c5SEd Maste }
516*493d26c5SEd Maste 
rdm_rx_desc_len_set(struct aq_hw * aq_hw,u32 rx_desc_len,u32 descriptor)517*493d26c5SEd Maste void rdm_rx_desc_len_set(struct aq_hw *aq_hw, u32 rx_desc_len, u32 descriptor)
518*493d26c5SEd Maste {
519*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descdlen_adr(descriptor),
520*493d26c5SEd Maste                 rdm_descdlen_msk, rdm_descdlen_shift,
521*493d26c5SEd Maste                 rx_desc_len);
522*493d26c5SEd Maste }
523*493d26c5SEd Maste 
rdm_rx_desc_res_set(struct aq_hw * aq_hw,u32 rx_desc_res,u32 descriptor)524*493d26c5SEd Maste void rdm_rx_desc_res_set(struct aq_hw *aq_hw, u32 rx_desc_res, u32 descriptor)
525*493d26c5SEd Maste {
526*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_descdreset_adr(descriptor),
527*493d26c5SEd Maste                 rdm_descdreset_msk, rdm_descdreset_shift,
528*493d26c5SEd Maste                 rx_desc_res);
529*493d26c5SEd Maste }
530*493d26c5SEd Maste 
rdm_rx_desc_wr_wb_irq_en_set(struct aq_hw * aq_hw,u32 rx_desc_wr_wb_irq_en)531*493d26c5SEd Maste void rdm_rx_desc_wr_wb_irq_en_set(struct aq_hw *aq_hw,
532*493d26c5SEd Maste                   u32 rx_desc_wr_wb_irq_en)
533*493d26c5SEd Maste {
534*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_int_desc_wrb_en_adr,
535*493d26c5SEd Maste                 rdm_int_desc_wrb_en_msk,
536*493d26c5SEd Maste                 rdm_int_desc_wrb_en_shift,
537*493d26c5SEd Maste                 rx_desc_wr_wb_irq_en);
538*493d26c5SEd Maste }
539*493d26c5SEd Maste 
rdm_rx_head_dca_en_set(struct aq_hw * aq_hw,u32 rx_head_dca_en,u32 dca)540*493d26c5SEd Maste void rdm_rx_head_dca_en_set(struct aq_hw *aq_hw, u32 rx_head_dca_en, u32 dca)
541*493d26c5SEd Maste {
542*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dcadhdr_en_adr(dca),
543*493d26c5SEd Maste                 rdm_dcadhdr_en_msk,
544*493d26c5SEd Maste                 rdm_dcadhdr_en_shift,
545*493d26c5SEd Maste                 rx_head_dca_en);
546*493d26c5SEd Maste }
547*493d26c5SEd Maste 
rdm_rx_pld_dca_en_set(struct aq_hw * aq_hw,u32 rx_pld_dca_en,u32 dca)548*493d26c5SEd Maste void rdm_rx_pld_dca_en_set(struct aq_hw *aq_hw, u32 rx_pld_dca_en, u32 dca)
549*493d26c5SEd Maste {
550*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_dcadpay_en_adr(dca),
551*493d26c5SEd Maste                 rdm_dcadpay_en_msk, rdm_dcadpay_en_shift,
552*493d26c5SEd Maste                 rx_pld_dca_en);
553*493d26c5SEd Maste }
554*493d26c5SEd Maste 
rdm_rdm_intr_moder_en_set(struct aq_hw * aq_hw,u32 rdm_intr_moder_en)555*493d26c5SEd Maste void rdm_rdm_intr_moder_en_set(struct aq_hw *aq_hw, u32 rdm_intr_moder_en)
556*493d26c5SEd Maste {
557*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_int_rim_en_adr,
558*493d26c5SEd Maste                 rdm_int_rim_en_msk,
559*493d26c5SEd Maste                 rdm_int_rim_en_shift,
560*493d26c5SEd Maste                 rdm_intr_moder_en);
561*493d26c5SEd Maste }
562*493d26c5SEd Maste 
563*493d26c5SEd Maste /* reg */
reg_gen_irq_map_set(struct aq_hw * aq_hw,u32 gen_intr_map,u32 regidx)564*493d26c5SEd Maste void reg_gen_irq_map_set(struct aq_hw *aq_hw, u32 gen_intr_map, u32 regidx)
565*493d26c5SEd Maste {
566*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, gen_intr_map_adr(regidx), gen_intr_map);
567*493d26c5SEd Maste }
568*493d26c5SEd Maste 
reg_gen_irq_status_get(struct aq_hw * aq_hw)569*493d26c5SEd Maste u32 reg_gen_irq_status_get(struct aq_hw *aq_hw)
570*493d26c5SEd Maste {
571*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, gen_intr_stat_adr);
572*493d26c5SEd Maste }
573*493d26c5SEd Maste 
reg_irq_glb_ctl_set(struct aq_hw * aq_hw,u32 intr_glb_ctl)574*493d26c5SEd Maste void reg_irq_glb_ctl_set(struct aq_hw *aq_hw, u32 intr_glb_ctl)
575*493d26c5SEd Maste {
576*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, intr_glb_ctl_adr, intr_glb_ctl);
577*493d26c5SEd Maste }
578*493d26c5SEd Maste 
reg_irq_thr_set(struct aq_hw * aq_hw,u32 intr_thr,u32 throttle)579*493d26c5SEd Maste void reg_irq_thr_set(struct aq_hw *aq_hw, u32 intr_thr, u32 throttle)
580*493d26c5SEd Maste {
581*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, intr_thr_adr(throttle), intr_thr);
582*493d26c5SEd Maste }
583*493d26c5SEd Maste 
reg_rx_dma_desc_base_addresslswset(struct aq_hw * aq_hw,u32 rx_dma_desc_base_addrlsw,u32 descriptor)584*493d26c5SEd Maste void reg_rx_dma_desc_base_addresslswset(struct aq_hw *aq_hw,
585*493d26c5SEd Maste                     u32 rx_dma_desc_base_addrlsw,
586*493d26c5SEd Maste                     u32 descriptor)
587*493d26c5SEd Maste {
588*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_dma_desc_base_addrlsw_adr(descriptor),
589*493d26c5SEd Maste             rx_dma_desc_base_addrlsw);
590*493d26c5SEd Maste }
591*493d26c5SEd Maste 
reg_rx_dma_desc_base_addressmswset(struct aq_hw * aq_hw,u32 rx_dma_desc_base_addrmsw,u32 descriptor)592*493d26c5SEd Maste void reg_rx_dma_desc_base_addressmswset(struct aq_hw *aq_hw,
593*493d26c5SEd Maste                     u32 rx_dma_desc_base_addrmsw,
594*493d26c5SEd Maste                     u32 descriptor)
595*493d26c5SEd Maste {
596*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_dma_desc_base_addrmsw_adr(descriptor),
597*493d26c5SEd Maste             rx_dma_desc_base_addrmsw);
598*493d26c5SEd Maste }
599*493d26c5SEd Maste 
reg_rx_dma_desc_status_get(struct aq_hw * aq_hw,u32 descriptor)600*493d26c5SEd Maste u32 reg_rx_dma_desc_status_get(struct aq_hw *aq_hw, u32 descriptor)
601*493d26c5SEd Maste {
602*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, rx_dma_desc_stat_adr(descriptor));
603*493d26c5SEd Maste }
604*493d26c5SEd Maste 
reg_rx_dma_desc_tail_ptr_set(struct aq_hw * aq_hw,u32 rx_dma_desc_tail_ptr,u32 descriptor)605*493d26c5SEd Maste void reg_rx_dma_desc_tail_ptr_set(struct aq_hw *aq_hw,
606*493d26c5SEd Maste                   u32 rx_dma_desc_tail_ptr, u32 descriptor)
607*493d26c5SEd Maste {
608*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_dma_desc_tail_ptr_adr(descriptor),
609*493d26c5SEd Maste             rx_dma_desc_tail_ptr);
610*493d26c5SEd Maste }
611*493d26c5SEd Maste 
reg_rx_dma_desc_tail_ptr_get(struct aq_hw * aq_hw,u32 descriptor)612*493d26c5SEd Maste u32 reg_rx_dma_desc_tail_ptr_get(struct aq_hw *aq_hw, u32 descriptor)
613*493d26c5SEd Maste {
614*493d26c5SEd Maste       return AQ_READ_REG(aq_hw, rx_dma_desc_tail_ptr_adr(descriptor));
615*493d26c5SEd Maste }
616*493d26c5SEd Maste 
reg_rx_flr_mcst_flr_msk_set(struct aq_hw * aq_hw,u32 rx_flr_mcst_flr_msk)617*493d26c5SEd Maste void reg_rx_flr_mcst_flr_msk_set(struct aq_hw *aq_hw, u32 rx_flr_mcst_flr_msk)
618*493d26c5SEd Maste {
619*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_flr_mcst_flr_msk_adr, rx_flr_mcst_flr_msk);
620*493d26c5SEd Maste }
621*493d26c5SEd Maste 
reg_rx_flr_mcst_flr_set(struct aq_hw * aq_hw,u32 rx_flr_mcst_flr,u32 filter)622*493d26c5SEd Maste void reg_rx_flr_mcst_flr_set(struct aq_hw *aq_hw, u32 rx_flr_mcst_flr,
623*493d26c5SEd Maste                  u32 filter)
624*493d26c5SEd Maste {
625*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_flr_mcst_flr_adr(filter), rx_flr_mcst_flr);
626*493d26c5SEd Maste }
627*493d26c5SEd Maste 
reg_rx_flr_rss_control1set(struct aq_hw * aq_hw,u32 rx_flr_rss_control1)628*493d26c5SEd Maste void reg_rx_flr_rss_control1set(struct aq_hw *aq_hw, u32 rx_flr_rss_control1)
629*493d26c5SEd Maste {
630*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_flr_rss_control1_adr, rx_flr_rss_control1);
631*493d26c5SEd Maste }
632*493d26c5SEd Maste 
reg_rx_flr_control2_set(struct aq_hw * aq_hw,u32 rx_filter_control2)633*493d26c5SEd Maste void reg_rx_flr_control2_set(struct aq_hw *aq_hw, u32 rx_filter_control2)
634*493d26c5SEd Maste {
635*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_flr_control2_adr, rx_filter_control2);
636*493d26c5SEd Maste }
637*493d26c5SEd Maste 
reg_rx_intr_moder_ctrl_set(struct aq_hw * aq_hw,u32 rx_intr_moderation_ctl,u32 queue)638*493d26c5SEd Maste void reg_rx_intr_moder_ctrl_set(struct aq_hw *aq_hw,
639*493d26c5SEd Maste                 u32 rx_intr_moderation_ctl,
640*493d26c5SEd Maste                 u32 queue)
641*493d26c5SEd Maste {
642*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rx_intr_moderation_ctl_adr(queue),
643*493d26c5SEd Maste             rx_intr_moderation_ctl);
644*493d26c5SEd Maste }
645*493d26c5SEd Maste 
reg_tx_dma_debug_ctl_set(struct aq_hw * aq_hw,u32 tx_dma_debug_ctl)646*493d26c5SEd Maste void reg_tx_dma_debug_ctl_set(struct aq_hw *aq_hw, u32 tx_dma_debug_ctl)
647*493d26c5SEd Maste {
648*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tx_dma_debug_ctl_adr, tx_dma_debug_ctl);
649*493d26c5SEd Maste }
650*493d26c5SEd Maste 
reg_tx_dma_desc_base_addresslswset(struct aq_hw * aq_hw,u32 tx_dma_desc_base_addrlsw,u32 descriptor)651*493d26c5SEd Maste void reg_tx_dma_desc_base_addresslswset(struct aq_hw *aq_hw,
652*493d26c5SEd Maste                     u32 tx_dma_desc_base_addrlsw,
653*493d26c5SEd Maste                     u32 descriptor)
654*493d26c5SEd Maste {
655*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tx_dma_desc_base_addrlsw_adr(descriptor),
656*493d26c5SEd Maste             tx_dma_desc_base_addrlsw);
657*493d26c5SEd Maste }
658*493d26c5SEd Maste 
reg_tx_dma_desc_base_addressmswset(struct aq_hw * aq_hw,u32 tx_dma_desc_base_addrmsw,u32 descriptor)659*493d26c5SEd Maste void reg_tx_dma_desc_base_addressmswset(struct aq_hw *aq_hw,
660*493d26c5SEd Maste                     u32 tx_dma_desc_base_addrmsw,
661*493d26c5SEd Maste                     u32 descriptor)
662*493d26c5SEd Maste {
663*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tx_dma_desc_base_addrmsw_adr(descriptor),
664*493d26c5SEd Maste             tx_dma_desc_base_addrmsw);
665*493d26c5SEd Maste }
666*493d26c5SEd Maste 
reg_tx_dma_desc_tail_ptr_set(struct aq_hw * aq_hw,u32 tx_dma_desc_tail_ptr,u32 descriptor)667*493d26c5SEd Maste void reg_tx_dma_desc_tail_ptr_set(struct aq_hw *aq_hw,
668*493d26c5SEd Maste                   u32 tx_dma_desc_tail_ptr, u32 descriptor)
669*493d26c5SEd Maste {
670*493d26c5SEd Maste     //wmb();
671*493d26c5SEd Maste 
672*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tx_dma_desc_tail_ptr_adr(descriptor),
673*493d26c5SEd Maste             tx_dma_desc_tail_ptr);
674*493d26c5SEd Maste }
675*493d26c5SEd Maste 
reg_tx_dma_desc_tail_ptr_get(struct aq_hw * aq_hw,u32 descriptor)676*493d26c5SEd Maste u32 reg_tx_dma_desc_tail_ptr_get(struct aq_hw *aq_hw, u32 descriptor)
677*493d26c5SEd Maste {
678*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, tx_dma_desc_tail_ptr_adr(descriptor));
679*493d26c5SEd Maste }
680*493d26c5SEd Maste 
reg_tx_intr_moder_ctrl_set(struct aq_hw * aq_hw,u32 tx_intr_moderation_ctl,u32 queue)681*493d26c5SEd Maste void reg_tx_intr_moder_ctrl_set(struct aq_hw *aq_hw,
682*493d26c5SEd Maste                 u32 tx_intr_moderation_ctl,
683*493d26c5SEd Maste                 u32 queue)
684*493d26c5SEd Maste {
685*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tx_intr_moderation_ctl_adr(queue),
686*493d26c5SEd Maste             tx_intr_moderation_ctl);
687*493d26c5SEd Maste }
688*493d26c5SEd Maste 
689*493d26c5SEd Maste /* RPB: rx packet buffer */
rpb_dma_sys_lbk_set(struct aq_hw * aq_hw,u32 dma_sys_lbk)690*493d26c5SEd Maste void rpb_dma_sys_lbk_set(struct aq_hw *aq_hw, u32 dma_sys_lbk)
691*493d26c5SEd Maste {
692*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_dma_sys_lbk_adr,
693*493d26c5SEd Maste                 rpb_dma_sys_lbk_msk,
694*493d26c5SEd Maste                 rpb_dma_sys_lbk_shift, dma_sys_lbk);
695*493d26c5SEd Maste }
696*493d26c5SEd Maste 
rpb_rpf_rx_traf_class_mode_set(struct aq_hw * aq_hw,u32 rx_traf_class_mode)697*493d26c5SEd Maste void rpb_rpf_rx_traf_class_mode_set(struct aq_hw *aq_hw,
698*493d26c5SEd Maste                     u32 rx_traf_class_mode)
699*493d26c5SEd Maste {
700*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rpf_rx_tc_mode_adr,
701*493d26c5SEd Maste                 rpb_rpf_rx_tc_mode_msk,
702*493d26c5SEd Maste                 rpb_rpf_rx_tc_mode_shift,
703*493d26c5SEd Maste                 rx_traf_class_mode);
704*493d26c5SEd Maste }
705*493d26c5SEd Maste 
rpb_rx_buff_en_set(struct aq_hw * aq_hw,u32 rx_buff_en)706*493d26c5SEd Maste void rpb_rx_buff_en_set(struct aq_hw *aq_hw, u32 rx_buff_en)
707*493d26c5SEd Maste {
708*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rx_buf_en_adr, rpb_rx_buf_en_msk,
709*493d26c5SEd Maste                 rpb_rx_buf_en_shift, rx_buff_en);
710*493d26c5SEd Maste }
711*493d26c5SEd Maste 
rpb_rx_buff_hi_threshold_per_tc_set(struct aq_hw * aq_hw,u32 rx_buff_hi_threshold_per_tc,u32 buffer)712*493d26c5SEd Maste void rpb_rx_buff_hi_threshold_per_tc_set(struct aq_hw *aq_hw,
713*493d26c5SEd Maste                      u32 rx_buff_hi_threshold_per_tc,
714*493d26c5SEd Maste                      u32 buffer)
715*493d26c5SEd Maste {
716*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rxbhi_thresh_adr(buffer),
717*493d26c5SEd Maste                 rpb_rxbhi_thresh_msk, rpb_rxbhi_thresh_shift,
718*493d26c5SEd Maste                 rx_buff_hi_threshold_per_tc);
719*493d26c5SEd Maste }
720*493d26c5SEd Maste 
rpb_rx_buff_lo_threshold_per_tc_set(struct aq_hw * aq_hw,u32 rx_buff_lo_threshold_per_tc,u32 buffer)721*493d26c5SEd Maste void rpb_rx_buff_lo_threshold_per_tc_set(struct aq_hw *aq_hw,
722*493d26c5SEd Maste                      u32 rx_buff_lo_threshold_per_tc,
723*493d26c5SEd Maste                      u32 buffer)
724*493d26c5SEd Maste {
725*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rxblo_thresh_adr(buffer),
726*493d26c5SEd Maste                 rpb_rxblo_thresh_msk,
727*493d26c5SEd Maste                 rpb_rxblo_thresh_shift,
728*493d26c5SEd Maste                 rx_buff_lo_threshold_per_tc);
729*493d26c5SEd Maste }
730*493d26c5SEd Maste 
rpb_rx_flow_ctl_mode_set(struct aq_hw * aq_hw,u32 rx_flow_ctl_mode)731*493d26c5SEd Maste void rpb_rx_flow_ctl_mode_set(struct aq_hw *aq_hw, u32 rx_flow_ctl_mode)
732*493d26c5SEd Maste {
733*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rx_fc_mode_adr,
734*493d26c5SEd Maste                 rpb_rx_fc_mode_msk,
735*493d26c5SEd Maste                 rpb_rx_fc_mode_shift, rx_flow_ctl_mode);
736*493d26c5SEd Maste }
737*493d26c5SEd Maste 
rpb_rx_pkt_buff_size_per_tc_set(struct aq_hw * aq_hw,u32 rx_pkt_buff_size_per_tc,u32 buffer)738*493d26c5SEd Maste void rpb_rx_pkt_buff_size_per_tc_set(struct aq_hw *aq_hw,
739*493d26c5SEd Maste                      u32 rx_pkt_buff_size_per_tc, u32 buffer)
740*493d26c5SEd Maste {
741*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rxbbuf_size_adr(buffer),
742*493d26c5SEd Maste                 rpb_rxbbuf_size_msk, rpb_rxbbuf_size_shift,
743*493d26c5SEd Maste                 rx_pkt_buff_size_per_tc);
744*493d26c5SEd Maste }
745*493d26c5SEd Maste 
rpb_rx_xoff_en_per_tc_set(struct aq_hw * aq_hw,u32 rx_xoff_en_per_tc,u32 buffer)746*493d26c5SEd Maste void rpb_rx_xoff_en_per_tc_set(struct aq_hw *aq_hw, u32 rx_xoff_en_per_tc,
747*493d26c5SEd Maste                    u32 buffer)
748*493d26c5SEd Maste {
749*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpb_rxbxoff_en_adr(buffer),
750*493d26c5SEd Maste                 rpb_rxbxoff_en_msk, rpb_rxbxoff_en_shift,
751*493d26c5SEd Maste                 rx_xoff_en_per_tc);
752*493d26c5SEd Maste }
753*493d26c5SEd Maste 
754*493d26c5SEd Maste /* rpf */
755*493d26c5SEd Maste 
rpfl2broadcast_count_threshold_set(struct aq_hw * aq_hw,u32 l2broadcast_count_threshold)756*493d26c5SEd Maste void rpfl2broadcast_count_threshold_set(struct aq_hw *aq_hw,
757*493d26c5SEd Maste                     u32 l2broadcast_count_threshold)
758*493d26c5SEd Maste {
759*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2bc_thresh_adr,
760*493d26c5SEd Maste                 rpfl2bc_thresh_msk,
761*493d26c5SEd Maste                 rpfl2bc_thresh_shift,
762*493d26c5SEd Maste                 l2broadcast_count_threshold);
763*493d26c5SEd Maste }
764*493d26c5SEd Maste 
rpfl2broadcast_en_set(struct aq_hw * aq_hw,u32 l2broadcast_en)765*493d26c5SEd Maste void rpfl2broadcast_en_set(struct aq_hw *aq_hw, u32 l2broadcast_en)
766*493d26c5SEd Maste {
767*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2bc_en_adr, rpfl2bc_en_msk,
768*493d26c5SEd Maste                 rpfl2bc_en_shift, l2broadcast_en);
769*493d26c5SEd Maste }
770*493d26c5SEd Maste 
rpfl2broadcast_flr_act_set(struct aq_hw * aq_hw,u32 l2broadcast_flr_act)771*493d26c5SEd Maste void rpfl2broadcast_flr_act_set(struct aq_hw *aq_hw, u32 l2broadcast_flr_act)
772*493d26c5SEd Maste {
773*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2bc_act_adr, rpfl2bc_act_msk,
774*493d26c5SEd Maste                 rpfl2bc_act_shift, l2broadcast_flr_act);
775*493d26c5SEd Maste }
776*493d26c5SEd Maste 
rpfl2multicast_flr_en_set(struct aq_hw * aq_hw,u32 l2multicast_flr_en,u32 filter)777*493d26c5SEd Maste void rpfl2multicast_flr_en_set(struct aq_hw *aq_hw, u32 l2multicast_flr_en,
778*493d26c5SEd Maste                    u32 filter)
779*493d26c5SEd Maste {
780*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2mc_enf_adr(filter),
781*493d26c5SEd Maste                 rpfl2mc_enf_msk,
782*493d26c5SEd Maste                 rpfl2mc_enf_shift, l2multicast_flr_en);
783*493d26c5SEd Maste }
784*493d26c5SEd Maste 
rpfl2promiscuous_mode_en_set(struct aq_hw * aq_hw,u32 l2promiscuous_mode_en)785*493d26c5SEd Maste void rpfl2promiscuous_mode_en_set(struct aq_hw *aq_hw,
786*493d26c5SEd Maste                   u32 l2promiscuous_mode_en)
787*493d26c5SEd Maste {
788*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2promis_mode_adr,
789*493d26c5SEd Maste                 rpfl2promis_mode_msk,
790*493d26c5SEd Maste                 rpfl2promis_mode_shift,
791*493d26c5SEd Maste                 l2promiscuous_mode_en);
792*493d26c5SEd Maste }
793*493d26c5SEd Maste 
rpfl2unicast_flr_act_set(struct aq_hw * aq_hw,u32 l2unicast_flr_act,u32 filter)794*493d26c5SEd Maste void rpfl2unicast_flr_act_set(struct aq_hw *aq_hw, u32 l2unicast_flr_act,
795*493d26c5SEd Maste                   u32 filter)
796*493d26c5SEd Maste {
797*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2uc_actf_adr(filter),
798*493d26c5SEd Maste                 rpfl2uc_actf_msk, rpfl2uc_actf_shift,
799*493d26c5SEd Maste                 l2unicast_flr_act);
800*493d26c5SEd Maste }
801*493d26c5SEd Maste 
rpfl2_uc_flr_en_set(struct aq_hw * aq_hw,u32 l2unicast_flr_en,u32 filter)802*493d26c5SEd Maste void rpfl2_uc_flr_en_set(struct aq_hw *aq_hw, u32 l2unicast_flr_en,
803*493d26c5SEd Maste              u32 filter)
804*493d26c5SEd Maste {
805*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2uc_enf_adr(filter),
806*493d26c5SEd Maste                 rpfl2uc_enf_msk,
807*493d26c5SEd Maste                 rpfl2uc_enf_shift, l2unicast_flr_en);
808*493d26c5SEd Maste }
809*493d26c5SEd Maste 
rpfl2unicast_dest_addresslsw_set(struct aq_hw * aq_hw,u32 l2unicast_dest_addresslsw,u32 filter)810*493d26c5SEd Maste void rpfl2unicast_dest_addresslsw_set(struct aq_hw *aq_hw,
811*493d26c5SEd Maste                       u32 l2unicast_dest_addresslsw,
812*493d26c5SEd Maste                       u32 filter)
813*493d26c5SEd Maste {
814*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rpfl2uc_daflsw_adr(filter),
815*493d26c5SEd Maste             l2unicast_dest_addresslsw);
816*493d26c5SEd Maste }
817*493d26c5SEd Maste 
rpfl2unicast_dest_addressmsw_set(struct aq_hw * aq_hw,u32 l2unicast_dest_addressmsw,u32 filter)818*493d26c5SEd Maste void rpfl2unicast_dest_addressmsw_set(struct aq_hw *aq_hw,
819*493d26c5SEd Maste                       u32 l2unicast_dest_addressmsw,
820*493d26c5SEd Maste                       u32 filter)
821*493d26c5SEd Maste {
822*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2uc_dafmsw_adr(filter),
823*493d26c5SEd Maste                 rpfl2uc_dafmsw_msk, rpfl2uc_dafmsw_shift,
824*493d26c5SEd Maste                 l2unicast_dest_addressmsw);
825*493d26c5SEd Maste }
826*493d26c5SEd Maste 
rpfl2_accept_all_mc_packets_set(struct aq_hw * aq_hw,u32 l2_accept_all_mc_packets)827*493d26c5SEd Maste void rpfl2_accept_all_mc_packets_set(struct aq_hw *aq_hw,
828*493d26c5SEd Maste                      u32 l2_accept_all_mc_packets)
829*493d26c5SEd Maste {
830*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpfl2mc_accept_all_adr,
831*493d26c5SEd Maste                 rpfl2mc_accept_all_msk,
832*493d26c5SEd Maste                 rpfl2mc_accept_all_shift,
833*493d26c5SEd Maste                 l2_accept_all_mc_packets);
834*493d26c5SEd Maste }
835*493d26c5SEd Maste 
rpf_rpb_user_priority_tc_map_set(struct aq_hw * aq_hw,u32 user_priority_tc_map,u32 tc)836*493d26c5SEd Maste void rpf_rpb_user_priority_tc_map_set(struct aq_hw *aq_hw,
837*493d26c5SEd Maste                       u32 user_priority_tc_map, u32 tc)
838*493d26c5SEd Maste {
839*493d26c5SEd Maste /* register address for bitfield rx_tc_up{t}[2:0] */
840*493d26c5SEd Maste     static u32 rpf_rpb_rx_tc_upt_adr[8] = {
841*493d26c5SEd Maste             0x000054c4U, 0x000054c4U, 0x000054c4U, 0x000054c4U,
842*493d26c5SEd Maste             0x000054c4U, 0x000054c4U, 0x000054c4U, 0x000054c4U
843*493d26c5SEd Maste         };
844*493d26c5SEd Maste 
845*493d26c5SEd Maste /* bitmask for bitfield rx_tc_up{t}[2:0] */
846*493d26c5SEd Maste     static u32 rpf_rpb_rx_tc_upt_msk[8] = {
847*493d26c5SEd Maste             0x00000007U, 0x00000070U, 0x00000700U, 0x00007000U,
848*493d26c5SEd Maste             0x00070000U, 0x00700000U, 0x07000000U, 0x70000000U
849*493d26c5SEd Maste         };
850*493d26c5SEd Maste 
851*493d26c5SEd Maste /* lower bit position of bitfield rx_tc_up{t}[2:0] */
852*493d26c5SEd Maste     static u32 rpf_rpb_rx_tc_upt_shft[8] = {
853*493d26c5SEd Maste             0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U
854*493d26c5SEd Maste         };
855*493d26c5SEd Maste 
856*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rpb_rx_tc_upt_adr[tc],
857*493d26c5SEd Maste                 rpf_rpb_rx_tc_upt_msk[tc],
858*493d26c5SEd Maste                 rpf_rpb_rx_tc_upt_shft[tc],
859*493d26c5SEd Maste                 user_priority_tc_map);
860*493d26c5SEd Maste }
861*493d26c5SEd Maste 
rpf_rss_key_addr_set(struct aq_hw * aq_hw,u32 rss_key_addr)862*493d26c5SEd Maste void rpf_rss_key_addr_set(struct aq_hw *aq_hw, u32 rss_key_addr)
863*493d26c5SEd Maste {
864*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rss_key_addr_adr,
865*493d26c5SEd Maste                 rpf_rss_key_addr_msk,
866*493d26c5SEd Maste                 rpf_rss_key_addr_shift,
867*493d26c5SEd Maste                 rss_key_addr);
868*493d26c5SEd Maste }
869*493d26c5SEd Maste 
rpf_rss_key_wr_data_set(struct aq_hw * aq_hw,u32 rss_key_wr_data)870*493d26c5SEd Maste void rpf_rss_key_wr_data_set(struct aq_hw *aq_hw, u32 rss_key_wr_data)
871*493d26c5SEd Maste {
872*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rpf_rss_key_wr_data_adr,
873*493d26c5SEd Maste             rss_key_wr_data);
874*493d26c5SEd Maste }
875*493d26c5SEd Maste 
rpf_rss_key_rd_data_get(struct aq_hw * aq_hw)876*493d26c5SEd Maste u32 rpf_rss_key_rd_data_get(struct aq_hw *aq_hw)
877*493d26c5SEd Maste {
878*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, rpf_rss_key_rd_data_adr);
879*493d26c5SEd Maste }
880*493d26c5SEd Maste 
rpf_rss_key_wr_en_get(struct aq_hw * aq_hw)881*493d26c5SEd Maste u32 rpf_rss_key_wr_en_get(struct aq_hw *aq_hw)
882*493d26c5SEd Maste {
883*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, rpf_rss_key_wr_eni_adr,
884*493d26c5SEd Maste                   rpf_rss_key_wr_eni_msk,
885*493d26c5SEd Maste                   rpf_rss_key_wr_eni_shift);
886*493d26c5SEd Maste }
887*493d26c5SEd Maste 
rpf_rss_key_wr_en_set(struct aq_hw * aq_hw,u32 rss_key_wr_en)888*493d26c5SEd Maste void rpf_rss_key_wr_en_set(struct aq_hw *aq_hw, u32 rss_key_wr_en)
889*493d26c5SEd Maste {
890*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rss_key_wr_eni_adr,
891*493d26c5SEd Maste                 rpf_rss_key_wr_eni_msk,
892*493d26c5SEd Maste                 rpf_rss_key_wr_eni_shift,
893*493d26c5SEd Maste                 rss_key_wr_en);
894*493d26c5SEd Maste }
895*493d26c5SEd Maste 
rpf_rss_redir_tbl_addr_set(struct aq_hw * aq_hw,u32 rss_redir_tbl_addr)896*493d26c5SEd Maste void rpf_rss_redir_tbl_addr_set(struct aq_hw *aq_hw, u32 rss_redir_tbl_addr)
897*493d26c5SEd Maste {
898*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rss_redir_addr_adr,
899*493d26c5SEd Maste                 rpf_rss_redir_addr_msk,
900*493d26c5SEd Maste                 rpf_rss_redir_addr_shift, rss_redir_tbl_addr);
901*493d26c5SEd Maste }
902*493d26c5SEd Maste 
rpf_rss_redir_tbl_wr_data_set(struct aq_hw * aq_hw,u32 rss_redir_tbl_wr_data)903*493d26c5SEd Maste void rpf_rss_redir_tbl_wr_data_set(struct aq_hw *aq_hw,
904*493d26c5SEd Maste                    u32 rss_redir_tbl_wr_data)
905*493d26c5SEd Maste {
906*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rss_redir_wr_data_adr,
907*493d26c5SEd Maste                 rpf_rss_redir_wr_data_msk,
908*493d26c5SEd Maste                 rpf_rss_redir_wr_data_shift,
909*493d26c5SEd Maste                 rss_redir_tbl_wr_data);
910*493d26c5SEd Maste }
911*493d26c5SEd Maste 
rpf_rss_redir_wr_en_get(struct aq_hw * aq_hw)912*493d26c5SEd Maste u32 rpf_rss_redir_wr_en_get(struct aq_hw *aq_hw)
913*493d26c5SEd Maste {
914*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, rpf_rss_redir_wr_eni_adr,
915*493d26c5SEd Maste                   rpf_rss_redir_wr_eni_msk,
916*493d26c5SEd Maste                   rpf_rss_redir_wr_eni_shift);
917*493d26c5SEd Maste }
918*493d26c5SEd Maste 
rpf_rss_redir_wr_en_set(struct aq_hw * aq_hw,u32 rss_redir_wr_en)919*493d26c5SEd Maste void rpf_rss_redir_wr_en_set(struct aq_hw *aq_hw, u32 rss_redir_wr_en)
920*493d26c5SEd Maste {
921*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_rss_redir_wr_eni_adr,
922*493d26c5SEd Maste                 rpf_rss_redir_wr_eni_msk,
923*493d26c5SEd Maste                 rpf_rss_redir_wr_eni_shift, rss_redir_wr_en);
924*493d26c5SEd Maste }
925*493d26c5SEd Maste 
rpf_tpo_to_rpf_sys_lbk_set(struct aq_hw * aq_hw,u32 tpo_to_rpf_sys_lbk)926*493d26c5SEd Maste void rpf_tpo_to_rpf_sys_lbk_set(struct aq_hw *aq_hw, u32 tpo_to_rpf_sys_lbk)
927*493d26c5SEd Maste {
928*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_tpo_rpf_sys_lbk_adr,
929*493d26c5SEd Maste                 rpf_tpo_rpf_sys_lbk_msk,
930*493d26c5SEd Maste                 rpf_tpo_rpf_sys_lbk_shift,
931*493d26c5SEd Maste                 tpo_to_rpf_sys_lbk);
932*493d26c5SEd Maste }
933*493d26c5SEd Maste 
934*493d26c5SEd Maste 
hw_atl_rpf_vlan_inner_etht_set(struct aq_hw_s * aq_hw,u32 vlan_inner_etht)935*493d26c5SEd Maste void hw_atl_rpf_vlan_inner_etht_set(struct aq_hw_s *aq_hw, u32 vlan_inner_etht)
936*493d26c5SEd Maste {
937*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_INNER_TPID_ADR,
938*493d26c5SEd Maste 			    HW_ATL_RPF_VL_INNER_TPID_MSK,
939*493d26c5SEd Maste 			    HW_ATL_RPF_VL_INNER_TPID_SHIFT,
940*493d26c5SEd Maste 			    vlan_inner_etht);
941*493d26c5SEd Maste }
942*493d26c5SEd Maste 
hw_atl_rpf_vlan_outer_etht_set(struct aq_hw_s * aq_hw,u32 vlan_outer_etht)943*493d26c5SEd Maste void hw_atl_rpf_vlan_outer_etht_set(struct aq_hw_s *aq_hw, u32 vlan_outer_etht)
944*493d26c5SEd Maste {
945*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_OUTER_TPID_ADR,
946*493d26c5SEd Maste 			    HW_ATL_RPF_VL_OUTER_TPID_MSK,
947*493d26c5SEd Maste 			    HW_ATL_RPF_VL_OUTER_TPID_SHIFT,
948*493d26c5SEd Maste 			    vlan_outer_etht);
949*493d26c5SEd Maste }
950*493d26c5SEd Maste 
hw_atl_rpf_vlan_prom_mode_en_set(struct aq_hw_s * aq_hw,u32 vlan_prom_mode_en)951*493d26c5SEd Maste void hw_atl_rpf_vlan_prom_mode_en_set(struct aq_hw_s *aq_hw,
952*493d26c5SEd Maste 				      u32 vlan_prom_mode_en)
953*493d26c5SEd Maste {
954*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_PROMIS_MODE_ADR,
955*493d26c5SEd Maste 			    HW_ATL_RPF_VL_PROMIS_MODE_MSK,
956*493d26c5SEd Maste 			    HW_ATL_RPF_VL_PROMIS_MODE_SHIFT,
957*493d26c5SEd Maste 			    vlan_prom_mode_en);
958*493d26c5SEd Maste }
959*493d26c5SEd Maste 
hw_atl_rpf_vlan_accept_untagged_packets_set(struct aq_hw_s * aq_hw,u32 vlan_acc_untagged_packets)960*493d26c5SEd Maste void hw_atl_rpf_vlan_accept_untagged_packets_set(struct aq_hw_s *aq_hw,
961*493d26c5SEd Maste 						 u32 vlan_acc_untagged_packets)
962*493d26c5SEd Maste {
963*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_ADR,
964*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_MSK,
965*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_SHIFT,
966*493d26c5SEd Maste 			    vlan_acc_untagged_packets);
967*493d26c5SEd Maste }
968*493d26c5SEd Maste 
hw_atl_rpf_vlan_untagged_act_set(struct aq_hw_s * aq_hw,u32 vlan_untagged_act)969*493d26c5SEd Maste void hw_atl_rpf_vlan_untagged_act_set(struct aq_hw_s *aq_hw,
970*493d26c5SEd Maste 				      u32 vlan_untagged_act)
971*493d26c5SEd Maste {
972*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_UNTAGGED_ACT_ADR,
973*493d26c5SEd Maste 			    HW_ATL_RPF_VL_UNTAGGED_ACT_MSK,
974*493d26c5SEd Maste 			    HW_ATL_RPF_VL_UNTAGGED_ACT_SHIFT,
975*493d26c5SEd Maste 			    vlan_untagged_act);
976*493d26c5SEd Maste }
977*493d26c5SEd Maste 
hw_atl_rpf_vlan_flr_en_set(struct aq_hw_s * aq_hw,u32 vlan_flr_en,u32 filter)978*493d26c5SEd Maste void hw_atl_rpf_vlan_flr_en_set(struct aq_hw_s *aq_hw, u32 vlan_flr_en,
979*493d26c5SEd Maste 				u32 filter)
980*493d26c5SEd Maste {
981*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_EN_F_ADR(filter),
982*493d26c5SEd Maste 			    HW_ATL_RPF_VL_EN_F_MSK,
983*493d26c5SEd Maste 			    HW_ATL_RPF_VL_EN_F_SHIFT,
984*493d26c5SEd Maste 			    vlan_flr_en);
985*493d26c5SEd Maste }
986*493d26c5SEd Maste 
hw_atl_rpf_vlan_flr_act_set(struct aq_hw_s * aq_hw,u32 vlan_flr_act,u32 filter)987*493d26c5SEd Maste void hw_atl_rpf_vlan_flr_act_set(struct aq_hw_s *aq_hw, u32 vlan_flr_act,
988*493d26c5SEd Maste 				 u32 filter)
989*493d26c5SEd Maste {
990*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_ACT_F_ADR(filter),
991*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ACT_F_MSK,
992*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ACT_F_SHIFT,
993*493d26c5SEd Maste 			    vlan_flr_act);
994*493d26c5SEd Maste }
995*493d26c5SEd Maste 
hw_atl_rpf_vlan_id_flr_set(struct aq_hw_s * aq_hw,u32 vlan_id_flr,u32 filter)996*493d26c5SEd Maste void hw_atl_rpf_vlan_id_flr_set(struct aq_hw_s *aq_hw, u32 vlan_id_flr,
997*493d26c5SEd Maste 				u32 filter)
998*493d26c5SEd Maste {
999*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_ID_F_ADR(filter),
1000*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ID_F_MSK,
1001*493d26c5SEd Maste 			    HW_ATL_RPF_VL_ID_F_SHIFT,
1002*493d26c5SEd Maste 			    vlan_id_flr);
1003*493d26c5SEd Maste }
1004*493d26c5SEd Maste 
hw_atl_rpf_vlan_rxq_en_flr_set(struct aq_hw_s * aq_hw,u32 vlan_rxq_en,u32 filter)1005*493d26c5SEd Maste void hw_atl_rpf_vlan_rxq_en_flr_set(struct aq_hw_s *aq_hw, u32 vlan_rxq_en,
1006*493d26c5SEd Maste 				u32 filter)
1007*493d26c5SEd Maste {
1008*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_RXQ_EN_F_ADR(filter),
1009*493d26c5SEd Maste 			    HW_ATL_RPF_VL_RXQ_EN_F_MSK,
1010*493d26c5SEd Maste 			    HW_ATL_RPF_VL_RXQ_EN_F_SHIFT,
1011*493d26c5SEd Maste 			    vlan_rxq_en);
1012*493d26c5SEd Maste }
1013*493d26c5SEd Maste 
hw_atl_rpf_vlan_rxq_flr_set(struct aq_hw_s * aq_hw,u32 vlan_rxq,u32 filter)1014*493d26c5SEd Maste void hw_atl_rpf_vlan_rxq_flr_set(struct aq_hw_s *aq_hw, u32 vlan_rxq,
1015*493d26c5SEd Maste 				u32 filter)
1016*493d26c5SEd Maste {
1017*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_VL_RXQ_F_ADR(filter),
1018*493d26c5SEd Maste 			    HW_ATL_RPF_VL_RXQ_F_MSK,
1019*493d26c5SEd Maste 			    HW_ATL_RPF_VL_RXQ_F_SHIFT,
1020*493d26c5SEd Maste 			    vlan_rxq);
1021*493d26c5SEd Maste };
1022*493d26c5SEd Maste 
hw_atl_rpf_etht_flr_en_set(struct aq_hw_s * aq_hw,u32 etht_flr_en,u32 filter)1023*493d26c5SEd Maste void hw_atl_rpf_etht_flr_en_set(struct aq_hw_s *aq_hw, u32 etht_flr_en,
1024*493d26c5SEd Maste 				u32 filter)
1025*493d26c5SEd Maste {
1026*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_ENF_ADR(filter),
1027*493d26c5SEd Maste 			    HW_ATL_RPF_ET_ENF_MSK,
1028*493d26c5SEd Maste 			    HW_ATL_RPF_ET_ENF_SHIFT, etht_flr_en);
1029*493d26c5SEd Maste }
1030*493d26c5SEd Maste 
hw_atl_rpf_etht_user_priority_en_set(struct aq_hw_s * aq_hw,u32 etht_user_priority_en,u32 filter)1031*493d26c5SEd Maste void hw_atl_rpf_etht_user_priority_en_set(struct aq_hw_s *aq_hw,
1032*493d26c5SEd Maste 					  u32 etht_user_priority_en, u32 filter)
1033*493d26c5SEd Maste {
1034*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_UPFEN_ADR(filter),
1035*493d26c5SEd Maste 			    HW_ATL_RPF_ET_UPFEN_MSK, HW_ATL_RPF_ET_UPFEN_SHIFT,
1036*493d26c5SEd Maste 			    etht_user_priority_en);
1037*493d26c5SEd Maste }
1038*493d26c5SEd Maste 
hw_atl_rpf_etht_rx_queue_en_set(struct aq_hw_s * aq_hw,u32 etht_rx_queue_en,u32 filter)1039*493d26c5SEd Maste void hw_atl_rpf_etht_rx_queue_en_set(struct aq_hw_s *aq_hw,
1040*493d26c5SEd Maste 				     u32 etht_rx_queue_en,
1041*493d26c5SEd Maste 				     u32 filter)
1042*493d26c5SEd Maste {
1043*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_RXQFEN_ADR(filter),
1044*493d26c5SEd Maste 			    HW_ATL_RPF_ET_RXQFEN_MSK,
1045*493d26c5SEd Maste 			    HW_ATL_RPF_ET_RXQFEN_SHIFT,
1046*493d26c5SEd Maste 			    etht_rx_queue_en);
1047*493d26c5SEd Maste }
1048*493d26c5SEd Maste 
hw_atl_rpf_etht_user_priority_set(struct aq_hw_s * aq_hw,u32 etht_user_priority,u32 filter)1049*493d26c5SEd Maste void hw_atl_rpf_etht_user_priority_set(struct aq_hw_s *aq_hw,
1050*493d26c5SEd Maste 				       u32 etht_user_priority,
1051*493d26c5SEd Maste 				       u32 filter)
1052*493d26c5SEd Maste {
1053*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_UPF_ADR(filter),
1054*493d26c5SEd Maste 			    HW_ATL_RPF_ET_UPF_MSK,
1055*493d26c5SEd Maste 			    HW_ATL_RPF_ET_UPF_SHIFT, etht_user_priority);
1056*493d26c5SEd Maste }
1057*493d26c5SEd Maste 
hw_atl_rpf_etht_rx_queue_set(struct aq_hw_s * aq_hw,u32 etht_rx_queue,u32 filter)1058*493d26c5SEd Maste void hw_atl_rpf_etht_rx_queue_set(struct aq_hw_s *aq_hw, u32 etht_rx_queue,
1059*493d26c5SEd Maste 				  u32 filter)
1060*493d26c5SEd Maste {
1061*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_RXQF_ADR(filter),
1062*493d26c5SEd Maste 			    HW_ATL_RPF_ET_RXQF_MSK,
1063*493d26c5SEd Maste 			    HW_ATL_RPF_ET_RXQF_SHIFT, etht_rx_queue);
1064*493d26c5SEd Maste }
1065*493d26c5SEd Maste 
hw_atl_rpf_etht_mgt_queue_set(struct aq_hw_s * aq_hw,u32 etht_mgt_queue,u32 filter)1066*493d26c5SEd Maste void hw_atl_rpf_etht_mgt_queue_set(struct aq_hw_s *aq_hw, u32 etht_mgt_queue,
1067*493d26c5SEd Maste 				   u32 filter)
1068*493d26c5SEd Maste {
1069*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_MNG_RXQF_ADR(filter),
1070*493d26c5SEd Maste 			    HW_ATL_RPF_ET_MNG_RXQF_MSK,
1071*493d26c5SEd Maste 			    HW_ATL_RPF_ET_MNG_RXQF_SHIFT,
1072*493d26c5SEd Maste 			    etht_mgt_queue);
1073*493d26c5SEd Maste }
1074*493d26c5SEd Maste 
hw_atl_rpf_etht_flr_act_set(struct aq_hw_s * aq_hw,u32 etht_flr_act,u32 filter)1075*493d26c5SEd Maste void hw_atl_rpf_etht_flr_act_set(struct aq_hw_s *aq_hw, u32 etht_flr_act,
1076*493d26c5SEd Maste 				 u32 filter)
1077*493d26c5SEd Maste {
1078*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_ACTF_ADR(filter),
1079*493d26c5SEd Maste 			    HW_ATL_RPF_ET_ACTF_MSK,
1080*493d26c5SEd Maste 			    HW_ATL_RPF_ET_ACTF_SHIFT, etht_flr_act);
1081*493d26c5SEd Maste }
1082*493d26c5SEd Maste 
hw_atl_rpf_etht_flr_set(struct aq_hw_s * aq_hw,u32 etht_flr,u32 filter)1083*493d26c5SEd Maste void hw_atl_rpf_etht_flr_set(struct aq_hw_s *aq_hw, u32 etht_flr, u32 filter)
1084*493d26c5SEd Maste {
1085*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_ET_VALF_ADR(filter),
1086*493d26c5SEd Maste 			    HW_ATL_RPF_ET_VALF_MSK,
1087*493d26c5SEd Maste 			    HW_ATL_RPF_ET_VALF_SHIFT, etht_flr);
1088*493d26c5SEd Maste }
1089*493d26c5SEd Maste 
hw_atl_rpf_l3_l4_enf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1090*493d26c5SEd Maste void hw_atl_rpf_l3_l4_enf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1091*493d26c5SEd Maste {
1092*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_L4_ENF_ADR(filter),
1093*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_ENF_MSK,
1094*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_ENF_SHIFT, val);
1095*493d26c5SEd Maste }
1096*493d26c5SEd Maste 
hw_atl_rpf_l3_v6_enf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1097*493d26c5SEd Maste void hw_atl_rpf_l3_v6_enf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1098*493d26c5SEd Maste {
1099*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_V6_ENF_ADR(filter),
1100*493d26c5SEd Maste 			HW_ATL_RPF_L3_V6_ENF_MSK,
1101*493d26c5SEd Maste 			HW_ATL_RPF_L3_V6_ENF_SHIFT, val);
1102*493d26c5SEd Maste }
1103*493d26c5SEd Maste 
hw_atl_rpf_l3_saf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1104*493d26c5SEd Maste void hw_atl_rpf_l3_saf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1105*493d26c5SEd Maste {
1106*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_SAF_EN_ADR(filter),
1107*493d26c5SEd Maste 			HW_ATL_RPF_L3_SAF_EN_MSK,
1108*493d26c5SEd Maste 			HW_ATL_RPF_L3_SAF_EN_SHIFT, val);
1109*493d26c5SEd Maste }
1110*493d26c5SEd Maste 
hw_atl_rpf_l3_daf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1111*493d26c5SEd Maste void hw_atl_rpf_l3_daf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1112*493d26c5SEd Maste {
1113*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_DAF_EN_ADR(filter),
1114*493d26c5SEd Maste 			HW_ATL_RPF_L3_DAF_EN_MSK,
1115*493d26c5SEd Maste 			HW_ATL_RPF_L3_DAF_EN_SHIFT, val);
1116*493d26c5SEd Maste }
1117*493d26c5SEd Maste 
hw_atl_rpf_l4_spf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1118*493d26c5SEd Maste void hw_atl_rpf_l4_spf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1119*493d26c5SEd Maste {
1120*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_SPF_EN_ADR(filter),
1121*493d26c5SEd Maste 			HW_ATL_RPF_L4_SPF_EN_MSK,
1122*493d26c5SEd Maste 			HW_ATL_RPF_L4_SPF_EN_SHIFT, val);
1123*493d26c5SEd Maste }
1124*493d26c5SEd Maste 
hw_atl_rpf_l4_dpf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1125*493d26c5SEd Maste void hw_atl_rpf_l4_dpf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1126*493d26c5SEd Maste {
1127*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_DPF_EN_ADR(filter),
1128*493d26c5SEd Maste 			HW_ATL_RPF_L4_DPF_EN_MSK,
1129*493d26c5SEd Maste 			HW_ATL_RPF_L4_DPF_EN_SHIFT, val);
1130*493d26c5SEd Maste }
1131*493d26c5SEd Maste 
hw_atl_rpf_l4_protf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1132*493d26c5SEd Maste void hw_atl_rpf_l4_protf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1133*493d26c5SEd Maste {
1134*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_PROTF_EN_ADR(filter),
1135*493d26c5SEd Maste 			HW_ATL_RPF_L4_PROTF_EN_MSK,
1136*493d26c5SEd Maste 			HW_ATL_RPF_L4_PROTF_EN_SHIFT, val);
1137*493d26c5SEd Maste }
1138*493d26c5SEd Maste 
hw_atl_rpf_l3_arpf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1139*493d26c5SEd Maste void hw_atl_rpf_l3_arpf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1140*493d26c5SEd Maste {
1141*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_ARPF_EN_ADR(filter),
1142*493d26c5SEd Maste 			HW_ATL_RPF_L3_ARPF_EN_MSK,
1143*493d26c5SEd Maste 			HW_ATL_RPF_L3_ARPF_EN_SHIFT, val);
1144*493d26c5SEd Maste }
1145*493d26c5SEd Maste 
hw_atl_rpf_l3_l4_rxqf_en_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1146*493d26c5SEd Maste void hw_atl_rpf_l3_l4_rxqf_en_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1147*493d26c5SEd Maste {
1148*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_L4_RXQF_EN_ADR(filter),
1149*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_RXQF_EN_MSK,
1150*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_RXQF_EN_SHIFT, val);
1151*493d26c5SEd Maste }
1152*493d26c5SEd Maste 
hw_atl_rpf_l3_l4_mng_rxqf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1153*493d26c5SEd Maste void hw_atl_rpf_l3_l4_mng_rxqf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1154*493d26c5SEd Maste {
1155*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_L4_MNG_RXQF_ADR(filter),
1156*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_MNG_RXQF_MSK,
1157*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_MNG_RXQF_SHIFT, val);
1158*493d26c5SEd Maste }
1159*493d26c5SEd Maste 
hw_atl_rpf_l3_l4_actf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1160*493d26c5SEd Maste void hw_atl_rpf_l3_l4_actf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1161*493d26c5SEd Maste {
1162*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_L4_ACTF_ADR(filter),
1163*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_ACTF_MSK,
1164*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_ACTF_SHIFT, val);
1165*493d26c5SEd Maste }
1166*493d26c5SEd Maste 
hw_atl_rpf_l3_l4_rxqf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1167*493d26c5SEd Maste void hw_atl_rpf_l3_l4_rxqf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1168*493d26c5SEd Maste {
1169*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L3_L4_RXQF_ADR(filter),
1170*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_RXQF_MSK,
1171*493d26c5SEd Maste 			HW_ATL_RPF_L3_L4_RXQF_SHIFT, val);
1172*493d26c5SEd Maste }
1173*493d26c5SEd Maste 
hw_atl_rpf_l4_protf_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1174*493d26c5SEd Maste void hw_atl_rpf_l4_protf_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1175*493d26c5SEd Maste {
1176*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_PROTF_ADR(filter),
1177*493d26c5SEd Maste 			HW_ATL_RPF_L4_PROTF_MSK,
1178*493d26c5SEd Maste 			HW_ATL_RPF_L4_PROTF_SHIFT, val);
1179*493d26c5SEd Maste }
1180*493d26c5SEd Maste 
hw_atl_rpf_l4_spd_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1181*493d26c5SEd Maste void hw_atl_rpf_l4_spd_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1182*493d26c5SEd Maste {
1183*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_SPD_ADR(filter),
1184*493d26c5SEd Maste 			HW_ATL_RPF_L4_SPD_MSK,
1185*493d26c5SEd Maste 			HW_ATL_RPF_L4_SPD_SHIFT, val);
1186*493d26c5SEd Maste }
1187*493d26c5SEd Maste 
hw_atl_rpf_l4_dpd_set(struct aq_hw_s * aq_hw,u32 val,u32 filter)1188*493d26c5SEd Maste void hw_atl_rpf_l4_dpd_set(struct aq_hw_s *aq_hw, u32 val, u32 filter)
1189*493d26c5SEd Maste {
1190*493d26c5SEd Maste 	aq_hw_write_reg_bit(aq_hw, HW_ATL_RPF_L4_DPD_ADR(filter),
1191*493d26c5SEd Maste 			HW_ATL_RPF_L4_DPD_MSK,
1192*493d26c5SEd Maste 			HW_ATL_RPF_L4_DPD_SHIFT, val);
1193*493d26c5SEd Maste }
1194*493d26c5SEd Maste 
rpf_vlan_inner_etht_set(struct aq_hw * aq_hw,u32 vlan_inner_etht)1195*493d26c5SEd Maste void rpf_vlan_inner_etht_set(struct aq_hw *aq_hw, u32 vlan_inner_etht)
1196*493d26c5SEd Maste {
1197*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_inner_tpid_adr,
1198*493d26c5SEd Maste                 rpf_vl_inner_tpid_msk,
1199*493d26c5SEd Maste                 rpf_vl_inner_tpid_shift,
1200*493d26c5SEd Maste                 vlan_inner_etht);
1201*493d26c5SEd Maste }
1202*493d26c5SEd Maste 
rpf_vlan_outer_etht_set(struct aq_hw * aq_hw,u32 vlan_outer_etht)1203*493d26c5SEd Maste void rpf_vlan_outer_etht_set(struct aq_hw *aq_hw, u32 vlan_outer_etht)
1204*493d26c5SEd Maste {
1205*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_outer_tpid_adr,
1206*493d26c5SEd Maste                 rpf_vl_outer_tpid_msk,
1207*493d26c5SEd Maste                 rpf_vl_outer_tpid_shift,
1208*493d26c5SEd Maste                 vlan_outer_etht);
1209*493d26c5SEd Maste }
1210*493d26c5SEd Maste 
rpf_vlan_prom_mode_en_set(struct aq_hw * aq_hw,u32 vlan_prom_mode_en)1211*493d26c5SEd Maste void rpf_vlan_prom_mode_en_set(struct aq_hw *aq_hw, u32 vlan_prom_mode_en)
1212*493d26c5SEd Maste {
1213*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_promis_mode_adr,
1214*493d26c5SEd Maste                 rpf_vl_promis_mode_msk,
1215*493d26c5SEd Maste                 rpf_vl_promis_mode_shift,
1216*493d26c5SEd Maste                 vlan_prom_mode_en);
1217*493d26c5SEd Maste }
1218*493d26c5SEd Maste 
rpf_vlan_accept_untagged_packets_set(struct aq_hw * aq_hw,u32 vlan_accept_untagged_packets)1219*493d26c5SEd Maste void rpf_vlan_accept_untagged_packets_set(struct aq_hw *aq_hw,
1220*493d26c5SEd Maste                       u32 vlan_accept_untagged_packets)
1221*493d26c5SEd Maste {
1222*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_accept_untagged_mode_adr,
1223*493d26c5SEd Maste                 rpf_vl_accept_untagged_mode_msk,
1224*493d26c5SEd Maste                 rpf_vl_accept_untagged_mode_shift,
1225*493d26c5SEd Maste                 vlan_accept_untagged_packets);
1226*493d26c5SEd Maste }
1227*493d26c5SEd Maste 
rpf_vlan_untagged_act_set(struct aq_hw * aq_hw,u32 vlan_untagged_act)1228*493d26c5SEd Maste void rpf_vlan_untagged_act_set(struct aq_hw *aq_hw, u32 vlan_untagged_act)
1229*493d26c5SEd Maste {
1230*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_untagged_act_adr,
1231*493d26c5SEd Maste                 rpf_vl_untagged_act_msk,
1232*493d26c5SEd Maste                 rpf_vl_untagged_act_shift,
1233*493d26c5SEd Maste                 vlan_untagged_act);
1234*493d26c5SEd Maste }
1235*493d26c5SEd Maste 
rpf_vlan_flr_en_set(struct aq_hw * aq_hw,u32 vlan_flr_en,u32 filter)1236*493d26c5SEd Maste void rpf_vlan_flr_en_set(struct aq_hw *aq_hw, u32 vlan_flr_en, u32 filter)
1237*493d26c5SEd Maste {
1238*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_en_f_adr(filter),
1239*493d26c5SEd Maste                 rpf_vl_en_f_msk,
1240*493d26c5SEd Maste                 rpf_vl_en_f_shift,
1241*493d26c5SEd Maste                 vlan_flr_en);
1242*493d26c5SEd Maste }
1243*493d26c5SEd Maste 
rpf_vlan_flr_act_set(struct aq_hw * aq_hw,u32 vlan_flr_act,u32 filter)1244*493d26c5SEd Maste void rpf_vlan_flr_act_set(struct aq_hw *aq_hw, u32 vlan_flr_act, u32 filter)
1245*493d26c5SEd Maste {
1246*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_act_f_adr(filter),
1247*493d26c5SEd Maste                 rpf_vl_act_f_msk,
1248*493d26c5SEd Maste                 rpf_vl_act_f_shift,
1249*493d26c5SEd Maste                 vlan_flr_act);
1250*493d26c5SEd Maste }
1251*493d26c5SEd Maste 
rpf_vlan_id_flr_set(struct aq_hw * aq_hw,u32 vlan_id_flr,u32 filter)1252*493d26c5SEd Maste void rpf_vlan_id_flr_set(struct aq_hw *aq_hw, u32 vlan_id_flr, u32 filter)
1253*493d26c5SEd Maste {
1254*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_vl_id_f_adr(filter),
1255*493d26c5SEd Maste                 rpf_vl_id_f_msk,
1256*493d26c5SEd Maste                 rpf_vl_id_f_shift,
1257*493d26c5SEd Maste                 vlan_id_flr);
1258*493d26c5SEd Maste }
1259*493d26c5SEd Maste 
rpf_etht_flr_en_set(struct aq_hw * aq_hw,u32 etht_flr_en,u32 filter)1260*493d26c5SEd Maste void rpf_etht_flr_en_set(struct aq_hw *aq_hw, u32 etht_flr_en, u32 filter)
1261*493d26c5SEd Maste {
1262*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_enf_adr(filter),
1263*493d26c5SEd Maste                 rpf_et_enf_msk,
1264*493d26c5SEd Maste                 rpf_et_enf_shift, etht_flr_en);
1265*493d26c5SEd Maste }
1266*493d26c5SEd Maste 
rpf_etht_user_priority_en_set(struct aq_hw * aq_hw,u32 etht_user_priority_en,u32 filter)1267*493d26c5SEd Maste void rpf_etht_user_priority_en_set(struct aq_hw *aq_hw,
1268*493d26c5SEd Maste                    u32 etht_user_priority_en, u32 filter)
1269*493d26c5SEd Maste {
1270*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_upfen_adr(filter),
1271*493d26c5SEd Maste                 rpf_et_upfen_msk, rpf_et_upfen_shift,
1272*493d26c5SEd Maste                 etht_user_priority_en);
1273*493d26c5SEd Maste }
1274*493d26c5SEd Maste 
rpf_etht_rx_queue_en_set(struct aq_hw * aq_hw,u32 etht_rx_queue_en,u32 filter)1275*493d26c5SEd Maste void rpf_etht_rx_queue_en_set(struct aq_hw *aq_hw, u32 etht_rx_queue_en,
1276*493d26c5SEd Maste                   u32 filter)
1277*493d26c5SEd Maste {
1278*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_rxqfen_adr(filter),
1279*493d26c5SEd Maste                 rpf_et_rxqfen_msk, rpf_et_rxqfen_shift,
1280*493d26c5SEd Maste                 etht_rx_queue_en);
1281*493d26c5SEd Maste }
1282*493d26c5SEd Maste 
rpf_etht_user_priority_set(struct aq_hw * aq_hw,u32 etht_user_priority,u32 filter)1283*493d26c5SEd Maste void rpf_etht_user_priority_set(struct aq_hw *aq_hw, u32 etht_user_priority,
1284*493d26c5SEd Maste                 u32 filter)
1285*493d26c5SEd Maste {
1286*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_upf_adr(filter),
1287*493d26c5SEd Maste                 rpf_et_upf_msk,
1288*493d26c5SEd Maste                 rpf_et_upf_shift, etht_user_priority);
1289*493d26c5SEd Maste }
1290*493d26c5SEd Maste 
rpf_etht_rx_queue_set(struct aq_hw * aq_hw,u32 etht_rx_queue,u32 filter)1291*493d26c5SEd Maste void rpf_etht_rx_queue_set(struct aq_hw *aq_hw, u32 etht_rx_queue,
1292*493d26c5SEd Maste                u32 filter)
1293*493d26c5SEd Maste {
1294*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_rxqf_adr(filter),
1295*493d26c5SEd Maste                 rpf_et_rxqf_msk,
1296*493d26c5SEd Maste                 rpf_et_rxqf_shift, etht_rx_queue);
1297*493d26c5SEd Maste }
1298*493d26c5SEd Maste 
rpf_etht_mgt_queue_set(struct aq_hw * aq_hw,u32 etht_mgt_queue,u32 filter)1299*493d26c5SEd Maste void rpf_etht_mgt_queue_set(struct aq_hw *aq_hw, u32 etht_mgt_queue,
1300*493d26c5SEd Maste                 u32 filter)
1301*493d26c5SEd Maste {
1302*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_mng_rxqf_adr(filter),
1303*493d26c5SEd Maste                 rpf_et_mng_rxqf_msk, rpf_et_mng_rxqf_shift,
1304*493d26c5SEd Maste                 etht_mgt_queue);
1305*493d26c5SEd Maste }
1306*493d26c5SEd Maste 
rpf_etht_flr_act_set(struct aq_hw * aq_hw,u32 etht_flr_act,u32 filter)1307*493d26c5SEd Maste void rpf_etht_flr_act_set(struct aq_hw *aq_hw, u32 etht_flr_act, u32 filter)
1308*493d26c5SEd Maste {
1309*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_actf_adr(filter),
1310*493d26c5SEd Maste                 rpf_et_actf_msk,
1311*493d26c5SEd Maste                 rpf_et_actf_shift, etht_flr_act);
1312*493d26c5SEd Maste }
1313*493d26c5SEd Maste 
rpf_etht_flr_set(struct aq_hw * aq_hw,u32 etht_flr,u32 filter)1314*493d26c5SEd Maste void rpf_etht_flr_set(struct aq_hw *aq_hw, u32 etht_flr, u32 filter)
1315*493d26c5SEd Maste {
1316*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpf_et_valf_adr(filter),
1317*493d26c5SEd Maste                 rpf_et_valf_msk,
1318*493d26c5SEd Maste                 rpf_et_valf_shift, etht_flr);
1319*493d26c5SEd Maste }
1320*493d26c5SEd Maste 
1321*493d26c5SEd Maste /* RPO: rx packet offload */
rpo_ipv4header_crc_offload_en_set(struct aq_hw * aq_hw,u32 ipv4header_crc_offload_en)1322*493d26c5SEd Maste void rpo_ipv4header_crc_offload_en_set(struct aq_hw *aq_hw,
1323*493d26c5SEd Maste                        u32 ipv4header_crc_offload_en)
1324*493d26c5SEd Maste {
1325*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_ipv4chk_en_adr,
1326*493d26c5SEd Maste                 rpo_ipv4chk_en_msk,
1327*493d26c5SEd Maste                 rpo_ipv4chk_en_shift,
1328*493d26c5SEd Maste                 ipv4header_crc_offload_en);
1329*493d26c5SEd Maste }
1330*493d26c5SEd Maste 
rpo_rx_desc_vlan_stripping_set(struct aq_hw * aq_hw,u32 rx_desc_vlan_stripping,u32 descriptor)1331*493d26c5SEd Maste void rpo_rx_desc_vlan_stripping_set(struct aq_hw *aq_hw,
1332*493d26c5SEd Maste                     u32 rx_desc_vlan_stripping, u32 descriptor)
1333*493d26c5SEd Maste {
1334*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_descdvl_strip_adr(descriptor),
1335*493d26c5SEd Maste                 rpo_descdvl_strip_msk,
1336*493d26c5SEd Maste                 rpo_descdvl_strip_shift,
1337*493d26c5SEd Maste                 rx_desc_vlan_stripping);
1338*493d26c5SEd Maste }
1339*493d26c5SEd Maste 
rpo_tcp_udp_crc_offload_en_set(struct aq_hw * aq_hw,u32 tcp_udp_crc_offload_en)1340*493d26c5SEd Maste void rpo_tcp_udp_crc_offload_en_set(struct aq_hw *aq_hw,
1341*493d26c5SEd Maste                     u32 tcp_udp_crc_offload_en)
1342*493d26c5SEd Maste {
1343*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpol4chk_en_adr, rpol4chk_en_msk,
1344*493d26c5SEd Maste                 rpol4chk_en_shift, tcp_udp_crc_offload_en);
1345*493d26c5SEd Maste }
1346*493d26c5SEd Maste 
rpo_lro_en_set(struct aq_hw * aq_hw,u32 lro_en)1347*493d26c5SEd Maste void rpo_lro_en_set(struct aq_hw *aq_hw, u32 lro_en)
1348*493d26c5SEd Maste {
1349*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rpo_lro_en_adr, lro_en);
1350*493d26c5SEd Maste }
1351*493d26c5SEd Maste 
rpo_lro_patch_optimization_en_set(struct aq_hw * aq_hw,u32 lro_patch_optimization_en)1352*493d26c5SEd Maste void rpo_lro_patch_optimization_en_set(struct aq_hw *aq_hw,
1353*493d26c5SEd Maste                        u32 lro_patch_optimization_en)
1354*493d26c5SEd Maste {
1355*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_ptopt_en_adr,
1356*493d26c5SEd Maste                 rpo_lro_ptopt_en_msk,
1357*493d26c5SEd Maste                 rpo_lro_ptopt_en_shift,
1358*493d26c5SEd Maste                 lro_patch_optimization_en);
1359*493d26c5SEd Maste }
1360*493d26c5SEd Maste 
rpo_lro_qsessions_lim_set(struct aq_hw * aq_hw,u32 lro_qsessions_lim)1361*493d26c5SEd Maste void rpo_lro_qsessions_lim_set(struct aq_hw *aq_hw,
1362*493d26c5SEd Maste                    u32 lro_qsessions_lim)
1363*493d26c5SEd Maste {
1364*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_qses_lmt_adr,
1365*493d26c5SEd Maste                 rpo_lro_qses_lmt_msk,
1366*493d26c5SEd Maste                 rpo_lro_qses_lmt_shift,
1367*493d26c5SEd Maste                 lro_qsessions_lim);
1368*493d26c5SEd Maste }
1369*493d26c5SEd Maste 
rpo_lro_total_desc_lim_set(struct aq_hw * aq_hw,u32 lro_total_desc_lim)1370*493d26c5SEd Maste void rpo_lro_total_desc_lim_set(struct aq_hw *aq_hw, u32 lro_total_desc_lim)
1371*493d26c5SEd Maste {
1372*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_tot_dsc_lmt_adr,
1373*493d26c5SEd Maste                 rpo_lro_tot_dsc_lmt_msk,
1374*493d26c5SEd Maste                 rpo_lro_tot_dsc_lmt_shift,
1375*493d26c5SEd Maste                 lro_total_desc_lim);
1376*493d26c5SEd Maste }
1377*493d26c5SEd Maste 
rpo_lro_min_pay_of_first_pkt_set(struct aq_hw * aq_hw,u32 lro_min_pld_of_first_pkt)1378*493d26c5SEd Maste void rpo_lro_min_pay_of_first_pkt_set(struct aq_hw *aq_hw,
1379*493d26c5SEd Maste                       u32 lro_min_pld_of_first_pkt)
1380*493d26c5SEd Maste {
1381*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_pkt_min_adr,
1382*493d26c5SEd Maste                 rpo_lro_pkt_min_msk,
1383*493d26c5SEd Maste                 rpo_lro_pkt_min_shift,
1384*493d26c5SEd Maste                 lro_min_pld_of_first_pkt);
1385*493d26c5SEd Maste }
1386*493d26c5SEd Maste 
rpo_lro_pkt_lim_set(struct aq_hw * aq_hw,u32 lro_pkt_lim)1387*493d26c5SEd Maste void rpo_lro_pkt_lim_set(struct aq_hw *aq_hw, u32 lro_pkt_lim)
1388*493d26c5SEd Maste {
1389*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, rpo_lro_rsc_max_adr, lro_pkt_lim);
1390*493d26c5SEd Maste }
1391*493d26c5SEd Maste 
rpo_lro_max_num_of_descriptors_set(struct aq_hw * aq_hw,u32 lro_max_number_of_descriptors,u32 lro)1392*493d26c5SEd Maste void rpo_lro_max_num_of_descriptors_set(struct aq_hw *aq_hw,
1393*493d26c5SEd Maste                     u32 lro_max_number_of_descriptors,
1394*493d26c5SEd Maste                     u32 lro)
1395*493d26c5SEd Maste {
1396*493d26c5SEd Maste /* Register address for bitfield lro{L}_des_max[1:0] */
1397*493d26c5SEd Maste     static u32 rpo_lro_ldes_max_adr[32] = {
1398*493d26c5SEd Maste             0x000055A0U, 0x000055A0U, 0x000055A0U, 0x000055A0U,
1399*493d26c5SEd Maste             0x000055A0U, 0x000055A0U, 0x000055A0U, 0x000055A0U,
1400*493d26c5SEd Maste             0x000055A4U, 0x000055A4U, 0x000055A4U, 0x000055A4U,
1401*493d26c5SEd Maste             0x000055A4U, 0x000055A4U, 0x000055A4U, 0x000055A4U,
1402*493d26c5SEd Maste             0x000055A8U, 0x000055A8U, 0x000055A8U, 0x000055A8U,
1403*493d26c5SEd Maste             0x000055A8U, 0x000055A8U, 0x000055A8U, 0x000055A8U,
1404*493d26c5SEd Maste             0x000055ACU, 0x000055ACU, 0x000055ACU, 0x000055ACU,
1405*493d26c5SEd Maste             0x000055ACU, 0x000055ACU, 0x000055ACU, 0x000055ACU
1406*493d26c5SEd Maste         };
1407*493d26c5SEd Maste 
1408*493d26c5SEd Maste /* Bitmask for bitfield lro{L}_des_max[1:0] */
1409*493d26c5SEd Maste     static u32 rpo_lro_ldes_max_msk[32] = {
1410*493d26c5SEd Maste             0x00000003U, 0x00000030U, 0x00000300U, 0x00003000U,
1411*493d26c5SEd Maste             0x00030000U, 0x00300000U, 0x03000000U, 0x30000000U,
1412*493d26c5SEd Maste             0x00000003U, 0x00000030U, 0x00000300U, 0x00003000U,
1413*493d26c5SEd Maste             0x00030000U, 0x00300000U, 0x03000000U, 0x30000000U,
1414*493d26c5SEd Maste             0x00000003U, 0x00000030U, 0x00000300U, 0x00003000U,
1415*493d26c5SEd Maste             0x00030000U, 0x00300000U, 0x03000000U, 0x30000000U,
1416*493d26c5SEd Maste             0x00000003U, 0x00000030U, 0x00000300U, 0x00003000U,
1417*493d26c5SEd Maste             0x00030000U, 0x00300000U, 0x03000000U, 0x30000000U
1418*493d26c5SEd Maste         };
1419*493d26c5SEd Maste 
1420*493d26c5SEd Maste /* Lower bit position of bitfield lro{L}_des_max[1:0] */
1421*493d26c5SEd Maste     static u32 rpo_lro_ldes_max_shift[32] = {
1422*493d26c5SEd Maste             0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1423*493d26c5SEd Maste             0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1424*493d26c5SEd Maste             0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1425*493d26c5SEd Maste             0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U
1426*493d26c5SEd Maste         };
1427*493d26c5SEd Maste 
1428*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_ldes_max_adr[lro],
1429*493d26c5SEd Maste                 rpo_lro_ldes_max_msk[lro],
1430*493d26c5SEd Maste                 rpo_lro_ldes_max_shift[lro],
1431*493d26c5SEd Maste                 lro_max_number_of_descriptors);
1432*493d26c5SEd Maste }
1433*493d26c5SEd Maste 
rpo_lro_time_base_divider_set(struct aq_hw * aq_hw,u32 lro_time_base_divider)1434*493d26c5SEd Maste void rpo_lro_time_base_divider_set(struct aq_hw *aq_hw,
1435*493d26c5SEd Maste                    u32 lro_time_base_divider)
1436*493d26c5SEd Maste {
1437*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_tb_div_adr,
1438*493d26c5SEd Maste                 rpo_lro_tb_div_msk,
1439*493d26c5SEd Maste                 rpo_lro_tb_div_shift,
1440*493d26c5SEd Maste                 lro_time_base_divider);
1441*493d26c5SEd Maste }
1442*493d26c5SEd Maste 
rpo_lro_inactive_interval_set(struct aq_hw * aq_hw,u32 lro_inactive_interval)1443*493d26c5SEd Maste void rpo_lro_inactive_interval_set(struct aq_hw *aq_hw,
1444*493d26c5SEd Maste                    u32 lro_inactive_interval)
1445*493d26c5SEd Maste {
1446*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_ina_ival_adr,
1447*493d26c5SEd Maste                 rpo_lro_ina_ival_msk,
1448*493d26c5SEd Maste                 rpo_lro_ina_ival_shift,
1449*493d26c5SEd Maste                 lro_inactive_interval);
1450*493d26c5SEd Maste }
1451*493d26c5SEd Maste 
rpo_lro_max_coalescing_interval_set(struct aq_hw * aq_hw,u32 lro_max_coalescing_interval)1452*493d26c5SEd Maste void rpo_lro_max_coalescing_interval_set(struct aq_hw *aq_hw,
1453*493d26c5SEd Maste                      u32 lro_max_coalescing_interval)
1454*493d26c5SEd Maste {
1455*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rpo_lro_max_ival_adr,
1456*493d26c5SEd Maste                 rpo_lro_max_ival_msk,
1457*493d26c5SEd Maste                 rpo_lro_max_ival_shift,
1458*493d26c5SEd Maste                 lro_max_coalescing_interval);
1459*493d26c5SEd Maste }
1460*493d26c5SEd Maste 
1461*493d26c5SEd Maste /* rx */
rx_rx_reg_res_dis_set(struct aq_hw * aq_hw,u32 rx_reg_res_dis)1462*493d26c5SEd Maste void rx_rx_reg_res_dis_set(struct aq_hw *aq_hw, u32 rx_reg_res_dis)
1463*493d26c5SEd Maste {
1464*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rx_reg_res_dsbl_adr,
1465*493d26c5SEd Maste                 rx_reg_res_dsbl_msk,
1466*493d26c5SEd Maste                 rx_reg_res_dsbl_shift,
1467*493d26c5SEd Maste                 rx_reg_res_dis);
1468*493d26c5SEd Maste }
1469*493d26c5SEd Maste 
1470*493d26c5SEd Maste /* tdm */
tdm_cpu_id_set(struct aq_hw * aq_hw,u32 cpuid,u32 dca)1471*493d26c5SEd Maste void tdm_cpu_id_set(struct aq_hw *aq_hw, u32 cpuid, u32 dca)
1472*493d26c5SEd Maste {
1473*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_dcadcpuid_adr(dca),
1474*493d26c5SEd Maste                 tdm_dcadcpuid_msk,
1475*493d26c5SEd Maste                 tdm_dcadcpuid_shift, cpuid);
1476*493d26c5SEd Maste }
1477*493d26c5SEd Maste 
tdm_large_send_offload_en_set(struct aq_hw * aq_hw,u32 large_send_offload_en)1478*493d26c5SEd Maste void tdm_large_send_offload_en_set(struct aq_hw *aq_hw,
1479*493d26c5SEd Maste                    u32 large_send_offload_en)
1480*493d26c5SEd Maste {
1481*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, tdm_lso_en_adr, large_send_offload_en);
1482*493d26c5SEd Maste }
1483*493d26c5SEd Maste 
tdm_tx_dca_en_set(struct aq_hw * aq_hw,u32 tx_dca_en)1484*493d26c5SEd Maste void tdm_tx_dca_en_set(struct aq_hw *aq_hw, u32 tx_dca_en)
1485*493d26c5SEd Maste {
1486*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_dca_en_adr, tdm_dca_en_msk,
1487*493d26c5SEd Maste                 tdm_dca_en_shift, tx_dca_en);
1488*493d26c5SEd Maste }
1489*493d26c5SEd Maste 
tdm_tx_dca_mode_set(struct aq_hw * aq_hw,u32 tx_dca_mode)1490*493d26c5SEd Maste void tdm_tx_dca_mode_set(struct aq_hw *aq_hw, u32 tx_dca_mode)
1491*493d26c5SEd Maste {
1492*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_dca_mode_adr, tdm_dca_mode_msk,
1493*493d26c5SEd Maste                 tdm_dca_mode_shift, tx_dca_mode);
1494*493d26c5SEd Maste }
1495*493d26c5SEd Maste 
tdm_tx_desc_dca_en_set(struct aq_hw * aq_hw,u32 tx_desc_dca_en,u32 dca)1496*493d26c5SEd Maste void tdm_tx_desc_dca_en_set(struct aq_hw *aq_hw, u32 tx_desc_dca_en, u32 dca)
1497*493d26c5SEd Maste {
1498*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_dcaddesc_en_adr(dca),
1499*493d26c5SEd Maste                 tdm_dcaddesc_en_msk, tdm_dcaddesc_en_shift,
1500*493d26c5SEd Maste                 tx_desc_dca_en);
1501*493d26c5SEd Maste }
1502*493d26c5SEd Maste 
tdm_tx_desc_en_set(struct aq_hw * aq_hw,u32 tx_desc_en,u32 descriptor)1503*493d26c5SEd Maste void tdm_tx_desc_en_set(struct aq_hw *aq_hw, u32 tx_desc_en, u32 descriptor)
1504*493d26c5SEd Maste {
1505*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_descden_adr(descriptor),
1506*493d26c5SEd Maste                 tdm_descden_msk,
1507*493d26c5SEd Maste                 tdm_descden_shift,
1508*493d26c5SEd Maste                 tx_desc_en);
1509*493d26c5SEd Maste }
1510*493d26c5SEd Maste 
tdm_tx_desc_head_ptr_get(struct aq_hw * aq_hw,u32 descriptor)1511*493d26c5SEd Maste u32 tdm_tx_desc_head_ptr_get(struct aq_hw *aq_hw, u32 descriptor)
1512*493d26c5SEd Maste {
1513*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, tdm_descdhd_adr(descriptor),
1514*493d26c5SEd Maste                   tdm_descdhd_msk, tdm_descdhd_shift);
1515*493d26c5SEd Maste }
1516*493d26c5SEd Maste 
tdm_tx_desc_len_set(struct aq_hw * aq_hw,u32 tx_desc_len,u32 descriptor)1517*493d26c5SEd Maste void tdm_tx_desc_len_set(struct aq_hw *aq_hw, u32 tx_desc_len,
1518*493d26c5SEd Maste              u32 descriptor)
1519*493d26c5SEd Maste {
1520*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_descdlen_adr(descriptor),
1521*493d26c5SEd Maste                 tdm_descdlen_msk,
1522*493d26c5SEd Maste                 tdm_descdlen_shift,
1523*493d26c5SEd Maste                 tx_desc_len);
1524*493d26c5SEd Maste }
1525*493d26c5SEd Maste 
tdm_tx_desc_wr_wb_irq_en_set(struct aq_hw * aq_hw,u32 tx_desc_wr_wb_irq_en)1526*493d26c5SEd Maste void tdm_tx_desc_wr_wb_irq_en_set(struct aq_hw *aq_hw,
1527*493d26c5SEd Maste                   u32 tx_desc_wr_wb_irq_en)
1528*493d26c5SEd Maste {
1529*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_int_desc_wrb_en_adr,
1530*493d26c5SEd Maste                 tdm_int_desc_wrb_en_msk,
1531*493d26c5SEd Maste                 tdm_int_desc_wrb_en_shift,
1532*493d26c5SEd Maste                 tx_desc_wr_wb_irq_en);
1533*493d26c5SEd Maste }
1534*493d26c5SEd Maste 
tdm_tx_desc_wr_wb_threshold_set(struct aq_hw * aq_hw,u32 tx_desc_wr_wb_threshold,u32 descriptor)1535*493d26c5SEd Maste void tdm_tx_desc_wr_wb_threshold_set(struct aq_hw *aq_hw,
1536*493d26c5SEd Maste                      u32 tx_desc_wr_wb_threshold,
1537*493d26c5SEd Maste                      u32 descriptor)
1538*493d26c5SEd Maste {
1539*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_descdwrb_thresh_adr(descriptor),
1540*493d26c5SEd Maste                 tdm_descdwrb_thresh_msk,
1541*493d26c5SEd Maste                 tdm_descdwrb_thresh_shift,
1542*493d26c5SEd Maste                 tx_desc_wr_wb_threshold);
1543*493d26c5SEd Maste }
1544*493d26c5SEd Maste 
tdm_tdm_intr_moder_en_set(struct aq_hw * aq_hw,u32 tdm_irq_moderation_en)1545*493d26c5SEd Maste void tdm_tdm_intr_moder_en_set(struct aq_hw *aq_hw,
1546*493d26c5SEd Maste                    u32 tdm_irq_moderation_en)
1547*493d26c5SEd Maste {
1548*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tdm_int_mod_en_adr,
1549*493d26c5SEd Maste                 tdm_int_mod_en_msk,
1550*493d26c5SEd Maste                 tdm_int_mod_en_shift,
1551*493d26c5SEd Maste                 tdm_irq_moderation_en);
1552*493d26c5SEd Maste }
1553*493d26c5SEd Maste 
1554*493d26c5SEd Maste /* thm */
thm_lso_tcp_flag_of_first_pkt_set(struct aq_hw * aq_hw,u32 lso_tcp_flag_of_first_pkt)1555*493d26c5SEd Maste void thm_lso_tcp_flag_of_first_pkt_set(struct aq_hw *aq_hw,
1556*493d26c5SEd Maste                        u32 lso_tcp_flag_of_first_pkt)
1557*493d26c5SEd Maste {
1558*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, thm_lso_tcp_flag_first_adr,
1559*493d26c5SEd Maste                 thm_lso_tcp_flag_first_msk,
1560*493d26c5SEd Maste                 thm_lso_tcp_flag_first_shift,
1561*493d26c5SEd Maste                 lso_tcp_flag_of_first_pkt);
1562*493d26c5SEd Maste }
1563*493d26c5SEd Maste 
thm_lso_tcp_flag_of_last_pkt_set(struct aq_hw * aq_hw,u32 lso_tcp_flag_of_last_pkt)1564*493d26c5SEd Maste void thm_lso_tcp_flag_of_last_pkt_set(struct aq_hw *aq_hw,
1565*493d26c5SEd Maste                       u32 lso_tcp_flag_of_last_pkt)
1566*493d26c5SEd Maste {
1567*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, thm_lso_tcp_flag_last_adr,
1568*493d26c5SEd Maste                 thm_lso_tcp_flag_last_msk,
1569*493d26c5SEd Maste                 thm_lso_tcp_flag_last_shift,
1570*493d26c5SEd Maste                 lso_tcp_flag_of_last_pkt);
1571*493d26c5SEd Maste }
1572*493d26c5SEd Maste 
thm_lso_tcp_flag_of_middle_pkt_set(struct aq_hw * aq_hw,u32 lso_tcp_flag_of_middle_pkt)1573*493d26c5SEd Maste void thm_lso_tcp_flag_of_middle_pkt_set(struct aq_hw *aq_hw,
1574*493d26c5SEd Maste                     u32 lso_tcp_flag_of_middle_pkt)
1575*493d26c5SEd Maste {
1576*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, thm_lso_tcp_flag_mid_adr,
1577*493d26c5SEd Maste                 thm_lso_tcp_flag_mid_msk,
1578*493d26c5SEd Maste                 thm_lso_tcp_flag_mid_shift,
1579*493d26c5SEd Maste                 lso_tcp_flag_of_middle_pkt);
1580*493d26c5SEd Maste }
1581*493d26c5SEd Maste 
1582*493d26c5SEd Maste /* TPB: tx packet buffer */
tpb_tx_buff_en_set(struct aq_hw * aq_hw,u32 tx_buff_en)1583*493d26c5SEd Maste void tpb_tx_buff_en_set(struct aq_hw *aq_hw, u32 tx_buff_en)
1584*493d26c5SEd Maste {
1585*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_tx_buf_en_adr, tpb_tx_buf_en_msk,
1586*493d26c5SEd Maste                 tpb_tx_buf_en_shift, tx_buff_en);
1587*493d26c5SEd Maste }
1588*493d26c5SEd Maste 
tpb_tx_tc_mode_set(struct aq_hw * aq_hw,u32 tc_mode)1589*493d26c5SEd Maste void tpb_tx_tc_mode_set(struct aq_hw *aq_hw, u32 tc_mode)
1590*493d26c5SEd Maste {
1591*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_tx_tc_mode_adr, tpb_tx_tc_mode_msk,
1592*493d26c5SEd Maste                 tpb_tx_tc_mode_shift, tc_mode);
1593*493d26c5SEd Maste }
1594*493d26c5SEd Maste 
tpb_tx_buff_hi_threshold_per_tc_set(struct aq_hw * aq_hw,u32 tx_buff_hi_threshold_per_tc,u32 buffer)1595*493d26c5SEd Maste void tpb_tx_buff_hi_threshold_per_tc_set(struct aq_hw *aq_hw,
1596*493d26c5SEd Maste                      u32 tx_buff_hi_threshold_per_tc,
1597*493d26c5SEd Maste                      u32 buffer)
1598*493d26c5SEd Maste {
1599*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_txbhi_thresh_adr(buffer),
1600*493d26c5SEd Maste                 tpb_txbhi_thresh_msk, tpb_txbhi_thresh_shift,
1601*493d26c5SEd Maste                 tx_buff_hi_threshold_per_tc);
1602*493d26c5SEd Maste }
1603*493d26c5SEd Maste 
tpb_tx_buff_lo_threshold_per_tc_set(struct aq_hw * aq_hw,u32 tx_buff_lo_threshold_per_tc,u32 buffer)1604*493d26c5SEd Maste void tpb_tx_buff_lo_threshold_per_tc_set(struct aq_hw *aq_hw,
1605*493d26c5SEd Maste                      u32 tx_buff_lo_threshold_per_tc,
1606*493d26c5SEd Maste                      u32 buffer)
1607*493d26c5SEd Maste {
1608*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_txblo_thresh_adr(buffer),
1609*493d26c5SEd Maste                 tpb_txblo_thresh_msk, tpb_txblo_thresh_shift,
1610*493d26c5SEd Maste                 tx_buff_lo_threshold_per_tc);
1611*493d26c5SEd Maste }
1612*493d26c5SEd Maste 
tpb_tx_dma_sys_lbk_en_set(struct aq_hw * aq_hw,u32 tx_dma_sys_lbk_en)1613*493d26c5SEd Maste void tpb_tx_dma_sys_lbk_en_set(struct aq_hw *aq_hw, u32 tx_dma_sys_lbk_en)
1614*493d26c5SEd Maste {
1615*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_dma_sys_lbk_adr,
1616*493d26c5SEd Maste                 tpb_dma_sys_lbk_msk,
1617*493d26c5SEd Maste                 tpb_dma_sys_lbk_shift,
1618*493d26c5SEd Maste                 tx_dma_sys_lbk_en);
1619*493d26c5SEd Maste }
1620*493d26c5SEd Maste 
rdm_rx_dma_desc_cache_init_tgl(struct aq_hw * aq_hw)1621*493d26c5SEd Maste void rdm_rx_dma_desc_cache_init_tgl(struct aq_hw *aq_hw)
1622*493d26c5SEd Maste {
1623*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, rdm_rx_dma_desc_cache_init_adr,
1624*493d26c5SEd Maste                 rdm_rx_dma_desc_cache_init_msk,
1625*493d26c5SEd Maste                 rdm_rx_dma_desc_cache_init_shift,
1626*493d26c5SEd Maste                 AQ_READ_REG_BIT(aq_hw, rdm_rx_dma_desc_cache_init_adr,
1627*493d26c5SEd Maste                 rdm_rx_dma_desc_cache_init_msk,
1628*493d26c5SEd Maste                 rdm_rx_dma_desc_cache_init_shift) ^ 1
1629*493d26c5SEd Maste     );
1630*493d26c5SEd Maste }
1631*493d26c5SEd Maste 
tpb_tx_pkt_buff_size_per_tc_set(struct aq_hw * aq_hw,u32 tx_pkt_buff_size_per_tc,u32 buffer)1632*493d26c5SEd Maste void tpb_tx_pkt_buff_size_per_tc_set(struct aq_hw *aq_hw,
1633*493d26c5SEd Maste                      u32 tx_pkt_buff_size_per_tc, u32 buffer)
1634*493d26c5SEd Maste {
1635*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_txbbuf_size_adr(buffer),
1636*493d26c5SEd Maste                 tpb_txbbuf_size_msk,
1637*493d26c5SEd Maste                 tpb_txbbuf_size_shift,
1638*493d26c5SEd Maste                 tx_pkt_buff_size_per_tc);
1639*493d26c5SEd Maste }
1640*493d26c5SEd Maste 
tpb_tx_path_scp_ins_en_set(struct aq_hw * aq_hw,u32 tx_path_scp_ins_en)1641*493d26c5SEd Maste void tpb_tx_path_scp_ins_en_set(struct aq_hw *aq_hw, u32 tx_path_scp_ins_en)
1642*493d26c5SEd Maste {
1643*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpb_tx_scp_ins_en_adr,
1644*493d26c5SEd Maste                 tpb_tx_scp_ins_en_msk,
1645*493d26c5SEd Maste                 tpb_tx_scp_ins_en_shift,
1646*493d26c5SEd Maste                 tx_path_scp_ins_en);
1647*493d26c5SEd Maste }
1648*493d26c5SEd Maste 
1649*493d26c5SEd Maste /* TPO: tx packet offload */
tpo_ipv4header_crc_offload_en_set(struct aq_hw * aq_hw,u32 ipv4header_crc_offload_en)1650*493d26c5SEd Maste void tpo_ipv4header_crc_offload_en_set(struct aq_hw *aq_hw,
1651*493d26c5SEd Maste                        u32 ipv4header_crc_offload_en)
1652*493d26c5SEd Maste {
1653*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpo_ipv4chk_en_adr,
1654*493d26c5SEd Maste                 tpo_ipv4chk_en_msk,
1655*493d26c5SEd Maste                 tpo_ipv4chk_en_shift,
1656*493d26c5SEd Maste                 ipv4header_crc_offload_en);
1657*493d26c5SEd Maste }
1658*493d26c5SEd Maste 
tpo_tcp_udp_crc_offload_en_set(struct aq_hw * aq_hw,u32 tcp_udp_crc_offload_en)1659*493d26c5SEd Maste void tpo_tcp_udp_crc_offload_en_set(struct aq_hw *aq_hw,
1660*493d26c5SEd Maste                     u32 tcp_udp_crc_offload_en)
1661*493d26c5SEd Maste {
1662*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpol4chk_en_adr,
1663*493d26c5SEd Maste                 tpol4chk_en_msk,
1664*493d26c5SEd Maste                 tpol4chk_en_shift,
1665*493d26c5SEd Maste                 tcp_udp_crc_offload_en);
1666*493d26c5SEd Maste }
1667*493d26c5SEd Maste 
tpo_tx_pkt_sys_lbk_en_set(struct aq_hw * aq_hw,u32 tx_pkt_sys_lbk_en)1668*493d26c5SEd Maste void tpo_tx_pkt_sys_lbk_en_set(struct aq_hw *aq_hw, u32 tx_pkt_sys_lbk_en)
1669*493d26c5SEd Maste {
1670*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tpo_pkt_sys_lbk_adr,
1671*493d26c5SEd Maste                 tpo_pkt_sys_lbk_msk,
1672*493d26c5SEd Maste                 tpo_pkt_sys_lbk_shift,
1673*493d26c5SEd Maste                 tx_pkt_sys_lbk_en);
1674*493d26c5SEd Maste }
1675*493d26c5SEd Maste 
1676*493d26c5SEd Maste /* TPS: tx packet scheduler */
tps_tx_pkt_shed_data_arb_mode_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_data_arb_mode)1677*493d26c5SEd Maste void tps_tx_pkt_shed_data_arb_mode_set(struct aq_hw *aq_hw,
1678*493d26c5SEd Maste                        u32 tx_pkt_shed_data_arb_mode)
1679*493d26c5SEd Maste {
1680*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_data_tc_arb_mode_adr,
1681*493d26c5SEd Maste                 tps_data_tc_arb_mode_msk,
1682*493d26c5SEd Maste                 tps_data_tc_arb_mode_shift,
1683*493d26c5SEd Maste                 tx_pkt_shed_data_arb_mode);
1684*493d26c5SEd Maste }
1685*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_rate_curr_time_res_set(struct aq_hw * aq_hw,u32 curr_time_res)1686*493d26c5SEd Maste void tps_tx_pkt_shed_desc_rate_curr_time_res_set(struct aq_hw *aq_hw,
1687*493d26c5SEd Maste                          u32 curr_time_res)
1688*493d26c5SEd Maste {
1689*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_rate_ta_rst_adr,
1690*493d26c5SEd Maste                 tps_desc_rate_ta_rst_msk,
1691*493d26c5SEd Maste                 tps_desc_rate_ta_rst_shift,
1692*493d26c5SEd Maste                 curr_time_res);
1693*493d26c5SEd Maste }
1694*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_rate_lim_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_desc_rate_lim)1695*493d26c5SEd Maste void tps_tx_pkt_shed_desc_rate_lim_set(struct aq_hw *aq_hw,
1696*493d26c5SEd Maste                        u32 tx_pkt_shed_desc_rate_lim)
1697*493d26c5SEd Maste {
1698*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_rate_lim_adr,
1699*493d26c5SEd Maste                 tps_desc_rate_lim_msk,
1700*493d26c5SEd Maste                 tps_desc_rate_lim_shift,
1701*493d26c5SEd Maste                 tx_pkt_shed_desc_rate_lim);
1702*493d26c5SEd Maste }
1703*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_tc_arb_mode_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_desc_tc_arb_mode)1704*493d26c5SEd Maste void tps_tx_pkt_shed_desc_tc_arb_mode_set(struct aq_hw *aq_hw,
1705*493d26c5SEd Maste                       u32 tx_pkt_shed_desc_tc_arb_mode)
1706*493d26c5SEd Maste {
1707*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_tc_arb_mode_adr,
1708*493d26c5SEd Maste                 tps_desc_tc_arb_mode_msk,
1709*493d26c5SEd Maste                 tps_desc_tc_arb_mode_shift,
1710*493d26c5SEd Maste                 tx_pkt_shed_desc_tc_arb_mode);
1711*493d26c5SEd Maste }
1712*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_desc_tc_max_credit,u32 tc)1713*493d26c5SEd Maste void tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw *aq_hw,
1714*493d26c5SEd Maste                         u32 tx_pkt_shed_desc_tc_max_credit,
1715*493d26c5SEd Maste                         u32 tc)
1716*493d26c5SEd Maste {
1717*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_tctcredit_max_adr(tc),
1718*493d26c5SEd Maste                 tps_desc_tctcredit_max_msk,
1719*493d26c5SEd Maste                 tps_desc_tctcredit_max_shift,
1720*493d26c5SEd Maste                 tx_pkt_shed_desc_tc_max_credit);
1721*493d26c5SEd Maste }
1722*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_tc_weight_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_desc_tc_weight,u32 tc)1723*493d26c5SEd Maste void tps_tx_pkt_shed_desc_tc_weight_set(struct aq_hw *aq_hw,
1724*493d26c5SEd Maste                     u32 tx_pkt_shed_desc_tc_weight, u32 tc)
1725*493d26c5SEd Maste {
1726*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_tctweight_adr(tc),
1727*493d26c5SEd Maste                 tps_desc_tctweight_msk,
1728*493d26c5SEd Maste                 tps_desc_tctweight_shift,
1729*493d26c5SEd Maste                 tx_pkt_shed_desc_tc_weight);
1730*493d26c5SEd Maste }
1731*493d26c5SEd Maste 
tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_desc_vm_arb_mode)1732*493d26c5SEd Maste void tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw *aq_hw,
1733*493d26c5SEd Maste                       u32 tx_pkt_shed_desc_vm_arb_mode)
1734*493d26c5SEd Maste {
1735*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_desc_vm_arb_mode_adr,
1736*493d26c5SEd Maste                 tps_desc_vm_arb_mode_msk,
1737*493d26c5SEd Maste                 tps_desc_vm_arb_mode_shift,
1738*493d26c5SEd Maste                 tx_pkt_shed_desc_vm_arb_mode);
1739*493d26c5SEd Maste }
1740*493d26c5SEd Maste 
tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_tc_data_max_credit,u32 tc)1741*493d26c5SEd Maste void tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw *aq_hw,
1742*493d26c5SEd Maste                         u32 tx_pkt_shed_tc_data_max_credit,
1743*493d26c5SEd Maste                         u32 tc)
1744*493d26c5SEd Maste {
1745*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_data_tctcredit_max_adr(tc),
1746*493d26c5SEd Maste                 tps_data_tctcredit_max_msk,
1747*493d26c5SEd Maste                 tps_data_tctcredit_max_shift,
1748*493d26c5SEd Maste                 tx_pkt_shed_tc_data_max_credit);
1749*493d26c5SEd Maste }
1750*493d26c5SEd Maste 
tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw * aq_hw,u32 tx_pkt_shed_tc_data_weight,u32 tc)1751*493d26c5SEd Maste void tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw *aq_hw,
1752*493d26c5SEd Maste                     u32 tx_pkt_shed_tc_data_weight, u32 tc)
1753*493d26c5SEd Maste {
1754*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tps_data_tctweight_adr(tc),
1755*493d26c5SEd Maste                 tps_data_tctweight_msk,
1756*493d26c5SEd Maste                 tps_data_tctweight_shift,
1757*493d26c5SEd Maste                 tx_pkt_shed_tc_data_weight);
1758*493d26c5SEd Maste }
1759*493d26c5SEd Maste 
1760*493d26c5SEd Maste /* tx */
tx_tx_reg_res_dis_set(struct aq_hw * aq_hw,u32 tx_reg_res_dis)1761*493d26c5SEd Maste void tx_tx_reg_res_dis_set(struct aq_hw *aq_hw, u32 tx_reg_res_dis)
1762*493d26c5SEd Maste {
1763*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, tx_reg_res_dsbl_adr,
1764*493d26c5SEd Maste                 tx_reg_res_dsbl_msk,
1765*493d26c5SEd Maste                 tx_reg_res_dsbl_shift, tx_reg_res_dis);
1766*493d26c5SEd Maste }
1767*493d26c5SEd Maste 
1768*493d26c5SEd Maste /* msm */
msm_reg_access_status_get(struct aq_hw * aq_hw)1769*493d26c5SEd Maste u32 msm_reg_access_status_get(struct aq_hw *aq_hw)
1770*493d26c5SEd Maste {
1771*493d26c5SEd Maste     return AQ_READ_REG_BIT(aq_hw, msm_reg_access_busy_adr,
1772*493d26c5SEd Maste                   msm_reg_access_busy_msk,
1773*493d26c5SEd Maste                   msm_reg_access_busy_shift);
1774*493d26c5SEd Maste }
1775*493d26c5SEd Maste 
msm_reg_addr_for_indirect_addr_set(struct aq_hw * aq_hw,u32 reg_addr_for_indirect_addr)1776*493d26c5SEd Maste void msm_reg_addr_for_indirect_addr_set(struct aq_hw *aq_hw,
1777*493d26c5SEd Maste                     u32 reg_addr_for_indirect_addr)
1778*493d26c5SEd Maste {
1779*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, msm_reg_addr_adr,
1780*493d26c5SEd Maste                 msm_reg_addr_msk,
1781*493d26c5SEd Maste                 msm_reg_addr_shift,
1782*493d26c5SEd Maste                 reg_addr_for_indirect_addr);
1783*493d26c5SEd Maste }
1784*493d26c5SEd Maste 
msm_reg_rd_strobe_set(struct aq_hw * aq_hw,u32 reg_rd_strobe)1785*493d26c5SEd Maste void msm_reg_rd_strobe_set(struct aq_hw *aq_hw, u32 reg_rd_strobe)
1786*493d26c5SEd Maste {
1787*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, msm_reg_rd_strobe_adr,
1788*493d26c5SEd Maste                 msm_reg_rd_strobe_msk,
1789*493d26c5SEd Maste                 msm_reg_rd_strobe_shift,
1790*493d26c5SEd Maste                 reg_rd_strobe);
1791*493d26c5SEd Maste }
1792*493d26c5SEd Maste 
msm_reg_rd_data_get(struct aq_hw * aq_hw)1793*493d26c5SEd Maste u32 msm_reg_rd_data_get(struct aq_hw *aq_hw)
1794*493d26c5SEd Maste {
1795*493d26c5SEd Maste     return AQ_READ_REG(aq_hw, msm_reg_rd_data_adr);
1796*493d26c5SEd Maste }
1797*493d26c5SEd Maste 
msm_reg_wr_data_set(struct aq_hw * aq_hw,u32 reg_wr_data)1798*493d26c5SEd Maste void msm_reg_wr_data_set(struct aq_hw *aq_hw, u32 reg_wr_data)
1799*493d26c5SEd Maste {
1800*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, msm_reg_wr_data_adr, reg_wr_data);
1801*493d26c5SEd Maste }
1802*493d26c5SEd Maste 
msm_reg_wr_strobe_set(struct aq_hw * aq_hw,u32 reg_wr_strobe)1803*493d26c5SEd Maste void msm_reg_wr_strobe_set(struct aq_hw *aq_hw, u32 reg_wr_strobe)
1804*493d26c5SEd Maste {
1805*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, msm_reg_wr_strobe_adr,
1806*493d26c5SEd Maste                 msm_reg_wr_strobe_msk,
1807*493d26c5SEd Maste                 msm_reg_wr_strobe_shift,
1808*493d26c5SEd Maste                 reg_wr_strobe);
1809*493d26c5SEd Maste }
1810*493d26c5SEd Maste 
1811*493d26c5SEd Maste /* pci */
pci_pci_reg_res_dis_set(struct aq_hw * aq_hw,u32 pci_reg_res_dis)1812*493d26c5SEd Maste void pci_pci_reg_res_dis_set(struct aq_hw *aq_hw, u32 pci_reg_res_dis)
1813*493d26c5SEd Maste {
1814*493d26c5SEd Maste     AQ_WRITE_REG_BIT(aq_hw, pci_reg_res_dsbl_adr,
1815*493d26c5SEd Maste                 pci_reg_res_dsbl_msk,
1816*493d26c5SEd Maste                 pci_reg_res_dsbl_shift,
1817*493d26c5SEd Maste                 pci_reg_res_dis);
1818*493d26c5SEd Maste }
1819*493d26c5SEd Maste 
reg_glb_cpu_scratch_scp_get(struct aq_hw * hw,u32 glb_cpu_scratch_scp_idx)1820*493d26c5SEd Maste u32 reg_glb_cpu_scratch_scp_get(struct aq_hw *hw, u32 glb_cpu_scratch_scp_idx)
1821*493d26c5SEd Maste {
1822*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_cpu_scratch_scp_adr(glb_cpu_scratch_scp_idx));
1823*493d26c5SEd Maste }
reg_glb_cpu_scratch_scp_set(struct aq_hw * aq_hw,u32 glb_cpu_scratch_scp,u32 scratch_scp)1824*493d26c5SEd Maste void reg_glb_cpu_scratch_scp_set(struct aq_hw *aq_hw, u32 glb_cpu_scratch_scp,
1825*493d26c5SEd Maste                  u32 scratch_scp)
1826*493d26c5SEd Maste {
1827*493d26c5SEd Maste     AQ_WRITE_REG(aq_hw, glb_cpu_scratch_scp_adr(scratch_scp),
1828*493d26c5SEd Maste             glb_cpu_scratch_scp);
1829*493d26c5SEd Maste }
1830*493d26c5SEd Maste 
reg_glb_cpu_no_reset_scratchpad_get(struct aq_hw * hw,u32 index)1831*493d26c5SEd Maste u32 reg_glb_cpu_no_reset_scratchpad_get(struct aq_hw *hw, u32 index)
1832*493d26c5SEd Maste {
1833*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_cpu_no_reset_scratchpad_adr(index));
1834*493d26c5SEd Maste }
reg_glb_cpu_no_reset_scratchpad_set(struct aq_hw * hw,u32 value,u32 index)1835*493d26c5SEd Maste void reg_glb_cpu_no_reset_scratchpad_set(struct aq_hw* hw, u32 value, u32 index)
1836*493d26c5SEd Maste {
1837*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_cpu_no_reset_scratchpad_adr(index), value);
1838*493d26c5SEd Maste }
1839*493d26c5SEd Maste 
reg_mif_power_gating_enable_control_set(struct aq_hw * hw,u32 value)1840*493d26c5SEd Maste void reg_mif_power_gating_enable_control_set(struct aq_hw* hw, u32 value)
1841*493d26c5SEd Maste {
1842*493d26c5SEd Maste     AQ_WRITE_REG(hw, mif_power_gating_enable_control_adr, value);
1843*493d26c5SEd Maste 
1844*493d26c5SEd Maste }
reg_mif_power_gating_enable_control_get(struct aq_hw * hw)1845*493d26c5SEd Maste u32 reg_mif_power_gating_enable_control_get(struct aq_hw* hw)
1846*493d26c5SEd Maste {
1847*493d26c5SEd Maste     return AQ_READ_REG(hw, mif_power_gating_enable_control_adr);
1848*493d26c5SEd Maste }
1849*493d26c5SEd Maste 
1850*493d26c5SEd Maste 
reg_glb_general_provisioning9_set(struct aq_hw * hw,u32 value)1851*493d26c5SEd Maste void reg_glb_general_provisioning9_set(struct aq_hw* hw, u32 value)
1852*493d26c5SEd Maste {
1853*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_general_provisioning9_adr, value);
1854*493d26c5SEd Maste }
reg_glb_general_provisioning9_get(struct aq_hw * hw)1855*493d26c5SEd Maste u32 reg_glb_general_provisioning9_get(struct aq_hw* hw)
1856*493d26c5SEd Maste {
1857*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_general_provisioning9_adr);
1858*493d26c5SEd Maste }
1859*493d26c5SEd Maste 
reg_glb_nvr_provisioning2_set(struct aq_hw * hw,u32 value)1860*493d26c5SEd Maste void reg_glb_nvr_provisioning2_set(struct aq_hw* hw, u32 value)
1861*493d26c5SEd Maste {
1862*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_nvr_provisioning2_adr, value);
1863*493d26c5SEd Maste }
reg_glb_nvr_provisioning2_get(struct aq_hw * hw)1864*493d26c5SEd Maste u32 reg_glb_nvr_provisioning2_get(struct aq_hw* hw)
1865*493d26c5SEd Maste {
1866*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_nvr_provisioning2_adr);
1867*493d26c5SEd Maste }
1868*493d26c5SEd Maste 
reg_glb_nvr_interface1_set(struct aq_hw * hw,u32 value)1869*493d26c5SEd Maste void reg_glb_nvr_interface1_set(struct aq_hw* hw, u32 value)
1870*493d26c5SEd Maste {
1871*493d26c5SEd Maste     AQ_WRITE_REG(hw, glb_nvr_interface1_adr, value);
1872*493d26c5SEd Maste }
reg_glb_nvr_interface1_get(struct aq_hw * hw)1873*493d26c5SEd Maste u32 reg_glb_nvr_interface1_get(struct aq_hw* hw)
1874*493d26c5SEd Maste {
1875*493d26c5SEd Maste     return AQ_READ_REG(hw, glb_nvr_interface1_adr);
1876*493d26c5SEd Maste }
1877*493d26c5SEd Maste 
1878*493d26c5SEd Maste /* get mif up mailbox busy */
mif_mcp_up_mailbox_busy_get(struct aq_hw * hw)1879*493d26c5SEd Maste u32 mif_mcp_up_mailbox_busy_get(struct aq_hw *hw)
1880*493d26c5SEd Maste {
1881*493d26c5SEd Maste     return AQ_READ_REG_BIT(hw, mif_mcp_up_mailbox_busy_adr,
1882*493d26c5SEd Maste         mif_mcp_up_mailbox_busy_msk,
1883*493d26c5SEd Maste         mif_mcp_up_mailbox_busy_shift);
1884*493d26c5SEd Maste }
1885*493d26c5SEd Maste 
1886*493d26c5SEd Maste /* set mif up mailbox execute operation */
mif_mcp_up_mailbox_execute_operation_set(struct aq_hw * hw,u32 value)1887*493d26c5SEd Maste void mif_mcp_up_mailbox_execute_operation_set(struct aq_hw* hw, u32 value)
1888*493d26c5SEd Maste {
1889*493d26c5SEd Maste     AQ_WRITE_REG_BIT(hw, mif_mcp_up_mailbox_execute_operation_adr,
1890*493d26c5SEd Maste                      mif_mcp_up_mailbox_execute_operation_msk,
1891*493d26c5SEd Maste                      mif_mcp_up_mailbox_execute_operation_shift,
1892*493d26c5SEd Maste                      value);
1893*493d26c5SEd Maste }
1894*493d26c5SEd Maste /* get mif uP mailbox address */
mif_mcp_up_mailbox_addr_get(struct aq_hw * hw)1895*493d26c5SEd Maste u32 mif_mcp_up_mailbox_addr_get(struct aq_hw *hw)
1896*493d26c5SEd Maste {
1897*493d26c5SEd Maste     return AQ_READ_REG(hw, mif_mcp_up_mailbox_addr_adr);
1898*493d26c5SEd Maste }
1899*493d26c5SEd Maste /* set mif uP mailbox address */
mif_mcp_up_mailbox_addr_set(struct aq_hw * hw,u32 value)1900*493d26c5SEd Maste void mif_mcp_up_mailbox_addr_set(struct aq_hw *hw, u32 value)
1901*493d26c5SEd Maste {
1902*493d26c5SEd Maste     AQ_WRITE_REG(hw, mif_mcp_up_mailbox_addr_adr, value);
1903*493d26c5SEd Maste }
1904*493d26c5SEd Maste 
1905*493d26c5SEd Maste /* get mif uP mailbox data */
mif_mcp_up_mailbox_data_get(struct aq_hw * hw)1906*493d26c5SEd Maste u32 mif_mcp_up_mailbox_data_get(struct aq_hw *hw)
1907*493d26c5SEd Maste {
1908*493d26c5SEd Maste     return AQ_READ_REG(hw, mif_mcp_up_mailbox_data_adr);
1909*493d26c5SEd Maste }
1910*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv4_dest_addr_clear(struct aq_hw_s * aq_hw,u8 location)1911*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv4_dest_addr_clear(struct aq_hw_s *aq_hw, u8 location)
1912*493d26c5SEd Maste {
1913*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw, HW_ATL_RX_GET_ADDR_DESTA_FL3L4(location), 0U);
1914*493d26c5SEd Maste }
1915*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv4_src_addr_clear(struct aq_hw_s * aq_hw,u8 location)1916*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv4_src_addr_clear(struct aq_hw_s *aq_hw, u8 location)
1917*493d26c5SEd Maste {
1918*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw, HW_ATL_RX_GET_ADDR_SRCA_FL3L4(location), 0U);
1919*493d26c5SEd Maste }
1920*493d26c5SEd Maste 
hw_atl_rpfl3l4_cmd_clear(struct aq_hw_s * aq_hw,u8 location)1921*493d26c5SEd Maste void hw_atl_rpfl3l4_cmd_clear(struct aq_hw_s *aq_hw, u8 location)
1922*493d26c5SEd Maste {
1923*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw, HW_ATL_RX_GET_ADDR_CTRL_FL3L4(location), 0U);
1924*493d26c5SEd Maste }
1925*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv6_dest_addr_clear(struct aq_hw_s * aq_hw,u8 location)1926*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv6_dest_addr_clear(struct aq_hw_s *aq_hw, u8 location)
1927*493d26c5SEd Maste {
1928*493d26c5SEd Maste 	int i;
1929*493d26c5SEd Maste 
1930*493d26c5SEd Maste 	for (i = 0; i < 4; ++i)
1931*493d26c5SEd Maste 		aq_hw_write_reg(aq_hw,
1932*493d26c5SEd Maste 				HW_ATL_RX_GET_ADDR_DESTA_FL3L4(location + i),
1933*493d26c5SEd Maste 				0U);
1934*493d26c5SEd Maste }
1935*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv6_src_addr_clear(struct aq_hw_s * aq_hw,u8 location)1936*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv6_src_addr_clear(struct aq_hw_s *aq_hw, u8 location)
1937*493d26c5SEd Maste {
1938*493d26c5SEd Maste 	int i;
1939*493d26c5SEd Maste 
1940*493d26c5SEd Maste 	for (i = 0; i < 4; ++i)
1941*493d26c5SEd Maste 		aq_hw_write_reg(aq_hw,
1942*493d26c5SEd Maste 				HW_ATL_RX_GET_ADDR_SRCA_FL3L4(location + i),
1943*493d26c5SEd Maste 				0U);
1944*493d26c5SEd Maste }
1945*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv4_dest_addr_set(struct aq_hw_s * aq_hw,u8 location,u32 ipv4_dest)1946*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv4_dest_addr_set(struct aq_hw_s *aq_hw, u8 location,
1947*493d26c5SEd Maste 				       u32 ipv4_dest)
1948*493d26c5SEd Maste {
1949*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw, HW_ATL_RX_GET_ADDR_DESTA_FL3L4(location),
1950*493d26c5SEd Maste 			ipv4_dest);
1951*493d26c5SEd Maste }
1952*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv4_src_addr_set(struct aq_hw_s * aq_hw,u8 location,u32 ipv4_src)1953*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv4_src_addr_set(struct aq_hw_s *aq_hw, u8 location,
1954*493d26c5SEd Maste 				      u32 ipv4_src)
1955*493d26c5SEd Maste {
1956*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw,
1957*493d26c5SEd Maste 			HW_ATL_RX_GET_ADDR_SRCA_FL3L4(location),
1958*493d26c5SEd Maste 			ipv4_src);
1959*493d26c5SEd Maste }
1960*493d26c5SEd Maste 
hw_atl_rpfl3l4_cmd_set(struct aq_hw_s * aq_hw,u8 location,u32 cmd)1961*493d26c5SEd Maste void hw_atl_rpfl3l4_cmd_set(struct aq_hw_s *aq_hw, u8 location, u32 cmd)
1962*493d26c5SEd Maste {
1963*493d26c5SEd Maste 	aq_hw_write_reg(aq_hw, HW_ATL_RX_GET_ADDR_CTRL_FL3L4(location), cmd);
1964*493d26c5SEd Maste }
1965*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s * aq_hw,u8 location,u32 * ipv6_src)1966*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s *aq_hw, u8 location,
1967*493d26c5SEd Maste 				      u32 *ipv6_src)
1968*493d26c5SEd Maste {
1969*493d26c5SEd Maste 	int i;
1970*493d26c5SEd Maste 
1971*493d26c5SEd Maste 	for (i = 0; i < 4; ++i)
1972*493d26c5SEd Maste 		aq_hw_write_reg(aq_hw,
1973*493d26c5SEd Maste 				HW_ATL_RX_GET_ADDR_SRCA_FL3L4(location + i),
1974*493d26c5SEd Maste 				ipv6_src[i]);
1975*493d26c5SEd Maste }
1976*493d26c5SEd Maste 
hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s * aq_hw,u8 location,u32 * ipv6_dest)1977*493d26c5SEd Maste void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location,
1978*493d26c5SEd Maste 				       u32 *ipv6_dest)
1979*493d26c5SEd Maste {
1980*493d26c5SEd Maste 	int i;
1981*493d26c5SEd Maste 
1982*493d26c5SEd Maste 	for (i = 0; i < 4; ++i)
1983*493d26c5SEd Maste 		aq_hw_write_reg(aq_hw,
1984*493d26c5SEd Maste 				HW_ATL_RX_GET_ADDR_DESTA_FL3L4(location + i),
1985*493d26c5SEd Maste 				ipv6_dest[i]);
1986*493d26c5SEd Maste }
1987