File tree Expand file tree Collapse file tree 4 files changed +29
-9
lines changed
drivers/net/ethernet/amd/xgbe Expand file tree Collapse file tree 4 files changed +29
-9
lines changed Original file line number Diff line number Diff line change 365
365
#define MAC_HWF0R_TXCOESEL_WIDTH 1
366
366
#define MAC_HWF0R_VLHASH_INDEX 4
367
367
#define MAC_HWF0R_VLHASH_WIDTH 1
368
+ #define MAC_HWF1R_ADDR64_INDEX 14
369
+ #define MAC_HWF1R_ADDR64_WIDTH 2
368
370
#define MAC_HWF1R_ADVTHWORD_INDEX 13
369
371
#define MAC_HWF1R_ADVTHWORD_WIDTH 1
370
372
#define MAC_HWF1R_DBGMEMA_INDEX 19
Original file line number Diff line number Diff line change @@ -519,6 +519,7 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
519
519
RXFIFOSIZE );
520
520
hw_feat -> tx_fifo_size = XGMAC_GET_BITS (mac_hfr1 , MAC_HWF1R ,
521
521
TXFIFOSIZE );
522
+ hw_feat -> dma_width = XGMAC_GET_BITS (mac_hfr1 , MAC_HWF1R , ADDR64 );
522
523
hw_feat -> dcb = XGMAC_GET_BITS (mac_hfr1 , MAC_HWF1R , DCBEN );
523
524
hw_feat -> sph = XGMAC_GET_BITS (mac_hfr1 , MAC_HWF1R , SPHEN );
524
525
hw_feat -> tso = XGMAC_GET_BITS (mac_hfr1 , MAC_HWF1R , TSOEN );
@@ -553,6 +554,21 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
553
554
break ;
554
555
}
555
556
557
+ /* Translate the address width setting into actual number */
558
+ switch (hw_feat -> dma_width ) {
559
+ case 0 :
560
+ hw_feat -> dma_width = 32 ;
561
+ break ;
562
+ case 1 :
563
+ hw_feat -> dma_width = 40 ;
564
+ break ;
565
+ case 2 :
566
+ hw_feat -> dma_width = 48 ;
567
+ break ;
568
+ default :
569
+ hw_feat -> dma_width = 32 ;
570
+ }
571
+
556
572
/* The Queue, Channel and TC counts are zero based so increment them
557
573
* to get the actual number
558
574
*/
Original file line number Diff line number Diff line change @@ -374,15 +374,6 @@ static int xgbe_probe(struct platform_device *pdev)
374
374
pdata -> awcache = XGBE_DMA_SYS_AWCACHE ;
375
375
}
376
376
377
- /* Set the DMA mask */
378
- if (!dev -> dma_mask )
379
- dev -> dma_mask = & dev -> coherent_dma_mask ;
380
- ret = dma_set_mask_and_coherent (dev , DMA_BIT_MASK (40 ));
381
- if (ret ) {
382
- dev_err (dev , "dma_set_mask_and_coherent failed\n" );
383
- goto err_io ;
384
- }
385
-
386
377
/* Get the device interrupt */
387
378
ret = platform_get_irq (pdev , 0 );
388
379
if (ret < 0 ) {
@@ -409,6 +400,16 @@ static int xgbe_probe(struct platform_device *pdev)
409
400
/* Set default configuration data */
410
401
xgbe_default_config (pdata );
411
402
403
+ /* Set the DMA mask */
404
+ if (!dev -> dma_mask )
405
+ dev -> dma_mask = & dev -> coherent_dma_mask ;
406
+ ret = dma_set_mask_and_coherent (dev ,
407
+ DMA_BIT_MASK (pdata -> hw_feat .dma_width ));
408
+ if (ret ) {
409
+ dev_err (dev , "dma_set_mask_and_coherent failed\n" );
410
+ goto err_io ;
411
+ }
412
+
412
413
/* Calculate the number of Tx and Rx rings to be created
413
414
* -Tx (DMA) Channels map 1-to-1 to Tx Queues so set
414
415
* the number of Tx queues to the number of Tx channels
Original file line number Diff line number Diff line change @@ -632,6 +632,7 @@ struct xgbe_hw_features {
632
632
unsigned int rx_fifo_size ; /* MTL Receive FIFO Size */
633
633
unsigned int tx_fifo_size ; /* MTL Transmit FIFO Size */
634
634
unsigned int adv_ts_hi ; /* Advance Timestamping High Word */
635
+ unsigned int dma_width ; /* DMA width */
635
636
unsigned int dcb ; /* DCB Feature */
636
637
unsigned int sph ; /* Split Header Feature */
637
638
unsigned int tso ; /* TCP Segmentation Offload */
You can’t perform that action at this time.
0 commit comments