xref: /dpdk/drivers/common/nfp/nfp_dev.h (revision 4967a1c8224286072ba4d72d3463ceca253bedd5)
1*4967a1c8SChaoyong He /* SPDX-License-Identifier: BSD-3-Clause
2*4967a1c8SChaoyong He  * Copyright(c) 2023 Corigine, Inc.
3*4967a1c8SChaoyong He  * All rights reserved.
4*4967a1c8SChaoyong He  */
5*4967a1c8SChaoyong He 
6*4967a1c8SChaoyong He #ifndef __NFP_DEV_H__
7*4967a1c8SChaoyong He #define __NFP_DEV_H__
8*4967a1c8SChaoyong He 
9*4967a1c8SChaoyong He #include <stdint.h>
10*4967a1c8SChaoyong He 
11*4967a1c8SChaoyong He #include <rte_compat.h>
12*4967a1c8SChaoyong He 
13*4967a1c8SChaoyong He #define PCI_VENDOR_ID_NETRONOME         0x19ee
14*4967a1c8SChaoyong He #define PCI_VENDOR_ID_CORIGINE          0x1da8
15*4967a1c8SChaoyong He 
16*4967a1c8SChaoyong He #define PCI_DEVICE_ID_NFP3800_PF_NIC    0x3800
17*4967a1c8SChaoyong He #define PCI_DEVICE_ID_NFP3800_VF_NIC    0x3803
18*4967a1c8SChaoyong He #define PCI_DEVICE_ID_NFP4000_PF_NIC    0x4000
19*4967a1c8SChaoyong He #define PCI_DEVICE_ID_NFP6000_PF_NIC    0x6000
20*4967a1c8SChaoyong He #define PCI_DEVICE_ID_NFP6000_VF_NIC    0x6003  /* Include NFP4000VF */
21*4967a1c8SChaoyong He 
22*4967a1c8SChaoyong He enum nfp_dev_id {
23*4967a1c8SChaoyong He 	NFP_DEV_NFP3800,
24*4967a1c8SChaoyong He 	NFP_DEV_NFP3800_VF,
25*4967a1c8SChaoyong He 	NFP_DEV_NFP6000,
26*4967a1c8SChaoyong He 	NFP_DEV_NFP6000_VF,
27*4967a1c8SChaoyong He 	NFP_DEV_CNT,
28*4967a1c8SChaoyong He };
29*4967a1c8SChaoyong He 
30*4967a1c8SChaoyong He struct nfp_dev_info {
31*4967a1c8SChaoyong He 	/* Required fields */
32*4967a1c8SChaoyong He 	uint32_t qc_idx_mask;
33*4967a1c8SChaoyong He 	uint32_t qc_addr_offset;
34*4967a1c8SChaoyong He 	uint32_t min_qc_size;
35*4967a1c8SChaoyong He 	uint32_t max_qc_size;
36*4967a1c8SChaoyong He 
37*4967a1c8SChaoyong He 	/* PF-only fields */
38*4967a1c8SChaoyong He 	const char *chip_names;
39*4967a1c8SChaoyong He 	uint32_t pcie_cfg_expbar_offset;
40*4967a1c8SChaoyong He 	uint32_t qc_area_sz;
41*4967a1c8SChaoyong He 	uint8_t pf_num_per_unit;
42*4967a1c8SChaoyong He };
43*4967a1c8SChaoyong He 
44*4967a1c8SChaoyong He __rte_internal
45*4967a1c8SChaoyong He const struct nfp_dev_info *nfp_dev_info_get(uint16_t device_id);
46*4967a1c8SChaoyong He 
47*4967a1c8SChaoyong He #endif /* __NFP_DEV_H__ */
48