amd-xgbe: align CL37 AN sequence as per databook
Subsystems (3)
Raju Rangoju
maintainerUpdate the Clause 37 Auto-Negotiation implementation to properly align with the PCS hardware specifications:
- Fix incorrect bit settings in Link Status and Link Duplex fields
- Implement missing sequence steps 2 and 7
These changes ensure CL37 auto-negotiation protocol follows the exact sequence patterns as specified in the hardware databook.
--- drivers/net/ethernet/amd/xgbe/xgbe-common.h | 2 ++ drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 9 +++++++++ drivers/net/ethernet/amd/xgbe/xgbe.h | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-common.h +2 -0
@@ -1269,6 +1269,8 @@#define MDIO_VEND2_CTRL1_SS13 BIT(13)#endif +#define XGBE_VEND2_MAC_AUTO_SW BIT(9) +/* MDIO mask values */ #define XGBE_AN_CL73_INT_CMPLT BIT(0)#define XGBE_AN_CL73_INC_LINK BIT(1)
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +9 -0
@@ -266,6 +266,10 @@ static void xgbe_an37_set(struct xgbe_prv_data *pdata, bool enable, reg |=MDIO_VEND2_CTRL1_AN_RESTART ;XMDIO_WRITE (pdata,MDIO_MMD_VEND2 ,MDIO_CTRL1 , reg); + + reg =XMDIO_READ (pdata,MDIO_MMD_VEND2 ,MDIO_PCS_DIG_CTRL ); + reg |=XGBE_VEND2_MAC_AUTO_SW ; +XMDIO_WRITE (pdata,MDIO_MMD_VEND2 ,MDIO_PCS_DIG_CTRL , reg); }static void xgbe_an37_restart (struct xgbe_prv_data *pdata)
@@ -894,6 +898,11 @@ static void xgbe_an37_init(struct xgbe_prv_data *pdata)netif_dbg (pdata, link, pdata->netdev,"CL37 AN (%s) initialized\n" , (pdata->an_mode ==XGBE_AN_MODE_CL37 ) ?"BaseX" :"SGMII" ); + + reg =XMDIO_READ (pdata,MDIO_MMD_AN ,MDIO_CTRL1 ); + reg &= ~MDIO_AN_CTRL1_ENABLE ; +XMDIO_WRITE (pdata,MDIO_MMD_AN ,MDIO_CTRL1 , reg); + }static void xgbe_an73_init (struct xgbe_prv_data *pdata)
drivers/net/ethernet/amd/xgbe/xgbe.h +2 -2
@@ -183,12 +183,12 @@#define XGBE_LINK_TIMEOUT 5#define XGBE_KR_TRAINING_WAIT_ITER 50 -#define XGBE_SGMII_AN_LINK_STATUS BIT(1) +#define XGBE_SGMII_AN_LINK_DUPLEX BIT(1)#define XGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3))#define XGBE_SGMII_AN_LINK_SPEED_10 0x00#define XGBE_SGMII_AN_LINK_SPEED_100 0x04#define XGBE_SGMII_AN_LINK_SPEED_1000 0x08 -#define XGBE_SGMII_AN_LINK_DUPLEX BIT(4) +#define XGBE_SGMII_AN_LINK_STATUS BIT(4)/* ECC correctable error notification window (seconds) */ #define XGBE_ECC_LIMIT 60
Signature · 1 line
2.34.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 1 Jul 2025 00:56:36 +0530 you wrote:
Update the Clause 37 Auto-Negotiation implementation to properly align with the PCS hardware specifications:
- Fix incorrect bit settings in Link Status and Link Duplex fields
- Implement missing sequence steps 2 and 7These changes ensure CL37 auto-negotiation protocol follows the exact sequence patterns as specified in the hardware databook.
[...]
Here is the summary with links:
- [net] amd-xgbe: align CL37 AN sequence as per databook
https://git.kernel.org/netdev/net/c/42fd432fe6d3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html