]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | /* SPDX-License-Identifier: BSD-3-Clause |
2 | * | |
3 | * Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved. | |
f67539c2 | 4 | * Copyright 2016,2019 NXP |
11fdf7f2 TL |
5 | * |
6 | */ | |
7 | ||
8 | #ifndef _FSLMC_VFIO_H_ | |
9 | #define _FSLMC_VFIO_H_ | |
10 | ||
f67539c2 | 11 | #include <rte_compat.h> |
11fdf7f2 TL |
12 | #include <rte_vfio.h> |
13 | ||
f67539c2 TL |
14 | /* Pathname of FSL-MC devices directory. */ |
15 | #define SYSFS_FSL_MC_DEVICES "/sys/bus/fsl-mc/devices" | |
11fdf7f2 TL |
16 | #define DPAA2_MC_DPNI_DEVID 7 |
17 | #define DPAA2_MC_DPSECI_DEVID 3 | |
18 | #define DPAA2_MC_DPCON_DEVID 5 | |
19 | #define DPAA2_MC_DPIO_DEVID 9 | |
20 | #define DPAA2_MC_DPBP_DEVID 10 | |
21 | #define DPAA2_MC_DPCI_DEVID 11 | |
22 | ||
23 | typedef struct fslmc_vfio_device { | |
24 | int fd; /* fslmc root container device ?? */ | |
25 | int index; /*index of child object */ | |
26 | struct fslmc_vfio_device *child; /* Child object */ | |
27 | } fslmc_vfio_device; | |
28 | ||
29 | typedef struct fslmc_vfio_group { | |
30 | int fd; /* /dev/vfio/"groupid" */ | |
31 | int groupid; | |
32 | struct fslmc_vfio_container *container; | |
33 | int object_index; | |
34 | struct fslmc_vfio_device *vfio_device; | |
35 | } fslmc_vfio_group; | |
36 | ||
37 | typedef struct fslmc_vfio_container { | |
38 | int fd; /* /dev/vfio/vfio */ | |
39 | int used; | |
40 | int index; /* index in group list */ | |
41 | struct fslmc_vfio_group *group; | |
42 | } fslmc_vfio_container; | |
43 | ||
f67539c2 TL |
44 | extern char *fslmc_container; |
45 | ||
46 | __rte_internal | |
11fdf7f2 | 47 | int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index); |
f67539c2 TL |
48 | |
49 | __rte_internal | |
11fdf7f2 TL |
50 | int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index); |
51 | ||
52 | int rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle, | |
53 | int vfio_dev_fd, | |
54 | int num_irqs); | |
55 | ||
56 | int fslmc_vfio_setup_group(void); | |
57 | int fslmc_vfio_process_group(void); | |
58 | char *fslmc_get_container(void); | |
59 | int fslmc_get_container_group(int *gropuid); | |
60 | int rte_fslmc_vfio_dmamap(void); | |
f67539c2 TL |
61 | __rte_experimental |
62 | int rte_fslmc_vfio_mem_dmamap(uint64_t vaddr, uint64_t iova, uint64_t size); | |
11fdf7f2 TL |
63 | |
64 | #endif /* _FSLMC_VFIO_H_ */ |