aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2014-07-29 09:57:43 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-30 21:46:53 -0400
commit5c10e5cb0fbdde6cc79ca406b8bdcb05aa0c9489 (patch)
tree7713fd9ad8d50a62b1865287b1d5179ef56b5034 /drivers/net/phy
parent169a6303b89a99c807328f6f9772a81605b17116 (diff)
amd-xgbe-phy: Updates to KR training initiation
As part of changing rates to KR mode, KR training is initiated. If the KR training is restarted it is possible to enter an invalid logic state. This can be avoided by asserting a training reset bit before initiating the KR training and then clearing the training reset bit. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/amd-xgbe-phy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/phy/amd-xgbe-phy.c b/drivers/net/phy/amd-xgbe-phy.c
index a2d778aefadf..39428e5a1700 100644
--- a/drivers/net/phy/amd-xgbe-phy.c
+++ b/drivers/net/phy/amd-xgbe-phy.c
@@ -119,10 +119,13 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver");
119#endif 119#endif
120 120
121/* SerDes integration register offsets */ 121/* SerDes integration register offsets */
122#define SIR0_KR_RT_1 0x002c
122#define SIR0_STATUS 0x0040 123#define SIR0_STATUS 0x0040
123#define SIR1_SPEED 0x0000 124#define SIR1_SPEED 0x0000
124 125
125/* SerDes integration register entry bit positions and sizes */ 126/* SerDes integration register entry bit positions and sizes */
127#define SIR0_KR_RT_1_RESET_INDEX 11
128#define SIR0_KR_RT_1_RESET_WIDTH 1
126#define SIR0_STATUS_RX_READY_INDEX 0 129#define SIR0_STATUS_RX_READY_INDEX 0
127#define SIR0_STATUS_RX_READY_WIDTH 1 130#define SIR0_STATUS_RX_READY_WIDTH 1
128#define SIR0_STATUS_TX_READY_INDEX 8 131#define SIR0_STATUS_TX_READY_INDEX 8
@@ -636,9 +639,13 @@ static enum amd_xgbe_phy_an amd_xgbe_an_tx_training(struct phy_device *phydev,
636 if (ret < 0) 639 if (ret < 0)
637 return AMD_XGBE_AN_ERROR; 640 return AMD_XGBE_AN_ERROR;
638 641
642 XSIR0_IOWRITE_BITS(priv, SIR0_KR_RT_1, RESET, 1);
643
639 ret |= 0x01; 644 ret |= 0x01;
640 phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_PMD_CTRL, ret); 645 phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_PMD_CTRL, ret);
641 646
647 XSIR0_IOWRITE_BITS(priv, SIR0_KR_RT_1, RESET, 0);
648
642 return AMD_XGBE_AN_EVENT; 649 return AMD_XGBE_AN_EVENT;
643} 650}
644 651