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 14 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,6 +73,7 @@ e1000_get_hw_control ( struct e1000_adapter *adapter )
73 73
 		break;
74 74
 	case e1000_82571:
75 75
 	case e1000_82572:
76
+	case e1000_82576:
76 77
 	case e1000_80003es2lan:
77 78
 	case e1000_ich8lan:
78 79
 		ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
@@ -253,6 +254,7 @@ e1000_configure_tx ( struct e1000_adapter *adapter )
253 254
 {
254 255
 	struct e1000_hw *hw = &adapter->hw;
255 256
 	uint32_t tctl;
257
+	uint32_t txdctl;
256 258
 
257 259
 	DBG ( "e1000_configure_tx\n" );
258 260
 
@@ -271,6 +273,12 @@ e1000_configure_tx ( struct e1000_adapter *adapter )
271 273
 	adapter->tx_tail = 0;
272 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 282
 	/* Setup Transmit Descriptor Settings for eop descriptor */
275 283
 	tctl = E1000_TCTL_PSP | E1000_TCTL_EN |
276 284
 		(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT) | 
@@ -359,13 +367,15 @@ static void
359 367
 e1000_configure_rx ( struct e1000_adapter *adapter )
360 368
 {
361 369
 	struct e1000_hw *hw = &adapter->hw;
362
-	uint32_t rctl;
370
+	uint32_t rctl, rxdctl, mrqc, rxcsum;
363 371
 
364 372
 	DBG ( "e1000_configure_rx\n" );
365 373
 
366 374
 	/* disable receives while setting up the descriptors */
367 375
 	rctl = E1000_READ_REG ( hw, RCTL );
368 376
 	E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
377
+	E1000_WRITE_FLUSH ( hw );
378
+	mdelay(10);
369 379
 
370 380
 	adapter->rx_curr = 0;
371 381
 
@@ -377,16 +387,57 @@ e1000_configure_rx ( struct e1000_adapter *adapter )
377 387
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
378 388
 
379 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 424
 	E1000_WRITE_REG ( hw, RCTL, rctl );
388 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 441
         DBG ( "RDBAL: %#08x\n",  E1000_READ_REG ( hw, RDBAL ) );
391 442
         DBG ( "RDLEN: %d\n",     E1000_READ_REG ( hw, RDLEN ) );
392 443
         DBG ( "RCTL:  %#08x\n",  E1000_READ_REG ( hw, RCTL ) );
@@ -433,6 +484,9 @@ e1000_reset ( struct e1000_adapter *adapter )
433 484
 	case e1000_82573:
434 485
 		pba = E1000_PBA_20K;
435 486
 		break;
487
+	case e1000_82576:
488
+		pba = E1000_PBA_64K;
489
+		break;
436 490
 	case e1000_ich8lan:
437 491
 		pba = E1000_PBA_8K;
438 492
 	case e1000_undefined:
@@ -446,6 +500,7 @@ e1000_reset ( struct e1000_adapter *adapter )
446 500
 	/* Set the FC high water mark to 90% of the FIFO size.
447 501
 	 * Required to clear last 3 LSB */
448 502
 	fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
503
+
449 504
 	/* We can't use 90% on small FIFOs because the remainder
450 505
 	 * would be less than 1 full frame.  In this case, we size
451 506
 	 * it to allow at least a full frame above the high water
@@ -453,9 +508,20 @@ e1000_reset ( struct e1000_adapter *adapter )
453 508
 	if (pba < E1000_PBA_16K)
454 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 525
 		adapter->hw.fc_pause_time = 0xFFFF;
460 526
 	else
461 527
 		adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
@@ -1102,6 +1168,7 @@ static struct pci_device_id e1000_nics[] = {
1102 1168
 	PCI_ROM(0x8086, 0x10bc, "e1000-0x10bc", "e1000-0x10bc", 0),
1103 1169
 	PCI_ROM(0x8086, 0x10c4, "e1000-0x10c4", "e1000-0x10c4", 0),
1104 1170
 	PCI_ROM(0x8086, 0x10c5, "e1000-0x10c5", "e1000-0x10c5", 0),
1171
+	PCI_ROM(0x8086, 0x10c9, "e1000-0x10c9", "e1000-0x10c9", 0),
1105 1172
 	PCI_ROM(0x8086, 0x10d9, "e1000-0x10d9", "e1000-0x10d9", 0),
1106 1173
 	PCI_ROM(0x8086, 0x10da, "e1000-0x10da", "e1000-0x10da", 0),
1107 1174
 };

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

@@ -419,6 +419,9 @@ e1000_set_mac_type(struct e1000_hw *hw)
419 419
 	case E1000_DEV_ID_ICH8_IGP_M:
420 420
 		hw->mac_type = e1000_ich8lan;
421 421
 		break;
422
+	case E1000_DEV_ID_82576:
423
+		hw->mac_type = e1000_82576;
424
+		break;
422 425
 	default:
423 426
 		/* Should never have loaded on this device */
424 427
 		return -E1000_ERR_MAC_TYPE;
@@ -426,6 +429,7 @@ e1000_set_mac_type(struct e1000_hw *hw)
426 429
 
427 430
 	switch (hw->mac_type) {
428 431
 	case e1000_ich8lan:
432
+	case e1000_82576:
429 433
 		hw->swfwhw_semaphore_present = TRUE;
430 434
 		hw->asf_firmware_present = TRUE;
431 435
 		break;
@@ -504,6 +508,7 @@ e1000_set_media_type(struct e1000_hw *hw)
504 508
             break;
505 509
         case e1000_ich8lan:
506 510
         case e1000_82573:
511
+        case e1000_82576:
507 512
             /* The STATUS_TBIMODE bit is reserved or reused for the this
508 513
              * device.
509 514
              */
@@ -750,7 +755,8 @@ e1000_reset_hw(struct e1000_hw *hw)
750 755
 static void
751 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 760
         /* Settings common to all PCI-express silicon */
755 761
         uint32_t reg_ctrl, reg_ctrl_ext;
756 762
         uint32_t reg_tarc0, reg_tarc1;
@@ -907,11 +913,27 @@ e1000_init_hw(struct e1000_hw *hw)
907 913
 
908 914
     /* Disabling VLAN filtering. */
909 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 933
         if (hw->mac_type < e1000_82545_rev_3)
913 934
             E1000_WRITE_REG(hw, VET, 0);
914 935
         e1000_clear_vfta(hw);
936
+        break;
915 937
     }
916 938
 
917 939
     /* For 82542 (rev 2.0), disable MWI and put the receiver into reset */
@@ -1477,9 +1499,13 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw)
1477 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 1509
     /* Configure activity LED after PHY reset */
1484 1510
     led_ctrl = E1000_READ_REG(hw, LEDCTL);
1485 1511
     led_ctrl &= IGP_ACTIVITY_LED_MASK;
@@ -3493,7 +3519,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
3493 3519
 
3494 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 3523
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3498 3524
         swfw = E1000_SWFW_PHY1_SM;
3499 3525
     } else {
@@ -3631,7 +3657,7 @@ e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr,
3631 3657
 
3632 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 3661
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3636 3662
         swfw = E1000_SWFW_PHY1_SM;
3637 3663
     } else {
@@ -3751,7 +3777,7 @@ e1000_read_kmrn_reg(struct e1000_hw *hw,
3751 3777
     uint16_t swfw;
3752 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 3781
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3756 3782
         swfw = E1000_SWFW_PHY1_SM;
3757 3783
     } else {
@@ -3784,7 +3810,7 @@ e1000_write_kmrn_reg(struct e1000_hw *hw,
3784 3810
     uint16_t swfw;
3785 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 3814
         (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3789 3815
         swfw = E1000_SWFW_PHY1_SM;
3790 3816
     } else {
@@ -3826,7 +3852,8 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
3826 3852
     DEBUGOUT("Resetting Phy...\n");
3827 3853
 
3828 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 3857
             (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) {
3831 3858
             swfw = E1000_SWFW_PHY1_SM;
3832 3859
         } else {
@@ -4136,6 +4163,9 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
4136 4163
         if (hw->phy_id == IFE_PLUS_E_PHY_ID) match = TRUE;
4137 4164
         if (hw->phy_id == IFE_C_E_PHY_ID) match = TRUE;
4138 4165
         break;
4166
+    case e1000_82576:
4167
+        match = TRUE;
4168
+        break;
4139 4169
     default:
4140 4170
         DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type);
4141 4171
         return -E1000_ERR_CONFIG;
@@ -4607,6 +4637,38 @@ e1000_init_eeprom_params(struct e1000_hw *hw)
4607 4637
 
4608 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 4672
         break;
4611 4673
         }
4612 4674
     default:
@@ -5014,8 +5076,7 @@ e1000_read_eeprom(struct e1000_hw *hw,
5014 5076
      * directly. In this case, we need to acquire the EEPROM so that
5015 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 5080
         /* Prepare the EEPROM for bit-bang reading */
5020 5081
         if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
5021 5082
             return -E1000_ERR_EEPROM;
@@ -5198,6 +5259,8 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
5198 5259
 
5199 5260
     DEBUGFUNC("e1000_is_onboard_nvm_eeprom");
5200 5261
 
5262
+    assert(hw->mac_type != e1000_82576);
5263
+
5201 5264
     if (hw->mac_type == e1000_ich8lan)
5202 5265
         return FALSE;
5203 5266
 
@@ -5732,6 +5795,7 @@ e1000_read_mac_addr(struct e1000_hw * hw)
5732 5795
     case e1000_82546:
5733 5796
     case e1000_82546_rev_3:
5734 5797
     case e1000_82571:
5798
+    case e1000_82576:
5735 5799
     case e1000_80003es2lan:
5736 5800
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
5737 5801
             hw->perm_mac_addr[5] ^= 0x01;
@@ -5944,6 +6008,13 @@ e1000_rar_set(struct e1000_hw *hw,
5944 6008
     case e1000_80003es2lan:
5945 6009
         if (hw->leave_av_bit_off == TRUE)
5946 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 6018
     default:
5948 6019
         /* Indicate to hardware the Address is Valid. */
5949 6020
         rar_high |= E1000_RAH_AV;
@@ -6609,6 +6680,7 @@ e1000_get_bus_info(struct e1000_hw *hw)
6609 6680
     case e1000_82572:
6610 6681
     case e1000_82573:
6611 6682
     case e1000_80003es2lan:
6683
+    case e1000_82576:
6612 6684
         hw->bus_type = e1000_bus_type_pci_express;
6613 6685
         hw->bus_speed = e1000_bus_speed_2500;
6614 6686
         ret_val = e1000_read_pcie_cap_reg(hw,
@@ -8027,6 +8099,7 @@ e1000_get_auto_rd_done(struct e1000_hw *hw)
8027 8099
     case e1000_82573:
8028 8100
     case e1000_80003es2lan:
8029 8101
     case e1000_ich8lan:
8102
+    case e1000_82576:
8030 8103
         while (timeout) {
8031 8104
             if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD)
8032 8105
                 break;
@@ -8072,6 +8145,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw)
8072 8145
         mdelay(10);
8073 8146
         break;
8074 8147
     case e1000_80003es2lan:
8148
+    case e1000_82576:
8075 8149
         /* Separate *_CFG_DONE_* bit for each port */
8076 8150
         if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
8077 8151
             cfg_mask = E1000_EEPROM_CFG_DONE_PORT_1;
@@ -8282,6 +8356,7 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw)
8282 8356
     case e1000_82572:
8283 8357
     case e1000_82573:
8284 8358
     case e1000_80003es2lan:
8359
+    case e1000_82576:
8285 8360
         fwsm = E1000_READ_REG(hw, FWSM);
8286 8361
         if ((fwsm & E1000_FWSM_MODE_MASK) != 0)
8287 8362
             return TRUE;

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

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

Loading…
Cancel
Save