diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2019-11-18 18:05:01 +0200 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-12-02 18:04:52 +0800 |
commit | e51cc023c37902e10d1e0109ff0c6ddcce3d5c03 (patch) | |
tree | fb00439f33608aa519ad51cba4eceb91566fbcbc /include/soc | |
parent | f3ebad1269aad8a04710e84dc1cd5de485e5fec4 (diff) |
net: mscc: ocelot: convert to PHYLINK
This patch reworks ocelot_board.c (aka the MIPS on the VSC7514) to
register a PHYLINK instance for each port. The registration code is
local to the VSC7514, but the PHYLINK callback implementation is common
so that the Felix DSA front-end can use it as well (but DSA does its own
registration).
Now Felix can use native PHYLINK callbacks instead of the PHYLIB
adaptation layer in DSA, which had issues supporting fixed-link slave
ports (no struct phy_device to pass to the adjust_link callback), as
well as fixed-link CPU port at 2.5Gbps.
The old code from ocelot_port_enable and ocelot_port_disable has been
moved into ocelot_phylink_mac_link_up and ocelot_phylink_mac_link_down.
The PHY connect operation has been moved from ocelot_port_open to
mscc_ocelot_probe in ocelot_board.c.
The phy_set_mode_ext() call for the SerDes PHY has also been moved into
mscc_ocelot_probe from ocelot_port_open, and since that was the only
reason why a reference to it was kept in ocelot_port_private, that
reference was removed.
Again, the usage of phy_interface_t phy_mode is now local to
mscc_ocelot_probe only, after moving the PHY connect operation.
So it was also removed from ocelot_port_private.
*Maybe* in the future, it can be added back to the common struct
ocelot_port, with the purpose of validating mismatches between
state->phy_interface and ocelot_port->phy_mode in PHYLINK callbacks.
But at the moment that is not critical, since other DSA drivers are not
doing that either. No SFP+ modules are in use with Felix/Ocelot yet, to
my knowledge.
In-band AN is not yet supported, due to the fact that this is a mostly
mechanical patch for the moment. The mac_an_restart PHYLINK operation
needs to be implemented, as well as mac_link_state. Both are SerDes
specific, and Felix does not have its PCS configured yet (it works just
by virtue of U-Boot initialization at the moment).
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/mscc/ocelot.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index c64cf12d1569..75d80df851e7 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -518,17 +518,12 @@ void ocelot_deinit(struct ocelot *ocelot); void ocelot_init_port(struct ocelot *ocelot, int port); /* DSA callbacks */ -void ocelot_port_enable(struct ocelot *ocelot, int port, - struct phy_device *phy); -void ocelot_port_disable(struct ocelot *ocelot, int port); void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data); void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data); int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset); int ocelot_get_ts_info(struct ocelot *ocelot, int port, struct ethtool_ts_info *info); void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs); -void ocelot_adjust_link(struct ocelot *ocelot, int port, - struct phy_device *phydev); void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, bool vlan_aware); void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state); @@ -597,4 +592,21 @@ int ocelot_rtag_parse_enable(struct ocelot *ocelot, u8 port); int ocelot_dscp_set(struct ocelot *ocelot, int port, bool enable, const u8 dscp_ix, struct tsn_qos_switch_dscp_conf *c); +void ocelot_phylink_validate(struct ocelot *ocelot, int port, + unsigned long *supported, + struct phylink_link_state *state); +void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, + struct phylink_link_state *state); +void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port); +void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, + unsigned int link_an_mode, + const struct phylink_link_state *state); +void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, + unsigned int link_an_mode, + phy_interface_t interface); +void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port, + unsigned int link_an_mode, + phy_interface_t interface, + struct phy_device *phy); + #endif |