aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-03-26 21:36:33 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-29 16:23:52 -0400
commit54af0cf0d25eb3147ea6f1e121c641856486331a (patch)
tree3e194444fc1f0096802b61396314282a92a42cfd /drivers
parent2089052f82fdd85214542ece1ec39a383ab4c076 (diff)
net: dsa: mv88e6123_61_65: Use common port configuration
This will simplify adding offloaded bridge support later on. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dsa/mv88e6123_61_65.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/net/dsa/mv88e6123_61_65.c b/drivers/net/dsa/mv88e6123_61_65.c
index 6ebe57044afc..2d7e1ffe9fdc 100644
--- a/drivers/net/dsa/mv88e6123_61_65.c
+++ b/drivers/net/dsa/mv88e6123_61_65.c
@@ -222,28 +222,6 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p)
222 val |= 0x000c; 222 val |= 0x000c;
223 REG_WRITE(addr, 0x04, val); 223 REG_WRITE(addr, 0x04, val);
224 224
225 /* Port Control 1: disable trunking. Also, if this is the
226 * CPU port, enable learn messages to be sent to this port.
227 */
228 REG_WRITE(addr, 0x05, dsa_is_cpu_port(ds, p) ? 0x8000 : 0x0000);
229
230 /* Port based VLAN map: give each port its own address
231 * database, allow the CPU port to talk to each of the 'real'
232 * ports, and allow each of the 'real' ports to only talk to
233 * the upstream port.
234 */
235 val = (p & 0xf) << 12;
236 if (dsa_is_cpu_port(ds, p))
237 val |= ds->phys_port_mask;
238 else
239 val |= 1 << dsa_upstream_port(ds);
240 REG_WRITE(addr, 0x06, val);
241
242 /* Default VLAN ID and priority: don't set a default VLAN
243 * ID, and set the default packet priority to zero.
244 */
245 REG_WRITE(addr, 0x07, 0x0000);
246
247 /* Port Control 2: don't force a good FCS, set the maximum 225 /* Port Control 2: don't force a good FCS, set the maximum
248 * frame size to 10240 bytes, don't let the switch add or 226 * frame size to 10240 bytes, don't let the switch add or
249 * strip 802.1q tags, don't discard tagged or untagged frames 227 * strip 802.1q tags, don't discard tagged or untagged frames
@@ -288,7 +266,7 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p)
288 */ 266 */
289 REG_WRITE(addr, 0x19, 0x7654); 267 REG_WRITE(addr, 0x19, 0x7654);
290 268
291 return 0; 269 return mv88e6xxx_setup_port_common(ds, p);
292} 270}
293 271
294static int mv88e6123_61_65_setup(struct dsa_switch *ds) 272static int mv88e6123_61_65_setup(struct dsa_switch *ds)