summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2014-02-22 04:41:33 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2014-02-22 04:41:33 +0000
commite2e6bdd6bf398f33d8f4915206f0fa6d48c85bcc (patch)
tree799b713614a3ecedbd97da41459a13ba604e70e1 /sys
parent0deff4e550ec85cd9c4a93c689ec4dd6a95a9b5a (diff)
basic i210/i211 support (improved after looking at gollo@ i210 diff on misc)
tested on Supermicro X10SLL ok jsg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em.c36
-rw-r--r--sys/dev/pci/if_em_hw.c32
-rw-r--r--sys/dev/pci/if_em_hw.h11
3 files changed, 63 insertions, 16 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 248255edf7a..a06977b0771 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.276 2014/02/17 07:02:45 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.277 2014/02/22 04:41:31 chris Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -130,6 +130,13 @@ const struct pci_matchid em_devices[] = {
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82578DM },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82579LM },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82579V },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_FIBER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_SERDES },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_SGMII },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_COPPER_NF },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_SERDES_NF },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I211_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I217_LM },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I217_V },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I218_LM },
@@ -410,6 +417,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
case em_82574:
case em_82575:
case em_82580:
+ case em_i210:
case em_i350:
case em_ich9lan:
case em_ich10lan:
@@ -478,7 +486,8 @@ em_attach(struct device *parent, struct device *self, void *aux)
}
if (sc->hw.mac_type == em_80003es2lan || sc->hw.mac_type == em_82575 ||
- sc->hw.mac_type == em_82580 || sc->hw.mac_type == em_i350) {
+ sc->hw.mac_type == em_82580 || sc->hw.mac_type == em_i210 ||
+ sc->hw.mac_type == em_i350) {
uint32_t reg = EM_READ_REG(&sc->hw, E1000_STATUS);
sc->hw.bus_func = (reg & E1000_STATUS_FUNC_MASK) >>
E1000_STATUS_FUNC_SHIFT;
@@ -779,6 +788,9 @@ em_init(void *arg)
case em_i350:
pba = E1000_PBA_32K; /* 32K for Rx, 16K for Tx */
break;
+ case em_i210:
+ pba = E1000_PBA_34K;
+ break;
case em_82573: /* 82573: Total Packet Buffer is 32K */
/* Jumbo frames not supported */
pba = E1000_PBA_12K; /* 12K for Rx, 20K for Tx */
@@ -1122,7 +1134,8 @@ em_encap(struct em_softc *sc, struct mbuf *m_head)
goto fail;
if (sc->hw.mac_type >= em_82543 && sc->hw.mac_type != em_82575 &&
- sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i350)
+ sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i210 &&
+ sc->hw.mac_type != em_i350)
em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower);
else
txd_upper = txd_lower = 0;
@@ -1761,7 +1774,8 @@ em_hardware_init(struct em_softc *sc)
sc->hw.mac_type == em_82572 ||
sc->hw.mac_type == em_82575 ||
sc->hw.mac_type == em_82580 ||
- sc->hw.mac_type == em_i350)) {
+ sc->hw.mac_type == em_i210 ||
+ sc->hw.mac_type == em_i350 )) {
uint16_t phy_tmp = 0;
/* Speed up time to link by disabling smart power down */
@@ -1842,12 +1856,13 @@ em_setup_interface(struct em_softc *sc)
#if NVLAN > 0
if (sc->hw.mac_type != em_82575 && sc->hw.mac_type != em_82580 &&
- sc->hw.mac_type != em_i350)
+ sc->hw.mac_type != em_i210 && sc->hw.mac_type != em_i350)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
#endif
if (sc->hw.mac_type >= em_82543 && sc->hw.mac_type != em_82575 &&
- sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i350)
+ sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i210 &&
+ sc->hw.mac_type != em_i350)
ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
/*
@@ -2202,7 +2217,7 @@ em_initialize_transmit_unit(struct em_softc *sc)
sc->txd_cmd = E1000_TXD_CMD_IFCS;
if (sc->hw.mac_type == em_82575 || sc->hw.mac_type == em_82580 ||
- sc->hw.mac_type == em_i350) {
+ sc->hw.mac_type == em_i210 || sc->hw.mac_type == em_i350) {
/* 82575/6 need to enable the TX queue and lack the IDE bit */
reg_tctl = E1000_READ_REG(&sc->hw, TXDCTL);
reg_tctl |= E1000_TXDCTL_QUEUE_ENABLE;
@@ -2627,7 +2642,7 @@ em_initialize_receive_unit(struct em_softc *sc)
* asked to or not. So ask for stripped CRC here and
* cope in rxeof
*/
- if (sc->hw.mac_type == em_i350)
+ if (sc->hw.mac_type == em_i210 || sc->hw.mac_type == em_i350)
reg_rctl |= E1000_RCTL_SECRC;
switch (sc->rx_buffer_len) {
@@ -2664,7 +2679,7 @@ em_initialize_receive_unit(struct em_softc *sc)
E1000_WRITE_REG(&sc->hw, RDTR, 0x20);
if (sc->hw.mac_type == em_82575 || sc->hw.mac_type == em_82580 ||
- sc->hw.mac_type == em_i350) {
+ sc->hw.mac_type == em_i210 || sc->hw.mac_type == em_i350) {
/* 82575/6 need to enable the RX queue */
uint32_t reg;
reg = E1000_READ_REG(&sc->hw, RXDCTL);
@@ -2862,7 +2877,8 @@ em_rxeof(struct em_softc *sc)
if (desc_len < ETHER_CRC_LEN) {
len = 0;
prev_len_adj = ETHER_CRC_LEN - desc_len;
- } else if (sc->hw.mac_type == em_i350)
+ } else if (sc->hw.mac_type == em_i210 ||
+ sc->hw.mac_type == em_i350)
len = desc_len;
else
len = desc_len - ETHER_CRC_LEN;
diff --git a/sys/dev/pci/if_em_hw.c b/sys/dev/pci/if_em_hw.c
index 7af8837f52f..f11de823fa0 100644
--- a/sys/dev/pci/if_em_hw.c
+++ b/sys/dev/pci/if_em_hw.c
@@ -31,7 +31,7 @@
*******************************************************************************/
-/* $OpenBSD: if_em_hw.c,v 1.76 2014/02/17 07:02:45 jsg Exp $ */
+/* $OpenBSD: if_em_hw.c,v 1.77 2014/02/22 04:41:31 chris Exp $ */
/*
* if_em_hw.c Shared functions for accessing and configuring the MAC
*/
@@ -226,6 +226,7 @@ em_set_phy_type(struct em_hw *hw)
case M88E1011_I_PHY_ID:
case M88E1111_I_PHY_ID:
case M88E1543_E_PHY_ID:
+ case I210_I_PHY_ID:
hw->phy_type = em_phy_m88;
break;
case IGP01E1000_I_PHY_ID:
@@ -519,6 +520,17 @@ em_set_mac_type(struct em_hw *hw)
hw->mac_type = em_82580;
hw->initialize_hw_bits_disable = 1;
break;
+ case E1000_DEV_ID_I210_COPPER:
+ case E1000_DEV_ID_I210_FIBER:
+ case E1000_DEV_ID_I210_SERDES:
+ case E1000_DEV_ID_I210_SGMII:
+ case E1000_DEV_ID_I210_COPPER_FLASHLESS:
+ case E1000_DEV_ID_I210_SERDES_FLASHLESS:
+ case E1000_DEV_ID_I211_COPPER:
+ hw->mac_type = em_i210;
+ hw->initialize_hw_bits_disable = 1;
+ hw->eee_enable = 1;
+ break;
case E1000_DEV_ID_I350_COPPER:
case E1000_DEV_ID_I350_FIBER:
case E1000_DEV_ID_I350_SERDES:
@@ -612,6 +624,7 @@ em_set_mac_type(struct em_hw *hw)
case em_80003es2lan:
case em_82575:
case em_82580:
+ case em_i210:
case em_i350:
hw->swfw_sync_present = TRUE;
/* FALLTHROUGH */
@@ -650,7 +663,7 @@ em_set_media_type(struct em_hw *hw)
}
if (hw->mac_type == em_82575 || hw->mac_type == em_82580 ||
- hw->mac_type == em_i350) {
+ hw->mac_type == em_i210 || hw->mac_type == em_i350) {
hw->media_type = em_media_type_copper;
ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
@@ -755,7 +768,7 @@ em_reset_hw(struct em_hw *hw)
/* Set the completion timeout for 82575 chips */
if (hw->mac_type == em_82575 || hw->mac_type == em_82580 ||
- hw->mac_type == em_i350) {
+ hw->mac_type == em_i210 || hw->mac_type == em_i350) {
ret_val = em_set_pciex_completion_timeout(hw);
if (ret_val) {
DEBUGOUT("PCI-E Set completion timeout has failed.\n");
@@ -1011,7 +1024,7 @@ em_reset_hw(struct em_hw *hw)
EM_WRITE_REG(hw, E1000_MDICNFG, mdicnfg);
}
- if (hw->mac_type == em_i350)
+ if (hw->mac_type == em_i210 || hw->mac_type == em_i350)
em_set_eee_i350(hw);
return E1000_SUCCESS;
@@ -1380,6 +1393,7 @@ em_init_hw(struct em_hw *hw)
case em_82572:
case em_82575:
case em_82580:
+ case em_i210:
case em_i350:
case em_ich8lan:
case em_ich9lan:
@@ -5181,8 +5195,10 @@ em_match_gig_phy(struct em_hw *hw)
match = TRUE;
break;
case em_82580:
+ case em_i210:
case em_i350:
if (hw->phy_id == I82580_I_PHY_ID ||
+ hw->phy_id == I210_I_PHY_ID ||
hw->phy_id == I350_I_PHY_ID ||
hw->phy_id == M88E1543_E_PHY_ID) {
uint32_t mdic;
@@ -5319,7 +5335,8 @@ em_detect_gig_phy(struct em_hw *hw)
hw->phy_type = em_phy_gg82563;
/* Power on SGMII phy if it is disabled */
- if (hw->mac_type == em_82580 || hw->mac_type == em_i350) {
+ if (hw->mac_type == em_82580 || hw->mac_type == em_i210 ||
+ hw->mac_type == em_i350) {
uint32_t ctrl_ext = EM_READ_REG(hw, E1000_CTRL_EXT);
EM_WRITE_REG(hw, E1000_CTRL_EXT,
ctrl_ext & ~E1000_CTRL_EXT_SDP3_DATA);
@@ -5461,6 +5478,7 @@ em_init_eeprom_params(struct em_hw *hw)
case em_82574:
case em_82575:
case em_82580:
+ case em_i210:
case em_i350:
eeprom->type = em_eeprom_spi;
eeprom->opcode_bits = 8;
@@ -6789,6 +6807,8 @@ em_init_rx_addrs(struct em_hw *hw)
rar_num -= 1;
if (hw->mac_type == em_82580)
rar_num = E1000_RAR_ENTRIES_82580;
+ if (hw->mac_type == em_i210)
+ rar_num = E1000_RAR_ENTRIES_82575;
if (hw->mac_type == em_i350)
rar_num = E1000_RAR_ENTRIES_I350;
@@ -7444,6 +7464,7 @@ em_get_bus_info(struct em_hw *hw)
case em_82575:
case em_82580:
case em_80003es2lan:
+ case em_i210:
case em_i350:
hw->bus_type = em_bus_type_pci_express;
hw->bus_speed = em_bus_speed_2500;
@@ -8641,6 +8662,7 @@ em_get_auto_rd_done(struct em_hw *hw)
case em_82575:
case em_82580:
case em_80003es2lan:
+ case em_i210:
case em_i350:
case em_ich8lan:
case em_ich9lan:
diff --git a/sys/dev/pci/if_em_hw.h b/sys/dev/pci/if_em_hw.h
index 5774b44f0c9..65655220e99 100644
--- a/sys/dev/pci/if_em_hw.h
+++ b/sys/dev/pci/if_em_hw.h
@@ -31,7 +31,7 @@
*******************************************************************************/
-/* $OpenBSD: if_em_hw.h,v 1.57 2014/02/17 07:02:45 jsg Exp $ */
+/* $OpenBSD: if_em_hw.h,v 1.58 2014/02/22 04:41:32 chris Exp $ */
/* $FreeBSD: if_em_hw.h,v 1.15 2005/05/26 23:32:02 tackerman Exp $ */
/* if_em_hw.h
@@ -72,6 +72,7 @@ typedef enum {
em_82575,
em_82580,
em_i350,
+ em_i210,
em_80003es2lan,
em_ich8lan,
em_ich9lan,
@@ -570,6 +571,13 @@ int32_t em_check_phy_reset_block(struct em_hw *hw);
#define E1000_DEV_ID_I350_SERDES 0x1523
#define E1000_DEV_ID_I350_SGMII 0x1524
#define E1000_DEV_ID_82576_QUAD_CU_ET2 0x1526
+#define E1000_DEV_ID_I210_COPPER 0x1533
+#define E1000_DEV_ID_I210_FIBER 0x1536
+#define E1000_DEV_ID_I210_SERDES 0x1537
+#define E1000_DEV_ID_I210_SGMII 0x1538
+#define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B
+#define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C
+#define E1000_DEV_ID_I211_COPPER 0x1539
#define E1000_DEV_ID_I350_DA4 0x1546
#define E1000_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40
#define E1000_DEV_ID_I354_SGMII 0x1F41
@@ -3384,6 +3392,7 @@ struct em_host_command_info {
#define I217_E_PHY_ID 0x015400A0
#define I82580_I_PHY_ID 0x015403A0
#define I350_I_PHY_ID 0x015403B0
+#define I210_I_PHY_ID 0x01410C00
#define IGP04E1000_E_PHY_ID 0x02A80391
#define M88E1141_E_PHY_ID 0x01410CD0