Skip to content

Commit 967dd82

Browse files
ffainellidavem330
authored andcommitted
net: dsa: b53: Add support for Broadcom RoboSwitch
This patch adds support for Broadcom's BCM53xx switch family, also known as RoboSwitch. Some of these switches are ubiquituous, found in home routers, Wi-Fi routers, DSL and cable modem gateways and other networking related products. This drivers adds the library driver (b53_common.c) as well as a few bus glue drivers for MDIO, SPI, Switch Register Access Block (SRAB) and memory-mapped I/O into a SoC's address space (Broadcom BCM63xx/33xx). Basic operations are supported to bring the Layer 1/2 up and running, but not much more at this point, subsequent patches add the remaining features. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 409a5f2 commit 967dd82

File tree

14 files changed

+3397
-0
lines changed

14 files changed

+3397
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Broadcom BCM53xx Ethernet switches
2+
==================================
3+
4+
Required properties:
5+
6+
- compatible: For external switch chips, compatible string must be exactly one
7+
of: "brcm,bcm5325"
8+
"brcm,bcm53115"
9+
"brcm,bcm53125"
10+
"brcm,bcm53128"
11+
"brcm,bcm5365"
12+
"brcm,bcm5395"
13+
"brcm,bcm5397"
14+
"brcm,bcm5398"
15+
16+
For the BCM5310x SoCs with an integrated switch, must be one of:
17+
"brcm,bcm53010-srab"
18+
"brcm,bcm53011-srab"
19+
"brcm,bcm53012-srab"
20+
"brcm,bcm53018-srab"
21+
"brcm,bcm53019-srab" and the mandatory "brcm,bcm5301x-srab" string
22+
23+
For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
24+
"brcm,bcm3384-switch"
25+
"brcm,bcm6328-switch"
26+
"brcm,bcm6368-switch" and the mandatory "brcm,bcm63xx-switch"
27+
28+
See Documentation/devicetree/bindings/dsa/dsa.txt for a list of additional
29+
required and optional properties.
30+
31+
Examples:
32+
33+
Ethernet switch connected via MDIO to the host, CPU port wired to eth0:
34+
35+
eth0: ethernet@10001000 {
36+
compatible = "brcm,unimac";
37+
reg = <0x10001000 0x1000>;
38+
39+
fixed-link {
40+
speed = <1000>;
41+
duplex-full;
42+
};
43+
};
44+
45+
mdio0: mdio@10000000 {
46+
compatible = "brcm,unimac-mdio";
47+
#address-cells = <1>;
48+
#size-cells = <0>;
49+
50+
switch0: ethernet-switch@30 {
51+
compatible = "brcm,bcm53125";
52+
#address-cells = <1>;
53+
#size-cells = <0>;
54+
55+
ports {
56+
port0@0 {
57+
reg = <0>;
58+
label = "lan1";
59+
};
60+
61+
port1@1 {
62+
reg = <1>;
63+
label = "lan2";
64+
};
65+
66+
port5@5 {
67+
reg = <5>;
68+
label = "cable-modem";
69+
fixed-link {
70+
speed = <1000>;
71+
duplex-full;
72+
};
73+
phy-mode = "rgmii-txid";
74+
};
75+
76+
port8@8 {
77+
reg = <8>;
78+
label = "cpu";
79+
fixed-link {
80+
speed = <1000>;
81+
duplex-full;
82+
};
83+
phy-mode = "rgmii-txid";
84+
ethernet = <&eth0>;
85+
};
86+
};
87+
};
88+
};

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,14 @@ L: [email protected]
24542454
S: Supported
24552455
F: drivers/net/ethernet/broadcom/b44.*
24562456

2457+
BROADCOM B53 ETHERNET SWITCH DRIVER
2458+
M: Florian Fainelli <[email protected]>
2459+
2460+
L: [email protected] (subscribers-only)
2461+
S: Supported
2462+
F: drivers/net/dsa/b53/*
2463+
F: include/linux/platform_data/b53.h
2464+
24572465
BROADCOM GENET ETHERNET DRIVER
24582466
M: Florian Fainelli <[email protected]>
24592467

drivers/net/dsa/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ config NET_DSA_BCM_SF2
2828
This enables support for the Broadcom Starfighter 2 Ethernet
2929
switch chips.
3030

31+
source "drivers/net/dsa/b53/Kconfig"
32+
3133
endmenu

drivers/net/dsa/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
22
obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
33
obj-$(CONFIG_NET_DSA_BCM_SF2) += bcm_sf2.o
4+
5+
obj-y += b53/

drivers/net/dsa/b53/Kconfig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
menuconfig B53
2+
tristate "Broadcom BCM53xx managed switch support"
3+
depends on NET_DSA
4+
help
5+
This driver adds support for Broadcom managed switch chips. It supports
6+
BCM5325E, BCM5365, BCM539x, BCM53115 and BCM53125 as well as BCM63XX
7+
integrated switches.
8+
9+
config B53_SPI_DRIVER
10+
tristate "B53 SPI connected switch driver"
11+
depends on B53 && SPI
12+
help
13+
Select to enable support for registering switches configured through SPI.
14+
15+
config B53_MDIO_DRIVER
16+
tristate "B53 MDIO connected switch driver"
17+
depends on B53
18+
help
19+
Select to enable support for registering switches configured through MDIO.
20+
21+
config B53_MMAP_DRIVER
22+
tristate "B53 MMAP connected switch driver"
23+
depends on B53 && HAS_IOMEM
24+
help
25+
Select to enable support for memory-mapped switches like the BCM63XX
26+
integrated switches.
27+
28+
config B53_SRAB_DRIVER
29+
tristate "B53 SRAB connected switch driver"
30+
depends on B53 && HAS_IOMEM
31+
help
32+
Select to enable support for memory-mapped Switch Register Access
33+
Bridge Registers (SRAB) like it is found on the BCM53010

drivers/net/dsa/b53/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
obj-$(CONFIG_B53) += b53_common.o
2+
3+
obj-$(CONFIG_B53_SPI_DRIVER) += b53_spi.o
4+
obj-$(CONFIG_B53_MDIO_DRIVER) += b53_mdio.o
5+
obj-$(CONFIG_B53_MMAP_DRIVER) += b53_mmap.o
6+
obj-$(CONFIG_B53_SRAB_DRIVER) += b53_srab.o

0 commit comments

Comments
 (0)