dma/dpaa2: add driver-specific configuration API
[dpdk.git] / drivers / dma / dpaa2 / rte_pmd_dpaa2_qdma.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2021-2022 NXP
3  */
4
5 #ifndef _RTE_PMD_DPAA2_QDMA_H_
6 #define _RTE_PMD_DPAA2_QDMA_H_
7
8 /** States if the source addresses is physical. */
9 #define RTE_DPAA2_QDMA_JOB_SRC_PHY              (1ULL << 30)
10
11 /** States if the destination addresses is physical. */
12 #define RTE_DPAA2_QDMA_JOB_DEST_PHY             (1ULL << 31)
13
14 struct rte_dpaa2_qdma_rbp {
15         uint32_t use_ultrashort:1;
16         uint32_t enable:1;
17         /**
18          * dportid:
19          * 0000 PCI-Express 1
20          * 0001 PCI-Express 2
21          * 0010 PCI-Express 3
22          * 0011 PCI-Express 4
23          * 0100 PCI-Express 5
24          * 0101 PCI-Express 6
25          */
26         uint32_t dportid:4;
27         uint32_t dpfid:2;
28         uint32_t dvfid:6;
29         /*using route by port for destination */
30         uint32_t drbp:1;
31         /**
32          * sportid:
33          * 0000 PCI-Express 1
34          * 0001 PCI-Express 2
35          * 0010 PCI-Express 3
36          * 0011 PCI-Express 4
37          * 0100 PCI-Express 5
38          * 0101 PCI-Express 6
39          */
40         uint32_t sportid:4;
41         uint32_t spfid:2;
42         uint32_t svfid:6;
43         /* using route by port for source */
44         uint32_t srbp:1;
45         uint32_t rsv:4;
46 };
47
48 /**
49  * @warning
50  * @b EXPERIMENTAL: this API may change without prior notice.
51  *
52  * Enable FD in Ultra Short format on a channel. This API should be
53  * called before calling 'rte_dma_vchan_setup()' API.
54  *
55  * @param dev_id
56  *   The identifier of the device.
57  * @param vchan
58  *   The identifier of virtual DMA channel.
59  */
60 __rte_experimental
61 void rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan);
62
63 /**
64  * @warning
65  * @b EXPERIMENTAL: this API may change without prior notice.
66  *
67  * Enable internal SG processing on a channel. This API should be
68  * called before calling 'rte_dma_vchan_setup()' API.
69  *
70  * @param dev_id
71  *   The identifier of the device.
72  * @param vchan
73  *   The identifier of virtual DMA channel.
74  */
75 __rte_experimental
76 void rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan);
77
78 /**
79  * @warning
80  * @b EXPERIMENTAL: this API may change without prior notice.
81  *
82  * Enable Route-by-port on a channel. This API should be
83  * called before calling 'rte_dma_vchan_setup()' API.
84  *
85  * @param dev_id
86  *   The identifier of the device.
87  * @param vchan
88  *   The identifier of virtual DMA channel.
89  * @param rbp_config
90  *   Configuration for route-by-port
91  */
92 __rte_experimental
93 void rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan,
94                 struct rte_dpaa2_qdma_rbp *rbp_config);
95
96 #endif /* _RTE_PMD_DPAA2_QDMA_H_ */