aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-03-18 04:18:32 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-04-13 22:22:44 -0400
commit0fa6d83258252695203d24c8818092644df10fd7 (patch)
tree9ac59ecec98e4c5ab7594271c0012e88f0a9a99c /drivers/net/ixgbe
parent3d5c520727ce3dbf418eec38e431856708f946f8 (diff)
ixgbe: fix 82599 KR downshift coexistence with LESM FW module
Disable KR to KX4/KX downshift on 82599 backplane devices when LESM (Link Establishment State Machine) is enabled in FW. Those features cannot co-exist as they both manipulate the same registers. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Acked-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phillip Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c46
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h3
2 files changed, 48 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 09934a82eb30..d195278c62e3 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -61,6 +61,7 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
61 bool autoneg, 61 bool autoneg,
62 bool autoneg_wait_to_complete); 62 bool autoneg_wait_to_complete);
63static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); 63static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
64static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
64 65
65static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) 66static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
66{ 67{
@@ -86,7 +87,8 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
86 if ((mac->ops.get_media_type(hw) == 87 if ((mac->ops.get_media_type(hw) ==
87 ixgbe_media_type_backplane) && 88 ixgbe_media_type_backplane) &&
88 (hw->phy.smart_speed == ixgbe_smart_speed_auto || 89 (hw->phy.smart_speed == ixgbe_smart_speed_auto ||
89 hw->phy.smart_speed == ixgbe_smart_speed_on)) 90 hw->phy.smart_speed == ixgbe_smart_speed_on) &&
91 !ixgbe_verify_lesm_fw_enabled_82599(hw))
90 mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed; 92 mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed;
91 else 93 else
92 mac->ops.setup_link = &ixgbe_setup_mac_link_82599; 94 mac->ops.setup_link = &ixgbe_setup_mac_link_82599;
@@ -2028,6 +2030,48 @@ fw_version_out:
2028 return status; 2030 return status;
2029} 2031}
2030 2032
2033/**
2034 * ixgbe_verify_lesm_fw_enabled_82599 - Checks LESM FW module state.
2035 * @hw: pointer to hardware structure
2036 *
2037 * Returns true if the LESM FW module is present and enabled. Otherwise
2038 * returns false. Smart Speed must be disabled if LESM FW module is enabled.
2039 **/
2040static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw)
2041{
2042 bool lesm_enabled = false;
2043 u16 fw_offset, fw_lesm_param_offset, fw_lesm_state;
2044 s32 status;
2045
2046 /* get the offset to the Firmware Module block */
2047 status = hw->eeprom.ops.read(hw, IXGBE_FW_PTR, &fw_offset);
2048
2049 if ((status != 0) ||
2050 (fw_offset == 0) || (fw_offset == 0xFFFF))
2051 goto out;
2052
2053 /* get the offset to the LESM Parameters block */
2054 status = hw->eeprom.ops.read(hw, (fw_offset +
2055 IXGBE_FW_LESM_PARAMETERS_PTR),
2056 &fw_lesm_param_offset);
2057
2058 if ((status != 0) ||
2059 (fw_lesm_param_offset == 0) || (fw_lesm_param_offset == 0xFFFF))
2060 goto out;
2061
2062 /* get the lesm state word */
2063 status = hw->eeprom.ops.read(hw, (fw_lesm_param_offset +
2064 IXGBE_FW_LESM_STATE_1),
2065 &fw_lesm_state);
2066
2067 if ((status == 0) &&
2068 (fw_lesm_state & IXGBE_FW_LESM_STATE_ENABLED))
2069 lesm_enabled = true;
2070
2071out:
2072 return lesm_enabled;
2073}
2074
2031static struct ixgbe_mac_operations mac_ops_82599 = { 2075static struct ixgbe_mac_operations mac_ops_82599 = {
2032 .init_hw = &ixgbe_init_hw_generic, 2076 .init_hw = &ixgbe_init_hw_generic,
2033 .reset_hw = &ixgbe_reset_hw_82599, 2077 .reset_hw = &ixgbe_reset_hw_82599,
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index cd1c2b62ec49..e00356a25ee1 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -1625,6 +1625,9 @@
1625#define IXGBE_SAN_MAC_ADDR_PORT1_OFFSET 0x3 1625#define IXGBE_SAN_MAC_ADDR_PORT1_OFFSET 0x3
1626#define IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP 0x1 1626#define IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP 0x1
1627#define IXGBE_DEVICE_CAPS_FCOE_OFFLOADS 0x2 1627#define IXGBE_DEVICE_CAPS_FCOE_OFFLOADS 0x2
1628#define IXGBE_FW_LESM_PARAMETERS_PTR 0x2
1629#define IXGBE_FW_LESM_STATE_1 0x1
1630#define IXGBE_FW_LESM_STATE_ENABLED 0x8000 /* LESM Enable bit */
1628#define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 1631#define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4
1629#define IXGBE_FW_PATCH_VERSION_4 0x7 1632#define IXGBE_FW_PATCH_VERSION_4 0x7
1630 1633