Commit 364e9d77 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: dsa: mv88e6xxx: Power on/off SERDES on cmode change

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d2e1dd2
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "chip.h" #include "chip.h"
#include "port.h" #include "port.h"
#include "serdes.h"
int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg, int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
u16 *val) u16 *val)
...@@ -372,6 +373,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, ...@@ -372,6 +373,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
cmode = 0; cmode = 0;
} }
err = mv88e6390_serdes_power(chip, port, false);
if (err)
return err;
if (cmode) { if (cmode) {
err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg); err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg);
if (err) if (err)
...@@ -383,6 +388,10 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, ...@@ -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); err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_STS, reg);
if (err) if (err)
return err; return err;
err = mv88e6390_serdes_power(chip, port, true);
if (err)
return err;
} }
chip->ports[port].cmode = cmode; chip->ports[port].cmode = cmode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment