• Jiawen Wu's avatar
    net: pcs: xpcs: adapt Wangxun NICs for SGMII mode · 2a22b7ae
    Jiawen Wu authored
    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: default avatarJiawen Wu <jiawenwu@trustnetic.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2a22b7ae
pcs-xpcs.h 4.28 KB