linux-stable/drivers/net/pcs
Jiawen Wu 2a22b7ae2f net: pcs: xpcs: adapt Wangxun NICs for SGMII mode
Wangxun NICs support the connection with SFP to RJ45 module. In this case,
PCS need to be configured in SGMII mode.

According to chapter 6.11.1 "SGMII Auto-Negitiation" of DesignWare Cores
Ethernet PCS (version 3.20a) and custom design manual, do the following
configuration when the interface mode is SGMII.

1. program VR_MII_AN_CTRL bit(3) [TX_CONFIG] = 1b (PHY side SGMII)
2. program VR_MII_AN_CTRL bit(8) [MII_CTRL] = 1b (8-bit MII)
3. program VR_MII_DIG_CTRL1 bit(0) [PHY_MODE_CTRL] = 1b

Also CL37 AN in backplane configurations need to be enabled because of the
special hardware design. Another thing to note is that PMA needs to be
reconfigured before each CL37 AN configuration for SGMII, otherwise AN will
fail, although we don't know why.

On this device, CL37_ANSGM_STS (bit[4:1] of VR_MII_AN_INTR_STS) indicates
the status received from remote link during the auto-negotiation, and
self-clear after the auto-negotiation is complete.
Meanwhile, CL37_ANCMPLT_INTR will be set to 1, to indicate CL37 AN is
complete. So add another way to get the state for CL37 SGMII.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-25 07:42:59 +01:00
..
Kconfig net: pcs: Drop the TSE PCS driver 2023-06-05 09:56:36 +01:00
Makefile net: pcs: xpcs: support to switch mode for Wangxun NICs 2023-08-25 07:42:58 +01:00
pcs-lynx.c net: pcs: lynx: fix lynx_pcs_link_up_sgmii() not doing anything in fixed-link mode 2023-08-13 12:32:44 +01:00
pcs-mtk-lynxi.c net: pcs: lynxi: implement pcs_disable op 2023-08-21 19:08:57 -07:00
pcs-rzn1-miic.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-18 12:44:56 -07:00
pcs-xpcs-nxp.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
pcs-xpcs-wx.c net: pcs: xpcs: adapt Wangxun NICs for SGMII mode 2023-08-25 07:42:59 +01:00
pcs-xpcs.c net: pcs: xpcs: adapt Wangxun NICs for SGMII mode 2023-08-25 07:42:59 +01:00
pcs-xpcs.h net: pcs: xpcs: adapt Wangxun NICs for SGMII mode 2023-08-25 07:42:59 +01:00