Message ID | 20220823104343.6141-1-marex@denx.de (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: microchip: Support GMII on user ports | expand |
On Tue, Aug 23, 2022 at 12:43:43PM +0200, Marek Vasut wrote: > The user ports on KSZ879x indicate they are of GMII interface type instead > of INTERNAL interface type. Add GMII into the list of supported user port > interfaces to avoid the following failure on probe: > > " > ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL > ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL > ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0 > " > > Signed-off-by: Marek Vasut <marex@denx.de> > --- > Cc: Arun Ramadoss <arun.ramadoss@microchip.com> > Cc: David S. Miller <davem@davemloft.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Vladimir Oltean <olteanv@gmail.com> https://lore.kernel.org/netdev/20220818143250.2797111-1-vladimir.oltean@nxp.com/
On 8/23/22 20:13, Vladimir Oltean wrote: > On Tue, Aug 23, 2022 at 12:43:43PM +0200, Marek Vasut wrote: >> The user ports on KSZ879x indicate they are of GMII interface type instead >> of INTERNAL interface type. Add GMII into the list of supported user port >> interfaces to avoid the following failure on probe: >> >> " >> ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL >> ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL >> ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0 >> " >> >> Signed-off-by: Marek Vasut <marex@denx.de> >> --- >> Cc: Arun Ramadoss <arun.ramadoss@microchip.com> >> Cc: David S. Miller <davem@davemloft.net> >> Cc: Florian Fainelli <f.fainelli@gmail.com> >> Cc: Vladimir Oltean <olteanv@gmail.com> > > https://lore.kernel.org/netdev/20220818143250.2797111-1-vladimir.oltean@nxp.com/ Nice, thanks !
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index ed7d137cba994..4a77c8b0e664e 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -803,9 +803,12 @@ static void ksz_phylink_get_caps(struct dsa_switch *ds, int port, if (dev->info->supports_rgmii[port]) phy_interface_set_rgmii(config->supported_interfaces); - if (dev->info->internal_phy[port]) + if (dev->info->internal_phy[port]) { + __set_bit(PHY_INTERFACE_MODE_GMII, + config->supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces); + } if (dev->dev_ops->get_caps) dev->dev_ops->get_caps(dev, port, config);
The user ports on KSZ879x indicate they are of GMII interface type instead of INTERNAL interface type. Add GMII into the list of supported user port interfaces to avoid the following failure on probe: " ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0 " Signed-off-by: Marek Vasut <marex@denx.de> --- Cc: Arun Ramadoss <arun.ramadoss@microchip.com> Cc: David S. Miller <davem@davemloft.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Vladimir Oltean <olteanv@gmail.com> --- drivers/net/dsa/microchip/ksz_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)