common/cnxk: add constants to EC groups
[dpdk.git] / drivers / common / cnxk / roc_sso_priv.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef _ROC_SSO_PRIV_H_
6 #define _ROC_SSO_PRIV_H_
7
8 struct sso_rsrc {
9         uint16_t rsrc_id;
10         uint64_t base;
11 };
12
13 struct sso {
14         struct plt_pci_device *pci_dev;
15         struct dev dev;
16         /* Interrupt handler args. */
17         struct sso_rsrc hws_rsrc[MAX_RVU_BLKLF_CNT];
18         struct sso_rsrc hwgrp_rsrc[MAX_RVU_BLKLF_CNT];
19         /* MSIX offsets */
20         uint16_t hws_msix_offset[MAX_RVU_BLKLF_CNT];
21         uint16_t hwgrp_msix_offset[MAX_RVU_BLKLF_CNT];
22         /* SSO link mapping. */
23         struct plt_bitmap **link_map;
24         void *link_map_mem;
25 } __plt_cache_aligned;
26
27 enum sso_err_status {
28         SSO_ERR_PARAM = -4096,
29 };
30
31 enum sso_lf_type {
32         SSO_LF_TYPE_HWS,
33         SSO_LF_TYPE_HWGRP,
34 };
35
36 static inline struct sso *
37 roc_sso_to_sso_priv(struct roc_sso *roc_sso)
38 {
39         return (struct sso *)&roc_sso->reserved[0];
40 }
41
42 /* SSO IRQ */
43 int sso_register_irqs_priv(struct roc_sso *roc_sso,
44                            struct plt_intr_handle *handle, uint16_t nb_hws,
45                            uint16_t nb_hwgrp);
46 void sso_unregister_irqs_priv(struct roc_sso *roc_sso,
47                               struct plt_intr_handle *handle, uint16_t nb_hws,
48                               uint16_t nb_hwgrp);
49
50 #endif /* _ROC_SSO_PRIV_H_ */