• Clément Léger's avatar
    net: ocelot: add FDMA support · 753a026c
    Clément Léger authored
    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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Co-developed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
    Signed-off-by: default avatarClément Léger <clement.leger@bootlin.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    753a026c
ocelot_fdma.c 22.3 KB