184 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3==========================================4Broadcom RoboSwitch Ethernet switch driver5==========================================6 7The Broadcom RoboSwitch Ethernet switch family is used in quite a range of8xDSL router, cable modems and other multimedia devices.9 10The actual implementation supports the devices BCM5325E, BCM5365, BCM539x,11BCM53115 and BCM53125 as well as BCM63XX.12 13Implementation details14======================15 16The driver is located in ``drivers/net/dsa/b53/`` and is implemented as a17DSA driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the18subsystem and what it provides.19 20The switch is, if possible, configured to enable a Broadcom specific 4-bytes21switch tag which gets inserted by the switch for every packet forwarded to the22CPU interface, conversely, the CPU network interface should insert a similar23tag for packets entering the CPU port. The tag format is described in24``net/dsa/tag_brcm.c``.25 26The configuration of the device depends on whether or not tagging is27supported.28 29The interface names and example network configuration are used according the30configuration described in the :ref:`dsa-config-showcases`.31 32Configuration with tagging support33----------------------------------34 35The tagging based configuration is desired. It is not specific to the b5336DSA driver and will work like all DSA drivers which supports tagging.37 38See :ref:`dsa-tagged-configuration`.39 40Configuration without tagging support41-------------------------------------42 43Older models (5325, 5365) support a different tag format that is not supported44yet. 539x and 531x5 require managed mode and some special handling, which is45also not yet supported. The tagging support is disabled in these cases and the46switch need a different configuration.47 48The configuration slightly differ from the :ref:`dsa-vlan-configuration`.49 50The b53 tags the CPU port in all VLANs, since otherwise any PVID untagged51VLAN programming would basically change the CPU port's default PVID and make52it untagged, undesirable.53 54In difference to the configuration described in :ref:`dsa-vlan-configuration`55the default VLAN 1 has to be removed from the user interface configuration in56single port and gateway configuration, while there is no need to add an extra57VLAN configuration in the bridge showcase.58 59single port60~~~~~~~~~~~61The configuration can only be set up via VLAN tagging and bridge setup.62By default packages are tagged with vid 1:63 64.. code-block:: sh65 66 # tag traffic on CPU port67 ip link add link eth0 name eth0.1 type vlan id 168 ip link add link eth0 name eth0.2 type vlan id 269 ip link add link eth0 name eth0.3 type vlan id 370 71 # The conduit interface needs to be brought up before the user ports.72 ip link set eth0 up73 ip link set eth0.1 up74 ip link set eth0.2 up75 ip link set eth0.3 up76 77 # bring up the user interfaces78 ip link set wan up79 ip link set lan1 up80 ip link set lan2 up81 82 # create bridge83 ip link add name br0 type bridge84 85 # activate VLAN filtering86 ip link set dev br0 type bridge vlan_filtering 187 88 # add ports to bridges89 ip link set dev wan master br090 ip link set dev lan1 master br091 ip link set dev lan2 master br092 93 # tag traffic on ports94 bridge vlan add dev lan1 vid 2 pvid untagged95 bridge vlan del dev lan1 vid 196 bridge vlan add dev lan2 vid 3 pvid untagged97 bridge vlan del dev lan2 vid 198 99 # configure the VLANs100 ip addr add 192.0.2.1/30 dev eth0.1101 ip addr add 192.0.2.5/30 dev eth0.2102 ip addr add 192.0.2.9/30 dev eth0.3103 104 # bring up the bridge devices105 ip link set br0 up106 107 108bridge109~~~~~~110 111.. code-block:: sh112 113 # tag traffic on CPU port114 ip link add link eth0 name eth0.1 type vlan id 1115 116 # The conduit interface needs to be brought up before the user ports.117 ip link set eth0 up118 ip link set eth0.1 up119 120 # bring up the user interfaces121 ip link set wan up122 ip link set lan1 up123 ip link set lan2 up124 125 # create bridge126 ip link add name br0 type bridge127 128 # activate VLAN filtering129 ip link set dev br0 type bridge vlan_filtering 1130 131 # add ports to bridge132 ip link set dev wan master br0133 ip link set dev lan1 master br0134 ip link set dev lan2 master br0135 ip link set eth0.1 master br0136 137 # configure the bridge138 ip addr add 192.0.2.129/25 dev br0139 140 # bring up the bridge141 ip link set dev br0 up142 143gateway144~~~~~~~145 146.. code-block:: sh147 148 # tag traffic on CPU port149 ip link add link eth0 name eth0.1 type vlan id 1150 ip link add link eth0 name eth0.2 type vlan id 2151 152 # The conduit interface needs to be brought up before the user ports.153 ip link set eth0 up154 ip link set eth0.1 up155 ip link set eth0.2 up156 157 # bring up the user interfaces158 ip link set wan up159 ip link set lan1 up160 ip link set lan2 up161 162 # create bridge163 ip link add name br0 type bridge164 165 # activate VLAN filtering166 ip link set dev br0 type bridge vlan_filtering 1167 168 # add ports to bridges169 ip link set dev wan master br0170 ip link set eth0.1 master br0171 ip link set dev lan1 master br0172 ip link set dev lan2 master br0173 174 # tag traffic on ports175 bridge vlan add dev wan vid 2 pvid untagged176 bridge vlan del dev wan vid 1177 178 # configure the VLANs179 ip addr add 192.0.2.1/30 dev eth0.2180 ip addr add 192.0.2.129/25 dev br0181 182 # bring up the bridge devices183 ip link set br0 up184