net: dsa: sja1105: register the PCS MDIO bus for SJA1110
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 11 Jun 2021 20:05:29 +0000 (23:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:43:56 +0000 (13:43 -0700)
commit27871359bdf82677c0a854d17eb93c34402321c9
treebe36d4297ae2ddbae9b9dd77b961c794de4f4891
parent3ad1d171548e85fd582c8de8c0946875579aebe8
net: dsa: sja1105: register the PCS MDIO bus for SJA1110

On the SJA1110, the PCS of each SERDES-capable port is accessed through
a different memory window which is 0x100 bytes in size, denoted by
"pcs_base".

In each PCS register access window, the XPCS MMDs are accessed in an
indirect way: in pages/banks of up to 0x100 addresses each. Changing the
page/bank is done by writing to a special register at the end of the
access window.

The MDIO register map accessed indirectly through the indirect banked
method described above is similar to what SJA1105 has: upper 5 bits are
the MMD, lower 16 bits are the MDIO address within that MMD.

Since the PHY ID reported by the XPCS inside SJA1110 is also all zeroes
(like SJA1105), we need to trap those reads and return a fake PHY ID so
that the xpcs driver can apply some specific fixups for our integration.

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