OSDN Git Service

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)
commit753a026cfec1429c9e32e004ae4d4c2727cc0111
tree77627e06c25eebfc50e4bbcc05d7a3c1cbb160fc
parentde5841e1c93f2275bb73c471255b718b5ec2f0ec
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