Lines Matching +full:rx +full:- +full:ts +full:- +full:max
4 * Copyright (c) 2014-2016,2020 Advanced Micro Devices, Inc.
116 #include "xgbe-common.h"
124 return (-EINVAL); in xgbe_calc_rx_buf_size()
127 rx_buf_size = min(max(rx_buf_size, XGBE_RX_MIN_BUF_SIZE), PAGE_SIZE); in xgbe_calc_rx_buf_size()
128 rx_buf_size = (rx_buf_size + XGBE_RX_BUF_ALIGN - 1) & in xgbe_calc_rx_buf_size()
129 ~(XGBE_RX_BUF_ALIGN - 1); in xgbe_calc_rx_buf_size()
138 struct xgbe_hw_features *hw_feat = &pdata->hw_feat; in xgbe_get_all_hw_features()
140 DBGPR("-->xgbe_get_all_hw_features\n"); in xgbe_get_all_hw_features()
148 hw_feat->version = XGMAC_IOREAD(pdata, MAC_VR); in xgbe_get_all_hw_features()
151 hw_feat->gmii = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, GMIISEL); in xgbe_get_all_hw_features()
152 hw_feat->vlhash = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, VLHASH); in xgbe_get_all_hw_features()
153 hw_feat->sma = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, SMASEL); in xgbe_get_all_hw_features()
154 hw_feat->rwk = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, RWKSEL); in xgbe_get_all_hw_features()
155 hw_feat->mgk = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, MGKSEL); in xgbe_get_all_hw_features()
156 hw_feat->mmc = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, MMCSEL); in xgbe_get_all_hw_features()
157 hw_feat->aoe = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, ARPOFFSEL); in xgbe_get_all_hw_features()
158 hw_feat->ts = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, TSSEL); in xgbe_get_all_hw_features()
159 hw_feat->eee = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, EEESEL); in xgbe_get_all_hw_features()
160 hw_feat->tx_coe = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, TXCOESEL); in xgbe_get_all_hw_features()
161 hw_feat->rx_coe = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, RXCOESEL); in xgbe_get_all_hw_features()
162 hw_feat->addn_mac = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, in xgbe_get_all_hw_features()
164 hw_feat->ts_src = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, TSSTSSEL); in xgbe_get_all_hw_features()
165 hw_feat->sa_vlan_ins = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, SAVLANINS); in xgbe_get_all_hw_features()
166 hw_feat->vxn = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, VXN); in xgbe_get_all_hw_features()
169 hw_feat->rx_fifo_size = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, in xgbe_get_all_hw_features()
171 hw_feat->tx_fifo_size = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, in xgbe_get_all_hw_features()
173 hw_feat->adv_ts_hi = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, ADVTHWORD); in xgbe_get_all_hw_features()
174 hw_feat->dma_width = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, ADDR64); in xgbe_get_all_hw_features()
175 hw_feat->dcb = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, DCBEN); in xgbe_get_all_hw_features()
176 hw_feat->sph = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, SPHEN); in xgbe_get_all_hw_features()
177 hw_feat->tso = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, TSOEN); in xgbe_get_all_hw_features()
178 hw_feat->dma_debug = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, DBGMEMA); in xgbe_get_all_hw_features()
179 hw_feat->rss = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, RSSEN); in xgbe_get_all_hw_features()
180 hw_feat->tc_cnt = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, NUMTC); in xgbe_get_all_hw_features()
181 hw_feat->hash_table_size = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, in xgbe_get_all_hw_features()
183 hw_feat->l3l4_filter_num = XGMAC_GET_BITS(mac_hfr1, MAC_HWF1R, in xgbe_get_all_hw_features()
187 hw_feat->rx_q_cnt = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, RXQCNT); in xgbe_get_all_hw_features()
188 hw_feat->tx_q_cnt = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, TXQCNT); in xgbe_get_all_hw_features()
189 hw_feat->rx_ch_cnt = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, RXCHCNT); in xgbe_get_all_hw_features()
190 hw_feat->tx_ch_cnt = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, TXCHCNT); in xgbe_get_all_hw_features()
191 hw_feat->pps_out_num = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, PPSOUTNUM); in xgbe_get_all_hw_features()
192 hw_feat->aux_snap_num = XGMAC_GET_BITS(mac_hfr2, MAC_HWF2R, AUXSNAPNUM); in xgbe_get_all_hw_features()
195 switch (hw_feat->hash_table_size) { in xgbe_get_all_hw_features()
199 hw_feat->hash_table_size = 64; in xgbe_get_all_hw_features()
202 hw_feat->hash_table_size = 128; in xgbe_get_all_hw_features()
205 hw_feat->hash_table_size = 256; in xgbe_get_all_hw_features()
210 switch (hw_feat->dma_width) { in xgbe_get_all_hw_features()
212 hw_feat->dma_width = 32; in xgbe_get_all_hw_features()
215 hw_feat->dma_width = 40; in xgbe_get_all_hw_features()
218 hw_feat->dma_width = 48; in xgbe_get_all_hw_features()
221 hw_feat->dma_width = 32; in xgbe_get_all_hw_features()
227 hw_feat->rx_q_cnt++; in xgbe_get_all_hw_features()
228 hw_feat->tx_q_cnt++; in xgbe_get_all_hw_features()
229 hw_feat->rx_ch_cnt++; in xgbe_get_all_hw_features()
230 hw_feat->tx_ch_cnt++; in xgbe_get_all_hw_features()
231 hw_feat->tc_cnt++; in xgbe_get_all_hw_features()
234 hw_feat->rx_fifo_size = 1 << (hw_feat->rx_fifo_size + 7); in xgbe_get_all_hw_features()
235 hw_feat->tx_fifo_size = 1 << (hw_feat->tx_fifo_size + 7); in xgbe_get_all_hw_features()
236 DBGPR("%s: Tx fifo 0x%x Rx fifo 0x%x\n", __func__, in xgbe_get_all_hw_features()
237 hw_feat->tx_fifo_size, hw_feat->rx_fifo_size); in xgbe_get_all_hw_features()
243 hw_feat->gmii ? "yes" : "no"); in xgbe_get_all_hw_features()
245 hw_feat->vlhash ? "yes" : "no"); in xgbe_get_all_hw_features()
247 hw_feat->sma ? "yes" : "no"); in xgbe_get_all_hw_features()
248 DBGPR(" Wake-up packet support : %s\n", in xgbe_get_all_hw_features()
249 hw_feat->rwk ? "yes" : "no"); in xgbe_get_all_hw_features()
251 hw_feat->mgk ? "yes" : "no"); in xgbe_get_all_hw_features()
253 hw_feat->mmc ? "yes" : "no"); in xgbe_get_all_hw_features()
255 hw_feat->aoe ? "yes" : "no"); in xgbe_get_all_hw_features()
256 DBGPR(" IEEE 1588-2008 Timestamp : %s\n", in xgbe_get_all_hw_features()
257 hw_feat->ts ? "yes" : "no"); in xgbe_get_all_hw_features()
259 hw_feat->eee ? "yes" : "no"); in xgbe_get_all_hw_features()
261 hw_feat->tx_coe ? "yes" : "no"); in xgbe_get_all_hw_features()
262 DBGPR(" RX checksum offload : %s\n", in xgbe_get_all_hw_features()
263 hw_feat->rx_coe ? "yes" : "no"); in xgbe_get_all_hw_features()
265 hw_feat->addn_mac); in xgbe_get_all_hw_features()
267 (hw_feat->ts_src == 1) ? "internal" : in xgbe_get_all_hw_features()
268 (hw_feat->ts_src == 2) ? "external" : in xgbe_get_all_hw_features()
269 (hw_feat->ts_src == 3) ? "internal/external" : "n/a"); in xgbe_get_all_hw_features()
271 hw_feat->sa_vlan_ins ? "yes" : "no"); in xgbe_get_all_hw_features()
274 DBGPR(" RX fifo size : %u\n", in xgbe_get_all_hw_features()
275 hw_feat->rx_fifo_size); in xgbe_get_all_hw_features()
277 hw_feat->tx_fifo_size); in xgbe_get_all_hw_features()
279 hw_feat->adv_ts_hi ? "yes" : "no"); in xgbe_get_all_hw_features()
281 hw_feat->dma_width); in xgbe_get_all_hw_features()
283 hw_feat->dcb ? "yes" : "no"); in xgbe_get_all_hw_features()
285 hw_feat->sph ? "yes" : "no"); in xgbe_get_all_hw_features()
287 hw_feat->tso ? "yes" : "no"); in xgbe_get_all_hw_features()
289 hw_feat->dma_debug ? "yes" : "no"); in xgbe_get_all_hw_features()
291 hw_feat->rss ? "yes" : "no"); in xgbe_get_all_hw_features()
293 hw_feat->tc_cnt); in xgbe_get_all_hw_features()
295 hw_feat->hash_table_size); in xgbe_get_all_hw_features()
297 hw_feat->l3l4_filter_num); in xgbe_get_all_hw_features()
300 DBGPR(" RX queue count : %u\n", in xgbe_get_all_hw_features()
301 hw_feat->rx_q_cnt); in xgbe_get_all_hw_features()
303 hw_feat->tx_q_cnt); in xgbe_get_all_hw_features()
304 DBGPR(" RX DMA channel count : %u\n", in xgbe_get_all_hw_features()
305 hw_feat->rx_ch_cnt); in xgbe_get_all_hw_features()
307 hw_feat->rx_ch_cnt); in xgbe_get_all_hw_features()
309 hw_feat->pps_out_num); in xgbe_get_all_hw_features()
311 hw_feat->aux_snap_num); in xgbe_get_all_hw_features()
313 DBGPR("<--xgbe_get_all_hw_features\n"); in xgbe_get_all_hw_features()
319 struct xgbe_hw_if *hw_if = &pdata->hw_if; in xgbe_init_tx_coalesce()
321 DBGPR("-->xgbe_init_tx_coalesce\n"); in xgbe_init_tx_coalesce()
323 pdata->tx_usecs = XGMAC_INIT_DMA_TX_USECS; in xgbe_init_tx_coalesce()
324 pdata->tx_frames = XGMAC_INIT_DMA_TX_FRAMES; in xgbe_init_tx_coalesce()
326 hw_if->config_tx_coalesce(pdata); in xgbe_init_tx_coalesce()
328 DBGPR("<--xgbe_init_tx_coalesce\n"); in xgbe_init_tx_coalesce()
334 struct xgbe_hw_if *hw_if = &pdata->hw_if; in xgbe_init_rx_coalesce()
336 DBGPR("-->xgbe_init_rx_coalesce\n"); in xgbe_init_rx_coalesce()
338 pdata->rx_riwt = hw_if->usec_to_riwt(pdata, XGMAC_INIT_DMA_RX_USECS); in xgbe_init_rx_coalesce()
339 pdata->rx_usecs = XGMAC_INIT_DMA_RX_USECS; in xgbe_init_rx_coalesce()
340 pdata->rx_frames = XGMAC_INIT_DMA_RX_FRAMES; in xgbe_init_rx_coalesce()
342 hw_if->config_rx_coalesce(pdata); in xgbe_init_rx_coalesce()
344 DBGPR("<--xgbe_init_rx_coalesce\n"); in xgbe_init_rx_coalesce()