Skip to content

Commit 475d528

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 is6190x hint support for enabling on amd64 platform without device tree support. PR: 281211 Signed-off-by: Stas Alekseev <[email protected]> Trigger Build
1 parent a700bef commit 475d528

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

sys/dev/etherswitch/e6000sw/e6000sw.c

Lines changed: 22 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);
@@ -259,8 +260,16 @@ e6000sw_probe(device_t dev)
259260
*/
260261
resource_int_value(device_get_name(sc->dev),
261262
device_get_unit(sc->dev), "is8190", &is_6190);
263+
resource_int_value(device_get_name(sc->dev),
264+
device_get_unit(sc->dev), "is6190x", &is_6190x);
265+
if (is_6190 !=0 && is_6190x != 0)
266+
if (bootverbose)
267+
device_printf(dev, "Cannot configure conflicting variants\n");
268+
return (ENXIO);
262269
if (is_6190 != 0)
263270
sc->swid = MV88E6190;
271+
else if (is_6190x != 0)
272+
sc->swid = MV88E6190X;
264273
#endif
265274
if (sc->sw_addr < 0 || sc->sw_addr > 32)
266275
return (ENXIO);
@@ -302,6 +311,10 @@ e6000sw_probe(device_t dev)
302311
description = "Marvell 88E6190";
303312
sc->num_ports = 11;
304313
break;
314+
case MV88E6190X:
315+
description = "Marvell 88E6190X";
316+
sc->num_ports = 11;
317+
break;
305318
default:
306319
device_printf(dev, "Unrecognized device, id 0x%x.\n", sc->swid);
307320
return (ENXIO);
@@ -332,7 +345,7 @@ e6000sw_parse_fixed_link(e6000sw_softc_t *sc, phandle_t node, uint32_t port)
332345
return (ENXIO);
333346
}
334347
if (speed == 2500 && (MVSWITCH(sc, MV88E6141) ||
335-
MVSWITCH(sc, MV88E6341) || MVSWITCH(sc, MV88E6190)))
348+
MVSWITCH(sc, MV88E6341) || MVSWITCH(sc, MV88E6190) || MVSWITCH(sc, MV88E6190X)))
336349
sc->fixed25_mask |= (1 << port);
337350
}
338351

@@ -596,22 +609,26 @@ e6000sw_attach(device_t dev)
596609
reg |= PSC_CONTROL_SPD2500;
597610
else
598611
reg |= PSC_CONTROL_SPD1000;
599-
if (MVSWITCH(sc, MV88E6190) &&
612+
if (MVSWITCH(sc, MV88E6190) ||
613+
MVSWITCH(sc, MV88E6190X) &&
600614
e6000sw_is_fixed25port(sc, port))
601615
reg |= PSC_CONTROL_ALT_SPD;
602616
reg |= PSC_CONTROL_FORCED_DPX | PSC_CONTROL_FULLDPX |
603617
PSC_CONTROL_FORCED_LINK | PSC_CONTROL_LINK_UP |
604618
PSC_CONTROL_FORCED_SPD;
605-
if (!MVSWITCH(sc, MV88E6190))
619+
if (!MVSWITCH(sc, MV88E6190) &&
620+
!MVSWITCH(sc, MV88E6190X))
606621
reg |= PSC_CONTROL_FORCED_FC | PSC_CONTROL_FC_ON;
607622
if (MVSWITCH(sc, MV88E6141) ||
608623
MVSWITCH(sc, MV88E6341) ||
609-
MVSWITCH(sc, MV88E6190))
624+
MVSWITCH(sc, MV88E6190) ||
625+
MVSWITCH(sc, MV88E6190X))
610626
reg |= PSC_CONTROL_FORCED_EEE;
611627
e6000sw_writereg(sc, REG_PORT(sc, port), PSC_CONTROL,
612628
reg);
613629
/* Power on the SERDES interfaces. */
614-
if (MVSWITCH(sc, MV88E6190) &&
630+
if (MVSWITCH(sc, MV88E6190) ||
631+
MVSWITCH(sc, MV88E6190X) &&
615632
(port == 9 || port == 10)) {
616633
if (e6000sw_is_fixed25port(sc, port))
617634
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)