summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYaniv Rosner <yaniv.rosner@qlogic.com>2014-06-12 00:55:29 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-12 13:28:18 -0400
commitdad91ee478c7f39e04a33272732147b8c274bb58 (patch)
tree6eb99fcf77eb2dbe417e2e88c424216267188330 /drivers/net
parentd3217b15a19a4779c39b212358a5c71d725822ee (diff)
bnx2x: Fix link for KR with swapped polarity lane
This avoids clearing the RX polarity setting in KR mode when polarity lane is swapped, as otherwise this will result in failed link. Signed-off-by: Yaniv Rosner <yaniv.rosner@qlogic.com> Signed-off-by: Yuval Mintz <yuval.mintz@qlogic.com> Signed-off-by: Ariel Elior <ariel.elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 4fef1e199366..592a8a4ec9c9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3702,7 +3702,8 @@ static void bnx2x_warpcore_restart_AN_KR(struct bnx2x_phy *phy,
3702static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, 3702static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3703 struct link_params *params, 3703 struct link_params *params,
3704 struct link_vars *vars) { 3704 struct link_vars *vars) {
3705 u16 lane, i, cl72_ctrl, an_adv = 0; 3705 u16 lane, i, cl72_ctrl, an_adv = 0, val;
3706 u32 wc_lane_config;
3706 struct bnx2x *bp = params->bp; 3707 struct bnx2x *bp = params->bp;
3707 static struct bnx2x_reg_set reg_set[] = { 3708 static struct bnx2x_reg_set reg_set[] = {
3708 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7}, 3709 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
@@ -3821,15 +3822,27 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3821 /* Enable Auto-Detect to support 1G over CL37 as well */ 3822 /* Enable Auto-Detect to support 1G over CL37 as well */
3822 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, 3823 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3823 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10); 3824 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10);
3824 3825 wc_lane_config = REG_RD(bp, params->shmem_base +
3826 offsetof(struct shmem_region, dev_info.
3827 shared_hw_config.wc_lane_config));
3828 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3829 MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4), &val);
3825 /* Force cl48 sync_status LOW to avoid getting stuck in CL73 3830 /* Force cl48 sync_status LOW to avoid getting stuck in CL73
3826 * parallel-detect loop when CL73 and CL37 are enabled. 3831 * parallel-detect loop when CL73 and CL37 are enabled.
3827 */ 3832 */
3828 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK, 3833 val |= 1 << 11;
3829 MDIO_AER_BLOCK_AER_REG, 0); 3834
3835 /* Restore Polarity settings in case it was run over by
3836 * previous link owner
3837 */
3838 if (wc_lane_config &
3839 (SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED << lane))
3840 val |= 3 << 2;
3841 else
3842 val &= ~(3 << 2);
3830 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, 3843 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3831 MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800); 3844 MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4),
3832 bnx2x_set_aer_mmd(params, phy); 3845 val);
3833 3846
3834 bnx2x_disable_kr2(params, vars, phy); 3847 bnx2x_disable_kr2(params, vars, phy);
3835 } 3848 }