Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23c731e8 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'BCM53xx-driver'

Florian Fainelli says:

====================
net: dsa: Broadcom BCM53xx switches support

This patch series adds support for the Broadcom BCM53xx series aka RoboSwitches.

This driver is largely based on Jonas Gorski's b53 driver for OpenWrt which can
be found here:

https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/b53



a few bug fixes and DSA-ifycation later, here is what we got.

This has been successfully tested in the following configurations:

- Broadcom BCM53011 using the SRAB bus layer with 4 ports LAN, 1 port WAN

- A Broadcom BCM7445 device with an internal Starfighter 2 switch (bcm_sf2.c)
  and a Broadcom BCM53125 hanging off one of its ports connected via MDIO, creating
  two trees hanging off each other, and this works!

- A Broadcom BCM53125 MDIO connected to a Lamobo/Bananapi R1 board using the STMMAC
  MDIO driver

For now, we do not enable Broadcom tags, because there are different
generations of switches being supported which have different tag formats, but
the plan is to enable them later on.

Support for different HW features will be added later: EEE, Compact Field
Processor (TCAM) once this initial cut gets accepted.

Testing and bug reports welcome!
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 409a5f27 a2482d2c
Loading
Loading
Loading
Loading
+88 −0
Original line number Diff line number Diff line
Broadcom BCM53xx Ethernet switches
==================================

Required properties:

- compatible: For external switch chips, compatible string must be exactly one
  of: "brcm,bcm5325"
      "brcm,bcm53115"
      "brcm,bcm53125"
      "brcm,bcm53128"
      "brcm,bcm5365"
      "brcm,bcm5395"
      "brcm,bcm5397"
      "brcm,bcm5398"

  For the BCM5310x SoCs with an integrated switch, must be one of:
      "brcm,bcm53010-srab"
      "brcm,bcm53011-srab"
      "brcm,bcm53012-srab"
      "brcm,bcm53018-srab"
      "brcm,bcm53019-srab" and the mandatory "brcm,bcm5301x-srab" string

  For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
      "brcm,bcm3384-switch"
      "brcm,bcm6328-switch"
      "brcm,bcm6368-switch" and the mandatory "brcm,bcm63xx-switch"

See Documentation/devicetree/bindings/dsa/dsa.txt for a list of additional
required and optional properties.

Examples:

Ethernet switch connected via MDIO to the host, CPU port wired to eth0:

	eth0: ethernet@10001000 {
		compatible = "brcm,unimac";
		reg = <0x10001000 0x1000>;

		fixed-link {
			speed = <1000>;
			duplex-full;
		};
	};

	mdio0: mdio@10000000 {
		compatible = "brcm,unimac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		switch0: ethernet-switch@30 {
			compatible = "brcm,bcm53125";
			#address-cells = <1>;
			#size-cells = <0>;

			ports {
				port0@0 {
					reg = <0>;
					label = "lan1";
				};

				port1@1 {
					reg = <1>;
					label = "lan2";
				};

				port5@5 {
					reg = <5>;
					label = "cable-modem";
					fixed-link {
						speed = <1000>;
						duplex-full;
					};
					phy-mode = "rgmii-txid";
				};

				port8@8 {
					reg = <8>;
					label = "cpu";
					fixed-link {
						speed = <1000>;
						duplex-full;
					};
					phy-mode = "rgmii-txid";
					ethernet = <&eth0>;
				};
			};
		};
	};
+8 −0
Original line number Diff line number Diff line
@@ -2454,6 +2454,14 @@ L: netdev@vger.kernel.org
S:	Supported
F:	drivers/net/ethernet/broadcom/b44.*

BROADCOM B53 ETHERNET SWITCH DRIVER
M:	Florian Fainelli <f.fainelli@gmail.com>
L:	netdev@vger.kernel.org
L:	openwrt-devel@lists.openwrt.org (subscribers-only)
S:	Supported
F:	drivers/net/dsa/b53/*
F:	include/linux/platform_data/b53.h

BROADCOM GENET ETHERNET DRIVER
M:	Florian Fainelli <f.fainelli@gmail.com>
L:	netdev@vger.kernel.org
+2 −0
Original line number Diff line number Diff line
@@ -28,4 +28,6 @@ config NET_DSA_BCM_SF2
	  This enables support for the Broadcom Starfighter 2 Ethernet
	  switch chips.

source "drivers/net/dsa/b53/Kconfig"

endmenu
+2 −0
Original line number Diff line number Diff line
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
obj-$(CONFIG_NET_DSA_BCM_SF2)	+= bcm_sf2.o

obj-y				+= b53/
+33 −0
Original line number Diff line number Diff line
menuconfig B53
	tristate "Broadcom BCM53xx managed switch support"
	depends on NET_DSA
	help
	  This driver adds support for Broadcom managed switch chips. It supports
	  BCM5325E, BCM5365, BCM539x, BCM53115 and BCM53125 as well as BCM63XX
	  integrated switches.

config B53_SPI_DRIVER
	tristate "B53 SPI connected switch driver"
	depends on B53 && SPI
	help
	  Select to enable support for registering switches configured through SPI.

config B53_MDIO_DRIVER
	tristate "B53 MDIO connected switch driver"
	depends on B53
	help
	  Select to enable support for registering switches configured through MDIO.

config B53_MMAP_DRIVER
	tristate "B53 MMAP connected switch driver"
	depends on B53 && HAS_IOMEM
	help
	  Select to enable support for memory-mapped switches like the BCM63XX
	  integrated switches.

config B53_SRAB_DRIVER
	tristate "B53 SRAB connected switch driver"
	depends on B53 && HAS_IOMEM
	help
	  Select to enable support for memory-mapped Switch Register Access
	  Bridge Registers (SRAB) like it is found on the BCM53010
Loading