aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-03-26 21:36:32 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-29 16:23:52 -0400
commit2089052f82fdd85214542ece1ec39a383ab4c076 (patch)
tree6016ef82823252b13521444b47f842cf7d9b3b0e
parent8d6d09e7a0149b60a8b504b21cafe5f4b304fd97 (diff)
net: dsa: mv88e6352: Use common port initialization code
This prepares the driver for hardware bridging. 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>
-rw-r--r--drivers/net/dsa/mv88e6352.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 75cf9e1c5a44..f7e7c0f1dff4 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -215,28 +215,6 @@ static int mv88e6352_setup_port(struct dsa_switch *ds, int p)
215 val |= 0x000c; 215 val |= 0x000c;
216 REG_WRITE(addr, 0x04, val); 216 REG_WRITE(addr, 0x04, val);
217 217
218 /* Port Control 1: disable trunking. Also, if this is the
219 * CPU port, enable learn messages to be sent to this port.
220 */
221 REG_WRITE(addr, 0x05, dsa_is_cpu_port(ds, p) ? 0x8000 : 0x0000);
222
223 /* Port based VLAN map: give each port its own address
224 * database, allow the CPU port to talk to each of the 'real'
225 * ports, and allow each of the 'real' ports to only talk to
226 * the upstream port.
227 */
228 val = (p & 0xf) << 12;
229 if (dsa_is_cpu_port(ds, p))
230 val |= ds->phys_port_mask;
231 else
232 val |= 1 << dsa_upstream_port(ds);
233 REG_WRITE(addr, 0x06, val);
234
235 /* Default VLAN ID and priority: don't set a default VLAN
236 * ID, and set the default packet priority to zero.
237 */
238 REG_WRITE(addr, 0x07, 0x0000);
239
240 /* Port Control 2: don't force a good FCS, set the maximum 218 /* Port Control 2: don't force a good FCS, set the maximum
241 * frame size to 10240 bytes, don't let the switch add or 219 * frame size to 10240 bytes, don't let the switch add or
242 * strip 802.1q tags, don't discard tagged or untagged frames 220 * strip 802.1q tags, don't discard tagged or untagged frames
@@ -281,7 +259,7 @@ static int mv88e6352_setup_port(struct dsa_switch *ds, int p)
281 */ 259 */
282 REG_WRITE(addr, 0x19, 0x7654); 260 REG_WRITE(addr, 0x19, 0x7654);
283 261
284 return 0; 262 return mv88e6xxx_setup_port_common(ds, p);
285} 263}
286 264
287#ifdef CONFIG_NET_DSA_HWMON 265#ifdef CONFIG_NET_DSA_HWMON