diff mbox series

[net-next,v2,2/3] net: dsa: microchip: lan937x: disable in-band status support for RGMII interfaces

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

Checks

Context Check Description
netdev/series_format warning Series does not have a cover letter
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 839 this patch: 839
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 846 this patch: 846
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 846 this patch: 846
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-01--21-00 (tests: 665)

Commit Message

Oleksij Rempel July 1, 2024, 8:53 a.m. UTC
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
---
 drivers/net/dsa/microchip/ksz_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Vladimir Oltean July 1, 2024, 4:20 p.m. UTC | #1
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>
Arun Ramadoss July 3, 2024, 3:09 a.m. UTC | #2
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 mbox series

Patch

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: