Skip to content

Commit 5605194

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: ocelot: add driver for Felix switch family
This supports an Ethernet switching core from Vitesse / Microsemi / Microchip (VSC9959) which is part of the Ocelot family (a brand name), and whose code name is Felix. The switch can be (and is) integrated on different SoCs as a PCIe endpoint device. The functionality is provided by the core of the Ocelot switch driver (drivers/net/ethernet/mscc). In this regard, the current driver is an instance of Microsemi's Ocelot core driver, with a DSA front-end. It inherits its name from VSC9959's code name, to distinguish itself from the switchdev ocelot driver. The patch adds the logic for probing a PCI device and defines the register map for the VSC9959 switch core, since it has some differences in register addresses and bitfield mappings compared to the other Ocelot switches (VSC7511, VSC7512, VSC7513, VSC7514). The Felix driver declares the register map as part of the "instance table". Currently the VSC9959 inside NXP LS1028A is the only instance, but presumably it can support other switches in the Ocelot family, when used in DSA mode (Linux running on the external CPU, and not on the embedded MIPS). In a few cases, some h/w operations have to be done differently on VSC9959 due to missing bitfields. This is the case for the switch core reset and init. Because for this operation Ocelot uses some bits that are not present on Felix, the latter has to use a register from the global registers block (GCB) instead. Although it is a PCI driver, it relies on DT bindings for compatibility with DSA (CPU port link, PHY library). It does not have any custom device tree bindings, since we would like to minimize its dependency on device tree though. Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8dce89a commit 5605194

8 files changed

Lines changed: 1066 additions & 0 deletions

File tree

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17365,6 +17365,7 @@ M: Vladimir Oltean <vladimir.oltean@nxp.com>
1736517365
M: Claudiu Manoil <claudiu.manoil@nxp.com>
1736617366
L: netdev@vger.kernel.org
1736717367
S: Maintained
17368+
F: drivers/net/dsa/ocelot/*
1736817369
F: net/dsa/tag_ocelot.c
1736917370

1737017371
VIVID VIRTUAL VIDEO DRIVER

‎drivers/net/dsa/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ source "drivers/net/dsa/microchip/Kconfig"
5252

5353
source "drivers/net/dsa/mv88e6xxx/Kconfig"
5454

55+
source "drivers/net/dsa/ocelot/Kconfig"
56+
5557
source "drivers/net/dsa/sja1105/Kconfig"
5658

5759
config NET_DSA_QCA8K

‎drivers/net/dsa/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ obj-$(CONFIG_NET_DSA_VITESSE_VSC73XX_SPI) += vitesse-vsc73xx-spi.o
2020
obj-y += b53/
2121
obj-y += microchip/
2222
obj-y += mv88e6xxx/
23+
obj-y += ocelot/
2324
obj-y += sja1105/

‎drivers/net/dsa/ocelot/Kconfig‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config NET_DSA_MSCC_FELIX
3+
tristate "Ocelot / Felix Ethernet switch support"
4+
depends on NET_DSA && PCI
5+
select MSCC_OCELOT_SWITCH
6+
select NET_DSA_TAG_OCELOT
7+
help
8+
This driver supports the VSC9959 network switch, which is a member of
9+
the Vitesse / Microsemi / Microchip Ocelot family of switching cores.
10+
It is embedded as a PCIe function of the NXP LS1028A ENETC integrated
11+
endpoint.

‎drivers/net/dsa/ocelot/Makefile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
3+
4+
mscc_felix-objs := \
5+
felix.o \
6+
felix_vsc9959.o

0 commit comments

Comments
 (0)