@@ -127,6 +127,12 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
assert(fpga_info->n_fpga_prod_id > 0);
switch (fpga_info->n_fpga_prod_id) {
+ /* NT200A01: 2x100G (Xilinx) */
+ case 9563: /* NT200A02 (Cap) */
+ NT_LOG(ERR, NTNIC, "NT200A02 100G link module uninitialized\n");
+ res = -1;
+ break;
+
default:
NT_LOG(ERR, NTNIC, "Unsupported FPGA product: %04d\n",
fpga_info->n_fpga_prod_id);
@@ -25,6 +25,7 @@ sources = files(
'nthw/supported/nthw_fpga_9563_055_039_0000.c',
'nthw/supported/nthw_fpga_instances.c',
'nthw/supported/nthw_fpga_mod_str_map.c',
+ 'nthw/core/nt200a0x/nthw_fpga_nt200a0x.c',
'nthw/core/nthw_fpga.c',
'nthw/core/nthw_hif.c',
'nthw/core/nthw_iic.c',
@@ -18,5 +18,12 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info);
int nthw_fpga_get_param_info(struct fpga_info_s *p_fpga_info, nthw_fpga_t *p_fpga);
+struct nt200a0x_ops {
+ int (*nthw_fpga_nt200a0x_init)(struct fpga_info_s *p_fpga_info);
+};
+
+void register_nt200a0x_ops(struct nt200a0x_ops *ops);
+struct nt200a0x_ops *get_nt200a0x_ops(void);
+void nt200a0x_ops_init(void);
#endif /* __NTHW_FPGA_H__ */
new file mode 100644
@@ -0,0 +1,54 @@
+/*
+ * SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2023 Napatech A/S
+ */
+
+#include "ntlog.h"
+
+#include "nthw_fpga.h"
+#include "ntnic_mod_reg.h"
+
+static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)
+{
+ assert(p_fpga_info);
+
+ const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;
+ int res = -1;
+
+ bool included = true;
+
+ /* reset specific */
+ switch (p_fpga_info->n_fpga_prod_id) {
+ case 9563:
+ included = false;
+ break;
+
+ default:
+ NT_LOG(ERR, NTHW, "%s: Unsupported FPGA product: %04d\n", p_adapter_id_str,
+ p_fpga_info->n_fpga_prod_id);
+ res = -1;
+ break;
+ }
+
+ if (!included) {
+ NT_LOG(ERR, NTHW, "%s: NOT INCLUDED FPGA product: %04d\n", p_adapter_id_str,
+ p_fpga_info->n_fpga_prod_id);
+ res = -1;
+ }
+
+ if (res) {
+ NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d\n", p_adapter_id_str,
+ p_fpga_info->n_fpga_prod_id, res);
+ return res;
+ }
+
+ return res;
+}
+
+static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga_nt200a0x_init };
+
+void nt200a0x_ops_init(void)
+{
+ NT_LOG(INF, NTHW, "NT200A0X OPS INIT\n");
+ register_nt200a0x_ops(&nt200a0x_ops);
+}
@@ -152,7 +152,18 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)
nthw_rac_rab_flush(p_nthw_rac);
p_fpga_info->mp_nthw_rac = p_nthw_rac;
+ bool included = true;
+ struct nt200a0x_ops *nt200a0x_ops = get_nt200a0x_ops();
+
switch (p_fpga_info->n_nthw_adapter_id) {
+ case NT_HW_ADAPTER_ID_NT200A02:
+ if (nt200a0x_ops != NULL)
+ res = nt200a0x_ops->nthw_fpga_nt200a0x_init(p_fpga_info);
+
+ else
+ included = false;
+
+ break;
default:
NT_LOG(ERR, NTHW, "%s: Unsupported HW product id: %d\n", p_adapter_id_str,
p_fpga_info->n_nthw_adapter_id);
@@ -160,6 +171,12 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)
break;
}
+ if (!included) {
+ NT_LOG(ERR, NTHW, "%s: NOT INCLUDED HW product: %d\n", p_adapter_id_str,
+ p_fpga_info->n_nthw_adapter_id);
+ res = -1;
+ }
+
if (res) {
NT_LOG(ERR, NTHW, "%s: status: 0x%08X\n", p_adapter_id_str, res);
return res;
@@ -220,3 +237,17 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info)
return res;
}
+
+static struct nt200a0x_ops *nt200a0x_ops;
+
+void register_nt200a0x_ops(struct nt200a0x_ops *ops)
+{
+ nt200a0x_ops = ops;
+}
+
+struct nt200a0x_ops *get_nt200a0x_ops(void)
+{
+ if (nt200a0x_ops == NULL)
+ nt200a0x_ops_init();
+ return nt200a0x_ops;
+}
@@ -8,6 +8,9 @@
nthw_adapter_id_t nthw_platform_get_nthw_adapter_id(const uint16_t n_pci_device_id)
{
switch (n_pci_device_id) {
+ case NT_HW_PCI_DEVICE_ID_NT200A02:
+ return NT_HW_ADAPTER_ID_NT200A02;
+
default:
return NT_HW_ADAPTER_ID_UNKNOWN;
}
@@ -9,9 +9,11 @@
#include <stdint.h>
#define NT_HW_PCI_VENDOR_ID (0x18f4)
+#define NT_HW_PCI_DEVICE_ID_NT200A02 (0x1C5)
enum nthw_adapter_id_e {
NT_HW_ADAPTER_ID_UNKNOWN = 0,
+ NT_HW_ADAPTER_ID_NT200A02,
};
typedef enum nthw_adapter_id_e nthw_adapter_id_t;
@@ -25,6 +25,7 @@
#define EXCEPTION_PATH_HID 0
static const struct rte_pci_id nthw_pci_id_map[] = {
+ { RTE_PCI_DEVICE(NT_HW_PCI_VENDOR_ID, NT_HW_PCI_DEVICE_ID_NT200A02) },
{
.vendor_id = 0,
}, /* sentinel */
@@ -475,9 +476,11 @@ nthw_pci_remove(struct rte_pci_device *pci_dev)
static struct rte_pci_driver rte_nthw_pmd = {
.id_table = nthw_pci_id_map,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
.probe = nthw_pci_probe,
.remove = nthw_pci_remove,
};
RTE_PMD_REGISTER_PCI(net_ntnic, rte_nthw_pmd);
+RTE_PMD_REGISTER_PCI_TABLE(net_ntnic, nthw_pci_id_map);
RTE_PMD_REGISTER_KMOD_DEP(net_ntnic, "* vfio-pci");