Skip to content

Commit 6865ece

Browse files
colin-foster-in-advantagedavem330
authored andcommitted
net: dsa: felix: allow serdes configuration for dsa ports
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 544435c commit 6865ece

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,10 @@ static int felix_setup(struct dsa_switch *ds)
15851585
dsa_switch_for_each_available_port(dp, ds) {
15861586
ocelot_init_port(ocelot, dp->index);
15871587

1588+
if (felix->info->configure_serdes)
1589+
felix->info->configure_serdes(ocelot, dp->index,
1590+
dp->dn);
1591+
15881592
/* Set the default QoS Classification based on PCP and DEI
15891593
* bits of vlan tag.
15901594
*/

drivers/net/dsa/ocelot/felix.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#define OCELOT_PORT_MODE_USXGMII BIT(4)
1616
#define OCELOT_PORT_MODE_1000BASEX BIT(5)
1717

18+
struct device_node;
19+
1820
/* Platform-specific information */
1921
struct felix_info {
2022
/* Hardcoded resources provided by the hardware instantiation. */
@@ -61,6 +63,8 @@ struct felix_info {
6163
void (*phylink_mac_config)(struct ocelot *ocelot, int port,
6264
unsigned int mode,
6365
const struct phylink_link_state *state);
66+
int (*configure_serdes)(struct ocelot *ocelot, int port,
67+
struct device_node *portnp);
6468
};
6569

6670
/* Methods for initializing the hardware resources specific to a tagging

0 commit comments

Comments
 (0)