net: marvell: prestera: Add driver for Prestera family ASIC devices
authorVadym Kochan <vadym.kochan@plvision.eu>
Wed, 16 Sep 2020 16:30:57 +0000 (19:30 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Sep 2020 23:35:46 +0000 (16:35 -0700)
commit501ef3066c89d7f9045315e1be58749cf9e6814d
tree5b050dac6a4eafa7c2bd93774d44c15f384a6a80
parent5114b331051981ecbdf144b5ad33387ae8d0f0d5
net: marvell: prestera: Add driver for Prestera family ASIC devices

Marvell Prestera 98DX326x integrates up to 24 ports of 1GbE with 8
ports of 10GbE uplinks or 2 ports of 40Gbps stacking for a largely
wireless SMB deployment.

The current implementation supports only boards designed for the Marvell
Switchdev solution and requires special firmware.

The core Prestera switching logic is implemented in prestera_main.c,
there is an intermediate hw layer between core logic and firmware. It is
implemented in prestera_hw.c, the purpose of it is to encapsulate hw
related logic, in future there is a plan to support more devices with
different HW related configurations.

This patch contains only basic switch initialization and RX/TX support
over SDMA mechanism.

Currently supported devices have DMA access range <= 32bit and require
ZONE_DMA to be enabled, for such cases SDMA driver checks if the skb
allocated in proper range supported by the Prestera device.

Also meanwhile there is no TX interrupt support in current firmware
version so recycling work is scheduled on each xmit.

Port's mac address is generated from the switch base mac which may be
provided via device-tree (static one or as nvme cell), or randomly
generated. This is required by the firmware.

Co-developed-by: Andrii Savka <andrii.savka@plvision.eu>
Signed-off-by: Andrii Savka <andrii.savka@plvision.eu>
Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Co-developed-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Co-developed-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Signed-off-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Co-developed-by: Taras Chornyi <taras.chornyi@plvision.eu>
Signed-off-by: Taras Chornyi <taras.chornyi@plvision.eu>
Co-developed-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 files changed:
drivers/net/ethernet/marvell/Kconfig
drivers/net/ethernet/marvell/Makefile
drivers/net/ethernet/marvell/prestera/Kconfig [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/Makefile [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera.h [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_dsa.c [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_dsa.h [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_hw.c [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_hw.h [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_main.c [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_rxtx.c [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_rxtx.h [new file with mode: 0644]