netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4
@ 2024-07-05  8:47 Oleksij Rempel
  2024-07-05 14:33 ` Arun.Ramadoss
  2024-07-08 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Oleksij Rempel @ 2024-07-05  8:47 UTC (permalink / raw)
  To: David S. Miller, Andrew Lunn, Eric Dumazet, Florian Fainelli,
	Jakub Kicinski, Paolo Abeni, Vladimir Oltean, Woojung Huh,
	Arun Ramadoss
  Cc: Oleksij Rempel, Florian Fainelli, kernel, linux-kernel, netdev,
	UNGLinuxDriver

Set proper MAC capabilities for port 4 on LAN9371 and LAN9372 switches with
integrated 100BaseTX PHY. And introduce the is_lan937x_tx_phy() function to
reuse it where applicable.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
changes v2:
- add is_lan937x_tx_phy() function
- reuse is_lan937x_tx_phy() in lan937x_vphy_ind_addr_wr()
- add Reviewed-by: Florian Fainelli
---
 drivers/net/dsa/microchip/ksz_common.h   | 6 ++++++
 drivers/net/dsa/microchip/lan937x_main.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index c4a4664c03859..5f0a628b9849e 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -638,6 +638,12 @@ static inline int is_lan937x(struct ksz_device *dev)
 		dev->chip_id == LAN9374_CHIP_ID;
 }
 
+static inline bool is_lan937x_tx_phy(struct ksz_device *dev, int port)
+{
+	return (dev->chip_id == LAN9371_CHIP_ID ||
+		dev->chip_id == LAN9372_CHIP_ID) && port == KSZ_PORT_4;
+}
+
 /* STP State Defines */
 #define PORT_TX_ENABLE			BIT(2)
 #define PORT_RX_ENABLE			BIT(1)
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index 83ac33fede3f5..824d9309a3d35 100644
--- a/drivers/net/dsa/microchip/lan937x_main.c
+++ b/drivers/net/dsa/microchip/lan937x_main.c
@@ -55,8 +55,7 @@ static int lan937x_vphy_ind_addr_wr(struct ksz_device *dev, int addr, int reg)
 	u16 addr_base = REG_PORT_T1_PHY_CTRL_BASE;
 	u16 temp;
 
-	if ((dev->info->chip_id == LAN9371_CHIP_ID ||
-	     dev->info->chip_id == LAN9372_CHIP_ID) && addr == KSZ_PORT_4)
+	if (is_lan937x_tx_phy(dev, addr))
 		addr_base = REG_PORT_TX_PHY_CTRL_BASE;
 
 	/* get register address based on the logical port */
@@ -324,6 +323,9 @@ void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
 		/* MII/RMII/RGMII ports */
 		config->mac_capabilities |= MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
 					    MAC_100HD | MAC_10 | MAC_1000FD;
+	} else if (is_lan937x_tx_phy(dev, port)) {
+		config->mac_capabilities |= MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
+					    MAC_100HD | MAC_10;
 	}
 }
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4
  2024-07-05  8:47 [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4 Oleksij Rempel
@ 2024-07-05 14:33 ` Arun.Ramadoss
  2024-07-08 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Arun.Ramadoss @ 2024-07-05 14:33 UTC (permalink / raw)
  To: andrew, olteanv, davem, Woojung.Huh, pabeni, o.rempel, edumazet,
	f.fainelli, kuba
  Cc: kernel, linux-kernel, florian.fainelli, UNGLinuxDriver, netdev

On Fri, 2024-07-05 at 10:47 +0200, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> Set proper MAC capabilities for port 4 on LAN9371 and LAN9372
> switches with
> integrated 100BaseTX PHY. And introduce the is_lan937x_tx_phy()
> function to
> reuse it where applicable.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>

Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4
  2024-07-05  8:47 [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4 Oleksij Rempel
  2024-07-05 14:33 ` Arun.Ramadoss
@ 2024-07-08 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-08 12:50 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: davem, andrew, edumazet, f.fainelli, kuba, pabeni, olteanv,
	woojung.huh, arun.ramadoss, florian.fainelli, kernel,
	linux-kernel, netdev, UNGLinuxDriver

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri,  5 Jul 2024 10:47:15 +0200 you wrote:
> Set proper MAC capabilities for port 4 on LAN9371 and LAN9372 switches with
> integrated 100BaseTX PHY. And introduce the is_lan937x_tx_phy() function to
> reuse it where applicable.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4
    https://git.kernel.org/netdev/net-next/c/5483cbfd863f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-08 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05  8:47 [PATCH net-next v2 1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4 Oleksij Rempel
2024-07-05 14:33 ` Arun.Ramadoss
2024-07-08 12:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).