Skip to content

Commit 4e7ba71

Browse files
committed
e6000sw: Add support for MV88E6190X switch variant
This commit adds support for MV88E6190X switch variant that is similar to MV88E6190 in its configuration. It also adds is_6190x hint support for enabling on amd64 platform without device tree support. Signed-off-by: Stas Alekseev <[email protected]>
1 parent 1b9cfd6 commit 4e7ba71

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

sys/dev/etherswitch/e6000sw/e6000sw.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ e6000sw_probe(device_t dev)
217217
phandle_t switch_node;
218218
#else
219219
int is_6190;
220+
int is_6190x;
220221
#endif
221222

222223
sc = device_get_softc(dev);
@@ -261,6 +262,8 @@ e6000sw_probe(device_t dev)
261262
device_get_unit(sc->dev), "is8190", &is_6190);
262263
if (is_6190 != 0)
263264
sc->swid = MV88E6190;
265+
if (is_6190x != 0)
266+
sc->swid = MV88E6190X;
264267
#endif
265268
if (sc->sw_addr < 0 || sc->sw_addr > 32)
266269
return (ENXIO);
@@ -302,6 +305,10 @@ e6000sw_probe(device_t dev)
302305
description = "Marvell 88E6190";
303306
sc->num_ports = 11;
304307
break;
308+
case MV88E6190X:
309+
description = "Marvell 88E6190X";
310+
sc->num_ports = 11;
311+
break;
305312
default:
306313
device_printf(dev, "Unrecognized device, id 0x%x.\n", sc->swid);
307314
return (ENXIO);
@@ -332,7 +339,7 @@ e6000sw_parse_fixed_link(e6000sw_softc_t *sc, phandle_t node, uint32_t port)
332339
return (ENXIO);
333340
}
334341
if (speed == 2500 && (MVSWITCH(sc, MV88E6141) ||
335-
MVSWITCH(sc, MV88E6341) || MVSWITCH(sc, MV88E6190)))
342+
MVSWITCH(sc, MV88E6341) || MVSWITCH(sc, MV88E6190) || MVSWITCH(sc, MV88E6190X)))
336343
sc->fixed25_mask |= (1 << port);
337344
}
338345

@@ -596,22 +603,26 @@ e6000sw_attach(device_t dev)
596603
reg |= PSC_CONTROL_SPD2500;
597604
else
598605
reg |= PSC_CONTROL_SPD1000;
599-
if (MVSWITCH(sc, MV88E6190) &&
606+
if (MVSWITCH(sc, MV88E6190) ||
607+
MVSWITCH(sc, MV88E6190X) &&
600608
e6000sw_is_fixed25port(sc, port))
601609
reg |= PSC_CONTROL_ALT_SPD;
602610
reg |= PSC_CONTROL_FORCED_DPX | PSC_CONTROL_FULLDPX |
603611
PSC_CONTROL_FORCED_LINK | PSC_CONTROL_LINK_UP |
604612
PSC_CONTROL_FORCED_SPD;
605-
if (!MVSWITCH(sc, MV88E6190))
613+
if (!MVSWITCH(sc, MV88E6190) ||
614+
!MVSWITCH(sc, MV88E6190X))
606615
reg |= PSC_CONTROL_FORCED_FC | PSC_CONTROL_FC_ON;
607616
if (MVSWITCH(sc, MV88E6141) ||
608617
MVSWITCH(sc, MV88E6341) ||
609-
MVSWITCH(sc, MV88E6190))
618+
MVSWITCH(sc, MV88E6190) ||
619+
MVSWITCH(sc, MV88E6190X))
610620
reg |= PSC_CONTROL_FORCED_EEE;
611621
e6000sw_writereg(sc, REG_PORT(sc, port), PSC_CONTROL,
612622
reg);
613623
/* Power on the SERDES interfaces. */
614-
if (MVSWITCH(sc, MV88E6190) &&
624+
if (MVSWITCH(sc, MV88E6190) ||
625+
MVSWITCH(sc, MV88E6190X) &&
615626
(port == 9 || port == 10)) {
616627
if (e6000sw_is_fixed25port(sc, port))
617628
sgmii = false;

sys/dev/etherswitch/e6000sw/e6000swreg.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct atu_opt {
4747
#define MV88E6172 0x1720
4848
#define MV88E6176 0x1760
4949
#define MV88E6190 0x1900
50+
#define MV88E6190X 0x0a00
5051

5152
#define MVSWITCH(_sc, id) ((_sc)->swid == (id))
5253
#define MVSWITCH_MULTICHIP(_sc) ((_sc)->sw_addr != 0)
@@ -56,7 +57,7 @@ struct atu_opt {
5657
*/
5758
#define REG_GLOBAL 0x1b
5859
#define REG_GLOBAL2 0x1c
59-
#define REG_PORT(_sc, p) ((MVSWITCH((_sc), MV88E6190) ? 0 : 0x10) + (p))
60+
#define REG_PORT(_sc, p) ((MVSWITCH((_sc), MV88E6190) || MVSWITCH((_sc), MV88E6190X) ? 0 : 0x10) + (p))
6061

6162
#define REG_NUM_MAX 31
6263

@@ -138,13 +139,13 @@ struct atu_opt {
138139
#define VTU_DATA 7
139140
#define VTU_DATA2 8
140141

141-
#define VTU_FID_MASK(_sc) (MVSWITCH((_sc), MV88E6190) ? 0xfff : 0xff)
142+
#define VTU_FID_MASK(_sc) (MVSWITCH((_sc), MV88E6190) || MVSWITCH((_sc), MV88E6190X) ? 0xfff : 0xff)
142143
#define VTU_FID_POLICY (1 << 12)
143144
#define VTU_PORT_UNMODIFIED 0
144145
#define VTU_PORT_UNTAGGED 1
145146
#define VTU_PORT_TAGGED 2
146147
#define VTU_PORT_DISCARD 3
147-
#define VTU_PPREG(_sc) (MVSWITCH((_sc), MV88E6190) ? 8 : 4)
148+
#define VTU_PPREG(_sc) (MVSWITCH((_sc), MV88E6190) || MVSWITCH((_sc), MV88E6190X) ? 8 : 4)
148149
#define VTU_PORT(_sc, p) (((p) % VTU_PPREG(_sc)) * (16 / VTU_PPREG(_sc)))
149150
#define VTU_PORT_MASK 3
150151
#define VTU_BUSY (1 << 15)
@@ -174,7 +175,7 @@ struct atu_opt {
174175
#define ATU_MAC_ADDR45 15
175176

176177
#define ATU_DATA_LAG (1 << 15)
177-
#define ATU_PORT_MASK(_sc) (MVSWITCH((_sc), MV88E6190) ? 0xfff0 : 0xff0)
178+
#define ATU_PORT_MASK(_sc) (MVSWITCH((_sc), MV88E6190) || MVSWITCH((_sc), MV88E6190X) ? 0xfff0 : 0xff0)
178179
#define ATU_PORT_SHIFT 4
179180
#define ATU_LAG_MASK 0xf0
180181
#define ATU_LAG_SHIFT 4

0 commit comments

Comments
 (0)