New upstream version 18.02
[deb_dpdk.git] / drivers / bus / fslmc / fslmc_vfio.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
4  *   Copyright 2016 NXP
5  *
6  */
7
8 #ifndef _FSLMC_VFIO_H_
9 #define _FSLMC_VFIO_H_
10
11 #include <rte_vfio.h>
12
13 #include "eal_vfio.h"
14
15 #define DPAA2_MC_DPNI_DEVID     7
16 #define DPAA2_MC_DPSECI_DEVID   3
17 #define DPAA2_MC_DPCON_DEVID    5
18 #define DPAA2_MC_DPIO_DEVID     9
19 #define DPAA2_MC_DPBP_DEVID     10
20 #define DPAA2_MC_DPCI_DEVID     11
21
22 typedef struct fslmc_vfio_device {
23         int fd; /* fslmc root container device ?? */
24         int index; /*index of child object */
25         struct fslmc_vfio_device *child; /* Child object */
26 } fslmc_vfio_device;
27
28 typedef struct fslmc_vfio_group {
29         int fd; /* /dev/vfio/"groupid" */
30         int groupid;
31         struct fslmc_vfio_container *container;
32         int object_index;
33         struct fslmc_vfio_device *vfio_device;
34 } fslmc_vfio_group;
35
36 typedef struct fslmc_vfio_container {
37         int fd; /* /dev/vfio/vfio */
38         int used;
39         int index; /* index in group list */
40         struct fslmc_vfio_group *group;
41 } fslmc_vfio_container;
42
43 int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index);
44 int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index);
45
46 int rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle,
47                               int vfio_dev_fd,
48                               int num_irqs);
49
50 int fslmc_vfio_setup_group(void);
51 int fslmc_vfio_process_group(void);
52 char *fslmc_get_container(void);
53 int fslmc_get_container_group(int *gropuid);
54 int rte_fslmc_vfio_dmamap(void);
55
56 #endif /* _FSLMC_VFIO_H_ */