Message ID | 20240701085343.3042567-2-o.rempel@pengutronix.de (mailing list archive) |
---|---|
State | Accepted |
Commit | c3db39468a42fec7e83add335765f8d81e1864c3 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2,1/3] net: dsa: microchip: lan9371/2: add 100BaseTX PHY support | expand |
On Mon, Jul 01, 2024 at 10:53:42AM +0200, Oleksij Rempel wrote: > From: Lucas Stach <l.stach@pengutronix.de> > > This driver do not support in-band mode and in case of CPU<->Switch > link, this mode is not working any way. So, disable it otherwise ingress > path of the switch MAC will stay disabled. > > Note: lan9372 manual do not document 0xN301 BIT(2) for the RGMII mode > and recommend[1] to disable in-band link status update for the RGMII RX > path by clearing 0xN302 BIT(0). But, 0xN301 BIT(2) seems to work too, so > keep it unified with other KSZ switches. > > [1] https://microchip.my.site.com/s/article/LAN937X-The-required-configuration-for-the-external-MAC-port-to-operate-at-RGMII-to-RGMII-1Gbps-link-speed > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> > --- > changes v2: > - use ksz_set_xmii() instead of LAN937X specific code > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Hi Oleksij, On Mon, 2024-07-01 at 10:53 +0200, Oleksij Rempel wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > From: Lucas Stach <l.stach@pengutronix.de> > > This driver do not support in-band mode and in case of CPU<->Switch > link, this mode is not working any way. So, disable it otherwise > ingress > path of the switch MAC will stay disabled. > > Note: lan9372 manual do not document 0xN301 BIT(2) for the RGMII mode > and recommend[1] to disable in-band link status update for the RGMII > RX > path by clearing 0xN302 BIT(0). > But, 0xN301 BIT(2) seems to work too, so > keep it unified with other KSZ switches. > > [1] > https://microchip.my.site.com/s/article/LAN937X-The-required-configuration-for-the-external-MAC-port-to-operate-at-RGMII-to-RGMII-1Gbps-link-speed > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> But If you want IBS to be enabled, then we need to set both the bit 0xN301 BIT(2) and 0xN302 BIT(0). Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index baa1eeb9a1b04..b074b4bb06296 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -3116,7 +3116,8 @@ static void ksz_set_xmii(struct ksz_device *dev, int port, /* On KSZ9893, disable RGMII in-band status support */ if (dev->chip_id == KSZ9893_CHIP_ID || dev->chip_id == KSZ8563_CHIP_ID || - dev->chip_id == KSZ9563_CHIP_ID) + dev->chip_id == KSZ9563_CHIP_ID || + is_lan937x(dev)) data8 &= ~P_MII_MAC_MODE; break; default: