Skip to content

Commit a556c76

Browse files
alexandrebellonidavem330
authored andcommitted
net: mscc: Add initial Ocelot switch support
Add a driver for Microsemi Ocelot Ethernet switch support. This makes two modules: mscc_ocelot_common handles all the common features that doesn't depend on how the switch is integrated in the SoC. Currently, it handles offloading bridging to the hardware. ocelot_io.c handles register accesses. This is unfortunately needed because the register layout is packed and then depends on the number of ports available on the switch. The register definition files are automatically generated. ocelot_board handles the switch integration on the SoC and on the board. Frame injection and extraction to/from the CPU port is currently done using register accesses which is quite slow. DMA is possible but the port is not able to absorb the whole switch bandwidth. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 44b801e commit a556c76

17 files changed

+5283
-0
lines changed

drivers/net/ethernet/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ source "drivers/net/ethernet/mediatek/Kconfig"
114114
source "drivers/net/ethernet/mellanox/Kconfig"
115115
source "drivers/net/ethernet/micrel/Kconfig"
116116
source "drivers/net/ethernet/microchip/Kconfig"
117+
source "drivers/net/ethernet/mscc/Kconfig"
117118
source "drivers/net/ethernet/moxa/Kconfig"
118119
source "drivers/net/ethernet/myricom/Kconfig"
119120

drivers/net/ethernet/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ obj-$(CONFIG_NET_VENDOR_MEDIATEK) += mediatek/
5555
obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/
5656
obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/
5757
obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/
58+
obj-$(CONFIG_NET_VENDOR_MICROSEMI) += mscc/
5859
obj-$(CONFIG_NET_VENDOR_MOXART) += moxa/
5960
obj-$(CONFIG_NET_VENDOR_MYRI) += myricom/
6061
obj-$(CONFIG_FEALNX) += fealnx.o

drivers/net/ethernet/mscc/Kconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
config NET_VENDOR_MICROSEMI
3+
bool "Microsemi devices"
4+
default y
5+
help
6+
If you have a network (Ethernet) card belonging to this class, say Y.
7+
8+
Note that the answer to this question doesn't directly affect the
9+
kernel: saying N will just cause the configurator to skip all
10+
the questions about Microsemi devices.
11+
12+
if NET_VENDOR_MICROSEMI
13+
14+
config MSCC_OCELOT_SWITCH
15+
tristate "Ocelot switch driver"
16+
depends on NET_SWITCHDEV
17+
depends on HAS_IOMEM
18+
select PHYLIB
19+
select REGMAP_MMIO
20+
help
21+
This driver supports the Ocelot network switch device.
22+
23+
config MSCC_OCELOT_SWITCH_OCELOT
24+
tristate "Ocelot switch driver on Ocelot"
25+
depends on MSCC_OCELOT_SWITCH
26+
help
27+
This driver supports the Ocelot network switch device as present on
28+
the Ocelot SoCs.
29+
30+
endif # NET_VENDOR_MICROSEMI

drivers/net/ethernet/mscc/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
obj-$(CONFIG_MSCC_OCELOT_SWITCH) += mscc_ocelot_common.o
3+
mscc_ocelot_common-y := ocelot.o ocelot_io.o
4+
mscc_ocelot_common-y += ocelot_regs.o
5+
obj-$(CONFIG_MSCC_OCELOT_SWITCH_OCELOT) += ocelot_board.o

0 commit comments

Comments
 (0)