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

Commit 0ce4866f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sf2'



Florian Fainelli says:

====================
dsa: Broadcom Starfighter 2 switch support

This patch series adds support for the Broadcom Starfighter 2 (Roboswitch
successor) using the existing DSA infrastructure. This integrated switch
is heavily used in Set Top Box, Cable gateways and DSL gateways products
from Broadcom, and to a larger extent the new ARM-based Wi-Fi routers although
slightly differently.

Changes in v5 are the introduction of ETH_P_XDSA as suggested by Alexander to
help capture applications see this is a multiplexed DSA approach now.

Changes in v4 are the introducing of an indirection level for DSA switch tag
protocols receive and transmit functions.

I intentionnaly did not address one comment from Alexander who suggested to
move port_names and port_dn in a separate structure since that involves
touching arch/arm/ and arch/blackfin/ code which I am not yet comfortable
doing.

Notable changes in v3 is the preliminary patch that reworks the skb->protocol
override helpers for non-Ethertype switch tags, based on feedback from
Alexander Duyck.

The biggest changes from v1 of this patch series are:

- use the new fixed PHY helpers
- improved the switch driver with more complete features (interrupts,
  (RG)MII configuration, memory arrays power down/up, port disabling/enable
  VLAN separation

Future work will focus on bringing the upstream driver in feature parity with
the current downstream driver, including:

- adding Wake-on-LAN support to the switch
- adding suspend/resume callbacks for S2/S3 Power Management modes
- extending the switch register interface to cover BCM5310X SoCs
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents abc4da45 879bd83d
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
* Broadcom UniMAC MDIO bus controller

Required properties:
- compatible: should one from "brcm,genet-mdio-v1", "brcm,genet-mdio-v2",
  "brcm,genet-mdio-v3", "brcm,genet-mdio-v4" or "brcm,unimac-mdio"
- reg: address and length of the regsiter set for the device, first one is the
  base register, and the second one is optional and for indirect accesses to
  larger than 16-bits MDIO transactions
- reg-names: name(s) of the register must be "mdio" and optional "mdio_indir_rw"
- #size-cells: must be 1
- #address-cells: must be 0

Optional properties:
- interrupts: must be one if the interrupt is shared with the Ethernet MAC or
  Ethernet switch this MDIO block is integrated from, or must be two, if there
  are two separate interrupts, first one must be "mdio done" and second must be
  for "mdio error"
- interrupt-names: must be "mdio_done_error" when there is a share interrupt fed
  to this hardware block, or must be "mdio_done" for the first interrupt and
  "mdio_error" for the second when there are separate interrupts

Child nodes of this MDIO bus controller node are standard Ethernet PHY device
nodes as described in Documentation/devicetree/bindings/net/phy.txt

Example:

mdio@403c0 {
	compatible = "brcm,unimac-mdio";
	reg = <0x403c0 0x8 0x40300 0x18>;
	reg-names = "mdio", "mdio_indir_rw";
	#size-cells = <1>;
	#address-cells = <0>;

	...
	phy@0 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <0>;
	};
};
+78 −0
Original line number Diff line number Diff line
* Broadcom Starfighter 2 integrated swich

Required properties:

- compatible: should be "brcm,bcm7445-switch-v4.0"
- reg: addresses and length of the register sets for the device, must be 6
  pairs of register addresses and lengths
- interrupts: interrupts for the devices, must be two interrupts
- dsa,mii-bus: phandle to the MDIO bus controller, see dsa/dsa.txt
- dsa,ethernet: phandle to the CPU network interface controller, see dsa/dsa.txt
- #size-cells: must be 0
- #address-cells: must be 2, see dsa/dsa.txt

Subnodes:

The integrated switch subnode should be specified according to the binding
described in dsa/dsa.txt.

Optional properties:

- reg-names: litteral names for the device base register addresses, when present
  must be: "core", "reg", "intrl2_0", "intrl2_1", "fcb", "acb"

- interrupt-names: litternal names for the device interrupt lines, when present
  must be: "switch_0" and "switch_1"

- brcm,num-gphy: specify the maximum number of integrated gigabit PHYs in the
  switch

- brcm,num-rgmii-ports: specify the maximum number of RGMII interfaces supported
  by the switch

- brcm,fcb-pause-override: boolean property, if present indicates that the switch
  supports Failover Control Block pause override capability

- brcm,acb-packets-inflight: boolean property, if present indicates that the switch
  Admission Control Block supports reporting the number of packets in-flight in a
  switch queue

Example:

switch_top@f0b00000 {
	compatible = "simple-bus";
	#size-cells = <1>;
	#address-cells = <1>;
	ranges = <0 0xf0b00000 0x40804>;

	ethernet_switch@0 {
		compatible = "brcm,bcm7445-switch-v4.0";
		#size-cells = <0>;
		#address-cells = <2>;
		reg = <0x0 0x40000
			0x40000 0x110
			0x40340 0x30
			0x40380 0x30
			0x40400 0x34
			0x40600 0x208>;
		interrupts = <0 0x18 0
				0 0x19 0>;
		brcm,num-gphy = <1>;
		brcm,num-rgmii-ports = <2>;
		brcm,fcb-pause-override;
		brcm,acb-packets-inflight;

		...
		switch@0 {
			reg = <0 0>;
			#size-cells = <0>;
			#address-cells <1>;

			port@0 {
				label = "gphy";
				reg = <0>;
			};
			...
		};
	};
};
+17 −0
Original line number Diff line number Diff line
@@ -39,6 +39,22 @@ Optionnal property:
			  This property is only used when switches are being
			  chained/cascaded together.

- phy-handle		: Phandle to a PHY on an external MDIO bus, not the
			  switch internal one. See
			  Documentation/devicetree/bindings/net/ethernet.txt
			  for details.

- phy-mode		: String representing the connection to the designated
			  PHY node specified by the 'phy-handle' property. See
			  Documentation/devicetree/bindings/net/ethernet.txt
			  for details.

Optional subnodes:
- fixed-link		: Fixed-link subnode describing a link to a non-MDIO
			  managed entity. See
			  Documentation/devicetree/bindings/net/fixed-link.txt
			  for details.

Example:

	dsa@0 {
@@ -58,6 +74,7 @@ Example:
			port@0 {
				reg = <0>;
				label = "lan1";
				phy-handle = <&phy0>;
			};

			port@1 {
+11 −0
Original line number Diff line number Diff line
@@ -36,4 +36,15 @@ config NET_DSA_MV88E6123_61_65
	  This enables support for the Marvell 88E6123/6161/6165
	  ethernet switch chips.

config NET_DSA_BCM_SF2
	tristate "Broadcom Starfighter 2 Ethernet switch support"
	select NET_DSA
	select NET_DSA_TAG_BRCM
	select FIXED_PHY if NET_DSA_BCM_SF2=y
	select BCM7XXX_PHY
	select MDIO_BCM_UNIMAC
	---help---
	  This enables support for the Broadcom Starfighter 2 Ethernet
	  switch chips.

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -7,3 +7,4 @@ endif
ifdef CONFIG_NET_DSA_MV88E6131
mv88e6xxx_drv-y += mv88e6131.o
endif
obj-$(CONFIG_NET_DSA_BCM_SF2)	+= bcm_sf2.o
Loading