netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320
@ 2022-10-28 16:31 Fabio Estevam
  2022-10-28 18:43 ` Andrew Lunn
  2022-11-01  3:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2022-10-28 16:31 UTC (permalink / raw)
  To: kuba; +Cc: davem, olteanv, andrew, netdev, Steffen Bätz, Fabio Estevam

From: Steffen Bätz <steffen@innosonix.de>

Currently, the .port_set_rgmii_delay hook is missing for the 88E6320
family, which causes failure to retrieve an IP address via DHCP.

Add mv88e6320_port_set_rgmii_delay() that allows applying the RGMII
delay for ports 2, 5, and 6, which are the only ports that can be used
in RGMII mode.

Tested on a custom i.MX8MN board connected to an 88E6320 switch.

This change also applies safely to the 88E6321 variant.

The only difference between 88E6320 versus 88E6321 is the temperature
grade and pinout.

They share exactly the same MDIO register map for ports 2, 5, and 6,
which are the only ports that can be used in RGMII mode.

Signed-off-by: Steffen Bätz <steffen@innosonix.de>
[fabio: Improved commit log and extended it to mv88e6321_ops]
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v2:
- Add .port_set_rgmii_delay to mv88e6321_ops as well (Andrew).
Changes since v1:
- Improve the commit log by saying that change is also
valid for the 88E631 chip. (Andrew).

 drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
 drivers/net/dsa/mv88e6xxx/port.c | 9 +++++++++
 drivers/net/dsa/mv88e6xxx/port.h | 2 ++
 3 files changed, 13 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 2479be3a1e35..bf34c942db99 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5029,6 +5029,7 @@ static const struct mv88e6xxx_ops mv88e6320_ops = {
 	.phy_write = mv88e6xxx_g2_smi_phy_write,
 	.port_set_link = mv88e6xxx_port_set_link,
 	.port_sync_link = mv88e6xxx_port_sync_link,
+	.port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay,
 	.port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
 	.port_tag_remap = mv88e6095_port_tag_remap,
 	.port_set_frame_mode = mv88e6351_port_set_frame_mode,
@@ -5073,6 +5074,7 @@ static const struct mv88e6xxx_ops mv88e6321_ops = {
 	.phy_write = mv88e6xxx_g2_smi_phy_write,
 	.port_set_link = mv88e6xxx_port_set_link,
 	.port_sync_link = mv88e6xxx_port_sync_link,
+	.port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay,
 	.port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
 	.port_tag_remap = mv88e6095_port_tag_remap,
 	.port_set_frame_mode = mv88e6351_port_set_frame_mode,
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index 5c4195c635b0..f79cf716c541 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -133,6 +133,15 @@ int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
 	return mv88e6xxx_port_set_rgmii_delay(chip, port, mode);
 }
 
+int mv88e6320_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
+				   phy_interface_t mode)
+{
+	if (port != 2 && port != 5 && port != 6)
+		return -EOPNOTSUPP;
+
+	return mv88e6xxx_port_set_rgmii_delay(chip, port, mode);
+}
+
 int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link)
 {
 	u16 reg;
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
index cb04243f37c1..aec9d4fd20e3 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
@@ -332,6 +332,8 @@ int mv88e6xxx_port_wait_bit(struct mv88e6xxx_chip *chip, int port, int reg,
 
 int mv88e6185_port_set_pause(struct mv88e6xxx_chip *chip, int port,
 			     int pause);
+int mv88e6320_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
+				   phy_interface_t mode);
 int mv88e6352_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
 				   phy_interface_t mode);
 int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
-- 
2.25.1


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

* Re: [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320
  2022-10-28 16:31 [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320 Fabio Estevam
@ 2022-10-28 18:43 ` Andrew Lunn
  2022-11-01  3:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-10-28 18:43 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: kuba, davem, olteanv, netdev, Steffen Bätz, Fabio Estevam

On Fri, Oct 28, 2022 at 01:31:58PM -0300, Fabio Estevam wrote:
> From: Steffen Bätz <steffen@innosonix.de>
> 
> Currently, the .port_set_rgmii_delay hook is missing for the 88E6320
> family, which causes failure to retrieve an IP address via DHCP.
> 
> Add mv88e6320_port_set_rgmii_delay() that allows applying the RGMII
> delay for ports 2, 5, and 6, which are the only ports that can be used
> in RGMII mode.
> 
> Tested on a custom i.MX8MN board connected to an 88E6320 switch.
> 
> This change also applies safely to the 88E6321 variant.
> 
> The only difference between 88E6320 versus 88E6321 is the temperature
> grade and pinout.
> 
> They share exactly the same MDIO register map for ports 2, 5, and 6,
> which are the only ports that can be used in RGMII mode.
> 
> Signed-off-by: Steffen Bätz <steffen@innosonix.de>
> [fabio: Improved commit log and extended it to mv88e6321_ops]
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320
  2022-10-28 16:31 [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320 Fabio Estevam
  2022-10-28 18:43 ` Andrew Lunn
@ 2022-11-01  3:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-01  3:10 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: kuba, davem, olteanv, andrew, netdev, steffen, festevam

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 28 Oct 2022 13:31:58 -0300 you wrote:
> From: Steffen Bätz <steffen@innosonix.de>
> 
> Currently, the .port_set_rgmii_delay hook is missing for the 88E6320
> family, which causes failure to retrieve an IP address via DHCP.
> 
> Add mv88e6320_port_set_rgmii_delay() that allows applying the RGMII
> delay for ports 2, 5, and 6, which are the only ports that can be used
> in RGMII mode.
> 
> [...]

Here is the summary with links:
  - [v3,net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320
    https://git.kernel.org/netdev/net-next/c/91e87045a5ef

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:[~2022-11-01  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 16:31 [PATCH v3 net-next] net: dsa: mv88e6xxx: Add RGMII delay to 88E6320 Fabio Estevam
2022-10-28 18:43 ` Andrew Lunn
2022-11-01  3:10 ` 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).