aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/mv88e6131.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-03-20 05:50:39 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-21 22:06:54 -0400
commit076d3e10a54caa2c148de5732c126c7a31381d48 (patch)
tree8c9686248d46c803a994ab51ddee306ad4e4f4bc /net/dsa/mv88e6131.c
parentc084080151e1de92159f8437fde34b6e5bebe35e (diff)
dsa: add support for the Marvell 88E6095/6095F switch chips
Add support for the Marvell 88E6095/6095F switch chips. These chips are similar to the 88e6131, so we can add the support to mv88e6131.c easily. Thanks to Gary Thomas <gary@mlbassoc.com> and Jesper Dangaard Brouer <hawk@diku.dk> for testing various patches. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Tested-by: Gary Thomas <gary@mlbassoc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/mv88e6131.c')
-rw-r--r--net/dsa/mv88e6131.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c
index 70fae2444cb6..002995721ecf 100644
--- a/net/dsa/mv88e6131.c
+++ b/net/dsa/mv88e6131.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * net/dsa/mv88e6131.c - Marvell 88e6131 switch chip support 2 * net/dsa/mv88e6131.c - Marvell 88e6095/6095f/6131 switch chip support
3 * Copyright (c) 2008 Marvell Semiconductor 3 * Copyright (c) 2008-2009 Marvell Semiconductor
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@ static char *mv88e6131_probe(struct mii_bus *bus, int sw_addr)
21 ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03); 21 ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03);
22 if (ret >= 0) { 22 if (ret >= 0) {
23 ret &= 0xfff0; 23 ret &= 0xfff0;
24 if (ret == 0x0950)
25 return "Marvell 88E6095/88E6095F";
24 if (ret == 0x1060) 26 if (ret == 0x1060)
25 return "Marvell 88E6131"; 27 return "Marvell 88E6131";
26 } 28 }
@@ -36,7 +38,7 @@ static int mv88e6131_switch_reset(struct dsa_switch *ds)
36 /* 38 /*
37 * Set all ports to the disabled state. 39 * Set all ports to the disabled state.
38 */ 40 */
39 for (i = 0; i < 8; i++) { 41 for (i = 0; i < 11; i++) {
40 ret = REG_READ(REG_PORT(i), 0x04); 42 ret = REG_READ(REG_PORT(i), 0x04);
41 REG_WRITE(REG_PORT(i), 0x04, ret & 0xfffc); 43 REG_WRITE(REG_PORT(i), 0x04, ret & 0xfffc);
42 } 44 }
@@ -136,7 +138,7 @@ static int mv88e6131_setup_global(struct dsa_switch *ds)
136 * Clear all trunk masks. 138 * Clear all trunk masks.
137 */ 139 */
138 for (i = 0; i < 8; i++) 140 for (i = 0; i < 8; i++)
139 REG_WRITE(REG_GLOBAL2, 0x07, 0x8000 | (i << 12) | 0xff); 141 REG_WRITE(REG_GLOBAL2, 0x07, 0x8000 | (i << 12) | 0x7ff);
140 142
141 /* 143 /*
142 * Clear all trunk mappings. 144 * Clear all trunk mappings.
@@ -159,9 +161,13 @@ static int mv88e6131_setup_port(struct dsa_switch *ds, int p)
159 161
160 /* 162 /*
161 * MAC Forcing register: don't force link, speed, duplex 163 * MAC Forcing register: don't force link, speed, duplex
162 * or flow control state to any particular values. 164 * or flow control state to any particular values on physical
165 * ports, but force the CPU port to 1000 Mb/s full duplex.
163 */ 166 */
164 REG_WRITE(addr, 0x01, 0x0003); 167 if (p == ds->cpu_port)
168 REG_WRITE(addr, 0x01, 0x003e);
169 else
170 REG_WRITE(addr, 0x01, 0x0003);
165 171
166 /* 172 /*
167 * Port Control: disable Core Tag, disable Drop-on-Lock, 173 * Port Control: disable Core Tag, disable Drop-on-Lock,
@@ -268,7 +274,7 @@ static int mv88e6131_setup(struct dsa_switch *ds)
268 if (ret < 0) 274 if (ret < 0)
269 return ret; 275 return ret;
270 276
271 for (i = 0; i < 6; i++) { 277 for (i = 0; i < 11; i++) {
272 ret = mv88e6131_setup_port(ds, i); 278 ret = mv88e6131_setup_port(ds, i);
273 if (ret < 0) 279 if (ret < 0)
274 return ret; 280 return ret;
@@ -279,7 +285,7 @@ static int mv88e6131_setup(struct dsa_switch *ds)
279 285
280static int mv88e6131_port_to_phy_addr(int port) 286static int mv88e6131_port_to_phy_addr(int port)
281{ 287{
282 if (port >= 0 && port != 3 && port <= 7) 288 if (port >= 0 && port <= 11)
283 return port; 289 return port;
284 return -1; 290 return -1;
285} 291}