OSDN Git Service

net: dsa: sja1105: migrate to xpcs for SGMII
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 11 Jun 2021 20:05:28 +0000 (23:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:43:56 +0000 (13:43 -0700)
commit3ad1d171548e85fd582c8de8c0946875579aebe8
treeeb23c2a7852602776a47fa3c69913d40cd499c93
parenta853c68e29bb974ca0cc0a8eaf88c333217556aa
net: dsa: sja1105: migrate to xpcs for SGMII

There is a desire to use the generic driver for the Synopsys XPCS
located in drivers/net/pcs, and to achieve that, the sja1105 driver must
expose an MDIO bus for the SGMII PCS, because the XPCS probes as an
mdio_device.

In preparation of the SJA1110 which in fact has a different access
procedure for the SJA1105, we register this PCS MDIO bus once in the
common code, but we implement function pointers for the read and write
methods. In this patch there is a single implementation for them.

There is exactly one MDIO bus for the PCS, this will contain all PCSes
at MDIO addresses equal to the port number.

We delete a bunch of hardware support code because the xpcs driver
already does what we need.

We need to hack up the MDIO reads for the PHY ID, since our XPCS
instantiation returns zeroes and there are some specific fixups which
need to be applied by the xpcs driver.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/Kconfig
drivers/net/dsa/sja1105/sja1105.h
drivers/net/dsa/sja1105/sja1105_main.c
drivers/net/dsa/sja1105/sja1105_mdio.c
drivers/net/dsa/sja1105/sja1105_sgmii.h [deleted file]
drivers/net/dsa/sja1105/sja1105_spi.c