2a22b7ae | 23-Aug-2023 |
Jiawen Wu <jiawenwu@trustnetic.com> |
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 "SG
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>
show more ...
|
2deea43f | 23-Aug-2023 |
Jiawen Wu <jiawenwu@trustnetic.com> |
net: pcs: xpcs: add 1000BASE-X AN interrupt support
Enable CL37 AN complete interrupt for DW XPCS. It requires to clear the bit(0) [CL37_ANCMPLT_INTR] of VR_MII_AN_INTR_STS after AN completed.
And
net: pcs: xpcs: add 1000BASE-X AN interrupt support
Enable CL37 AN complete interrupt for DW XPCS. It requires to clear the bit(0) [CL37_ANCMPLT_INTR] of VR_MII_AN_INTR_STS after AN completed.
And there is a quirk for Wangxun devices to enable CL37 AN in backplane configurations because of the special hardware design.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
f629acc6 | 23-Aug-2023 |
Jiawen Wu <jiawenwu@trustnetic.com> |
net: pcs: xpcs: support to switch mode for Wangxun NICs
According to chapter 6 of DesignWare Cores Ethernet PCS (version 3.20a) and custom design manual, add a configuration flow for switching inter
net: pcs: xpcs: support to switch mode for Wangxun NICs
According to chapter 6 of DesignWare Cores Ethernet PCS (version 3.20a) and custom design manual, add a configuration flow for switching interface mode.
If the interface changes, the following setting is required: 1. wait VR_XS_PCS_DIG_STS bit(4, 2) [PSEQ_STATE] = 100b (Power-Good) 2. write SR_XS_PCS_CTRL2 to select various PCS type 3. write SR_PMA_CTRL1 and/or SR_XS_PCS_CTRL1 for link speed 4. program PMA registers 5. write VR_XS_PCS_DIG_CTRL1 bit(15) [VR_RST] = 1b (Vendor-Specific Soft Reset) 6. wait for VR_XS_PCS_DIG_CTRL1 bit(15) [VR_RST] to get cleared
Only 10GBASE-R/SGMII/1000BASE-X modes are planned for the current Wangxun devices. And there is a quirk for Wangxun devices to switch mode although the interface in phylink state has not changed, since PCS will change to default 10GBASE-R when the ethernet driver(txgbe) do LAN reset.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
c689a652 | 16-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: update PCS driver to use neg_mode
Update the Lynx PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and d
net: pcs: lynx: update PCS driver to use neg_mode
Update the Lynx PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and duplex when negotiation is disabled.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1qA8E4-00EaFf-Bf@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
3b2de56a | 16-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynxi: update PCS driver to use neg_mode
Update the Lynxi PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and
net: pcs: lynxi: update PCS driver to use neg_mode
Update the Lynxi PCS driver to use neg_mode rather than the mode argument. This ensures that the link_up() method will always program the speed and duplex when negotiation is disabled.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1qA8Dz-00EaFY-5A@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
a3a47cfb | 16-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: xpcs: update PCS driver to use neg_mode
Update xpcs to use neg_mode to configure whether inband negotiation should be used. We need to update sja1105 as well as that directly calls into th
net: pcs: xpcs: update PCS driver to use neg_mode
Update xpcs to use neg_mode to configure whether inband negotiation should be used. We need to update sja1105 as well as that directly calls into the XPCS driver's config function.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1qA8Dt-00EaFS-W9@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
d143898c | 07-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: check that the fwnode is available prior to use
Check that the fwnode is marked as available prior to trying to lookup the PCS device, and return -ENODEV if unavailable. Document the
net: pcs: lynx: check that the fwnode is available prior to use
Check that the fwnode is marked as available prior to trying to lookup the PCS device, and return -ENODEV if unavailable. Document the return codes from lynx_pcs_create_fwnode().
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
05b606b8 | 07-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: change lynx_pcs_create() to return error-pointers
Change lynx_pcs_create() to return an error-pointer on failure to allocate memory, rather than returning NULL. This allows the remov
net: pcs: lynx: change lynx_pcs_create() to return error-pointers
Change lynx_pcs_create() to return an error-pointer on failure to allocate memory, rather than returning NULL. This allows the removal of the conversion in lynx_pcs_create_fwnode() and lynx_pcs_create_mdiodev().
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
84e476b8 | 07-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: make lynx_pcs_create() static
We no longer need to export lynx_pcs_create() for drivers to use as we now have all the functionality we need in the two new creation helpers. Remove th
net: pcs: lynx: make lynx_pcs_create() static
We no longer need to export lynx_pcs_create() for drivers to use as we now have all the functionality we need in the two new creation helpers. Remove the export and prototype, and make it static.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
6e1a1282 | 07-Jun-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: add lynx_pcs_create_fwnode()
Add a helper to create a lynx PCS from a fwnode handle.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski
net: pcs: lynx: add lynx_pcs_create_fwnode()
Add a helper to create a lynx PCS from a fwnode handle.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
86b5f2d8 | 26-May-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: lynx: add lynx_pcs_create_mdiodev()
Add lynx_pcs_create_mdiodev() to simplify the creation of the mdio device associated with lynx PCS. In order to allow lynx_pcs_destroy() to clean this u
net: pcs: lynx: add lynx_pcs_create_mdiodev()
Add lynx_pcs_create_mdiodev() to simplify the creation of the mdio device associated with lynx PCS. In order to allow lynx_pcs_destroy() to clean this up, we need to arrange for lynx_pcs_create() to take a refcount on the mdiodev, and lynx_pcs_destroy() to put it.
Adding the refcounting to lynx_pcs_create()..lynx_pcs_destroy() will be transparent to existing users of these interfaces.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com> Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
883a98ed | 23-May-2023 |
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> |
net: pcs: xpcs: avoid reading STAT1 more than once
Avoid reading the STAT1 registers more than once while getting the PCS state, as this register contains latching-low bits that are lost after the f
net: pcs: xpcs: avoid reading STAT1 more than once
Avoid reading the STAT1 registers more than once while getting the PCS state, as this register contains latching-low bits that are lost after the first read.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|