* [PATCH] net: dsa: mv88e6xxx: Add .port_set_rgmii_delay to 88E6320
@ 2022-10-28 12:06 Fabio Estevam
2022-10-28 12:23 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2022-10-28 12:06 UTC (permalink / raw)
To: kuba; +Cc: 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 88E6320, which
causes failure to retrieve an IP address via DHCP.
Add mv88e6320_port_set_rgmii_delay() that allows applying the RGMII
delay for ports 3 and 4, which are the 10/100/1000 PHYs.
Tested on a i.MX8MN board connected to a 88E6320 switch.
Signed-off-by: Steffen Bätz <steffen@innosonix.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
drivers/net/dsa/mv88e6xxx/port.c | 9 +++++++++
drivers/net/dsa/mv88e6xxx/port.h | 2 ++
3 files changed, 12 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 2479be3a1e35..dc7cbf48bda5 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,
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..fe8f2085bb0b 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
@@ -336,6 +336,8 @@ 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,
phy_interface_t mode);
+int mv88e6320_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
+ phy_interface_t mode);
int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: Add .port_set_rgmii_delay to 88E6320
2022-10-28 12:06 [PATCH] net: dsa: mv88e6xxx: Add .port_set_rgmii_delay to 88E6320 Fabio Estevam
@ 2022-10-28 12:23 ` Andrew Lunn
2022-10-28 13:55 ` Fabio Estevam
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2022-10-28 12:23 UTC (permalink / raw)
To: Fabio Estevam; +Cc: kuba, olteanv, netdev, Steffen Bätz
On Fri, Oct 28, 2022 at 09:06:54AM -0300, Fabio Estevam wrote:
> From: Steffen Bätz <steffen@innosonix.de>
>
> Currently, the port_set_rgmii_delay hook is missing for 88E6320, which
> causes failure to retrieve an IP address via DHCP.
Hi Fabio
Thanks for the patch. The 88E6320 family contains both the 88E6320 and
the 88E6321. Could you check the datasheet if this same change works
for the 88E6321. It probably does.
Thanks
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: Add .port_set_rgmii_delay to 88E6320
2022-10-28 12:23 ` Andrew Lunn
@ 2022-10-28 13:55 ` Fabio Estevam
0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2022-10-28 13:55 UTC (permalink / raw)
To: Andrew Lunn; +Cc: kuba, olteanv, netdev, Steffen Bätz
Hi Andrew,
On Fri, Oct 28, 2022 at 9:23 AM Andrew Lunn <andrew@lunn.ch> wrote:
> Hi Fabio
>
> Thanks for the patch. The 88E6320 family contains both the 88E6320 and
> the 88E6321. Could you check the datasheet if this same change works
> for the 88E6321. It probably does.
Yes, the same change is valid for 88E6321 as well. Steffen confirmed
it and I have
sent a v2 with an improved commit log that explains this.
Thanks,
Fabio Estevam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-28 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 12:06 [PATCH] net: dsa: mv88e6xxx: Add .port_set_rgmii_delay to 88E6320 Fabio Estevam
2022-10-28 12:23 ` Andrew Lunn
2022-10-28 13:55 ` Fabio Estevam
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).