aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dsa/Kconfig6
-rw-r--r--net/dsa/mv88e6131.c22
2 files changed, 17 insertions, 11 deletions
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index 49211b35725b..c51b55400dc5 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -41,13 +41,13 @@ config NET_DSA_MV88E6XXX_NEED_PPU
41 default n 41 default n
42 42
43config NET_DSA_MV88E6131 43config NET_DSA_MV88E6131
44 bool "Marvell 88E6131 ethernet switch chip support" 44 bool "Marvell 88E6095/6095F/6131 ethernet switch chip support"
45 select NET_DSA_MV88E6XXX 45 select NET_DSA_MV88E6XXX
46 select NET_DSA_MV88E6XXX_NEED_PPU 46 select NET_DSA_MV88E6XXX_NEED_PPU
47 select NET_DSA_TAG_DSA 47 select NET_DSA_TAG_DSA
48 ---help--- 48 ---help---
49 This enables support for the Marvell 88E6131 ethernet switch 49 This enables support for the Marvell 88E6095/6095F/6131
50 chip. 50 ethernet switch chips.
51 51
52config NET_DSA_MV88E6123_61_65 52config NET_DSA_MV88E6123_61_65
53 bool "Marvell 88E6123/6161/6165 ethernet switch chip support" 53 bool "Marvell 88E6123/6161/6165 ethernet switch chip support"
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}