linux/drivers/net/ethernet/microchip
Steen Hegelund 10615907e9 net: sparx5: switchdev: adding frame DMA functionality
This add frame DMA functionality to the Sparx5 platform.

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 implements two extraction channels, one per switch core port
towards the VCore CPU system and a total of six injection channels.
Extraction channels are mapped one-to-one to the CPU ports, while injection
channels can be individually assigned to any CPU port.

- FDMA channel 0 through 5 corresponds to CPU port 0 injection direction
  FDMA_CH_CFG[channel].CH_INJ_PORT is set to 0.
- FDMA channel 0 through 5 corresponds to CPU port 1 injection direction when
  FDMA_CH_CFG[channel].CH_INJ_PORT is set to 1.
- FDMA channel 6 corresponds to CPU port 0 extraction direction.
- FDMA channel 7 corresponds to CPU port 1 extraction direction.

The FDMA implements a strict priority scheme among channels. Extraction
channels are prioritized over injection channels and secondarily channels
with higher channel number are prioritized over channels with lower number.
On the other hand, ports are being served on an equal-bandwidth principle
both on injection and extraction directions.  The equal-bandwidth principle
will not force an equal bandwidth. Instead, it ensures that the ports
perform at their best considering the operating conditions.

When more than one injection channel is enabled for injection on the same
CPU port, priority determines which channel can inject data. Ownership
is re-arbitrated on frame boundaries.

The FDMA processes linked lists of DMA Control Block Structures (DCBs). The
DCBs have the same basic structure for both injection and extraction. A DCB
must be placed on a 64-bit word-aligned address in memory. Each DCB has a
per-channel configurable amount of associated data blocks in memory, where
the frame data is stored.

The data blocks that are used by extraction channels must be placed on
64-bit word aligned addresses in memory, and their length must be a
multiple of 128 bytes.

A DCB carries the pointer to the next DCB of the linked list, the INFO word
which holds information for the DCB, and a pair of status word and memory
pointer for every data block that it is associated with.

Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-20 14:28:55 +01:00
..
sparx5 net: sparx5: switchdev: adding frame DMA functionality 2021-08-20 14:28:55 +01:00
enc28j60_hw.h
enc28j60.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
encx24j600_hw.h net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
encx24j600-regmap.c drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
encx24j600.c net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
lan743x_ethtool.c lan743x: remove redundant intializations of pointers adapter and phydev 2021-03-29 10:56:41 -07:00
lan743x_ethtool.h
lan743x_main.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
lan743x_main.h lan743x: boost performance on cpu archs w/o dma cache snooping 2021-02-16 15:08:48 -08:00
lan743x_ptp.c lan743x: Added fixed link and RGMII support 2020-06-01 11:51:17 -07:00
lan743x_ptp.h Support LAN743x PTP periodic output on any GPIO 2019-11-11 12:46:56 -08:00
Makefile net: sparx5: add the basic sparx5 driver 2021-06-24 11:28:12 -07:00