linux-imx/include/linux/pcs-lynx.h
Vladimir Oltean 91e32072db net: pcs: lynx: incorporate SerDes PHY handling from dpaa2-mac
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>
2023-10-30 17:16:56 +08:00

27 lines
727 B
C

/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
/* Copyright 2020 NXP
* Lynx PCS helpers
*/
#ifndef __LINUX_PCS_LYNX_H
#define __LINUX_PCS_LYNX_H
#include <linux/mdio.h>
#include <linux/phy.h>
#include <linux/phylink.h>
struct phy;
struct phylink_pcs *lynx_pcs_create_mdiodev(struct mii_bus *bus, int addr,
struct phy **phys, size_t num_phys);
struct phylink_pcs *lynx_pcs_create_fwnode(struct fwnode_handle *node,
struct phy **phys, size_t num_phys);
void lynx_pcs_destroy(struct phylink_pcs *pcs);
void lynx_pcs_set_supported_interfaces(struct phylink_pcs *pcs,
phy_interface_t default_interface,
unsigned long *supported_interfaces);
#endif /* __LINUX_PCS_LYNX_H */