mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
ixgbe: Introduce function to control MDIO speed
Move code that controls MDIO speed into a new function because there will be more MACs that need the control. 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>
This commit is contained in:
parent
537cc5df4f
commit
e84db72727
1 changed files with 21 additions and 6 deletions
|
@ -2306,6 +2306,26 @@ static s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ixgbe_set_mdio_speed - Set MDIO clock speed
|
||||||
|
* @hw: pointer to hardware structure
|
||||||
|
*/
|
||||||
|
static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
|
||||||
|
{
|
||||||
|
u32 hlreg0;
|
||||||
|
|
||||||
|
switch (hw->device_id) {
|
||||||
|
case IXGBE_DEV_ID_X550EM_X_10G_T:
|
||||||
|
/* Config MDIO clock speed before the first MDIO PHY access */
|
||||||
|
hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
|
||||||
|
hlreg0 &= ~IXGBE_HLREG0_MDCSPD;
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** ixgbe_reset_hw_X550em - Perform hardware reset
|
/** ixgbe_reset_hw_X550em - Perform hardware reset
|
||||||
** @hw: pointer to hardware structure
|
** @hw: pointer to hardware structure
|
||||||
**
|
**
|
||||||
|
@ -2319,7 +2339,6 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
|
||||||
s32 status;
|
s32 status;
|
||||||
u32 ctrl = 0;
|
u32 ctrl = 0;
|
||||||
u32 i;
|
u32 i;
|
||||||
u32 hlreg0;
|
|
||||||
bool link_up = false;
|
bool link_up = false;
|
||||||
|
|
||||||
/* Call adapter stop to disable Tx/Rx and clear interrupts */
|
/* Call adapter stop to disable Tx/Rx and clear interrupts */
|
||||||
|
@ -2405,11 +2424,7 @@ mac_reset_top:
|
||||||
hw->mac.num_rar_entries = 128;
|
hw->mac.num_rar_entries = 128;
|
||||||
hw->mac.ops.init_rx_addrs(hw);
|
hw->mac.ops.init_rx_addrs(hw);
|
||||||
|
|
||||||
if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
|
ixgbe_set_mdio_speed(hw);
|
||||||
hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
|
|
||||||
hlreg0 &= ~IXGBE_HLREG0_MDCSPD;
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
|
if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
|
||||||
ixgbe_setup_mux_ctl(hw);
|
ixgbe_setup_mux_ctl(hw);
|
||||||
|
|
Loading…
Add table
Reference in a new issue