Skip to content

Commit 5f67eef

Browse files
Vamsi Attunurugregkh
authored andcommitted
misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver
Adds a misc driver for Marvell CN10K DPI(DMA Engine) device's physical function which initializes DPI DMA hardware's global configuration and enables hardware mailbox channels between physical function (PF) and it's virtual functions (VF). VF device drivers (User space drivers) use this hw mailbox to communicate any required device configuration on it's respective VF device. Accordingly, this DPI PF driver provisions the VF device resources. At the hardware level, the DPI physical function (PF) acts as a management interface to setup the VF device resources, VF devices are only provisioned to handle or control the actual DMA Engine's data transfer capabilities. Signed-off-by: Vamsi Attunuru <[email protected]> Reviewed-by: Srujana Challa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e56af94 commit 5f67eef

File tree

9 files changed

+796
-0
lines changed

9 files changed

+796
-0
lines changed

Documentation/misc-devices/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fit into other categories.
2121
isl29003
2222
lis3lv02d
2323
max6875
24+
mrvl_cn10k_dpi
2425
oxsemi-tornado
2526
pci-endpoint-test
2627
spear-pcie-gadget
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===============================================
4+
Marvell CN10K DMA packet interface (DPI) driver
5+
===============================================
6+
7+
Overview
8+
========
9+
10+
DPI is a DMA packet interface hardware block in Marvell's CN10K silicon.
11+
DPI hardware comprises a physical function (PF), its virtual functions,
12+
mailbox logic, and a set of DMA engines & DMA command queues.
13+
14+
DPI PF function is an administrative function which services the mailbox
15+
requests from its VF functions and provisions DMA engine resources to
16+
it's VF functions.
17+
18+
mrvl_cn10k_dpi.ko misc driver loads on DPI PF device and services the
19+
mailbox commands submitted by the VF devices and accordingly initializes
20+
the DMA engines and VF device's DMA command queues. Also, driver creates
21+
/dev/mrvl-cn10k-dpi node to set DMA engine and PEM (PCIe interface) port
22+
attributes like fifo length, molr, mps & mrrs.
23+
24+
DPI PF driver is just an administrative driver to setup its VF device's
25+
queues and provisions the hardware resources, it cannot initiate any
26+
DMA operations. Only VF devices are provisioned with DMA capabilities.
27+
28+
Driver location
29+
===============
30+
31+
drivers/misc/mrvl_cn10k_dpi.c
32+
33+
Driver IOCTLs
34+
=============
35+
36+
:c:macro::`DPI_MPS_MRRS_CFG`
37+
ioctl that sets max payload size & max read request size parameters of
38+
a pem port to which DMA engines are wired.
39+
40+
41+
:c:macro::`DPI_ENGINE_CFG`
42+
ioctl that sets DMA engine's fifo sizes & max outstanding load request
43+
thresholds.
44+
45+
User space code example
46+
=======================
47+
48+
DPI VF devices are probed and accessed from user space applications using
49+
vfio-pci driver. Below is a sample dpi dma application to demonstrate on
50+
how applications use mailbox and ioctl services from DPI PF kernel driver.
51+
52+
https://github.com/MarvellEmbeddedProcessors/dpi-sample-app

Documentation/userspace-api/ioctl/ioctl-number.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ Code Seq# Include File Comments
362362
0xB6 all linux/fpga-dfl.h
363363
0xB7 all uapi/linux/remoteproc_cdev.h <mailto:[email protected]>
364364
0xB7 all uapi/linux/nsfs.h <mailto:Andrei Vagin <[email protected]>>
365+
0xB8 01-02 uapi/misc/mrvl_cn10k_dpi.h Marvell CN10K DPI driver
365366
0xC0 00-0F linux/usb/iowarrior.h
366367
0xCA 00-0F uapi/misc/cxl.h
367368
0xCA 10-2F uapi/misc/ocxl.h

MAINTAINERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13477,6 +13477,11 @@ S: Supported
1347713477
F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml
1347813478
F: drivers/mmc/host/sdhci-xenon*
1347913479

13480+
MARVELL OCTEON CN10K DPI DRIVER
13481+
M: Vamsi Attunuru <[email protected]>
13482+
S: Supported
13483+
F: drivers/misc/mrvl_cn10k_dpi.c
13484+
1348013485
MATROX FRAMEBUFFER DRIVER
1348113486
1348213487
S: Orphan

drivers/misc/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,20 @@ config NSM
585585
To compile this driver as a module, choose M here.
586586
The module will be called nsm.
587587

588+
config MARVELL_CN10K_DPI
589+
tristate "Octeon CN10K DPI driver"
590+
depends on PCI
591+
help
592+
Enables Octeon CN10K DMA packet interface (DPI) driver which
593+
intializes DPI hardware's physical function (PF) device's
594+
global configuration and its virtual function (VFs) resource
595+
configuration to enable DMA transfers. DPI PF device does not
596+
have any data movement functionality, it only serves VF's
597+
resource configuration requests.
598+
599+
To compile this driver as a module, choose M here: the module
600+
will be called mrvl_cn10k_dpi.
601+
588602
source "drivers/misc/c2port/Kconfig"
589603
source "drivers/misc/eeprom/Kconfig"
590604
source "drivers/misc/cb710/Kconfig"

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o
6969
obj-$(CONFIG_TPS6594_ESM) += tps6594-esm.o
7070
obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o
7171
obj-$(CONFIG_NSM) += nsm.o
72+
obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o
7273
obj-y += keba/

drivers/misc/Makefile.rej

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--- drivers/misc/Makefile
2+
+++ drivers/misc/Makefile
3+
@@ -69,3 +69,4 @@ obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o
4+
obj-$(CONFIG_TPS6594_ESM) += tps6594-esm.o
5+
obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o
6+
obj-$(CONFIG_NSM) += nsm.o
7+
+obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o

0 commit comments

Comments
 (0)