xref: /dpdk/drivers/common/cnxk/roc_npa_priv.h (revision e67f633e)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4 
5 #ifndef _ROC_NPA_PRIV_H_
6 #define _ROC_NPA_PRIV_H_
7 
8 enum npa_error_status {
9 	NPA_ERR_PARAM = -512,
10 	NPA_ERR_ALLOC = -513,
11 	NPA_ERR_INVALID_BLOCK_SZ = -514,
12 	NPA_ERR_AURA_ID_ALLOC = -515,
13 	NPA_ERR_AURA_POOL_INIT = -516,
14 	NPA_ERR_AURA_POOL_FINI = -517,
15 	NPA_ERR_BASE_INVALID = -518,
16 	NPA_ERR_DEVICE_NOT_BOUNDED = -519,
17 };
18 
19 struct npa_lf {
20 	struct plt_intr_handle *intr_handle;
21 	struct npa_aura_lim *aura_lim;
22 	struct plt_pci_device *pci_dev;
23 	struct plt_bitmap *npa_bmp;
24 	struct mbox *mbox;
25 	uint32_t stack_pg_ptrs;
26 	uint32_t stack_pg_bytes;
27 	uint16_t npa_msixoff;
28 	void *npa_qint_mem;
29 	void *npa_bmp_mem;
30 	uint32_t nr_pools;
31 	uint16_t pf_func;
32 	uint8_t aura_sz;
33 	uint32_t qints;
34 	uintptr_t base;
35 };
36 
37 struct npa_qint {
38 	struct npa_lf *lf;
39 	uint8_t qintx;
40 };
41 
42 struct npa_aura_lim {
43 	uint64_t ptr_start;
44 	uint64_t ptr_end;
45 };
46 
47 struct dev;
48 
49 static inline struct npa *
roc_npa_to_npa_priv(struct roc_npa * roc_npa)50 roc_npa_to_npa_priv(struct roc_npa *roc_npa)
51 {
52 	return (struct npa *)&roc_npa->reserved[0];
53 }
54 
55 /* NPA lf */
56 int npa_lf_init(struct dev *dev, struct plt_pci_device *pci_dev);
57 int npa_lf_fini(void);
58 
59 /* IRQ */
60 int npa_register_irqs(struct npa_lf *lf);
61 void npa_unregister_irqs(struct npa_lf *lf);
62 
63 #endif /* _ROC_NPA_PRIV_H_ */
64