raw/octeontx2_dma: update probe function
[dpdk.git] / drivers / raw / octeontx2_dma / otx2_dpi_rawdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef _DPI_RAWDEV_H_
6 #define _DPI_RAWDEV_H_
7
8 #define DPI_QUEUE_OPEN  0x1
9 #define DPI_QUEUE_CLOSE 0x2
10
11 /* DPI VF register offsets from VF_BAR0 */
12 #define DPI_VDMA_EN             (0x0)
13 #define DPI_VDMA_REQQ_CTL       (0x8)
14 #define DPI_VDMA_DBELL          (0x10)
15 #define DPI_VDMA_SADDR          (0x18)
16 #define DPI_VDMA_COUNTS         (0x20)
17 #define DPI_VDMA_NADDR          (0x28)
18 #define DPI_VDMA_IWBUSY         (0x30)
19 #define DPI_VDMA_CNT            (0x38)
20 #define DPI_VF_INT              (0x100)
21 #define DPI_VF_INT_W1S          (0x108)
22 #define DPI_VF_INT_ENA_W1C      (0x110)
23 #define DPI_VF_INT_ENA_W1S      (0x118)
24
25 #define DPI_MAX_VFS             8
26 #define DPI_DMA_CMD_SIZE        64
27 #define DPI_CHUNK_SIZE          1024
28 #define DPI_QUEUE_STOP          0x0
29 #define DPI_QUEUE_START         0x1
30
31 struct dpi_vf_s {
32         struct rte_pci_device *dev;
33         uint8_t state;
34         uint16_t vf_id;
35         uint8_t domain;
36         uintptr_t vf_bar0;
37         uintptr_t vf_bar2;
38
39         uint16_t pool_size_m1;
40         uint16_t index;
41         uint64_t *base_ptr;
42         void *chunk_pool;
43         struct otx2_mbox *mbox;
44 };
45
46 struct dpi_rawdev_conf_s {
47         void *chunk_pool;
48 };
49
50 enum dpi_dma_queue_result_e {
51         DPI_DMA_QUEUE_SUCCESS = 0,
52         DPI_DMA_QUEUE_NO_MEMORY = -1,
53         DPI_DMA_QUEUE_INVALID_PARAM = -2,
54 };
55
56 #endif /* _DPI_RAWDEV_H_ */