]> git.baikalelectronics.ru Git - kernel.git/commit
net: ocelot: add FDMA support
authorClément Léger <clement.leger@bootlin.com>
Thu, 9 Dec 2021 15:49:11 +0000 (16:49 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Dec 2021 04:56:58 +0000 (20:56 -0800)
commitb4a62dcb03a4bd7405efdb938c36d8e2858ba23d
tree77627e06c25eebfc50e4bbcc05d7a3c1cbb160fc
parent97f726676d01090bdd021f2cde5ab649909e074a
net: ocelot: add FDMA support

Ethernet frames can be extracted or injected autonomously to or from
the device’s DDR3/DDR3L memory and/or PCIe memory space. Linked list
data structures in memory are used for injecting or extracting Ethernet
frames. The FDMA generates interrupts when frame extraction or
injection is done and when the linked lists need updating.

The FDMA is shared between all the ethernet ports of the switch and
uses a linked list of descriptors (DCB) to inject and extract packets.
Before adding descriptors, the FDMA channels must be stopped. It would
be inefficient to do that each time a descriptor would be added so the
channels are restarted only once they stopped.

Both channels uses ring-like structure to feed the DCBs to the FDMA.
head and tail are never touched by hardware and are completely handled
by the driver. On top of that, page recycling has been added and is
mostly taken from gianfar driver.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Co-developed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/Makefile
drivers/net/ethernet/mscc/ocelot_fdma.c [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_fdma.h [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_net.c
drivers/net/ethernet/mscc/ocelot_vsc7514.c
include/soc/mscc/ocelot.h