Branch data Line data Source code
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 : : NPA_ERR_HALO_INIT = -520, 18 : : NPA_ERR_HALO_FINI = -521, 19 : : NPA_ERR_DPC_ALLOC = -522, 20 : : NPA_ERR_DPC_FREE = -523, 21 : : }; 22 : : 23 : : struct npa_lf { 24 : : struct plt_intr_handle *intr_handle; 25 : : struct npa_aura_attr *aura_attr; 26 : : struct npa_aura_lim *aura_lim; 27 : : struct plt_pci_device *pci_dev; 28 : : struct plt_bitmap *npa_bmp; 29 : : struct mbox *mbox; 30 : : uint32_t stack_pg_ptrs; 31 : : uint32_t stack_pg_bytes; 32 : : uint16_t npa_msixoff; 33 : : bool zero_aura_rsvd; 34 : : void *npa_qint_mem; 35 : : void *npa_bmp_mem; 36 : : uint32_t nr_pools; 37 : : uint16_t pf_func; 38 : : uint8_t aura_sz; 39 : : uint32_t qints; 40 : : uintptr_t base; 41 : : 42 : : }; 43 : : 44 : : struct npa_qint { 45 : : struct npa_lf *lf; 46 : : uint8_t qintx; 47 : : }; 48 : : 49 : : struct npa_aura_lim { 50 : : uint64_t ptr_start; 51 : : uint64_t ptr_end; 52 : : }; 53 : : 54 : : struct npa_aura_attr { 55 : : int buf_type[ROC_NPA_BUF_TYPE_END]; 56 : : uint16_t ref_count; 57 : : uint64_t nix0_bpid; 58 : : uint64_t nix1_bpid; 59 : : uint64_t shift; 60 : : uint64_t limit; 61 : : uint8_t bp_ena; 62 : : bool halo; 63 : : union { 64 : : uint8_t bp; /* CN9K, CN10K */ 65 : : uint8_t bp_thresh[8]; /* CN20K */ 66 : : }; 67 : : }; 68 : : 69 : : struct dev; 70 : : 71 : : static inline struct npa * 72 : : roc_npa_to_npa_priv(struct roc_npa *roc_npa) 73 : : { 74 : 0 : return (struct npa *)&roc_npa->reserved[0]; 75 : : } 76 : : 77 : : /* NPA lf */ 78 : : int npa_lf_init(struct dev *dev, struct plt_pci_device *pci_dev); 79 : : int npa_lf_fini(void); 80 : : 81 : : /* IRQ */ 82 : : int npa_register_irqs(struct npa_lf *lf); 83 : : void npa_unregister_irqs(struct npa_lf *lf); 84 : : 85 : : #endif /* _ROC_NPA_PRIV_H_ */