mbox series

[net-next,00/13] Port the SJA1105 DSA driver to XPCS

Message ID 20210609184155.921662-1-olteanv@gmail.com
Headers show
Series Port the SJA1105 DSA driver to XPCS | expand

Message

Vladimir Oltean June 9, 2021, 6:41 p.m. UTC
From: Vladimir Oltean <vladimir.oltean@nxp.com>

As requested when adding support for the NXP SJA1110, the SJA1105 driver
could make use of the common XPCS driver, to eliminate some hardware
specific code duplication.

This series modifies the XPCS driver so that it can accommodate the XPCS
instantiation from NXP switches, and the SJA1105 driver so it can expose
what the XPCS driver expects.

Tested on NXP SJA1105S and SJA1110A.

Vladimir Oltean (13):
  net: pcs: xpcs: rename mdio_xpcs_args to dw_xpcs
  net: stmmac: reverse Christmas tree notation in stmmac_xpcs_setup
  net: stmmac: reduce indentation when calling stmmac_xpcs_setup
  net: pcs: xpcs: move register bit descriptions to a header file
  net: pcs: xpcs: add support for sgmii with no inband AN
  net: pcs: xpcs: also ignore phy id if it's all ones
  net: pcs: xpcs: add support for NXP SJA1105
  net: pcs: xpcs: add support for NXP SJA1110
  net: pcs: xpcs: export xpcs_do_config and xpcs_link_up
  net: dsa: sja1105: migrate to xpcs for SGMII
  net: dsa: sja1105: register the PCS MDIO bus for SJA1110
  net: dsa: sja1105: SGMII and 2500base-x on the SJA1110 are 'special'
  net: dsa: sja1105: plug in support for 2500base-x

 MAINTAINERS                                   |   2 +
 drivers/net/dsa/sja1105/Kconfig               |   1 +
 drivers/net/dsa/sja1105/sja1105.h             |   9 +
 drivers/net/dsa/sja1105/sja1105_main.c        | 186 +++----------
 drivers/net/dsa/sja1105/sja1105_mdio.c        | 254 +++++++++++++++++
 drivers/net/dsa/sja1105/sja1105_sgmii.h       |   2 -
 drivers/net/dsa/sja1105/sja1105_spi.c         |  17 ++
 drivers/net/ethernet/stmicro/stmmac/common.h  |   2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  10 +-
 .../net/ethernet/stmicro/stmmac/stmmac_mdio.c |   6 +-
 drivers/net/pcs/Makefile                      |   2 +-
 drivers/net/pcs/pcs-xpcs-nxp.c                | 185 ++++++++++++
 drivers/net/pcs/pcs-xpcs.c                    | 263 +++++++++---------
 drivers/net/pcs/pcs-xpcs.h                    | 115 ++++++++
 include/linux/pcs/pcs-xpcs.h                  |  21 +-
 15 files changed, 770 insertions(+), 305 deletions(-)
 create mode 100644 drivers/net/pcs/pcs-xpcs-nxp.c
 create mode 100644 drivers/net/pcs/pcs-xpcs.h

Comments

Wong Vee Khee June 9, 2021, 11:28 p.m. UTC | #1
On Wed, Jun 09, 2021 at 09:41:44PM +0300, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> Reorder the variable declarations in descending line length order,
> according to the networking coding style.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index 3b3033b20b1d..a5d150c5f3d8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> @@ -399,11 +399,11 @@ int stmmac_mdio_reset(struct mii_bus *bus)
>  
>  int stmmac_xpcs_setup(struct mii_bus *bus)
>  {
> -	int mode, addr;
>  	struct net_device *ndev = bus->priv;
> -	struct dw_xpcs *xpcs;
> -	struct stmmac_priv *priv;
>  	struct mdio_device *mdiodev;
> +	struct stmmac_priv *priv;
> +	struct dw_xpcs *xpcs;
> +	int mode, addr;
>  
>  	priv = netdev_priv(ndev);
>  	mode = priv->plat->phy_interface;
> -- 
> 2.25.1
>
Vladimir Oltean June 10, 2021, 5:45 p.m. UTC | #2
On Wed, Jun 09, 2021 at 09:41:42PM +0300, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>

> 

> As requested when adding support for the NXP SJA1110, the SJA1105 driver

> could make use of the common XPCS driver, to eliminate some hardware

> specific code duplication.

> 

> This series modifies the XPCS driver so that it can accommodate the XPCS

> instantiation from NXP switches, and the SJA1105 driver so it can expose

> what the XPCS driver expects.

> 

> Tested on NXP SJA1105S and SJA1110A.


I expected there to be more objections to the choices I made, but I
guess silence is a feedback of sorts too.

I need to resend because of some small fixups that I need to make, so
please mark this as obsolete. Thanks.