Skip to content

Commit

Permalink
Documentation: net: dsa: transition to the rst format
Browse files Browse the repository at this point in the history
This patch also performs some minor adjustments such as numbering for
the receive path sequence, conversion of keywords to inline literals and
adding an index page so it looks better in the output of 'make htmldocs'.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ioana Ciornei authored and David S. Miller committed Apr 12, 2019
1 parent 056b21f commit 3c91d11
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 154 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
=============================================
Broadcom Starfighter 2 Ethernet switch driver
=============================================

Expand Down Expand Up @@ -25,27 +26,27 @@ are connected at a lower speed.
The switch hardware block is typically interfaced using MMIO accesses and
contains a bunch of sub-blocks/registers:

* SWITCH_CORE: common switch registers
* SWITCH_REG: external interfaces switch register
* SWITCH_MDIO: external MDIO bus controller (there is another one in SWITCH_CORE,
- ``SWITCH_CORE``: common switch registers
- ``SWITCH_REG``: external interfaces switch register
- ``SWITCH_MDIO``: external MDIO bus controller (there is another one in SWITCH_CORE,
which is used for indirect PHY accesses)
* SWITCH_INDIR_RW: 64-bits wide register helper block
* SWITCH_INTRL2_0/1: Level-2 interrupt controllers
* SWITCH_ACB: Admission control block
* SWITCH_FCB: Fail-over control block
- ``SWITCH_INDIR_RW``: 64-bits wide register helper block
- ``SWITCH_INTRL2_0/1``: Level-2 interrupt controllers
- ``SWITCH_ACB``: Admission control block
- ``SWITCH_FCB``: Fail-over control block

Implementation details
======================

The driver is located in drivers/net/dsa/bcm_sf2.c and is implemented as a DSA
driver; see Documentation/networking/dsa/dsa.txt for details on the subsystem
The driver is located in ``drivers/net/dsa/bcm_sf2.c`` and is implemented as a DSA
driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the subsystem
and what it provides.

The SF2 switch is configured to enable a Broadcom specific 4-bytes switch tag
which gets inserted by the switch for every packet forwarded to the CPU
interface, conversely, the CPU network interface should insert a similar tag for
packets entering the CPU port. The tag format is described in
net/dsa/tag_brcm.c.
``net/dsa/tag_brcm.c``.

Overall, the SF2 driver is a fairly regular DSA driver; there are a few
specifics covered below.
Expand All @@ -54,7 +55,7 @@ Device Tree probing
-------------------

The DSA platform device driver is probed using a specific compatible string
provided in net/dsa/dsa.c. The reason for that is because the DSA subsystem gets
provided in ``net/dsa/dsa.c``. The reason for that is because the DSA subsystem gets
registered as a platform device driver currently. DSA will provide the needed
device_node pointers which are then accessible by the switch driver setup
function to setup resources such as register ranges and interrupts. This
Expand All @@ -70,7 +71,7 @@ Broadcom switches connected to a SF2 require the use of the DSA slave MDIO bus
in order to properly configure them. By default, the SF2 pseudo-PHY address, and
an external switch pseudo-PHY address will both be snooping for incoming MDIO
transactions, since they are at the same address (30), resulting in some kind of
"double" programming. Using DSA, and setting ds->phys_mii_mask accordingly, we
"double" programming. Using DSA, and setting ``ds->phys_mii_mask`` accordingly, we
selectively divert reads and writes towards external Broadcom switches
pseudo-PHY addresses. Newer revisions of the SF2 hardware have introduced a
configurable pseudo-PHY address which circumvents the initial design limitation.
Expand All @@ -86,7 +87,7 @@ firmware gets reloaded. The SF2 driver relies on such events to properly set its
MoCA interface carrier state and properly report this to the networking stack.

The MoCA interfaces are supported using the PHY library's fixed PHY/emulated PHY
device and the switch driver registers a fixed_link_update callback for such
device and the switch driver registers a ``fixed_link_update`` callback for such
PHYs which reflects the link state obtained from the interrupt handler.


Expand Down
Loading

0 comments on commit 3c91d11

Please sign in to comment.