1 // SPDX-License-Identifier: GPL-2.0-only
3 * aQuantia Corporation Network Driver
4 * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved
7 /* File hw_atl_llh.c: Definitions of bitfield and register access functions for
11 #include "hw_atl_llh.h"
12 #include "hw_atl_llh_internal.h"
13 #include "../aq_hw_utils.h"
16 void hw_atl_reg_glb_cpu_sem_set(struct aq_hw_s
*aq_hw
, u32 glb_cpu_sem
,
19 aq_hw_write_reg(aq_hw
, HW_ATL_GLB_CPU_SEM_ADR(semaphore
), glb_cpu_sem
);
22 u32
hw_atl_reg_glb_cpu_sem_get(struct aq_hw_s
*aq_hw
, u32 semaphore
)
24 return aq_hw_read_reg(aq_hw
, HW_ATL_GLB_CPU_SEM_ADR(semaphore
));
27 void hw_atl_glb_glb_reg_res_dis_set(struct aq_hw_s
*aq_hw
, u32 glb_reg_res_dis
)
29 aq_hw_write_reg_bit(aq_hw
, HW_ATL_GLB_REG_RES_DIS_ADR
,
30 HW_ATL_GLB_REG_RES_DIS_MSK
,
31 HW_ATL_GLB_REG_RES_DIS_SHIFT
,
35 void hw_atl_glb_soft_res_set(struct aq_hw_s
*aq_hw
, u32 soft_res
)
37 aq_hw_write_reg_bit(aq_hw
, HW_ATL_GLB_SOFT_RES_ADR
,
38 HW_ATL_GLB_SOFT_RES_MSK
,
39 HW_ATL_GLB_SOFT_RES_SHIFT
, soft_res
);
42 u32
hw_atl_glb_soft_res_get(struct aq_hw_s
*aq_hw
)
44 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_GLB_SOFT_RES_ADR
,
45 HW_ATL_GLB_SOFT_RES_MSK
,
46 HW_ATL_GLB_SOFT_RES_SHIFT
);
49 u32
hw_atl_reg_glb_mif_id_get(struct aq_hw_s
*aq_hw
)
51 return aq_hw_read_reg(aq_hw
, HW_ATL_GLB_MIF_ID_ADR
);
55 u32
hw_atl_rpb_rx_dma_drop_pkt_cnt_get(struct aq_hw_s
*aq_hw
)
57 return aq_hw_read_reg(aq_hw
, HW_ATL_RPB_RX_DMA_DROP_PKT_CNT_ADR
);
60 u64
hw_atl_stats_rx_dma_good_octet_counter_get(struct aq_hw_s
*aq_hw
)
62 return aq_hw_read_reg64(aq_hw
, HW_ATL_STATS_RX_DMA_GOOD_OCTET_COUNTERLSW
);
65 u64
hw_atl_stats_rx_dma_good_pkt_counter_get(struct aq_hw_s
*aq_hw
)
67 return aq_hw_read_reg64(aq_hw
, HW_ATL_STATS_RX_DMA_GOOD_PKT_COUNTERLSW
);
70 u64
hw_atl_stats_tx_dma_good_octet_counter_get(struct aq_hw_s
*aq_hw
)
72 return aq_hw_read_reg64(aq_hw
, HW_ATL_STATS_TX_DMA_GOOD_OCTET_COUNTERLSW
);
75 u64
hw_atl_stats_tx_dma_good_pkt_counter_get(struct aq_hw_s
*aq_hw
)
77 return aq_hw_read_reg64(aq_hw
, HW_ATL_STATS_TX_DMA_GOOD_PKT_COUNTERLSW
);
81 void hw_atl_itr_irq_auto_masklsw_set(struct aq_hw_s
*aq_hw
,
84 aq_hw_write_reg(aq_hw
, HW_ATL_ITR_IAMRLSW_ADR
, irq_auto_masklsw
);
87 void hw_atl_itr_irq_map_en_rx_set(struct aq_hw_s
*aq_hw
, u32 irq_map_en_rx
,
90 /* register address for bitfield imr_rx{r}_en */
91 static u32 itr_imr_rxren_adr
[32] = {
92 0x00002100U
, 0x00002100U
, 0x00002104U
, 0x00002104U
,
93 0x00002108U
, 0x00002108U
, 0x0000210CU
, 0x0000210CU
,
94 0x00002110U
, 0x00002110U
, 0x00002114U
, 0x00002114U
,
95 0x00002118U
, 0x00002118U
, 0x0000211CU
, 0x0000211CU
,
96 0x00002120U
, 0x00002120U
, 0x00002124U
, 0x00002124U
,
97 0x00002128U
, 0x00002128U
, 0x0000212CU
, 0x0000212CU
,
98 0x00002130U
, 0x00002130U
, 0x00002134U
, 0x00002134U
,
99 0x00002138U
, 0x00002138U
, 0x0000213CU
, 0x0000213CU
102 /* bitmask for bitfield imr_rx{r}_en */
103 static u32 itr_imr_rxren_msk
[32] = {
104 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
105 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
106 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
107 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
108 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
109 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
110 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
,
111 0x00008000U
, 0x00000080U
, 0x00008000U
, 0x00000080U
114 /* lower bit position of bitfield imr_rx{r}_en */
115 static u32 itr_imr_rxren_shift
[32] = {
116 15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
117 15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
118 15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U,
119 15U, 7U, 15U, 7U, 15U, 7U, 15U, 7U
122 aq_hw_write_reg_bit(aq_hw
, itr_imr_rxren_adr
[rx
],
123 itr_imr_rxren_msk
[rx
],
124 itr_imr_rxren_shift
[rx
],
128 void hw_atl_itr_irq_map_en_tx_set(struct aq_hw_s
*aq_hw
, u32 irq_map_en_tx
,
131 /* register address for bitfield imr_tx{t}_en */
132 static u32 itr_imr_txten_adr
[32] = {
133 0x00002100U
, 0x00002100U
, 0x00002104U
, 0x00002104U
,
134 0x00002108U
, 0x00002108U
, 0x0000210CU
, 0x0000210CU
,
135 0x00002110U
, 0x00002110U
, 0x00002114U
, 0x00002114U
,
136 0x00002118U
, 0x00002118U
, 0x0000211CU
, 0x0000211CU
,
137 0x00002120U
, 0x00002120U
, 0x00002124U
, 0x00002124U
,
138 0x00002128U
, 0x00002128U
, 0x0000212CU
, 0x0000212CU
,
139 0x00002130U
, 0x00002130U
, 0x00002134U
, 0x00002134U
,
140 0x00002138U
, 0x00002138U
, 0x0000213CU
, 0x0000213CU
143 /* bitmask for bitfield imr_tx{t}_en */
144 static u32 itr_imr_txten_msk
[32] = {
145 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
146 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
147 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
148 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
149 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
150 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
151 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
,
152 0x80000000U
, 0x00800000U
, 0x80000000U
, 0x00800000U
155 /* lower bit position of bitfield imr_tx{t}_en */
156 static u32 itr_imr_txten_shift
[32] = {
157 31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
158 31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
159 31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U,
160 31U, 23U, 31U, 23U, 31U, 23U, 31U, 23U
163 aq_hw_write_reg_bit(aq_hw
, itr_imr_txten_adr
[tx
],
164 itr_imr_txten_msk
[tx
],
165 itr_imr_txten_shift
[tx
],
169 void hw_atl_itr_irq_map_rx_set(struct aq_hw_s
*aq_hw
, u32 irq_map_rx
, u32 rx
)
171 /* register address for bitfield imr_rx{r}[4:0] */
172 static u32 itr_imr_rxr_adr
[32] = {
173 0x00002100U
, 0x00002100U
, 0x00002104U
, 0x00002104U
,
174 0x00002108U
, 0x00002108U
, 0x0000210CU
, 0x0000210CU
,
175 0x00002110U
, 0x00002110U
, 0x00002114U
, 0x00002114U
,
176 0x00002118U
, 0x00002118U
, 0x0000211CU
, 0x0000211CU
,
177 0x00002120U
, 0x00002120U
, 0x00002124U
, 0x00002124U
,
178 0x00002128U
, 0x00002128U
, 0x0000212CU
, 0x0000212CU
,
179 0x00002130U
, 0x00002130U
, 0x00002134U
, 0x00002134U
,
180 0x00002138U
, 0x00002138U
, 0x0000213CU
, 0x0000213CU
183 /* bitmask for bitfield imr_rx{r}[4:0] */
184 static u32 itr_imr_rxr_msk
[32] = {
185 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
186 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
187 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
188 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
189 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
190 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
191 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
,
192 0x00001f00U
, 0x0000001FU
, 0x00001F00U
, 0x0000001FU
195 /* lower bit position of bitfield imr_rx{r}[4:0] */
196 static u32 itr_imr_rxr_shift
[32] = {
197 8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
198 8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
199 8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U,
200 8U, 0U, 8U, 0U, 8U, 0U, 8U, 0U
203 aq_hw_write_reg_bit(aq_hw
, itr_imr_rxr_adr
[rx
],
205 itr_imr_rxr_shift
[rx
],
209 void hw_atl_itr_irq_map_tx_set(struct aq_hw_s
*aq_hw
, u32 irq_map_tx
, u32 tx
)
211 /* register address for bitfield imr_tx{t}[4:0] */
212 static u32 itr_imr_txt_adr
[32] = {
213 0x00002100U
, 0x00002100U
, 0x00002104U
, 0x00002104U
,
214 0x00002108U
, 0x00002108U
, 0x0000210CU
, 0x0000210CU
,
215 0x00002110U
, 0x00002110U
, 0x00002114U
, 0x00002114U
,
216 0x00002118U
, 0x00002118U
, 0x0000211CU
, 0x0000211CU
,
217 0x00002120U
, 0x00002120U
, 0x00002124U
, 0x00002124U
,
218 0x00002128U
, 0x00002128U
, 0x0000212CU
, 0x0000212CU
,
219 0x00002130U
, 0x00002130U
, 0x00002134U
, 0x00002134U
,
220 0x00002138U
, 0x00002138U
, 0x0000213CU
, 0x0000213CU
223 /* bitmask for bitfield imr_tx{t}[4:0] */
224 static u32 itr_imr_txt_msk
[32] = {
225 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
226 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
227 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
228 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
229 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
230 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
231 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
,
232 0x1f000000U
, 0x001F0000U
, 0x1F000000U
, 0x001F0000U
235 /* lower bit position of bitfield imr_tx{t}[4:0] */
236 static u32 itr_imr_txt_shift
[32] = {
237 24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
238 24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
239 24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U,
240 24U, 16U, 24U, 16U, 24U, 16U, 24U, 16U
243 aq_hw_write_reg_bit(aq_hw
, itr_imr_txt_adr
[tx
],
245 itr_imr_txt_shift
[tx
],
249 void hw_atl_itr_irq_msk_clearlsw_set(struct aq_hw_s
*aq_hw
,
250 u32 irq_msk_clearlsw
)
252 aq_hw_write_reg(aq_hw
, HW_ATL_ITR_IMCRLSW_ADR
, irq_msk_clearlsw
);
255 void hw_atl_itr_irq_msk_setlsw_set(struct aq_hw_s
*aq_hw
, u32 irq_msk_setlsw
)
257 aq_hw_write_reg(aq_hw
, HW_ATL_ITR_IMSRLSW_ADR
, irq_msk_setlsw
);
260 void hw_atl_itr_irq_reg_res_dis_set(struct aq_hw_s
*aq_hw
, u32 irq_reg_res_dis
)
262 aq_hw_write_reg_bit(aq_hw
, HW_ATL_ITR_REG_RES_DSBL_ADR
,
263 HW_ATL_ITR_REG_RES_DSBL_MSK
,
264 HW_ATL_ITR_REG_RES_DSBL_SHIFT
, irq_reg_res_dis
);
267 void hw_atl_itr_irq_status_clearlsw_set(struct aq_hw_s
*aq_hw
,
268 u32 irq_status_clearlsw
)
270 aq_hw_write_reg(aq_hw
, HW_ATL_ITR_ISCRLSW_ADR
, irq_status_clearlsw
);
273 u32
hw_atl_itr_irq_statuslsw_get(struct aq_hw_s
*aq_hw
)
275 return aq_hw_read_reg(aq_hw
, HW_ATL_ITR_ISRLSW_ADR
);
278 u32
hw_atl_itr_res_irq_get(struct aq_hw_s
*aq_hw
)
280 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_ITR_RES_ADR
, HW_ATL_ITR_RES_MSK
,
281 HW_ATL_ITR_RES_SHIFT
);
284 void hw_atl_itr_res_irq_set(struct aq_hw_s
*aq_hw
, u32 res_irq
)
286 aq_hw_write_reg_bit(aq_hw
, HW_ATL_ITR_RES_ADR
, HW_ATL_ITR_RES_MSK
,
287 HW_ATL_ITR_RES_SHIFT
, res_irq
);
290 /* set RSC interrupt */
291 void hw_atl_itr_rsc_en_set(struct aq_hw_s
*aq_hw
, u32 enable
)
293 aq_hw_write_reg(aq_hw
, HW_ATL_ITR_RSC_EN_ADR
, enable
);
297 void hw_atl_itr_rsc_delay_set(struct aq_hw_s
*aq_hw
, u32 delay
)
299 aq_hw_write_reg_bit(aq_hw
, HW_ATL_ITR_RSC_DELAY_ADR
,
300 HW_ATL_ITR_RSC_DELAY_MSK
,
301 HW_ATL_ITR_RSC_DELAY_SHIFT
,
306 void hw_atl_rdm_cpu_id_set(struct aq_hw_s
*aq_hw
, u32 cpuid
, u32 dca
)
308 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCADCPUID_ADR(dca
),
309 HW_ATL_RDM_DCADCPUID_MSK
,
310 HW_ATL_RDM_DCADCPUID_SHIFT
, cpuid
);
313 void hw_atl_rdm_rx_dca_en_set(struct aq_hw_s
*aq_hw
, u32 rx_dca_en
)
315 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCA_EN_ADR
, HW_ATL_RDM_DCA_EN_MSK
,
316 HW_ATL_RDM_DCA_EN_SHIFT
, rx_dca_en
);
319 void hw_atl_rdm_rx_dca_mode_set(struct aq_hw_s
*aq_hw
, u32 rx_dca_mode
)
321 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCA_MODE_ADR
,
322 HW_ATL_RDM_DCA_MODE_MSK
,
323 HW_ATL_RDM_DCA_MODE_SHIFT
, rx_dca_mode
);
326 void hw_atl_rdm_rx_desc_data_buff_size_set(struct aq_hw_s
*aq_hw
,
327 u32 rx_desc_data_buff_size
,
330 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDDATA_SIZE_ADR(descriptor
),
331 HW_ATL_RDM_DESCDDATA_SIZE_MSK
,
332 HW_ATL_RDM_DESCDDATA_SIZE_SHIFT
,
333 rx_desc_data_buff_size
);
336 void hw_atl_rdm_rx_desc_dca_en_set(struct aq_hw_s
*aq_hw
, u32 rx_desc_dca_en
,
339 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCADDESC_EN_ADR(dca
),
340 HW_ATL_RDM_DCADDESC_EN_MSK
,
341 HW_ATL_RDM_DCADDESC_EN_SHIFT
,
345 void hw_atl_rdm_rx_desc_en_set(struct aq_hw_s
*aq_hw
, u32 rx_desc_en
,
348 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDEN_ADR(descriptor
),
349 HW_ATL_RDM_DESCDEN_MSK
,
350 HW_ATL_RDM_DESCDEN_SHIFT
,
354 void hw_atl_rdm_rx_desc_head_buff_size_set(struct aq_hw_s
*aq_hw
,
355 u32 rx_desc_head_buff_size
,
358 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDHDR_SIZE_ADR(descriptor
),
359 HW_ATL_RDM_DESCDHDR_SIZE_MSK
,
360 HW_ATL_RDM_DESCDHDR_SIZE_SHIFT
,
361 rx_desc_head_buff_size
);
364 void hw_atl_rdm_rx_desc_head_splitting_set(struct aq_hw_s
*aq_hw
,
365 u32 rx_desc_head_splitting
,
368 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDHDR_SPLIT_ADR(descriptor
),
369 HW_ATL_RDM_DESCDHDR_SPLIT_MSK
,
370 HW_ATL_RDM_DESCDHDR_SPLIT_SHIFT
,
371 rx_desc_head_splitting
);
374 u32
hw_atl_rdm_rx_desc_head_ptr_get(struct aq_hw_s
*aq_hw
, u32 descriptor
)
376 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_RDM_DESCDHD_ADR(descriptor
),
377 HW_ATL_RDM_DESCDHD_MSK
,
378 HW_ATL_RDM_DESCDHD_SHIFT
);
381 void hw_atl_rdm_rx_desc_len_set(struct aq_hw_s
*aq_hw
, u32 rx_desc_len
,
384 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDLEN_ADR(descriptor
),
385 HW_ATL_RDM_DESCDLEN_MSK
, HW_ATL_RDM_DESCDLEN_SHIFT
,
389 void hw_atl_rdm_rx_desc_res_set(struct aq_hw_s
*aq_hw
, u32 rx_desc_res
,
392 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DESCDRESET_ADR(descriptor
),
393 HW_ATL_RDM_DESCDRESET_MSK
,
394 HW_ATL_RDM_DESCDRESET_SHIFT
,
398 void hw_atl_rdm_rx_desc_wr_wb_irq_en_set(struct aq_hw_s
*aq_hw
,
399 u32 rx_desc_wr_wb_irq_en
)
401 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_INT_DESC_WRB_EN_ADR
,
402 HW_ATL_RDM_INT_DESC_WRB_EN_MSK
,
403 HW_ATL_RDM_INT_DESC_WRB_EN_SHIFT
,
404 rx_desc_wr_wb_irq_en
);
407 void hw_atl_rdm_rx_head_dca_en_set(struct aq_hw_s
*aq_hw
, u32 rx_head_dca_en
,
410 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCADHDR_EN_ADR(dca
),
411 HW_ATL_RDM_DCADHDR_EN_MSK
,
412 HW_ATL_RDM_DCADHDR_EN_SHIFT
,
416 void hw_atl_rdm_rx_pld_dca_en_set(struct aq_hw_s
*aq_hw
, u32 rx_pld_dca_en
,
419 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_DCADPAY_EN_ADR(dca
),
420 HW_ATL_RDM_DCADPAY_EN_MSK
,
421 HW_ATL_RDM_DCADPAY_EN_SHIFT
,
425 void hw_atl_rdm_rdm_intr_moder_en_set(struct aq_hw_s
*aq_hw
,
426 u32 rdm_intr_moder_en
)
428 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_INT_RIM_EN_ADR
,
429 HW_ATL_RDM_INT_RIM_EN_MSK
,
430 HW_ATL_RDM_INT_RIM_EN_SHIFT
,
435 void hw_atl_reg_gen_irq_map_set(struct aq_hw_s
*aq_hw
, u32 gen_intr_map
,
438 aq_hw_write_reg(aq_hw
, HW_ATL_GEN_INTR_MAP_ADR(regidx
), gen_intr_map
);
441 u32
hw_atl_reg_gen_irq_status_get(struct aq_hw_s
*aq_hw
)
443 return aq_hw_read_reg(aq_hw
, HW_ATL_GEN_INTR_STAT_ADR
);
446 void hw_atl_reg_irq_glb_ctl_set(struct aq_hw_s
*aq_hw
, u32 intr_glb_ctl
)
448 aq_hw_write_reg(aq_hw
, HW_ATL_INTR_GLB_CTL_ADR
, intr_glb_ctl
);
451 void hw_atl_reg_irq_thr_set(struct aq_hw_s
*aq_hw
, u32 intr_thr
, u32 throttle
)
453 aq_hw_write_reg(aq_hw
, HW_ATL_INTR_THR_ADR(throttle
), intr_thr
);
456 void hw_atl_reg_rx_dma_desc_base_addresslswset(struct aq_hw_s
*aq_hw
,
457 u32 rx_dma_desc_base_addrlsw
,
460 aq_hw_write_reg(aq_hw
, HW_ATL_RX_DMA_DESC_BASE_ADDRLSW_ADR(descriptor
),
461 rx_dma_desc_base_addrlsw
);
464 void hw_atl_reg_rx_dma_desc_base_addressmswset(struct aq_hw_s
*aq_hw
,
465 u32 rx_dma_desc_base_addrmsw
,
468 aq_hw_write_reg(aq_hw
, HW_ATL_RX_DMA_DESC_BASE_ADDRMSW_ADR(descriptor
),
469 rx_dma_desc_base_addrmsw
);
472 u32
hw_atl_reg_rx_dma_desc_status_get(struct aq_hw_s
*aq_hw
, u32 descriptor
)
474 return aq_hw_read_reg(aq_hw
, HW_ATL_RX_DMA_DESC_STAT_ADR(descriptor
));
477 void hw_atl_reg_rx_dma_desc_tail_ptr_set(struct aq_hw_s
*aq_hw
,
478 u32 rx_dma_desc_tail_ptr
,
481 aq_hw_write_reg(aq_hw
, HW_ATL_RX_DMA_DESC_TAIL_PTR_ADR(descriptor
),
482 rx_dma_desc_tail_ptr
);
485 void hw_atl_reg_rx_flr_mcst_flr_msk_set(struct aq_hw_s
*aq_hw
,
486 u32 rx_flr_mcst_flr_msk
)
488 aq_hw_write_reg(aq_hw
, HW_ATL_RX_FLR_MCST_FLR_MSK_ADR
,
489 rx_flr_mcst_flr_msk
);
492 void hw_atl_reg_rx_flr_mcst_flr_set(struct aq_hw_s
*aq_hw
, u32 rx_flr_mcst_flr
,
495 aq_hw_write_reg(aq_hw
, HW_ATL_RX_FLR_MCST_FLR_ADR(filter
),
499 void hw_atl_reg_rx_flr_rss_control1set(struct aq_hw_s
*aq_hw
,
500 u32 rx_flr_rss_control1
)
502 aq_hw_write_reg(aq_hw
, HW_ATL_RX_FLR_RSS_CONTROL1_ADR
,
503 rx_flr_rss_control1
);
506 void hw_atl_reg_rx_flr_control2_set(struct aq_hw_s
*aq_hw
,
507 u32 rx_filter_control2
)
509 aq_hw_write_reg(aq_hw
, HW_ATL_RX_FLR_CONTROL2_ADR
, rx_filter_control2
);
512 void hw_atl_reg_rx_intr_moder_ctrl_set(struct aq_hw_s
*aq_hw
,
513 u32 rx_intr_moderation_ctl
,
516 aq_hw_write_reg(aq_hw
, HW_ATL_RX_INTR_MODERATION_CTL_ADR(queue
),
517 rx_intr_moderation_ctl
);
520 void hw_atl_reg_tx_dma_debug_ctl_set(struct aq_hw_s
*aq_hw
,
521 u32 tx_dma_debug_ctl
)
523 aq_hw_write_reg(aq_hw
, HW_ATL_TX_DMA_DEBUG_CTL_ADR
, tx_dma_debug_ctl
);
526 void hw_atl_reg_tx_dma_desc_base_addresslswset(struct aq_hw_s
*aq_hw
,
527 u32 tx_dma_desc_base_addrlsw
,
530 aq_hw_write_reg(aq_hw
, HW_ATL_TX_DMA_DESC_BASE_ADDRLSW_ADR(descriptor
),
531 tx_dma_desc_base_addrlsw
);
534 void hw_atl_reg_tx_dma_desc_base_addressmswset(struct aq_hw_s
*aq_hw
,
535 u32 tx_dma_desc_base_addrmsw
,
538 aq_hw_write_reg(aq_hw
, HW_ATL_TX_DMA_DESC_BASE_ADDRMSW_ADR(descriptor
),
539 tx_dma_desc_base_addrmsw
);
542 void hw_atl_reg_tx_dma_desc_tail_ptr_set(struct aq_hw_s
*aq_hw
,
543 u32 tx_dma_desc_tail_ptr
,
546 aq_hw_write_reg(aq_hw
, HW_ATL_TX_DMA_DESC_TAIL_PTR_ADR(descriptor
),
547 tx_dma_desc_tail_ptr
);
550 void hw_atl_reg_tx_intr_moder_ctrl_set(struct aq_hw_s
*aq_hw
,
551 u32 tx_intr_moderation_ctl
,
554 aq_hw_write_reg(aq_hw
, HW_ATL_TX_INTR_MODERATION_CTL_ADR(queue
),
555 tx_intr_moderation_ctl
);
558 /* RPB: rx packet buffer */
559 void hw_atl_rpb_dma_sys_lbk_set(struct aq_hw_s
*aq_hw
, u32 dma_sys_lbk
)
561 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_DMA_SYS_LBK_ADR
,
562 HW_ATL_RPB_DMA_SYS_LBK_MSK
,
563 HW_ATL_RPB_DMA_SYS_LBK_SHIFT
, dma_sys_lbk
);
566 void hw_atl_rpb_rpf_rx_traf_class_mode_set(struct aq_hw_s
*aq_hw
,
567 u32 rx_traf_class_mode
)
569 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RPF_RX_TC_MODE_ADR
,
570 HW_ATL_RPB_RPF_RX_TC_MODE_MSK
,
571 HW_ATL_RPB_RPF_RX_TC_MODE_SHIFT
,
575 void hw_atl_rpb_rx_buff_en_set(struct aq_hw_s
*aq_hw
, u32 rx_buff_en
)
577 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RX_BUF_EN_ADR
,
578 HW_ATL_RPB_RX_BUF_EN_MSK
,
579 HW_ATL_RPB_RX_BUF_EN_SHIFT
, rx_buff_en
);
582 void hw_atl_rpb_rx_buff_hi_threshold_per_tc_set(struct aq_hw_s
*aq_hw
,
583 u32 rx_buff_hi_threshold_per_tc
,
586 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RXBHI_THRESH_ADR(buffer
),
587 HW_ATL_RPB_RXBHI_THRESH_MSK
,
588 HW_ATL_RPB_RXBHI_THRESH_SHIFT
,
589 rx_buff_hi_threshold_per_tc
);
592 void hw_atl_rpb_rx_buff_lo_threshold_per_tc_set(struct aq_hw_s
*aq_hw
,
593 u32 rx_buff_lo_threshold_per_tc
,
596 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RXBLO_THRESH_ADR(buffer
),
597 HW_ATL_RPB_RXBLO_THRESH_MSK
,
598 HW_ATL_RPB_RXBLO_THRESH_SHIFT
,
599 rx_buff_lo_threshold_per_tc
);
602 void hw_atl_rpb_rx_flow_ctl_mode_set(struct aq_hw_s
*aq_hw
, u32 rx_flow_ctl_mode
)
604 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RX_FC_MODE_ADR
,
605 HW_ATL_RPB_RX_FC_MODE_MSK
,
606 HW_ATL_RPB_RX_FC_MODE_SHIFT
, rx_flow_ctl_mode
);
609 void hw_atl_rdm_rx_dma_desc_cache_init_tgl(struct aq_hw_s
*aq_hw
)
613 val
= aq_hw_read_reg_bit(aq_hw
, HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_ADR
,
614 HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_MSK
,
615 HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_SHIFT
);
617 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_ADR
,
618 HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_MSK
,
619 HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_SHIFT
,
623 u32
hw_atl_rdm_rx_dma_desc_cache_init_done_get(struct aq_hw_s
*aq_hw
)
625 return aq_hw_read_reg_bit(aq_hw
, RDM_RX_DMA_DESC_CACHE_INIT_DONE_ADR
,
626 RDM_RX_DMA_DESC_CACHE_INIT_DONE_MSK
,
627 RDM_RX_DMA_DESC_CACHE_INIT_DONE_SHIFT
);
630 void hw_atl_rpb_rx_pkt_buff_size_per_tc_set(struct aq_hw_s
*aq_hw
,
631 u32 rx_pkt_buff_size_per_tc
, u32 buffer
)
633 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RXBBUF_SIZE_ADR(buffer
),
634 HW_ATL_RPB_RXBBUF_SIZE_MSK
,
635 HW_ATL_RPB_RXBBUF_SIZE_SHIFT
,
636 rx_pkt_buff_size_per_tc
);
639 void hw_atl_rpb_rx_xoff_en_per_tc_set(struct aq_hw_s
*aq_hw
, u32 rx_xoff_en_per_tc
,
642 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPB_RXBXOFF_EN_ADR(buffer
),
643 HW_ATL_RPB_RXBXOFF_EN_MSK
,
644 HW_ATL_RPB_RXBXOFF_EN_SHIFT
,
650 void hw_atl_rpfl2broadcast_count_threshold_set(struct aq_hw_s
*aq_hw
,
651 u32 l2broadcast_count_threshold
)
653 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2BC_THRESH_ADR
,
654 HW_ATL_RPFL2BC_THRESH_MSK
,
655 HW_ATL_RPFL2BC_THRESH_SHIFT
,
656 l2broadcast_count_threshold
);
659 void hw_atl_rpfl2broadcast_en_set(struct aq_hw_s
*aq_hw
, u32 l2broadcast_en
)
661 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2BC_EN_ADR
, HW_ATL_RPFL2BC_EN_MSK
,
662 HW_ATL_RPFL2BC_EN_SHIFT
, l2broadcast_en
);
665 void hw_atl_rpfl2broadcast_flr_act_set(struct aq_hw_s
*aq_hw
,
666 u32 l2broadcast_flr_act
)
668 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2BC_ACT_ADR
,
669 HW_ATL_RPFL2BC_ACT_MSK
,
670 HW_ATL_RPFL2BC_ACT_SHIFT
, l2broadcast_flr_act
);
673 void hw_atl_rpfl2multicast_flr_en_set(struct aq_hw_s
*aq_hw
,
674 u32 l2multicast_flr_en
,
677 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2MC_ENF_ADR(filter
),
678 HW_ATL_RPFL2MC_ENF_MSK
,
679 HW_ATL_RPFL2MC_ENF_SHIFT
, l2multicast_flr_en
);
682 void hw_atl_rpfl2promiscuous_mode_en_set(struct aq_hw_s
*aq_hw
,
683 u32 l2promiscuous_mode_en
)
685 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2PROMIS_MODE_ADR
,
686 HW_ATL_RPFL2PROMIS_MODE_MSK
,
687 HW_ATL_RPFL2PROMIS_MODE_SHIFT
,
688 l2promiscuous_mode_en
);
691 void hw_atl_rpfl2unicast_flr_act_set(struct aq_hw_s
*aq_hw
,
692 u32 l2unicast_flr_act
,
695 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2UC_ACTF_ADR(filter
),
696 HW_ATL_RPFL2UC_ACTF_MSK
, HW_ATL_RPFL2UC_ACTF_SHIFT
,
700 void hw_atl_rpfl2_uc_flr_en_set(struct aq_hw_s
*aq_hw
, u32 l2unicast_flr_en
,
703 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2UC_ENF_ADR(filter
),
704 HW_ATL_RPFL2UC_ENF_MSK
,
705 HW_ATL_RPFL2UC_ENF_SHIFT
, l2unicast_flr_en
);
708 void hw_atl_rpfl2unicast_dest_addresslsw_set(struct aq_hw_s
*aq_hw
,
709 u32 l2unicast_dest_addresslsw
,
712 aq_hw_write_reg(aq_hw
, HW_ATL_RPFL2UC_DAFLSW_ADR(filter
),
713 l2unicast_dest_addresslsw
);
716 void hw_atl_rpfl2unicast_dest_addressmsw_set(struct aq_hw_s
*aq_hw
,
717 u32 l2unicast_dest_addressmsw
,
720 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2UC_DAFMSW_ADR(filter
),
721 HW_ATL_RPFL2UC_DAFMSW_MSK
,
722 HW_ATL_RPFL2UC_DAFMSW_SHIFT
,
723 l2unicast_dest_addressmsw
);
726 void hw_atl_rpfl2_accept_all_mc_packets_set(struct aq_hw_s
*aq_hw
,
727 u32 l2_accept_all_mc_packets
)
729 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPFL2MC_ACCEPT_ALL_ADR
,
730 HW_ATL_RPFL2MC_ACCEPT_ALL_MSK
,
731 HW_ATL_RPFL2MC_ACCEPT_ALL_SHIFT
,
732 l2_accept_all_mc_packets
);
735 void hw_atl_rpf_rpb_user_priority_tc_map_set(struct aq_hw_s
*aq_hw
,
736 u32 user_priority_tc_map
, u32 tc
)
738 /* register address for bitfield rx_tc_up{t}[2:0] */
739 static u32 rpf_rpb_rx_tc_upt_adr
[8] = {
740 0x000054c4U
, 0x000054C4U
, 0x000054C4U
, 0x000054C4U
,
741 0x000054c4U
, 0x000054C4U
, 0x000054C4U
, 0x000054C4U
744 /* bitmask for bitfield rx_tc_up{t}[2:0] */
745 static u32 rpf_rpb_rx_tc_upt_msk
[8] = {
746 0x00000007U
, 0x00000070U
, 0x00000700U
, 0x00007000U
,
747 0x00070000U
, 0x00700000U
, 0x07000000U
, 0x70000000U
750 /* lower bit position of bitfield rx_tc_up{t}[2:0] */
751 static u32 rpf_rpb_rx_tc_upt_shft
[8] = {
752 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U
755 aq_hw_write_reg_bit(aq_hw
, rpf_rpb_rx_tc_upt_adr
[tc
],
756 rpf_rpb_rx_tc_upt_msk
[tc
],
757 rpf_rpb_rx_tc_upt_shft
[tc
],
758 user_priority_tc_map
);
761 void hw_atl_rpf_rss_key_addr_set(struct aq_hw_s
*aq_hw
, u32 rss_key_addr
)
763 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_RSS_KEY_ADDR_ADR
,
764 HW_ATL_RPF_RSS_KEY_ADDR_MSK
,
765 HW_ATL_RPF_RSS_KEY_ADDR_SHIFT
,
769 void hw_atl_rpf_rss_key_wr_data_set(struct aq_hw_s
*aq_hw
, u32 rss_key_wr_data
)
771 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_RSS_KEY_WR_DATA_ADR
,
775 u32
hw_atl_rpf_rss_key_wr_en_get(struct aq_hw_s
*aq_hw
)
777 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_RPF_RSS_KEY_WR_ENI_ADR
,
778 HW_ATL_RPF_RSS_KEY_WR_ENI_MSK
,
779 HW_ATL_RPF_RSS_KEY_WR_ENI_SHIFT
);
782 void hw_atl_rpf_rss_key_wr_en_set(struct aq_hw_s
*aq_hw
, u32 rss_key_wr_en
)
784 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_RSS_KEY_WR_ENI_ADR
,
785 HW_ATL_RPF_RSS_KEY_WR_ENI_MSK
,
786 HW_ATL_RPF_RSS_KEY_WR_ENI_SHIFT
,
790 void hw_atl_rpf_rss_redir_tbl_addr_set(struct aq_hw_s
*aq_hw
,
791 u32 rss_redir_tbl_addr
)
793 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_RSS_REDIR_ADDR_ADR
,
794 HW_ATL_RPF_RSS_REDIR_ADDR_MSK
,
795 HW_ATL_RPF_RSS_REDIR_ADDR_SHIFT
,
799 void hw_atl_rpf_rss_redir_tbl_wr_data_set(struct aq_hw_s
*aq_hw
,
800 u32 rss_redir_tbl_wr_data
)
802 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_RSS_REDIR_WR_DATA_ADR
,
803 HW_ATL_RPF_RSS_REDIR_WR_DATA_MSK
,
804 HW_ATL_RPF_RSS_REDIR_WR_DATA_SHIFT
,
805 rss_redir_tbl_wr_data
);
808 u32
hw_atl_rpf_rss_redir_wr_en_get(struct aq_hw_s
*aq_hw
)
810 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_RPF_RSS_REDIR_WR_ENI_ADR
,
811 HW_ATL_RPF_RSS_REDIR_WR_ENI_MSK
,
812 HW_ATL_RPF_RSS_REDIR_WR_ENI_SHIFT
);
815 void hw_atl_rpf_rss_redir_wr_en_set(struct aq_hw_s
*aq_hw
, u32 rss_redir_wr_en
)
817 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_RSS_REDIR_WR_ENI_ADR
,
818 HW_ATL_RPF_RSS_REDIR_WR_ENI_MSK
,
819 HW_ATL_RPF_RSS_REDIR_WR_ENI_SHIFT
, rss_redir_wr_en
);
822 void hw_atl_rpf_tpo_to_rpf_sys_lbk_set(struct aq_hw_s
*aq_hw
,
823 u32 tpo_to_rpf_sys_lbk
)
825 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_TPO_RPF_SYS_LBK_ADR
,
826 HW_ATL_RPF_TPO_RPF_SYS_LBK_MSK
,
827 HW_ATL_RPF_TPO_RPF_SYS_LBK_SHIFT
,
831 void hw_atl_rpf_vlan_inner_etht_set(struct aq_hw_s
*aq_hw
, u32 vlan_inner_etht
)
833 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_INNER_TPID_ADR
,
834 HW_ATL_RPF_VL_INNER_TPID_MSK
,
835 HW_ATL_RPF_VL_INNER_TPID_SHIFT
,
839 void hw_atl_rpf_vlan_outer_etht_set(struct aq_hw_s
*aq_hw
, u32 vlan_outer_etht
)
841 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_OUTER_TPID_ADR
,
842 HW_ATL_RPF_VL_OUTER_TPID_MSK
,
843 HW_ATL_RPF_VL_OUTER_TPID_SHIFT
,
847 void hw_atl_rpf_vlan_prom_mode_en_set(struct aq_hw_s
*aq_hw
,
848 u32 vlan_prom_mode_en
)
850 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_PROMIS_MODE_ADR
,
851 HW_ATL_RPF_VL_PROMIS_MODE_MSK
,
852 HW_ATL_RPF_VL_PROMIS_MODE_SHIFT
,
856 void hw_atl_rpf_vlan_accept_untagged_packets_set(struct aq_hw_s
*aq_hw
,
857 u32 vlan_acc_untagged_packets
)
859 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_ADR
,
860 HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_MSK
,
861 HW_ATL_RPF_VL_ACCEPT_UNTAGGED_MODE_SHIFT
,
862 vlan_acc_untagged_packets
);
865 void hw_atl_rpf_vlan_untagged_act_set(struct aq_hw_s
*aq_hw
,
866 u32 vlan_untagged_act
)
868 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_UNTAGGED_ACT_ADR
,
869 HW_ATL_RPF_VL_UNTAGGED_ACT_MSK
,
870 HW_ATL_RPF_VL_UNTAGGED_ACT_SHIFT
,
874 void hw_atl_rpf_vlan_flr_en_set(struct aq_hw_s
*aq_hw
, u32 vlan_flr_en
,
877 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_EN_F_ADR(filter
),
878 HW_ATL_RPF_VL_EN_F_MSK
,
879 HW_ATL_RPF_VL_EN_F_SHIFT
,
883 void hw_atl_rpf_vlan_flr_act_set(struct aq_hw_s
*aq_hw
, u32 vlan_flr_act
,
886 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_ACT_F_ADR(filter
),
887 HW_ATL_RPF_VL_ACT_F_MSK
,
888 HW_ATL_RPF_VL_ACT_F_SHIFT
,
892 void hw_atl_rpf_vlan_id_flr_set(struct aq_hw_s
*aq_hw
, u32 vlan_id_flr
,
895 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_ID_F_ADR(filter
),
896 HW_ATL_RPF_VL_ID_F_MSK
,
897 HW_ATL_RPF_VL_ID_F_SHIFT
,
901 void hw_atl_rpf_vlan_rxq_en_flr_set(struct aq_hw_s
*aq_hw
, u32 vlan_rxq_en
,
904 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_RXQ_EN_F_ADR(filter
),
905 HW_ATL_RPF_VL_RXQ_EN_F_MSK
,
906 HW_ATL_RPF_VL_RXQ_EN_F_SHIFT
,
910 void hw_atl_rpf_vlan_rxq_flr_set(struct aq_hw_s
*aq_hw
, u32 vlan_rxq
,
913 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_VL_RXQ_F_ADR(filter
),
914 HW_ATL_RPF_VL_RXQ_F_MSK
,
915 HW_ATL_RPF_VL_RXQ_F_SHIFT
,
919 void hw_atl_rpf_etht_flr_en_set(struct aq_hw_s
*aq_hw
, u32 etht_flr_en
,
922 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_ENF_ADR(filter
),
923 HW_ATL_RPF_ET_ENF_MSK
,
924 HW_ATL_RPF_ET_ENF_SHIFT
, etht_flr_en
);
927 void hw_atl_rpf_etht_user_priority_en_set(struct aq_hw_s
*aq_hw
,
928 u32 etht_user_priority_en
, u32 filter
)
930 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_UPFEN_ADR(filter
),
931 HW_ATL_RPF_ET_UPFEN_MSK
, HW_ATL_RPF_ET_UPFEN_SHIFT
,
932 etht_user_priority_en
);
935 void hw_atl_rpf_etht_rx_queue_en_set(struct aq_hw_s
*aq_hw
,
936 u32 etht_rx_queue_en
,
939 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_RXQFEN_ADR(filter
),
940 HW_ATL_RPF_ET_RXQFEN_MSK
,
941 HW_ATL_RPF_ET_RXQFEN_SHIFT
,
945 void hw_atl_rpf_etht_user_priority_set(struct aq_hw_s
*aq_hw
,
946 u32 etht_user_priority
,
949 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_UPF_ADR(filter
),
950 HW_ATL_RPF_ET_UPF_MSK
,
951 HW_ATL_RPF_ET_UPF_SHIFT
, etht_user_priority
);
954 void hw_atl_rpf_etht_rx_queue_set(struct aq_hw_s
*aq_hw
, u32 etht_rx_queue
,
957 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_RXQF_ADR(filter
),
958 HW_ATL_RPF_ET_RXQF_MSK
,
959 HW_ATL_RPF_ET_RXQF_SHIFT
, etht_rx_queue
);
962 void hw_atl_rpf_etht_mgt_queue_set(struct aq_hw_s
*aq_hw
, u32 etht_mgt_queue
,
965 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_MNG_RXQF_ADR(filter
),
966 HW_ATL_RPF_ET_MNG_RXQF_MSK
,
967 HW_ATL_RPF_ET_MNG_RXQF_SHIFT
,
971 void hw_atl_rpf_etht_flr_act_set(struct aq_hw_s
*aq_hw
, u32 etht_flr_act
,
974 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_ACTF_ADR(filter
),
975 HW_ATL_RPF_ET_ACTF_MSK
,
976 HW_ATL_RPF_ET_ACTF_SHIFT
, etht_flr_act
);
979 void hw_atl_rpf_etht_flr_set(struct aq_hw_s
*aq_hw
, u32 etht_flr
, u32 filter
)
981 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_ET_VALF_ADR(filter
),
982 HW_ATL_RPF_ET_VALF_MSK
,
983 HW_ATL_RPF_ET_VALF_SHIFT
, etht_flr
);
986 void hw_atl_rpf_l4_spd_set(struct aq_hw_s
*aq_hw
, u32 val
, u32 filter
)
988 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_L4_SPD_ADR(filter
),
989 HW_ATL_RPF_L4_SPD_MSK
,
990 HW_ATL_RPF_L4_SPD_SHIFT
, val
);
993 void hw_atl_rpf_l4_dpd_set(struct aq_hw_s
*aq_hw
, u32 val
, u32 filter
)
995 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPF_L4_DPD_ADR(filter
),
996 HW_ATL_RPF_L4_DPD_MSK
,
997 HW_ATL_RPF_L4_DPD_SHIFT
, val
);
1000 /* RPO: rx packet offload */
1001 void hw_atl_rpo_ipv4header_crc_offload_en_set(struct aq_hw_s
*aq_hw
,
1002 u32 ipv4header_crc_offload_en
)
1004 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_IPV4CHK_EN_ADR
,
1005 HW_ATL_RPO_IPV4CHK_EN_MSK
,
1006 HW_ATL_RPO_IPV4CHK_EN_SHIFT
,
1007 ipv4header_crc_offload_en
);
1010 void hw_atl_rpo_rx_desc_vlan_stripping_set(struct aq_hw_s
*aq_hw
,
1011 u32 rx_desc_vlan_stripping
,
1014 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_DESCDVL_STRIP_ADR(descriptor
),
1015 HW_ATL_RPO_DESCDVL_STRIP_MSK
,
1016 HW_ATL_RPO_DESCDVL_STRIP_SHIFT
,
1017 rx_desc_vlan_stripping
);
1020 void hw_atl_rpo_outer_vlan_tag_mode_set(void *context
,
1021 u32 outervlantagmode
)
1023 aq_hw_write_reg_bit(context
, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR
,
1024 HW_ATL_RPO_OUTER_VL_INS_MODE_MSK
,
1025 HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT
,
1029 u32
hw_atl_rpo_outer_vlan_tag_mode_get(void *context
)
1031 return aq_hw_read_reg_bit(context
, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR
,
1032 HW_ATL_RPO_OUTER_VL_INS_MODE_MSK
,
1033 HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT
);
1036 void hw_atl_rpo_tcp_udp_crc_offload_en_set(struct aq_hw_s
*aq_hw
,
1037 u32 tcp_udp_crc_offload_en
)
1039 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPOL4CHK_EN_ADR
,
1040 HW_ATL_RPOL4CHK_EN_MSK
,
1041 HW_ATL_RPOL4CHK_EN_SHIFT
, tcp_udp_crc_offload_en
);
1044 void hw_atl_rpo_lro_en_set(struct aq_hw_s
*aq_hw
, u32 lro_en
)
1046 aq_hw_write_reg(aq_hw
, HW_ATL_RPO_LRO_EN_ADR
, lro_en
);
1049 void hw_atl_rpo_lro_patch_optimization_en_set(struct aq_hw_s
*aq_hw
,
1050 u32 lro_patch_optimization_en
)
1052 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_PTOPT_EN_ADR
,
1053 HW_ATL_RPO_LRO_PTOPT_EN_MSK
,
1054 HW_ATL_RPO_LRO_PTOPT_EN_SHIFT
,
1055 lro_patch_optimization_en
);
1058 void hw_atl_rpo_lro_qsessions_lim_set(struct aq_hw_s
*aq_hw
,
1059 u32 lro_qsessions_lim
)
1061 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_QSES_LMT_ADR
,
1062 HW_ATL_RPO_LRO_QSES_LMT_MSK
,
1063 HW_ATL_RPO_LRO_QSES_LMT_SHIFT
,
1067 void hw_atl_rpo_lro_total_desc_lim_set(struct aq_hw_s
*aq_hw
,
1068 u32 lro_total_desc_lim
)
1070 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_TOT_DSC_LMT_ADR
,
1071 HW_ATL_RPO_LRO_TOT_DSC_LMT_MSK
,
1072 HW_ATL_RPO_LRO_TOT_DSC_LMT_SHIFT
,
1073 lro_total_desc_lim
);
1076 void hw_atl_rpo_lro_min_pay_of_first_pkt_set(struct aq_hw_s
*aq_hw
,
1077 u32 lro_min_pld_of_first_pkt
)
1079 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_PKT_MIN_ADR
,
1080 HW_ATL_RPO_LRO_PKT_MIN_MSK
,
1081 HW_ATL_RPO_LRO_PKT_MIN_SHIFT
,
1082 lro_min_pld_of_first_pkt
);
1085 void hw_atl_rpo_lro_pkt_lim_set(struct aq_hw_s
*aq_hw
, u32 lro_pkt_lim
)
1087 aq_hw_write_reg(aq_hw
, HW_ATL_RPO_LRO_RSC_MAX_ADR
, lro_pkt_lim
);
1090 void hw_atl_rpo_lro_max_num_of_descriptors_set(struct aq_hw_s
*aq_hw
,
1091 u32 lro_max_number_of_descriptors
,
1094 /* Register address for bitfield lro{L}_des_max[1:0] */
1095 static u32 rpo_lro_ldes_max_adr
[32] = {
1096 0x000055A0U
, 0x000055A0U
, 0x000055A0U
, 0x000055A0U
,
1097 0x000055A0U
, 0x000055A0U
, 0x000055A0U
, 0x000055A0U
,
1098 0x000055A4U
, 0x000055A4U
, 0x000055A4U
, 0x000055A4U
,
1099 0x000055A4U
, 0x000055A4U
, 0x000055A4U
, 0x000055A4U
,
1100 0x000055A8U
, 0x000055A8U
, 0x000055A8U
, 0x000055A8U
,
1101 0x000055A8U
, 0x000055A8U
, 0x000055A8U
, 0x000055A8U
,
1102 0x000055ACU
, 0x000055ACU
, 0x000055ACU
, 0x000055ACU
,
1103 0x000055ACU
, 0x000055ACU
, 0x000055ACU
, 0x000055ACU
1106 /* Bitmask for bitfield lro{L}_des_max[1:0] */
1107 static u32 rpo_lro_ldes_max_msk
[32] = {
1108 0x00000003U
, 0x00000030U
, 0x00000300U
, 0x00003000U
,
1109 0x00030000U
, 0x00300000U
, 0x03000000U
, 0x30000000U
,
1110 0x00000003U
, 0x00000030U
, 0x00000300U
, 0x00003000U
,
1111 0x00030000U
, 0x00300000U
, 0x03000000U
, 0x30000000U
,
1112 0x00000003U
, 0x00000030U
, 0x00000300U
, 0x00003000U
,
1113 0x00030000U
, 0x00300000U
, 0x03000000U
, 0x30000000U
,
1114 0x00000003U
, 0x00000030U
, 0x00000300U
, 0x00003000U
,
1115 0x00030000U
, 0x00300000U
, 0x03000000U
, 0x30000000U
1118 /* Lower bit position of bitfield lro{L}_des_max[1:0] */
1119 static u32 rpo_lro_ldes_max_shift
[32] = {
1120 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1121 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1122 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U,
1123 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U
1126 aq_hw_write_reg_bit(aq_hw
, rpo_lro_ldes_max_adr
[lro
],
1127 rpo_lro_ldes_max_msk
[lro
],
1128 rpo_lro_ldes_max_shift
[lro
],
1129 lro_max_number_of_descriptors
);
1132 void hw_atl_rpo_lro_time_base_divider_set(struct aq_hw_s
*aq_hw
,
1133 u32 lro_time_base_divider
)
1135 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_TB_DIV_ADR
,
1136 HW_ATL_RPO_LRO_TB_DIV_MSK
,
1137 HW_ATL_RPO_LRO_TB_DIV_SHIFT
,
1138 lro_time_base_divider
);
1141 void hw_atl_rpo_lro_inactive_interval_set(struct aq_hw_s
*aq_hw
,
1142 u32 lro_inactive_interval
)
1144 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_INA_IVAL_ADR
,
1145 HW_ATL_RPO_LRO_INA_IVAL_MSK
,
1146 HW_ATL_RPO_LRO_INA_IVAL_SHIFT
,
1147 lro_inactive_interval
);
1150 void hw_atl_rpo_lro_max_coalescing_interval_set(struct aq_hw_s
*aq_hw
,
1151 u32 lro_max_coal_interval
)
1153 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RPO_LRO_MAX_IVAL_ADR
,
1154 HW_ATL_RPO_LRO_MAX_IVAL_MSK
,
1155 HW_ATL_RPO_LRO_MAX_IVAL_SHIFT
,
1156 lro_max_coal_interval
);
1160 void hw_atl_rx_rx_reg_res_dis_set(struct aq_hw_s
*aq_hw
, u32 rx_reg_res_dis
)
1162 aq_hw_write_reg_bit(aq_hw
, HW_ATL_RX_REG_RES_DSBL_ADR
,
1163 HW_ATL_RX_REG_RES_DSBL_MSK
,
1164 HW_ATL_RX_REG_RES_DSBL_SHIFT
,
1169 void hw_atl_tdm_cpu_id_set(struct aq_hw_s
*aq_hw
, u32 cpuid
, u32 dca
)
1171 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DCADCPUID_ADR(dca
),
1172 HW_ATL_TDM_DCADCPUID_MSK
,
1173 HW_ATL_TDM_DCADCPUID_SHIFT
, cpuid
);
1176 void hw_atl_tdm_large_send_offload_en_set(struct aq_hw_s
*aq_hw
,
1177 u32 large_send_offload_en
)
1179 aq_hw_write_reg(aq_hw
, HW_ATL_TDM_LSO_EN_ADR
, large_send_offload_en
);
1182 void hw_atl_tdm_tx_dca_en_set(struct aq_hw_s
*aq_hw
, u32 tx_dca_en
)
1184 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DCA_EN_ADR
, HW_ATL_TDM_DCA_EN_MSK
,
1185 HW_ATL_TDM_DCA_EN_SHIFT
, tx_dca_en
);
1188 void hw_atl_tdm_tx_dca_mode_set(struct aq_hw_s
*aq_hw
, u32 tx_dca_mode
)
1190 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DCA_MODE_ADR
,
1191 HW_ATL_TDM_DCA_MODE_MSK
,
1192 HW_ATL_TDM_DCA_MODE_SHIFT
, tx_dca_mode
);
1195 void hw_atl_tdm_tx_desc_dca_en_set(struct aq_hw_s
*aq_hw
, u32 tx_desc_dca_en
,
1198 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DCADDESC_EN_ADR(dca
),
1199 HW_ATL_TDM_DCADDESC_EN_MSK
,
1200 HW_ATL_TDM_DCADDESC_EN_SHIFT
,
1204 void hw_atl_tdm_tx_desc_en_set(struct aq_hw_s
*aq_hw
, u32 tx_desc_en
,
1207 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DESCDEN_ADR(descriptor
),
1208 HW_ATL_TDM_DESCDEN_MSK
,
1209 HW_ATL_TDM_DESCDEN_SHIFT
,
1213 u32
hw_atl_tdm_tx_desc_head_ptr_get(struct aq_hw_s
*aq_hw
, u32 descriptor
)
1215 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_TDM_DESCDHD_ADR(descriptor
),
1216 HW_ATL_TDM_DESCDHD_MSK
,
1217 HW_ATL_TDM_DESCDHD_SHIFT
);
1220 void hw_atl_tdm_tx_desc_len_set(struct aq_hw_s
*aq_hw
, u32 tx_desc_len
,
1223 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DESCDLEN_ADR(descriptor
),
1224 HW_ATL_TDM_DESCDLEN_MSK
,
1225 HW_ATL_TDM_DESCDLEN_SHIFT
,
1229 void hw_atl_tdm_tx_desc_wr_wb_irq_en_set(struct aq_hw_s
*aq_hw
,
1230 u32 tx_desc_wr_wb_irq_en
)
1232 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_INT_DESC_WRB_EN_ADR
,
1233 HW_ATL_TDM_INT_DESC_WRB_EN_MSK
,
1234 HW_ATL_TDM_INT_DESC_WRB_EN_SHIFT
,
1235 tx_desc_wr_wb_irq_en
);
1238 void hw_atl_tdm_tx_desc_wr_wb_threshold_set(struct aq_hw_s
*aq_hw
,
1239 u32 tx_desc_wr_wb_threshold
,
1242 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_DESCDWRB_THRESH_ADR(descriptor
),
1243 HW_ATL_TDM_DESCDWRB_THRESH_MSK
,
1244 HW_ATL_TDM_DESCDWRB_THRESH_SHIFT
,
1245 tx_desc_wr_wb_threshold
);
1248 void hw_atl_tdm_tdm_intr_moder_en_set(struct aq_hw_s
*aq_hw
,
1249 u32 tdm_irq_moderation_en
)
1251 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TDM_INT_MOD_EN_ADR
,
1252 HW_ATL_TDM_INT_MOD_EN_MSK
,
1253 HW_ATL_TDM_INT_MOD_EN_SHIFT
,
1254 tdm_irq_moderation_en
);
1258 void hw_atl_thm_lso_tcp_flag_of_first_pkt_set(struct aq_hw_s
*aq_hw
,
1259 u32 lso_tcp_flag_of_first_pkt
)
1261 aq_hw_write_reg_bit(aq_hw
, HW_ATL_THM_LSO_TCP_FLAG_FIRST_ADR
,
1262 HW_ATL_THM_LSO_TCP_FLAG_FIRST_MSK
,
1263 HW_ATL_THM_LSO_TCP_FLAG_FIRST_SHIFT
,
1264 lso_tcp_flag_of_first_pkt
);
1267 void hw_atl_thm_lso_tcp_flag_of_last_pkt_set(struct aq_hw_s
*aq_hw
,
1268 u32 lso_tcp_flag_of_last_pkt
)
1270 aq_hw_write_reg_bit(aq_hw
, HW_ATL_THM_LSO_TCP_FLAG_LAST_ADR
,
1271 HW_ATL_THM_LSO_TCP_FLAG_LAST_MSK
,
1272 HW_ATL_THM_LSO_TCP_FLAG_LAST_SHIFT
,
1273 lso_tcp_flag_of_last_pkt
);
1276 void hw_atl_thm_lso_tcp_flag_of_middle_pkt_set(struct aq_hw_s
*aq_hw
,
1277 u32 lso_tcp_flag_of_middle_pkt
)
1279 aq_hw_write_reg_bit(aq_hw
, HW_ATL_THM_LSO_TCP_FLAG_MID_ADR
,
1280 HW_ATL_THM_LSO_TCP_FLAG_MID_MSK
,
1281 HW_ATL_THM_LSO_TCP_FLAG_MID_SHIFT
,
1282 lso_tcp_flag_of_middle_pkt
);
1285 /* TPB: tx packet buffer */
1286 void hw_atl_tpb_tx_buff_en_set(struct aq_hw_s
*aq_hw
, u32 tx_buff_en
)
1288 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TX_BUF_EN_ADR
,
1289 HW_ATL_TPB_TX_BUF_EN_MSK
,
1290 HW_ATL_TPB_TX_BUF_EN_SHIFT
, tx_buff_en
);
1293 void hw_atl_rpb_tps_tx_tc_mode_set(struct aq_hw_s
*aq_hw
,
1294 u32 tx_traf_class_mode
)
1296 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TX_TC_MODE_ADDR
,
1297 HW_ATL_TPB_TX_TC_MODE_MSK
,
1298 HW_ATL_TPB_TX_TC_MODE_SHIFT
,
1299 tx_traf_class_mode
);
1302 void hw_atl_tpb_tx_buff_hi_threshold_per_tc_set(struct aq_hw_s
*aq_hw
,
1303 u32 tx_buff_hi_threshold_per_tc
,
1306 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TXBHI_THRESH_ADR(buffer
),
1307 HW_ATL_TPB_TXBHI_THRESH_MSK
,
1308 HW_ATL_TPB_TXBHI_THRESH_SHIFT
,
1309 tx_buff_hi_threshold_per_tc
);
1312 void hw_atl_tpb_tx_buff_lo_threshold_per_tc_set(struct aq_hw_s
*aq_hw
,
1313 u32 tx_buff_lo_threshold_per_tc
,
1316 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TXBLO_THRESH_ADR(buffer
),
1317 HW_ATL_TPB_TXBLO_THRESH_MSK
,
1318 HW_ATL_TPB_TXBLO_THRESH_SHIFT
,
1319 tx_buff_lo_threshold_per_tc
);
1322 void hw_atl_tpb_tx_dma_sys_lbk_en_set(struct aq_hw_s
*aq_hw
, u32 tx_dma_sys_lbk_en
)
1324 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_DMA_SYS_LBK_ADR
,
1325 HW_ATL_TPB_DMA_SYS_LBK_MSK
,
1326 HW_ATL_TPB_DMA_SYS_LBK_SHIFT
,
1330 void hw_atl_tpb_tx_pkt_buff_size_per_tc_set(struct aq_hw_s
*aq_hw
,
1331 u32 tx_pkt_buff_size_per_tc
, u32 buffer
)
1333 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TXBBUF_SIZE_ADR(buffer
),
1334 HW_ATL_TPB_TXBBUF_SIZE_MSK
,
1335 HW_ATL_TPB_TXBBUF_SIZE_SHIFT
,
1336 tx_pkt_buff_size_per_tc
);
1339 void hw_atl_tpb_tx_path_scp_ins_en_set(struct aq_hw_s
*aq_hw
, u32 tx_path_scp_ins_en
)
1341 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPB_TX_SCP_INS_EN_ADR
,
1342 HW_ATL_TPB_TX_SCP_INS_EN_MSK
,
1343 HW_ATL_TPB_TX_SCP_INS_EN_SHIFT
,
1344 tx_path_scp_ins_en
);
1347 /* TPO: tx packet offload */
1348 void hw_atl_tpo_ipv4header_crc_offload_en_set(struct aq_hw_s
*aq_hw
,
1349 u32 ipv4header_crc_offload_en
)
1351 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPO_IPV4CHK_EN_ADR
,
1352 HW_ATL_TPO_IPV4CHK_EN_MSK
,
1353 HW_ATL_TPO_IPV4CHK_EN_SHIFT
,
1354 ipv4header_crc_offload_en
);
1357 void hw_atl_tpo_tcp_udp_crc_offload_en_set(struct aq_hw_s
*aq_hw
,
1358 u32 tcp_udp_crc_offload_en
)
1360 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPOL4CHK_EN_ADR
,
1361 HW_ATL_TPOL4CHK_EN_MSK
,
1362 HW_ATL_TPOL4CHK_EN_SHIFT
,
1363 tcp_udp_crc_offload_en
);
1366 void hw_atl_tpo_tx_pkt_sys_lbk_en_set(struct aq_hw_s
*aq_hw
,
1367 u32 tx_pkt_sys_lbk_en
)
1369 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPO_PKT_SYS_LBK_ADR
,
1370 HW_ATL_TPO_PKT_SYS_LBK_MSK
,
1371 HW_ATL_TPO_PKT_SYS_LBK_SHIFT
,
1375 /* TPS: tx packet scheduler */
1376 void hw_atl_tps_tx_pkt_shed_data_arb_mode_set(struct aq_hw_s
*aq_hw
,
1377 u32 tx_pkt_shed_data_arb_mode
)
1379 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DATA_TC_ARB_MODE_ADR
,
1380 HW_ATL_TPS_DATA_TC_ARB_MODE_MSK
,
1381 HW_ATL_TPS_DATA_TC_ARB_MODE_SHIFT
,
1382 tx_pkt_shed_data_arb_mode
);
1385 void hw_atl_tps_tx_pkt_shed_desc_rate_curr_time_res_set(struct aq_hw_s
*aq_hw
,
1388 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_RATE_TA_RST_ADR
,
1389 HW_ATL_TPS_DESC_RATE_TA_RST_MSK
,
1390 HW_ATL_TPS_DESC_RATE_TA_RST_SHIFT
,
1394 void hw_atl_tps_tx_pkt_shed_desc_rate_lim_set(struct aq_hw_s
*aq_hw
,
1395 u32 tx_pkt_shed_desc_rate_lim
)
1397 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_RATE_LIM_ADR
,
1398 HW_ATL_TPS_DESC_RATE_LIM_MSK
,
1399 HW_ATL_TPS_DESC_RATE_LIM_SHIFT
,
1400 tx_pkt_shed_desc_rate_lim
);
1403 void hw_atl_tps_tx_pkt_shed_desc_tc_arb_mode_set(struct aq_hw_s
*aq_hw
,
1406 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_TC_ARB_MODE_ADR
,
1407 HW_ATL_TPS_DESC_TC_ARB_MODE_MSK
,
1408 HW_ATL_TPS_DESC_TC_ARB_MODE_SHIFT
,
1412 void hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw_s
*aq_hw
,
1416 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_TCTCREDIT_MAX_ADR(tc
),
1417 HW_ATL_TPS_DESC_TCTCREDIT_MAX_MSK
,
1418 HW_ATL_TPS_DESC_TCTCREDIT_MAX_SHIFT
,
1422 void hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(struct aq_hw_s
*aq_hw
,
1423 u32 tx_pkt_shed_desc_tc_weight
,
1426 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_TCTWEIGHT_ADR(tc
),
1427 HW_ATL_TPS_DESC_TCTWEIGHT_MSK
,
1428 HW_ATL_TPS_DESC_TCTWEIGHT_SHIFT
,
1429 tx_pkt_shed_desc_tc_weight
);
1432 void hw_atl_tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw_s
*aq_hw
,
1435 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DESC_VM_ARB_MODE_ADR
,
1436 HW_ATL_TPS_DESC_VM_ARB_MODE_MSK
,
1437 HW_ATL_TPS_DESC_VM_ARB_MODE_SHIFT
,
1441 void hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s
*aq_hw
,
1445 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DATA_TCTCREDIT_MAX_ADR(tc
),
1446 HW_ATL_TPS_DATA_TCTCREDIT_MAX_MSK
,
1447 HW_ATL_TPS_DATA_TCTCREDIT_MAX_SHIFT
,
1451 void hw_atl_tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw_s
*aq_hw
,
1452 u32 tx_pkt_shed_tc_data_weight
,
1455 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TPS_DATA_TCTWEIGHT_ADR(tc
),
1456 HW_ATL_TPS_DATA_TCTWEIGHT_MSK
,
1457 HW_ATL_TPS_DATA_TCTWEIGHT_SHIFT
,
1458 tx_pkt_shed_tc_data_weight
);
1462 void hw_atl_tx_tx_reg_res_dis_set(struct aq_hw_s
*aq_hw
, u32 tx_reg_res_dis
)
1464 aq_hw_write_reg_bit(aq_hw
, HW_ATL_TX_REG_RES_DSBL_ADR
,
1465 HW_ATL_TX_REG_RES_DSBL_MSK
,
1466 HW_ATL_TX_REG_RES_DSBL_SHIFT
, tx_reg_res_dis
);
1470 u32
hw_atl_msm_reg_access_status_get(struct aq_hw_s
*aq_hw
)
1472 return aq_hw_read_reg_bit(aq_hw
, HW_ATL_MSM_REG_ACCESS_BUSY_ADR
,
1473 HW_ATL_MSM_REG_ACCESS_BUSY_MSK
,
1474 HW_ATL_MSM_REG_ACCESS_BUSY_SHIFT
);
1477 void hw_atl_msm_reg_addr_for_indirect_addr_set(struct aq_hw_s
*aq_hw
,
1478 u32 reg_addr_for_indirect_addr
)
1480 aq_hw_write_reg_bit(aq_hw
, HW_ATL_MSM_REG_ADDR_ADR
,
1481 HW_ATL_MSM_REG_ADDR_MSK
,
1482 HW_ATL_MSM_REG_ADDR_SHIFT
,
1483 reg_addr_for_indirect_addr
);
1486 void hw_atl_msm_reg_rd_strobe_set(struct aq_hw_s
*aq_hw
, u32 reg_rd_strobe
)
1488 aq_hw_write_reg_bit(aq_hw
, HW_ATL_MSM_REG_RD_STROBE_ADR
,
1489 HW_ATL_MSM_REG_RD_STROBE_MSK
,
1490 HW_ATL_MSM_REG_RD_STROBE_SHIFT
,
1494 u32
hw_atl_msm_reg_rd_data_get(struct aq_hw_s
*aq_hw
)
1496 return aq_hw_read_reg(aq_hw
, HW_ATL_MSM_REG_RD_DATA_ADR
);
1499 void hw_atl_msm_reg_wr_data_set(struct aq_hw_s
*aq_hw
, u32 reg_wr_data
)
1501 aq_hw_write_reg(aq_hw
, HW_ATL_MSM_REG_WR_DATA_ADR
, reg_wr_data
);
1504 void hw_atl_msm_reg_wr_strobe_set(struct aq_hw_s
*aq_hw
, u32 reg_wr_strobe
)
1506 aq_hw_write_reg_bit(aq_hw
, HW_ATL_MSM_REG_WR_STROBE_ADR
,
1507 HW_ATL_MSM_REG_WR_STROBE_MSK
,
1508 HW_ATL_MSM_REG_WR_STROBE_SHIFT
,
1513 void hw_atl_pci_pci_reg_res_dis_set(struct aq_hw_s
*aq_hw
, u32 pci_reg_res_dis
)
1515 aq_hw_write_reg_bit(aq_hw
, HW_ATL_PCI_REG_RES_DSBL_ADR
,
1516 HW_ATL_PCI_REG_RES_DSBL_MSK
,
1517 HW_ATL_PCI_REG_RES_DSBL_SHIFT
,
1521 void hw_atl_reg_glb_cpu_scratch_scp_set(struct aq_hw_s
*aq_hw
,
1522 u32 glb_cpu_scratch_scp
,
1525 aq_hw_write_reg(aq_hw
, HW_ATL_GLB_CPU_SCRATCH_SCP_ADR(scratch_scp
),
1526 glb_cpu_scratch_scp
);
1529 void hw_atl_mcp_up_force_intr_set(struct aq_hw_s
*aq_hw
, u32 up_force_intr
)
1531 aq_hw_write_reg_bit(aq_hw
, HW_ATL_MCP_UP_FORCE_INTERRUPT_ADR
,
1532 HW_ATL_MCP_UP_FORCE_INTERRUPT_MSK
,
1533 HW_ATL_MCP_UP_FORCE_INTERRUPT_SHIFT
,
1537 void hw_atl_rpfl3l4_ipv4_dest_addr_clear(struct aq_hw_s
*aq_hw
, u8 location
)
1539 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_L3_DSTA_ADR(location
), 0U);
1542 void hw_atl_rpfl3l4_ipv4_src_addr_clear(struct aq_hw_s
*aq_hw
, u8 location
)
1544 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_L3_SRCA_ADR(location
), 0U);
1547 void hw_atl_rpfl3l4_cmd_clear(struct aq_hw_s
*aq_hw
, u8 location
)
1549 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_L3_REG_CTRL_ADR(location
), 0U);
1552 void hw_atl_rpfl3l4_ipv6_dest_addr_clear(struct aq_hw_s
*aq_hw
, u8 location
)
1556 for (i
= 0; i
< 4; ++i
)
1557 aq_hw_write_reg(aq_hw
,
1558 HW_ATL_RPF_L3_DSTA_ADR(location
+ i
),
1562 void hw_atl_rpfl3l4_ipv6_src_addr_clear(struct aq_hw_s
*aq_hw
, u8 location
)
1566 for (i
= 0; i
< 4; ++i
)
1567 aq_hw_write_reg(aq_hw
,
1568 HW_ATL_RPF_L3_SRCA_ADR(location
+ i
),
1572 void hw_atl_rpfl3l4_ipv4_dest_addr_set(struct aq_hw_s
*aq_hw
, u8 location
,
1575 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_L3_DSTA_ADR(location
),
1579 void hw_atl_rpfl3l4_ipv4_src_addr_set(struct aq_hw_s
*aq_hw
, u8 location
,
1582 aq_hw_write_reg(aq_hw
,
1583 HW_ATL_RPF_L3_SRCA_ADR(location
),
1587 void hw_atl_rpfl3l4_cmd_set(struct aq_hw_s
*aq_hw
, u8 location
, u32 cmd
)
1589 aq_hw_write_reg(aq_hw
, HW_ATL_RPF_L3_REG_CTRL_ADR(location
), cmd
);
1592 void hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s
*aq_hw
, u8 location
,
1597 for (i
= 0; i
< 4; ++i
)
1598 aq_hw_write_reg(aq_hw
,
1599 HW_ATL_RPF_L3_SRCA_ADR(location
+ i
),
1603 void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s
*aq_hw
, u8 location
,
1608 for (i
= 0; i
< 4; ++i
)
1609 aq_hw_write_reg(aq_hw
,
1610 HW_ATL_RPF_L3_DSTA_ADR(location
+ i
),
1614 u32
hw_atl_sem_ram_get(struct aq_hw_s
*self
)
1616 return hw_atl_reg_glb_cpu_sem_get(self
, HW_ATL_FW_SM_RAM
);
1619 u32
hw_atl_scrpad_get(struct aq_hw_s
*aq_hw
, u32 scratch_scp
)
1621 return aq_hw_read_reg(aq_hw
,
1622 HW_ATL_GLB_CPU_SCRATCH_SCP_ADR(scratch_scp
));
1625 u32
hw_atl_scrpad12_get(struct aq_hw_s
*self
)
1627 return hw_atl_scrpad_get(self
, 0xB);
1630 u32
hw_atl_scrpad25_get(struct aq_hw_s
*self
)
1632 return hw_atl_scrpad_get(self
, 0x18);