diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-05-09 13:22:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-09 14:26:12 -0400 |
commit | 50484ff4d11c1eca0059f3b3d407ecec0f1b83b0 (patch) | |
tree | a989243cfc875498a7ea1d3359139d076abf5c08 /drivers/net/dsa/mv88e6xxx.c | |
parent | b0745e87943b40734e6c341dcf47a6ec80ee4346 (diff) | |
download | lwn-50484ff4d11c1eca0059f3b3d407ecec0f1b83b0.tar.gz lwn-50484ff4d11c1eca0059f3b3d407ecec0f1b83b0.zip |
net: dsa: mv88e6xxx: factorize GLOBAL_CONTROL_2 setup
All switch models setup the GLOBAL_CONTROL_2 register with slightly
differences.
Since the cascade mode is valid even in a single chip setup, factorize
such configuration.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 27551c1f1cd0..d8bb4c8e005f 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -2950,6 +2950,13 @@ static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps) if (err) return err; + /* Disable remote management, and set the switch's DSA device number. */ + err = _mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2, + GLOBAL_CONTROL_2_MULTIPLE_CASCADE | + (ds->index & 0x1f)); + if (err) + return err; + /* Set the default address aging time to 5 minutes, and * enable address learn messages to be sent to all message * ports. |