Browse Source

[e1000] Add 82576 support

Add the 82576 to the e1000 driver.

- Examining the Linux 2.6.30-rc4 igb driver, which supports this card and;
- Information available in the Intel® 82576 Gigabit Ethernet
  Controller Datasheet v2.1, which is available from Intel's web site.

I only have a dual-ported card with Copper PHY, so any code paths relating
to Fibre haven't been tested. Also, I have only tested using auto-negotiation
of speed and duplex, and no flow control.  Other code paths relating to
those settings also have not been exercised.

Signed-off-by: Simon Horman <horms@verge.net.au>
Sponsored-by: Thomas Miletich <thomas.miletich@gmail.com>
Modified-by: Thomas Miletich <thomas.miletich@gmail.com>
Modified-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
tags/v0.9.9
Simon Horman 15 years ago
parent
commit
04cb1cde5c
3 changed files with 181 additions and 24 deletions
  1. 77
    10
      src/drivers/net/e1000/e1000.c
  2. 88
    13
      src/drivers/net/e1000/e1000_hw.c
  3. 16
    1
      src/drivers/net/e1000/e1000_hw.h

+ 77
- 10
src/drivers/net/e1000/e1000.c View File

73
 		break;
73
 		break;
74
 	case e1000_82571:
74
 	case e1000_82571:
75
 	case e1000_82572:
75
 	case e1000_82572:
76
+	case e1000_82576:
76
 	case e1000_80003es2lan:
77
 	case e1000_80003es2lan:
77
 	case e1000_ich8lan:
78
 	case e1000_ich8lan:
78
 		ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
79
 		ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
253
 {
254
 {
254
 	struct e1000_hw *hw = &adapter->hw;
255
 	struct e1000_hw *hw = &adapter->hw;
255
 	uint32_t tctl;
256
 	uint32_t tctl;
257
+	uint32_t txdctl;
256
 
258
 
257
 	DBG ( "e1000_configure_tx\n" );
259
 	DBG ( "e1000_configure_tx\n" );
258
 
260
 
271
 	adapter->tx_tail = 0;
273
 	adapter->tx_tail = 0;
272
 	adapter->tx_fill_ctr = 0;
274
 	adapter->tx_fill_ctr = 0;
273
 
275
 
276
+	if (hw->mac_type == e1000_82576) {
277
+		txdctl = E1000_READ_REG ( hw, TXDCTL );
278
+		txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
279
+		E1000_WRITE_REG ( hw, TXDCTL, txdctl );
280
+	}
281
+
274
 	/* Setup Transmit Descriptor Settings for eop descriptor */
282
 	/* Setup Transmit Descriptor Settings for eop descriptor */
275
 	tctl = E1000_TCTL_PSP | E1000_TCTL_EN |
283
 	tctl = E1000_TCTL_PSP | E1000_TCTL_EN |
276
 		(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT) | 
284
 		(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT) | 
359
 e1000_configure_rx ( struct e1000_adapter *adapter )
367
 e1000_configure_rx ( struct e1000_adapter *adapter )
360
 {
368
 {
361
 	struct e1000_hw *hw = &adapter->hw;
369
 	struct e1000_hw *hw = &adapter->hw;
362
-	uint32_t rctl;
370
+	uint32_t rctl, rxdctl, mrqc, rxcsum;
363
 
371
 
364
 	DBG ( "e1000_configure_rx\n" );
372
 	DBG ( "e1000_configure_rx\n" );
365
 
373
 
366
 	/* disable receives while setting up the descriptors */
374
 	/* disable receives while setting up the descriptors */
367
 	rctl = E1000_READ_REG ( hw, RCTL );
375
 	rctl = E1000_READ_REG ( hw, RCTL );
368
 	E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
376
 	E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
377
+	E1000_WRITE_FLUSH ( hw );
378
+	mdelay(10);
369
 
379
 
370
 	adapter->rx_curr = 0;
380
 	adapter->rx_curr = 0;
371
 
381
 
377
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
387
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
378
 
388
 
379
 	E1000_WRITE_REG ( hw, RDH, 0 );
389
 	E1000_WRITE_REG ( hw, RDH, 0 );
380
-	E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
381
-	
382
-	/* Enable Receives */
383
-	rctl = ( E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
384
-		 E1000_RCTL_MPE 
385
-		);
390
+	if (hw->mac_type == e1000_82576)
391
+		E1000_WRITE_REG ( hw, RDT, 0 );
392
+	else
393
+		E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
394
+
395
+	/* This doesn't seem to  be necessary for correct operation,
396
+	 * but it seems as well to be implicit
397
+	 */
398
+	if (hw->mac_type == e1000_82576) {
399
+		rxdctl = E1000_READ_REG ( hw, RXDCTL );
400
+		rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
401
+		rxdctl &= 0xFFF00000;
402
+		rxdctl |= IGB_RX_PTHRESH;
403
+		rxdctl |= IGB_RX_HTHRESH << 8;
404
+		rxdctl |= IGB_RX_WTHRESH << 16;
405
+		E1000_WRITE_REG ( hw, RXDCTL, rxdctl );
406
+		E1000_WRITE_FLUSH ( hw );
407
+
408
+		rxcsum = E1000_READ_REG(hw, RXCSUM);
409
+		rxcsum &= ~( E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPPCSE );
410
+		E1000_WRITE_REG ( hw, RXCSUM, 0 );
411
+
412
+		/* The initial value for MRQC disables multiple receive
413
+		 * queues, however this setting is not recommended.
414
+		 * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
415
+	         *   Section 8.10.9 Multiple Queues Command Register - MRQC
416
+		 */
417
+		mrqc = E1000_MRQC_ENABLE_VMDQ;
418
+		E1000_WRITE_REG ( hw, MRQC, mrqc );
419
+	}
386
 
420
 
421
+	/* Enable Receives */
422
+	rctl |=  E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
423
+		 E1000_RCTL_MPE;
387
 	E1000_WRITE_REG ( hw, RCTL, rctl );
424
 	E1000_WRITE_REG ( hw, RCTL, rctl );
388
 	E1000_WRITE_FLUSH ( hw );
425
 	E1000_WRITE_FLUSH ( hw );
389
 
426
 
427
+	/* On the 82576, RDT([0]) must not be "bumped" before
428
+	 * the enable bit of RXDCTL([0]) is set.
429
+	 * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
430
+	 *   Section 4.5.9 receive Initialization
431
+	 *
432
+	 * By observation I have found to occur when the enable bit of
433
+	 * RCTL is set. The datasheet recommends polling for this bit,
434
+	 * however as I see no evidence of this in the Linux igb driver
435
+	 * I have omitted that step.
436
+	 * - Simon Horman, May 2009
437
+	 */
438
+	if (hw->mac_type == e1000_82576)
439
+		E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
440
+
390
         DBG ( "RDBAL: %#08x\n",  E1000_READ_REG ( hw, RDBAL ) );
441
         DBG ( "RDBAL: %#08x\n",  E1000_READ_REG ( hw, RDBAL ) );
391
         DBG ( "RDLEN: %d\n",     E1000_READ_REG ( hw, RDLEN ) );
442
         DBG ( "RDLEN: %d\n",     E1000_READ_REG ( hw, RDLEN ) );
392
         DBG ( "RCTL:  %#08x\n",  E1000_READ_REG ( hw, RCTL ) );
443
         DBG ( "RCTL:  %#08x\n",  E1000_READ_REG ( hw, RCTL ) );
433
 	case e1000_82573:
484
 	case e1000_82573:
434
 		pba = E1000_PBA_20K;
485
 		pba = E1000_PBA_20K;
435
 		break;
486
 		break;
487
+	case e1000_82576:
488
+		pba = E1000_PBA_64K;
489
+		break;
436
 	case e1000_ich8lan:
490
 	case e1000_ich8lan:
437
 		pba = E1000_PBA_8K;
491
 		pba = E1000_PBA_8K;
438
 	case e1000_undefined:
492
 	case e1000_undefined:
446
 	/* Set the FC high water mark to 90% of the FIFO size.
500
 	/* Set the FC high water mark to 90% of the FIFO size.
447
 	 * Required to clear last 3 LSB */
501
 	 * Required to clear last 3 LSB */
448
 	fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
502
 	fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
503
+
449
 	/* We can't use 90% on small FIFOs because the remainder
504
 	/* We can't use 90% on small FIFOs because the remainder
450
 	 * would be less than 1 full frame.  In this case, we size
505
 	 * would be less than 1 full frame.  In this case, we size
451
 	 * it to allow at least a full frame above the high water
506
 	 * it to allow at least a full frame above the high water
453
 	if (pba < E1000_PBA_16K)
508
 	if (pba < E1000_PBA_16K)
454
 		fc_high_water_mark = (pba * 1024) - 1600;
509
 		fc_high_water_mark = (pba * 1024) - 1600;
455
 
510
 
456
-	adapter->hw.fc_high_water = fc_high_water_mark;
457
-	adapter->hw.fc_low_water = fc_high_water_mark - 8;
458
-	if (adapter->hw.mac_type == e1000_80003es2lan)
511
+	/* This actually applies to < e1000_82575, one revision less than
512
+	 * e1000_82576, but e1000_82575 isn't currently defined in the code */
513
+	if (adapter->hw.mac_type < e1000_82576) {
514
+		/* 8-byte granularity */
515
+		adapter->hw.fc_high_water = fc_high_water_mark & 0xFFF8;
516
+		adapter->hw.fc_low_water = adapter->hw.fc_high_water - 8;
517
+	} else {
518
+		/* 16-byte granularity */
519
+		adapter->hw.fc_high_water = fc_high_water_mark & 0xFFF0;
520
+		adapter->hw.fc_low_water = adapter->hw.fc_high_water - 16;
521
+	}
522
+
523
+	if (adapter->hw.mac_type == e1000_80003es2lan ||
524
+	    adapter->hw.mac_type == e1000_82576)
459
 		adapter->hw.fc_pause_time = 0xFFFF;
525
 		adapter->hw.fc_pause_time = 0xFFFF;
460
 	else
526
 	else
461
 		adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
527
 		adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
1102
 	PCI_ROM(0x8086, 0x10bc, "e1000-0x10bc", "e1000-0x10bc", 0),
1168
 	PCI_ROM(0x8086, 0x10bc, "e1000-0x10bc", "e1000-0x10bc", 0),
1103
 	PCI_ROM(0x8086, 0x10c4, "e1000-0x10c4", "e1000-0x10c4", 0),
1169
 	PCI_ROM(0x8086, 0x10c4, "e1000-0x10c4", "e1000-0x10c4", 0),
1104
 	PCI_ROM(0x8086, 0x10c5, "e1000-0x10c5", "e1000-0x10c5", 0),
1170
 	PCI_ROM(0x8086, 0x10c5, "e1000-0x10c5", "e1000-0x10c5", 0),
1171
+	PCI_ROM(0x8086, 0x10c9, "e1000-0x10c9", "e1000-0x10c9", 0),
1105
 	PCI_ROM(0x8086, 0x10d9, "e1000-0x10d9", "e1000-0x10d9", 0),
1172
 	PCI_ROM(0x8086, 0x10d9, "e1000-0x10d9", "e1000-0x10d9", 0),
1106
 	PCI_ROM(0x8086, 0x10da, "e1000-0x10da", "e1000-0x10da", 0),
1173
 	PCI_ROM(0x8086, 0x10da, "e1000-0x10da", "e1000-0x10da", 0),
1107
 };
1174
 };

+ 88
- 13
src/drivers/net/e1000/e1000_hw.c View File

419
 	case E1000_DEV_ID_ICH8_IGP_M:
419
 	case E1000_DEV_ID_ICH8_IGP_M:
420
 		hw->mac_type = e1000_ich8lan;
420
 		hw->mac_type = e1000_ich8lan;
421
 		break;
421
 		break;
422
+	case E1000_DEV_ID_82576:
423
+		hw->mac_type = e1000_82576;
424
+		break;
422
 	default:
425
 	default:
423
 		/* Should never have loaded on this device */
426
 		/* Should never have loaded on this device */
424
 		return -E1000_ERR_MAC_TYPE;
427
 		return -E1000_ERR_MAC_TYPE;
426
 
429
 
427
 	switch (hw->mac_type) {
430
 	switch (hw->mac_type) {
428
 	case e1000_ich8lan:
431
 	case e1000_ich8lan:
432
+	case e1000_82576:
429
 		hw->swfwhw_semaphore_present = TRUE;
433
 		hw->swfwhw_semaphore_present = TRUE;
430
 		hw->asf_firmware_present = TRUE;
434
 		hw->asf_firmware_present = TRUE;
431
 		break;
435
 		break;
504
             break;
508
             break;
505
         case e1000_ich8lan:
509
         case e1000_ich8lan:
506
         case e1000_82573:
510
         case e1000_82573:
511
+        case e1000_82576:
507
             /* The STATUS_TBIMODE bit is reserved or reused for the this
512
             /* The STATUS_TBIMODE bit is reserved or reused for the this
508
              * device.
513
              * device.
509
              */
514
              */
750
 static void
755
 static void
751
 e1000_initialize_hardware_bits(struct e1000_hw *hw)
756
 e1000_initialize_hardware_bits(struct e1000_hw *hw)
752
 {
757
 {
753
-    if ((hw->mac_type >= e1000_82571) && (!hw->initialize_hw_bits_disable)) {
758
+    if ((hw->mac_type >= e1000_82571 && hw->mac_type < e1000_82576) &&
759
+        (!hw->initialize_hw_bits_disable)) {
754
         /* Settings common to all PCI-express silicon */
760
         /* Settings common to all PCI-express silicon */
755
         uint32_t reg_ctrl, reg_ctrl_ext;
761
         uint32_t reg_ctrl, reg_ctrl_ext;
756
         uint32_t reg_tarc0, reg_tarc1;
762
         uint32_t reg_tarc0, reg_tarc1;
907
 
913
 
908
     /* Disabling VLAN filtering. */
914
     /* Disabling VLAN filtering. */
909
     DEBUGOUT("Initializing the IEEE VLAN\n");
915
     DEBUGOUT("Initializing the IEEE VLAN\n");
910
-    /* VET hardcoded to standard value and VFTA removed in ICH8 LAN */
911
-    if (hw->mac_type != e1000_ich8lan) {
916
+    switch (hw->mac_type) {
917
+    case e1000_ich8lan:
918
+        /* VET hardcoded to standard value and VFTA removed in ICH8 LAN */
919
+        break;
920
+    case e1000_82576:
921
+        /* There is no need to clear vfta on 82576 if VLANs are not used.
922
+         * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
923
+         *   Section 8.10.19 Table Array - VFTA
924
+         *
925
+         * Setting VET may also be unnecessary, however the documentation
926
+         * isn't specific on this point. The value used here is as advised in
927
+	 * - Intel® 82576 Gigabit Ethernet Controller Datasheet r2.41
928
+         *   Section 8.2.7 VLAN Ether Type - VET
929
+         */
930
+        E1000_WRITE_REG(hw, VET, ETHERNET_IEEE_VLAN_TYPE);
931
+        break;
932
+    default:
912
         if (hw->mac_type < e1000_82545_rev_3)
933
         if (hw->mac_type < e1000_82545_rev_3)
913
             E1000_WRITE_REG(hw, VET, 0);
934
             E1000_WRITE_REG(hw, VET, 0);
914
         e1000_clear_vfta(hw);
935
         e1000_clear_vfta(hw);
936
+        break;
915
     }
937
     }
916
 
938
 
917
     /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */
939
     /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */
1477
         return ret_val;
1499
         return ret_val;
1478
     }
1500
     }
1479
 
1501
 
1480
-    /* Wait 15ms for MAC to configure PHY from eeprom settings */
1481
-    msleep(15);
1482
-    if (hw->mac_type != e1000_ich8lan) {
1502
+    /*
1503
+     * Wait 100ms for MAC to configure PHY from NVM settings, to avoid
1504
+     * timeout issues when LFS is enabled.
1505
+     */
1506
+    msleep(100);
1507
+
1508
+    if (hw->mac_type != e1000_ich8lan && hw->mac_type != e1000_82576) {
1483
     /* Configure activity LED after PHY reset */
1509
     /* Configure activity LED after PHY reset */
1484
     led_ctrl = E1000_READ_REG(hw, LEDCTL);
1510
     led_ctrl = E1000_READ_REG(hw, LEDCTL);
1485
     led_ctrl &= IGP_ACTIVITY_LED_MASK;
1511
     led_ctrl &= IGP_ACTIVITY_LED_MASK;
3493
 
3519
 
3494
     DEBUGFUNC("e1000_read_phy_reg");
3520
     DEBUGFUNC("e1000_read_phy_reg");
3495
 
3521
 
3496
-    if ((hw->mac_type == e1000_80003es2lan) &&
3522
+    if ((hw->mac_type == e1000_80003es2lan || hw->mac_type == e1000_82576) &&
3497
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3523
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3498
         swfw = E1000_SWFW_PHY1_SM;
3524
         swfw = E1000_SWFW_PHY1_SM;
3499
     } else {
3525
     } else {
3631
 
3657
 
3632
     DEBUGFUNC("e1000_write_phy_reg");
3658
     DEBUGFUNC("e1000_write_phy_reg");
3633
 
3659
 
3634
-    if ((hw->mac_type == e1000_80003es2lan) &&
3660
+    if ((hw->mac_type == e1000_80003es2lan || hw->mac_type == e1000_82576) &&
3635
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3661
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3636
         swfw = E1000_SWFW_PHY1_SM;
3662
         swfw = E1000_SWFW_PHY1_SM;
3637
     } else {
3663
     } else {
3751
     uint16_t swfw;
3777
     uint16_t swfw;
3752
     DEBUGFUNC("e1000_read_kmrn_reg");
3778
     DEBUGFUNC("e1000_read_kmrn_reg");
3753
 
3779
 
3754
-    if ((hw->mac_type == e1000_80003es2lan) &&
3780
+    if ((hw->mac_type == e1000_80003es2lan || hw->mac_type == e1000_82576) &&
3755
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3781
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3756
         swfw = E1000_SWFW_PHY1_SM;
3782
         swfw = E1000_SWFW_PHY1_SM;
3757
     } else {
3783
     } else {
3784
     uint16_t swfw;
3810
     uint16_t swfw;
3785
     DEBUGFUNC("e1000_write_kmrn_reg");
3811
     DEBUGFUNC("e1000_write_kmrn_reg");
3786
 
3812
 
3787
-    if ((hw->mac_type == e1000_80003es2lan) &&
3813
+    if ((hw->mac_type == e1000_80003es2lan || hw->mac_type == e1000_82576) &&
3788
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3814
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3789
         swfw = E1000_SWFW_PHY1_SM;
3815
         swfw = E1000_SWFW_PHY1_SM;
3790
     } else {
3816
     } else {
3826
     DEBUGOUT("Resetting Phy...\n");
3852
     DEBUGOUT("Resetting Phy...\n");
3827
 
3853
 
3828
     if (hw->mac_type > e1000_82543) {
3854
     if (hw->mac_type > e1000_82543) {
3829
-        if ((hw->mac_type == e1000_80003es2lan) &&
3855
+        if ((hw->mac_type == e1000_80003es2lan ||
3856
+             hw->mac_type == e1000_82576) &&
3830
             (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3857
             (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3831
             swfw = E1000_SWFW_PHY1_SM;
3858
             swfw = E1000_SWFW_PHY1_SM;
3832
         } else {
3859
         } else {
4136
         if (hw->phy_id == IFE_PLUS_E_PHY_ID) match = TRUE;
4163
         if (hw->phy_id == IFE_PLUS_E_PHY_ID) match = TRUE;
4137
         if (hw->phy_id == IFE_C_E_PHY_ID) match = TRUE;
4164
         if (hw->phy_id == IFE_C_E_PHY_ID) match = TRUE;
4138
         break;
4165
         break;
4166
+    case e1000_82576:
4167
+        match = TRUE;
4168
+        break;
4139
     default:
4169
     default:
4140
         DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type);
4170
         DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type);
4141
         return -E1000_ERR_CONFIG;
4171
         return -E1000_ERR_CONFIG;
4607
 
4637
 
4608
         hw->flash_bank_size /= 2 * sizeof(uint16_t);
4638
         hw->flash_bank_size /= 2 * sizeof(uint16_t);
4609
 
4639
 
4640
+        break;
4641
+        }
4642
+    case e1000_82576:
4643
+        {
4644
+        uint16_t size;
4645
+
4646
+        eeprom->type = e1000_eeprom_spi;
4647
+        eeprom->opcode_bits = 8;
4648
+        eeprom->delay_usec = 1;
4649
+        if (eecd & E1000_EECD_ADDR_BITS) {
4650
+            eeprom->page_size = 32;
4651
+            eeprom->address_bits = 16;
4652
+        } else {
4653
+            eeprom->page_size = 8;
4654
+            eeprom->address_bits = 8;
4655
+        }
4656
+        eeprom->use_eerd = TRUE;
4657
+        eeprom->use_eewr = FALSE;
4658
+
4659
+        size = (uint16_t)((eecd & E1000_EECD_SIZE_EX_MASK) >>
4660
+                          E1000_EECD_SIZE_EX_SHIFT);
4661
+	/*
4662
+	 * Added to a constant, "size" becomes the left-shift value
4663
+	 * for setting word_size.
4664
+	 */
4665
+	size += EEPROM_WORD_SIZE_SHIFT;
4666
+
4667
+	/* EEPROM access above 16k is unsupported */
4668
+	if (size > 14)
4669
+		size = 14;
4670
+	eeprom->word_size = 1 << size;
4671
+
4610
         break;
4672
         break;
4611
         }
4673
         }
4612
     default:
4674
     default:
5014
      * directly. In this case, we need to acquire the EEPROM so that
5076
      * directly. In this case, we need to acquire the EEPROM so that
5015
      * FW or other port software does not interrupt.
5077
      * FW or other port software does not interrupt.
5016
      */
5078
      */
5017
-    if (e1000_is_onboard_nvm_eeprom(hw) == TRUE &&
5018
-        hw->eeprom.use_eerd == FALSE) {
5079
+    if (hw->eeprom.use_eerd == FALSE && e1000_is_onboard_nvm_eeprom(hw)) {
5019
         /* Prepare the EEPROM for bit-bang reading */
5080
         /* Prepare the EEPROM for bit-bang reading */
5020
         if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
5081
         if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
5021
             return -E1000_ERR_EEPROM;
5082
             return -E1000_ERR_EEPROM;
5198
 
5259
 
5199
     DEBUGFUNC("e1000_is_onboard_nvm_eeprom");
5260
     DEBUGFUNC("e1000_is_onboard_nvm_eeprom");
5200
 
5261
 
5262
+    assert(hw->mac_type != e1000_82576);
5263
+
5201
     if (hw->mac_type == e1000_ich8lan)
5264
     if (hw->mac_type == e1000_ich8lan)
5202
         return FALSE;
5265
         return FALSE;
5203
 
5266
 
5732
     case e1000_82546:
5795
     case e1000_82546:
5733
     case e1000_82546_rev_3:
5796
     case e1000_82546_rev_3:
5734
     case e1000_82571:
5797
     case e1000_82571:
5798
+    case e1000_82576:
5735
     case e1000_80003es2lan:
5799
     case e1000_80003es2lan:
5736
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
5800
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
5737
             hw->perm_mac_addr[5] ^= 0x01;
5801
             hw->perm_mac_addr[5] ^= 0x01;
5944
     case e1000_80003es2lan:
6008
     case e1000_80003es2lan:
5945
         if (hw->leave_av_bit_off == TRUE)
6009
         if (hw->leave_av_bit_off == TRUE)
5946
             break;
6010
             break;
6011
+    case e1000_82576:
6012
+        /* If MAC address zero, no need to set the AV bit */
6013
+        if (rar_low || rar_high)
6014
+            rar_high |= E1000_RAH_AV;
6015
+            // Only neded when Multiple Receive Queues are enabmed in MRQC
6016
+        rar_high |= E1000_RAH_POOL_1;
6017
+        break;
5947
     default:
6018
     default:
5948
         /* Indicate to hardware the Address is Valid. */
6019
         /* Indicate to hardware the Address is Valid. */
5949
         rar_high |= E1000_RAH_AV;
6020
         rar_high |= E1000_RAH_AV;
6609
     case e1000_82572:
6680
     case e1000_82572:
6610
     case e1000_82573:
6681
     case e1000_82573:
6611
     case e1000_80003es2lan:
6682
     case e1000_80003es2lan:
6683
+    case e1000_82576:
6612
         hw->bus_type = e1000_bus_type_pci_express;
6684
         hw->bus_type = e1000_bus_type_pci_express;
6613
         hw->bus_speed = e1000_bus_speed_2500;
6685
         hw->bus_speed = e1000_bus_speed_2500;
6614
         ret_val = e1000_read_pcie_cap_reg(hw,
6686
         ret_val = e1000_read_pcie_cap_reg(hw,
8027
     case e1000_82573:
8099
     case e1000_82573:
8028
     case e1000_80003es2lan:
8100
     case e1000_80003es2lan:
8029
     case e1000_ich8lan:
8101
     case e1000_ich8lan:
8102
+    case e1000_82576:
8030
         while (timeout) {
8103
         while (timeout) {
8031
             if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD)
8104
             if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD)
8032
                 break;
8105
                 break;
8072
         mdelay(10);
8145
         mdelay(10);
8073
         break;
8146
         break;
8074
     case e1000_80003es2lan:
8147
     case e1000_80003es2lan:
8148
+    case e1000_82576:
8075
         /* Separate *_CFG_DONE_* bit for each port */
8149
         /* Separate *_CFG_DONE_* bit for each port */
8076
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
8150
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
8077
             cfg_mask = E1000_EEPROM_CFG_DONE_PORT_1;
8151
             cfg_mask = E1000_EEPROM_CFG_DONE_PORT_1;
8282
     case e1000_82572:
8356
     case e1000_82572:
8283
     case e1000_82573:
8357
     case e1000_82573:
8284
     case e1000_80003es2lan:
8358
     case e1000_80003es2lan:
8359
+    case e1000_82576:
8285
         fwsm = E1000_READ_REG(hw, FWSM);
8360
         fwsm = E1000_READ_REG(hw, FWSM);
8286
         if ((fwsm & E1000_FWSM_MODE_MASK) != 0)
8361
         if ((fwsm & E1000_FWSM_MODE_MASK) != 0)
8287
             return TRUE;
8362
             return TRUE;

+ 16
- 1
src/drivers/net/e1000/e1000_hw.h View File

64
     e1000_82573,
64
     e1000_82573,
65
     e1000_80003es2lan,
65
     e1000_80003es2lan,
66
     e1000_ich8lan,
66
     e1000_ich8lan,
67
+    e1000_82576,
67
     e1000_num_macs
68
     e1000_num_macs
68
 } e1000_mac_type;
69
 } e1000_mac_type;
69
 
70
 
502
 #define E1000_DEV_ID_ICH8_IFE_G          0x10C5
503
 #define E1000_DEV_ID_ICH8_IFE_G          0x10C5
503
 #define E1000_DEV_ID_ICH8_IGP_M          0x104D
504
 #define E1000_DEV_ID_ICH8_IGP_M          0x104D
504
 
505
 
506
+#define E1000_DEV_ID_82576                    0x10C9
505
 
507
 
506
 #define NODE_ADDRESS_SIZE 6
508
 #define NODE_ADDRESS_SIZE 6
507
 #define ETH_LENGTH_OF_ADDRESS 6
509
 #define ETH_LENGTH_OF_ADDRESS 6
569
     E1000_IMS_TXDW   |    \
571
     E1000_IMS_TXDW   |    \
570
     E1000_IMS_RXDMT0 |    \
572
     E1000_IMS_RXDMT0 |    \
571
     E1000_IMS_RXSEQ  |    \
573
     E1000_IMS_RXSEQ  |    \
572
-    E1000_IMS_LSC)
574
+    E1000_IMS_LSC    |    \
575
+    E1000_IMS_DOUTSYNC)
573
 
576
 
574
 /* Additional interrupts need to be handled for e1000_ich8lan:
577
 /* Additional interrupts need to be handled for e1000_ich8lan:
575
     DSW = The FW changed the status of the DISSW bit in FWSM
578
     DSW = The FW changed the status of the DISSW bit in FWSM
1748
 /* Receive Address */
1751
 /* Receive Address */
1749
 #define E1000_RAH_AV  0x80000000        /* Receive descriptor valid */
1752
 #define E1000_RAH_AV  0x80000000        /* Receive descriptor valid */
1750
 
1753
 
1754
+#define E1000_RAH_POOL_1 0x00040000
1755
+
1751
 /* Interrupt Cause Read */
1756
 /* Interrupt Cause Read */
1752
 #define E1000_ICR_TXDW          0x00000001 /* Transmit desc written back */
1757
 #define E1000_ICR_TXDW          0x00000001 /* Transmit desc written back */
1753
 #define E1000_ICR_TXQE          0x00000002 /* Transmit Queue empty */
1758
 #define E1000_ICR_TXQE          0x00000002 /* Transmit Queue empty */
1754
 #define E1000_ICR_LSC           0x00000004 /* Link Status Change */
1759
 #define E1000_ICR_LSC           0x00000004 /* Link Status Change */
1755
 #define E1000_ICR_RXSEQ         0x00000008 /* rx sequence error */
1760
 #define E1000_ICR_RXSEQ         0x00000008 /* rx sequence error */
1756
 #define E1000_ICR_RXDMT0        0x00000010 /* rx desc min. threshold (0) */
1761
 #define E1000_ICR_RXDMT0        0x00000010 /* rx desc min. threshold (0) */
1762
+/* LAN connected device generates an interrupt */
1763
+#define E1000_ICR_DOUTSYNC      0x10000000 /* NIC DMA out of sync */
1757
 #define E1000_ICR_RXO           0x00000040 /* rx overrun */
1764
 #define E1000_ICR_RXO           0x00000040 /* rx overrun */
1758
 #define E1000_ICR_RXT0          0x00000080 /* rx timer intr (ring 0) */
1765
 #define E1000_ICR_RXT0          0x00000080 /* rx timer intr (ring 0) */
1759
 #define E1000_ICR_MDAC          0x00000200 /* MDIO access complete */
1766
 #define E1000_ICR_MDAC          0x00000200 /* MDIO access complete */
1815
 #define E1000_IMS_RXSEQ     E1000_ICR_RXSEQ     /* rx sequence error */
1822
 #define E1000_IMS_RXSEQ     E1000_ICR_RXSEQ     /* rx sequence error */
1816
 #define E1000_IMS_RXDMT0    E1000_ICR_RXDMT0    /* rx desc min. threshold */
1823
 #define E1000_IMS_RXDMT0    E1000_ICR_RXDMT0    /* rx desc min. threshold */
1817
 #define E1000_IMS_RXO       E1000_ICR_RXO       /* rx overrun */
1824
 #define E1000_IMS_RXO       E1000_ICR_RXO       /* rx overrun */
1825
+#define E1000_IMS_DOUTSYNC  E1000_ICR_DOUTSYNC  /* NIC DMA out of sync */
1818
 #define E1000_IMS_RXT0      E1000_ICR_RXT0      /* rx timer intr */
1826
 #define E1000_IMS_RXT0      E1000_ICR_RXT0      /* rx timer intr */
1819
 #define E1000_IMS_MDAC      E1000_ICR_MDAC      /* MDIO access complete */
1827
 #define E1000_IMS_MDAC      E1000_ICR_MDAC      /* MDIO access complete */
1820
 #define E1000_IMS_RXCFG     E1000_ICR_RXCFG     /* RX /c/ ordered set */
1828
 #define E1000_IMS_RXCFG     E1000_ICR_RXCFG     /* RX /c/ ordered set */
1975
 #define E1000_RXDCTL_HTHRESH 0x00003F00 /* RXDCTL Host Threshold */
1983
 #define E1000_RXDCTL_HTHRESH 0x00003F00 /* RXDCTL Host Threshold */
1976
 #define E1000_RXDCTL_WTHRESH 0x003F0000 /* RXDCTL Writeback Threshold */
1984
 #define E1000_RXDCTL_WTHRESH 0x003F0000 /* RXDCTL Writeback Threshold */
1977
 #define E1000_RXDCTL_GRAN    0x01000000 /* RXDCTL Granularity */
1985
 #define E1000_RXDCTL_GRAN    0x01000000 /* RXDCTL Granularity */
1986
+#define E1000_RXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Rx Queue */
1987
+#define IGB_RX_PTHRESH                    16
1988
+#define IGB_RX_HTHRESH                     8
1989
+#define IGB_RX_WTHRESH                     1
1978
 
1990
 
1979
 /* Transmit Descriptor Control */
1991
 /* Transmit Descriptor Control */
1980
 #define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
1992
 #define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
1985
 #define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
1997
 #define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
1986
 #define E1000_TXDCTL_COUNT_DESC 0x00400000 /* Enable the counting of desc.
1998
 #define E1000_TXDCTL_COUNT_DESC 0x00400000 /* Enable the counting of desc.
1987
                                               still to be processed. */
1999
                                               still to be processed. */
2000
+#define E1000_TXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Tx Queue */
1988
 /* Transmit Configuration Word */
2001
 /* Transmit Configuration Word */
1989
 #define E1000_TXCW_FD         0x00000020        /* TXCW full duplex */
2002
 #define E1000_TXCW_FD         0x00000020        /* TXCW full duplex */
1990
 #define E1000_TXCW_HD         0x00000040        /* TXCW half duplex */
2003
 #define E1000_TXCW_HD         0x00000040        /* TXCW half duplex */
2034
 
2047
 
2035
 /* Multiple Receive Queue Control */
2048
 /* Multiple Receive Queue Control */
2036
 #define E1000_MRQC_ENABLE_MASK              0x00000003
2049
 #define E1000_MRQC_ENABLE_MASK              0x00000003
2050
+#define E1000_MRQC_ENABLE_VMDQ              0x00000003
2037
 #define E1000_MRQC_ENABLE_RSS_2Q            0x00000001
2051
 #define E1000_MRQC_ENABLE_RSS_2Q            0x00000001
2038
 #define E1000_MRQC_ENABLE_RSS_INT           0x00000004
2052
 #define E1000_MRQC_ENABLE_RSS_INT           0x00000004
2039
 #define E1000_MRQC_RSS_FIELD_MASK           0xFFFF0000
2053
 #define E1000_MRQC_RSS_FIELD_MASK           0xFFFF0000
2437
 #define E1000_PBA_38K 0x0026
2451
 #define E1000_PBA_38K 0x0026
2438
 #define E1000_PBA_40K 0x0028
2452
 #define E1000_PBA_40K 0x0028
2439
 #define E1000_PBA_48K 0x0030    /* 48KB, default RX allocation */
2453
 #define E1000_PBA_48K 0x0030    /* 48KB, default RX allocation */
2454
+#define E1000_PBA_64K 0x0040    /* 64KB */
2440
 
2455
 
2441
 #define E1000_PBS_16K E1000_PBA_16K
2456
 #define E1000_PBS_16K E1000_PBA_16K
2442
 
2457
 

Loading…
Cancel
Save