netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Florian Fainelli <f.fainelli@gmail.com>,
	nikita.yoush@cogentembedded.com, Chris Healy <cphealy@gmail.com>,
	marek.behun@nic.cz, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next 10/13] net: dsa: mv88e6xxx: Power on/off SERDES on cmode change
Date: Thu,  9 Aug 2018 15:38:46 +0200	[thread overview]
Message-ID: <1533821929-20071-11-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1533821929-20071-1-git-send-email-andrew@lunn.ch>

The 6390 family has a number of SERDES interfaces per port. When the
cmode changes, eg 1000Base-X to XAUI, the SERDES interface in use will
also change. Power down the old SERDES interface and power up the new
SERDES interface.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6xxx/port.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index d236f3420f2d..977b4cb82299 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -19,6 +19,7 @@
 
 #include "chip.h"
 #include "port.h"
+#include "serdes.h"
 
 int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
 			u16 *val)
@@ -372,6 +373,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
 		cmode = 0;
 	}
 
+	err = mv88e6390_serdes_power(chip, port, false);
+	if (err)
+		return err;
+
 	if (cmode) {
 		err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg);
 		if (err)
@@ -383,6 +388,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
 		err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_STS, reg);
 		if (err)
 			return err;
+
+		err = mv88e6390_serdes_power(chip, port, true);
+		if (err)
+			return err;
 	}
 
 	chip->ports[port].cmode = cmode;
-- 
2.18.0

  parent reply	other threads:[~2018-08-09 16:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 13:38 [PATCH net-next 00/13] More complete PHYLINK support for mv88e6xxx Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 01/13] net: dsa: mv88e6xxx: Add support to enabling pause Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 02/13] phylink: add helper for configuring 2500BaseX modes Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 03/13] net: dsa: mv88e6xxx: add phylink support Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 04/13] net: dsa: mv88e6xxx: Refactor SERDES lane code Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 05/13] net: dsa: mv88e6xxx: 6390 vs 6390X SERDES support Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 06/13] net: dsa: mv88e6xxx: Rename sgmii/10g power functions Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 07/13] net: dsa: mv88e6xxx: Add serdes register read/write helper Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 08/13] net: dsa: mv88e6xxx: 2500Base-X uses the 1000Base-X SERDES Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 09/13] net: dsa: mv88e6xxx: Cache the port cmode Andrew Lunn
2018-08-09 13:38 ` Andrew Lunn [this message]
2018-08-09 13:38 ` [PATCH net-next 11/13] net: dsa: mv88e6xxx: link mv88e6xxx_port to mv88e6xxx_chip Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 12/13] net: dsa: mv88e6xxx: Add SERDES phydev_mac_change up for 6390 Andrew Lunn
2018-08-09 13:38 ` [PATCH net-next 13/13] net: dsa: mv88e6xxx: Re-setup interrupts on CMODE change Andrew Lunn
2018-08-09 18:08 ` [PATCH net-next 00/13] More complete PHYLINK support for mv88e6xxx David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533821929-20071-11-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=netdev@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).