diff options
| author | Mark Rustad <mark.d.rustad@intel.com> | 2016-04-01 15:18:25 -0400 |
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-04-07 19:36:47 -0400 |
| commit | 537cc5df4fcb82c0ee1f1dc4751357929a135bbc (patch) | |
| tree | 6ada1b2eade3be85e450aacc743fb4dec4a70a68 /drivers/net/ethernet | |
| parent | c898fe280457dcdf500fc1001ee73cb1adedc4d2 (diff) | |
ixgbe: Read and parse NW_MNG_IF_SEL register
Read the IXGBE_NW_MNG_IF_SEL register and use it to set interface
attributes.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 37 |
2 files changed, 37 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h index a5c789e30de3..6b68e8ba1dce 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | |||
| @@ -3649,5 +3649,10 @@ struct ixgbe_info { | |||
| 3649 | #define IXGBE_SB_IOSF_TARGET_KX4_PCS1 3 | 3649 | #define IXGBE_SB_IOSF_TARGET_KX4_PCS1 3 |
| 3650 | 3650 | ||
| 3651 | #define IXGBE_NW_MNG_IF_SEL 0x00011178 | 3651 | #define IXGBE_NW_MNG_IF_SEL 0x00011178 |
| 3652 | #define IXGBE_NW_MNG_IF_SEL_MDIO_ACT BIT(1) | ||
| 3653 | #define IXGBE_NW_MNG_IF_SEL_ENABLE_10_100M BIT(23) | ||
| 3652 | #define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE BIT(24) | 3654 | #define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE BIT(24) |
| 3655 | #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT 3 | ||
| 3656 | #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ | ||
| 3657 | (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) | ||
| 3653 | #endif /* _IXGBE_TYPE_H_ */ | 3658 | #endif /* _IXGBE_TYPE_H_ */ |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index ef1dc3b5b4ed..3563b862d8ea 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | |||
| @@ -2137,6 +2137,36 @@ static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) | |||
| 2137 | return status; | 2137 | return status; |
| 2138 | } | 2138 | } |
| 2139 | 2139 | ||
| 2140 | /** | ||
| 2141 | * ixgbe_read_mng_if_sel_x550em - Read NW_MNG_IF_SEL register | ||
| 2142 | * @hw: pointer to hardware structure | ||
| 2143 | * | ||
| 2144 | * Read NW_MNG_IF_SEL register and save field values. | ||
| 2145 | */ | ||
| 2146 | static void ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw) | ||
| 2147 | { | ||
| 2148 | /* Save NW management interface connected on board. This is used | ||
| 2149 | * to determine internal PHY mode. | ||
| 2150 | */ | ||
| 2151 | hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); | ||
| 2152 | |||
| 2153 | /* If X552 (X550EM_a) and MDIO is connected to external PHY, then set | ||
| 2154 | * PHY address. This register field was has only been used for X552. | ||
| 2155 | */ | ||
| 2156 | if (!hw->phy.nw_mng_if_sel) { | ||
| 2157 | if (hw->mac.type == ixgbe_mac_x550em_a) { | ||
| 2158 | struct ixgbe_adapter *adapter = hw->back; | ||
| 2159 | |||
| 2160 | e_warn(drv, "nw_mng_if_sel not set\n"); | ||
| 2161 | } | ||
| 2162 | return; | ||
| 2163 | } | ||
| 2164 | |||
| 2165 | hw->phy.mdio.prtad = (hw->phy.nw_mng_if_sel & | ||
| 2166 | IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD) >> | ||
| 2167 | IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT; | ||
| 2168 | } | ||
| 2169 | |||
| 2140 | /** ixgbe_init_phy_ops_X550em - PHY/SFP specific init | 2170 | /** ixgbe_init_phy_ops_X550em - PHY/SFP specific init |
| 2141 | * @hw: pointer to hardware structure | 2171 | * @hw: pointer to hardware structure |
| 2142 | * | 2172 | * |
| @@ -2151,14 +2181,11 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) | |||
| 2151 | 2181 | ||
| 2152 | hw->mac.ops.set_lan_id(hw); | 2182 | hw->mac.ops.set_lan_id(hw); |
| 2153 | 2183 | ||
| 2184 | ixgbe_read_mng_if_sel_x550em(hw); | ||
| 2185 | |||
| 2154 | if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { | 2186 | if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { |
| 2155 | phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; | 2187 | phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; |
| 2156 | ixgbe_setup_mux_ctl(hw); | 2188 | ixgbe_setup_mux_ctl(hw); |
| 2157 | |||
| 2158 | /* Save NW management interface connected on board. This is used | ||
| 2159 | * to determine internal PHY mode. | ||
| 2160 | */ | ||
| 2161 | phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); | ||
| 2162 | } | 2189 | } |
| 2163 | 2190 | ||
| 2164 | /* Identify the PHY or SFP module */ | 2191 | /* Identify the PHY or SFP module */ |
