net: dsa: felix: allow serdes configuration for dsa ports
authorColin Foster <colin.foster@in-advantage.com>
Fri, 17 Mar 2023 18:54:14 +0000 (11:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Mar 2023 09:08:48 +0000 (09:08 +0000)
Ports for Ocelot devices (VSC7511, VSC7512, VSC7513 and VSC7514) support
external phys. When external phys are used, additional configuration on
each port is required to enable QSGMII mode and set external phy modes.

Add a configurable hook into these routines, so the external ports can be
used.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/ocelot/felix.h

index 845068b..6dcebcf 100644 (file)
@@ -1585,6 +1585,10 @@ static int felix_setup(struct dsa_switch *ds)
        dsa_switch_for_each_available_port(dp, ds) {
                ocelot_init_port(ocelot, dp->index);
 
+               if (felix->info->configure_serdes)
+                       felix->info->configure_serdes(ocelot, dp->index,
+                                                     dp->dn);
+
                /* Set the default QoS Classification based on PCP and DEI
                 * bits of vlan tag.
                 */
index 9877127..96008c0 100644 (file)
@@ -15,6 +15,8 @@
 #define OCELOT_PORT_MODE_USXGMII       BIT(4)
 #define OCELOT_PORT_MODE_1000BASEX     BIT(5)
 
+struct device_node;
+
 /* Platform-specific information */
 struct felix_info {
        /* Hardcoded resources provided by the hardware instantiation. */
@@ -61,6 +63,8 @@ struct felix_info {
        void    (*phylink_mac_config)(struct ocelot *ocelot, int port,
                                      unsigned int mode,
                                      const struct phylink_link_state *state);
+       int     (*configure_serdes)(struct ocelot *ocelot, int port,
+                                   struct device_node *portnp);
 };
 
 /* Methods for initializing the hardware resources specific to a tagging