diff options
author | william <william@cvs.openbsd.org> | 2011-04-04 03:49:33 +0000 |
---|---|---|
committer | william <william@cvs.openbsd.org> | 2011-04-04 03:49:33 +0000 |
commit | 6d64d358d68ddb10eae9d681971466c4782ef40b (patch) | |
tree | 4b44ad17c3b8db52a1edc92bf656b6540bc8d937 /sys/dev/pci | |
parent | 852369d6a2aa06c036160f01c1f734516f6c90c5 (diff) |
The backplane version of the 82575EB has no link state -- it's always
up. From FreeBSD.
ok jsg claudio
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_em_hw.c | 30 | ||||
-rw-r--r-- | sys/dev/pci/if_em_hw.h | 6 |
2 files changed, 29 insertions, 7 deletions
diff --git a/sys/dev/pci/if_em_hw.c b/sys/dev/pci/if_em_hw.c index e58fff322fa..c4d3f34f418 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.60 2011/02/15 19:15:25 miod Exp $ */ +/* $OpenBSD: if_em_hw.c,v 1.61 2011/04/04 03:49:32 william Exp $ */ /* * if_em_hw.c Shared functions for accessing and configuring the MAC */ @@ -1570,7 +1570,7 @@ em_power_up_serdes_link_82575(struct em_hw *hw) static int32_t em_setup_fiber_serdes_link(struct em_hw *hw) { - uint32_t ctrl, reg; + uint32_t ctrl, ctrl_ext, reg; uint32_t status; uint32_t txcw = 0; uint32_t i; @@ -1613,10 +1613,28 @@ em_setup_fiber_serdes_link(struct em_hw *hw) /* set both sw defined pins on 82575/82576*/ ctrl |= E1000_CTRL_SWDPIN0 | E1000_CTRL_SWDPIN1; - /* Set switch control to serdes energy detect */ - reg = E1000_READ_REG(hw, CONNSW); - reg |= E1000_CONNSW_ENRGSRC; - E1000_WRITE_REG(hw, CONNSW, reg); + ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); + switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) { + case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: + case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: + /* the backplane is always connected */ + reg = E1000_READ_REG(hw, PCS_LCTL); + reg |= E1000_PCS_LCTL_FORCE_FCTRL; + reg |= E1000_PCS_LCTL_FSV_1000 | E1000_PCS_LCTL_FDV_FULL; + reg |= E1000_PCS_LCTL_FSD; /* Force Speed */ + DEBUGOUT("Configuring Forced Link\n"); + E1000_WRITE_REG(hw, PCS_LCTL, reg); + em_force_mac_fc(hw); + hw->autoneg_failed = 0; + return E1000_SUCCESS; + break; + default: + /* Set switch control to serdes energy detect */ + reg = E1000_READ_REG(hw, CONNSW); + reg |= E1000_CONNSW_ENRGSRC; + E1000_WRITE_REG(hw, CONNSW, reg); + break; + } } /* Adjust VCO speed to improve BER performance */ diff --git a/sys/dev/pci/if_em_hw.h b/sys/dev/pci/if_em_hw.h index e2770c0c3fa..345735366de 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.47 2011/02/06 23:47:14 dlg Exp $ */ +/* $OpenBSD: if_em_hw.h,v 1.48 2011/04/04 03:49:32 william Exp $ */ /* $FreeBSD: if_em_hw.h,v 1.15 2005/05/26 23:32:02 tackerman Exp $ */ /* if_em_hw.h @@ -1579,6 +1579,10 @@ struct em_hw { #define E1000_CONNSW_ENRGSRC 0x4 #define E1000_PCS_CFG_PCS_EN 8 +#define E1000_PCS_LCTL_FSV_1000 4 +#define E1000_PCS_LCTL_FDV_FULL 8 +#define E1000_PCS_LCTL_FSD 0x10 +#define E1000_PCS_LCTL_FORCE_FCTRL 0x80 #define E1000_PCS_LSTS_LINK_OK 0x01 #define E1000_PCS_LSTS_SPEED_100 0x02 |