mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] net: phy: mv88e6xxx: implement port_set_speed for mv88e6250
@ 2022-03-21 13:16 Steffen Trumtrar
  2022-03-21 13:16 ` [PATCH 2/2] net: phy: mv88e6xxx: add support " Steffen Trumtrar
  2022-03-28  8:29 ` [PATCH 1/2] net: phy: mv88e6xxx: implement port_set_speed " Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Steffen Trumtrar @ 2022-03-21 13:16 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

From: Steffen Trumtrar <s.trumtrar@pengutronix.de>

barebox port of the linux patch:

  commit a528e5be6b5f8026eda029b03340dcfa23c70824
  Author: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
  Date:   Tue Jun 4 07:34:29 2019 +0000

      net: dsa: mv88e6xxx: implement port_set_speed for mv88e6250

      The data sheet also mentions the possibility of selecting 200 Mbps for
      the MII ports (ports 5 and 6) by setting the ForceSpd field to
      0x2 (aka MV88E6065_PORT_MAC_CTL_SPEED_200). However, there's a note
      that "actual speed is determined by bit 8 above", and flipping back a
      page, one finds that bits 13:8 are reserved...

      So without further information on what bit 8 means, let's stick to
      supporting just 10 and 100 Mbps on all ports.

      Reviewed-by: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 drivers/net/phy/mv88e6xxx/port.c | 12 ++++++++++++
 drivers/net/phy/mv88e6xxx/port.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/phy/mv88e6xxx/port.c b/drivers/net/phy/mv88e6xxx/port.c
index ba2b03e18d..95542d4eec 100644
--- a/drivers/net/phy/mv88e6xxx/port.c
+++ b/drivers/net/phy/mv88e6xxx/port.c
@@ -277,6 +277,18 @@ int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed)
 	return mv88e6xxx_port_set_speed(chip, port, speed, false, false);
 }
 
+/* Support 10, 100 (e.g. 88E6250 family) */
+int mv88e6250_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed)
+{
+	if (speed == SPEED_MAX)
+		speed = 100;
+
+	if (speed > 100)
+		return -EOPNOTSUPP;
+
+	return mv88e6xxx_port_set_speed(chip, port, speed, false, false);
+}
+
 /* Support 10, 100, 200, 1000 Mbps (e.g. 88E6352 family) */
 int mv88e6352_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed)
 {
diff --git a/drivers/net/phy/mv88e6xxx/port.h b/drivers/net/phy/mv88e6xxx/port.h
index f47f392b87..f5cf72932a 100644
--- a/drivers/net/phy/mv88e6xxx/port.h
+++ b/drivers/net/phy/mv88e6xxx/port.h
@@ -121,6 +121,7 @@ int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link);
 int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup);
 int mv88e6065_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
 int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
+int mv88e6250_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
 int mv88e6352_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
 int mv88e6390_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
 int mv88e6390x_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2022-03-28  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 13:16 [PATCH 1/2] net: phy: mv88e6xxx: implement port_set_speed for mv88e6250 Steffen Trumtrar
2022-03-21 13:16 ` [PATCH 2/2] net: phy: mv88e6xxx: add support " Steffen Trumtrar
2022-03-28  8:29 ` [PATCH 1/2] net: phy: mv88e6xxx: implement port_set_speed " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox