It is said that with PHY_MODE_ETHERNET, the MAC driver is in control of
the SerDes lane, while with PHY_MODE_ETHERNET_LINKMODE, the internal PHY
is (for backplane link modes).
With the design decision to model the internal backplane PHY as
phylink_pcs, integrated with the lynx pcs, now we have just the
PHY_MODE_ETHERNET handling left in MAC drivers. So there needs to be
some coordination between when does the MAC drive the SerDes phys,
and when does the PCS drive them.
If we take a step back, it becomes apparent that it is also possible to
move the SerDes phy processing for PHY_MODE_ETHERNET from the MAC driver
into the PCS driver, and then teach the PCS driver (in the future) to
handle PHY_MODE_ETHERNET_LINKMODE for backplanes, and all of that can be
transparent to the MAC.
Extend lynx_pcs_create_mdiodev() and lynx_pcs_create_fwnode() with two
extra arguments: "struct phy **phys, size_t num_phys" which represent
the SerDes lanes (on LX2 we also support multi-lane link modes, like
40G, 50G, 100G, and each lane has a SerDes PHY).
Populating phylink_config :: supported_interfaces can also be left down
to the PCS, thus we also introduce lynx_pcs_set_supported_interfaces().
The SerDes phys are optional inside the lynx pcs driver.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
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>
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>
lynx_get_mdio_device() is no longer necessary, let's remove it so the
lynx PCS code is always managing the lifetime of the mdiodev.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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>
Remove references to lynx_pcs structures so drivers like the Felix DSA
can reference alternate PCS drivers.
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Add a Lynx PCS module which exposes the necessary operations to drive
the PCS using phylink.
The majority of the code is extracted from the Felix DSA driver, which
will be also modified in a later patch, and exposed as a separate module
for code reusability purposes.
As such, this aims at feature and bug parity with the existing Felix DSA
driver, and thus USXGMII, SGMII, QSGMII and 2500Base-X (only w/o in-band
AN) are supported by the Lynx PCS module since these were also supported
by Felix.
The module can only be enabled by the drivers in need and not user
selectable.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>