Skip to content

Commit 5657360

Browse files
jjdalynhanguy11
authored andcommitted
ixgbe: Manual AN-37 for troublesome link partners for X550 SFI
Some (Juniper MX5) SFP link partners exhibit a disinclination to autonegotiate with X550 configured in SFI mode. This patch enables a manual AN-37 restart to work around the problem. Signed-off-by: Jeff Daly <[email protected]> Tested-by: Dave Switzer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 03f5171 commit 5657360

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,7 +3712,9 @@ struct ixgbe_info {
37123712
#define IXGBE_KRM_LINK_S1(P) ((P) ? 0x8200 : 0x4200)
37133713
#define IXGBE_KRM_LINK_CTRL_1(P) ((P) ? 0x820C : 0x420C)
37143714
#define IXGBE_KRM_AN_CNTL_1(P) ((P) ? 0x822C : 0x422C)
3715+
#define IXGBE_KRM_AN_CNTL_4(P) ((P) ? 0x8238 : 0x4238)
37153716
#define IXGBE_KRM_AN_CNTL_8(P) ((P) ? 0x8248 : 0x4248)
3717+
#define IXGBE_KRM_PCS_KX_AN(P) ((P) ? 0x9918 : 0x5918)
37163718
#define IXGBE_KRM_SGMII_CTRL(P) ((P) ? 0x82A0 : 0x42A0)
37173719
#define IXGBE_KRM_LP_BASE_PAGE_HIGH(P) ((P) ? 0x836C : 0x436C)
37183720
#define IXGBE_KRM_DSP_TXFFE_STATE_4(P) ((P) ? 0x8634 : 0x4634)
@@ -3722,6 +3724,7 @@ struct ixgbe_info {
37223724
#define IXGBE_KRM_PMD_FLX_MASK_ST20(P) ((P) ? 0x9054 : 0x5054)
37233725
#define IXGBE_KRM_TX_COEFF_CTRL_1(P) ((P) ? 0x9520 : 0x5520)
37243726
#define IXGBE_KRM_RX_ANA_CTL(P) ((P) ? 0x9A00 : 0x5A00)
3727+
#define IXGBE_KRM_FLX_TMRS_CTRL_ST31(P) ((P) ? 0x9180 : 0x5180)
37253728

37263729
#define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA ~(0x3 << 20)
37273730
#define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_SR BIT(20)

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,9 +1721,59 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
17211721
return IXGBE_ERR_LINK_SETUP;
17221722
}
17231723

1724-
status = mac->ops.write_iosf_sb_reg(hw,
1725-
IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1726-
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1724+
(void)mac->ops.write_iosf_sb_reg(hw,
1725+
IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1726+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1727+
1728+
/* change mode enforcement rules to hybrid */
1729+
(void)mac->ops.read_iosf_sb_reg(hw,
1730+
IXGBE_KRM_FLX_TMRS_CTRL_ST31(hw->bus.lan_id),
1731+
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
1732+
reg_val |= 0x0400;
1733+
1734+
(void)mac->ops.write_iosf_sb_reg(hw,
1735+
IXGBE_KRM_FLX_TMRS_CTRL_ST31(hw->bus.lan_id),
1736+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1737+
1738+
/* manually control the config */
1739+
(void)mac->ops.read_iosf_sb_reg(hw,
1740+
IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1741+
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
1742+
reg_val |= 0x20002240;
1743+
1744+
(void)mac->ops.write_iosf_sb_reg(hw,
1745+
IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1746+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1747+
1748+
/* move the AN base page values */
1749+
(void)mac->ops.read_iosf_sb_reg(hw,
1750+
IXGBE_KRM_PCS_KX_AN(hw->bus.lan_id),
1751+
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
1752+
reg_val |= 0x1;
1753+
1754+
(void)mac->ops.write_iosf_sb_reg(hw,
1755+
IXGBE_KRM_PCS_KX_AN(hw->bus.lan_id),
1756+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1757+
1758+
/* set the AN37 over CB mode */
1759+
(void)mac->ops.read_iosf_sb_reg(hw,
1760+
IXGBE_KRM_AN_CNTL_4(hw->bus.lan_id),
1761+
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
1762+
reg_val |= 0x20000000;
1763+
1764+
(void)mac->ops.write_iosf_sb_reg(hw,
1765+
IXGBE_KRM_AN_CNTL_4(hw->bus.lan_id),
1766+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
1767+
1768+
/* restart AN manually */
1769+
(void)mac->ops.read_iosf_sb_reg(hw,
1770+
IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1771+
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
1772+
reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;
1773+
1774+
(void)mac->ops.write_iosf_sb_reg(hw,
1775+
IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1776+
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
17271777

17281778
/* Toggle port SW reset by AN reset. */
17291779
status = ixgbe_restart_an_internal_phy_x550em(hw);

0 commit comments

Comments
 (0)