]> git.itanic.dy.fi Git - linux-stable/commit
net: fman: memac: Use lynx pcs driver
authorSean Anderson <sean.anderson@seco.com>
Mon, 17 Oct 2022 20:22:37 +0000 (16:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Oct 2022 12:25:09 +0000 (13:25 +0100)
commita7c2a32e7f22cf5648c52e05a21725a9d0675649
tree9d61b491834d89241d8cffc6b83f06d538f22759
parent0fc83bd79589b3e354535a4761a4b2a483f2f14c
net: fman: memac: Use lynx pcs driver

Although not stated in the datasheet, as far as I can tell PCS for mEMACs
is a "Lynx." By reusing the existing driver, we can remove the PCS
management code from the memac driver. This requires calling some PCS
functions manually which phylink would usually do for us, but we will let
it do that soon.

One problem is that we don't actually have a PCS for QSGMII. We pretend
that each mEMAC's MDIO bus has four QSGMII PCSs, but this is not the case.
Only the "base" mEMAC's MDIO bus has the four QSGMII PCSs. This is not an
issue yet, because we never get the PCS state. However, it will be once the
conversion to phylink is complete, since the links will appear to never
come up. To get around this, we allow specifying multiple PCSs in pcsphy.
This breaks backwards compatibility with old device trees, but only for
QSGMII. IMO this is the only reasonable way to figure out what the actual
QSGMII PCS is.

Additionally, we now also support a separate XFI PCS. This can allow the
SerDes driver to set different addresses for the SGMII and XFI PCSs so they
can be accessed at the same time.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/Kconfig
drivers/net/ethernet/freescale/fman/fman_memac.c