[ipxe-devel] Additional e1000e IDs

Brandon Penglase bpenglase-ipxe at spaceservices.net
Mon Mar 26 21:09:09 UTC 2012


Hello,
     I wanted to submit this for further testing and hopefully 
inclusion. I updated the e1000e to include the IDs 1502 and 1503 
(82579LM, 82579V respectfully). The driver update was originally posted 
by Levente LEVAI in December 
(http://lists.ipxe.org/pipermail/ipxe-devel/2011-December/001086.html). 
I took their work, copied the updated code from the Linux Kernel 
v3.2.13, and tested on two different machines with the 1502 (Dell 
Optiplex 990 and Precision M4600). Below is the git diff. Let me know if 
I can do anything different or better (still learning this whole patch 
submitting process, and still learning git).

     Brandon Penglase

diff --git a/src/drivers/net/e1000e/e1000e.h 
b/src/drivers/net/e1000e/e1000e.h
index bc8e7b0..e3228ff 100644
--- a/src/drivers/net/e1000e/e1000e.h
+++ b/src/drivers/net/e1000e/e1000e.h
@@ -143,6 +143,7 @@ enum e1000_boards {
         board_ich9lan,
         board_ich10lan,
         board_pchlan,
+       board_pch2lan,
         board_82583,
  };

@@ -243,6 +244,8 @@ struct e1000_info {
  /* CRC Stripping defines */
  #define FLAG2_CRC_STRIPPING               (1 << 0)
  #define FLAG2_HAS_PHY_WAKEUP              (1 << 1)
+#define FLAG2_HAS_PHY_STATS               (1 << 4)
+#define FLAG2_HAS_EEE                     (1 << 5)

  #define E1000_RX_DESC_PS(R, i)     \
         (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
diff --git a/src/drivers/net/e1000e/e1000e_hw.h 
b/src/drivers/net/e1000e/e1000e_hw.h
index 03ed35c..eb45f91 100644
--- a/src/drivers/net/e1000e/e1000e_hw.h
+++ b/src/drivers/net/e1000e/e1000e_hw.h
@@ -109,6 +109,7 @@ enum e1000_mac_type {
         e1000_ich9lan,
         e1000_ich10lan,
         e1000_pchlan,
+       e1000_pch2lan,
         e1000_num_macs  /* List is 1-based, so subtract 1 for true 
count. */
  };
diff --git a/src/drivers/net/e1000e/e1000e_ich8lan.c 
b/src/drivers/net/e1000e/e1000e_ich8lan.c
index 7b9a49b..0b20fdc 100644
--- a/src/drivers/net/e1000e/e1000e_ich8lan.c
+++ b/src/drivers/net/e1000e/e1000e_ich8lan.c
@@ -54,6 +54,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
   * 82577LC Gigabit Network Connection
   * 82578DM Gigabit Network Connection
   * 82578DC Gigabit Network Connection
+ * 82579LM Gigabit Network Connection
+ * 82579V Gigabit Network Connection
   */

  #include "e1000e.h"
@@ -3434,6 +3436,8 @@ static struct pci_device_id e1000e_ich8lan_nics[] = {
       PCI_ROM(0x8086, 0x10EB, "E1000_DEV_ID_PCH_M_HV_LC", 
"E1000_DEV_ID_PCH_M_HV_LC", board_pchlan),
       PCI_ROM(0x8086, 0x10EF, "E1000_DEV_ID_PCH_D_HV_DM", 
"E1000_DEV_ID_PCH_D_HV_DM", board_pchlan),
       PCI_ROM(0x8086, 0x10F0, "E1000_DEV_ID_PCH_D_HV_DC", 
"E1000_DEV_ID_PCH_D_HV_DC", board_pchlan),
+     PCI_ROM(0x8086, 0x1502, "E1000_DEV_ID_PCH2_LV_LM", 
"E1000_DEV_ID_PCH2_LV_LM", board_pch2lan),
+     PCI_ROM(0x8086, 0x1503, "E1000_DEV_ID_PCH2_LV_LM", 
"E1000_DEV_ID_PCH2_LV_LM", board_pch2lan),
  };

  struct pci_driver e1000e_ich8lan_driver __pci_driver = {diff --git 
a/src/drivers/net/e1000e/e1000e_main.c 
b/src/drivers/net/e1000e/e1000e_main.c
index 352e3c4..bce17a5 100644
--- a/src/drivers/net/e1000e/e1000e_main.c
+++ b/src/drivers/net/e1000e/e1000e_main.c
@@ -279,6 +279,25 @@ static struct e1000_info e1000_pch_info = {
         .get_variants           = e1000e_get_variants_ich8lan,
  };

+const struct e1000_info e1000_pch2_info = {
+        .mac                    = e1000_pch2lan,
+        .flags                  = FLAG_IS_ICH
+                                  | FLAG_HAS_WOL
+                                  | FLAG_HAS_CTRLEXT_ON_LOAD
+                                  | FLAG_HAS_AMT
+                                  | FLAG_HAS_FLASH
+                                  | FLAG_HAS_JUMBO_FRAMES
+                                  | FLAG_APME_IN_WUC,
+        .flags2                 = FLAG2_HAS_PHY_STATS
+                                  | FLAG2_HAS_EEE,
+        .pba                    = 26,
+        .max_hw_frame_size      = DEFAULT_JUMBO,
+        .get_variants           = e1000e_get_variants_ich8lan,
+/*        .mac_ops                = &ich8_mac_ops,
+        .phy_ops                = &ich8_phy_ops,
+        .nvm_ops                = &ich8_nvm_ops,*/
+};
+
  static const struct e1000_info *e1000_info_tbl[] = {
         [board_82571]           = &e1000_82571_info,
         [board_82572]           = &e1000_82572_info,
@@ -290,6 +309,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
         [board_ich9lan]         = &e1000_ich9_info,
         [board_ich10lan]        = &e1000_ich10_info,
         [board_pchlan]          = &e1000_pch_info,
+       [board_pch2lan]         = &e1000_pch2_info,
  };

  /* Low-level support routines */
diff --git a/src/drivers/net/e1000e/e1000e_phy.c 
b/src/drivers/net/e1000e/e1000e_phy.c
index 337be73..9ec9fcb 100644
--- a/src/drivers/net/e1000e/e1000e_phy.c
+++ b/src/drivers/net/e1000e/e1000e_phy.c
@@ -213,6 +213,14 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, 
u32 offset, u16 *data)
         }
         *data = (u16) mdic;

+        /*
+         * Allow some time after each MDIC transaction to avoid
+         * reading duplicate data in the next MDIC transaction.
+         */
+        if (hw->mac.type == e1000_pch2lan)
+                udelay(100);
+
+
  out:
         return ret_val;
  }
@@ -265,6 +273,12 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, 
u32 offset, u16 data)
                 goto out;
         }

+        /*
+         * Allow some time after each MDIC transaction to avoid
+         * reading duplicate data in the next MDIC transaction.
+         */
+        if (hw->mac.type == e1000_pch2lan)
+                udelay(100);
  out:
         return ret_val;
  }





More information about the ipxe-devel mailing list