From 0d9cef0a94115791bee5308cf40f080c5a932d34 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Fri, 14 Feb 2020 15:04:56 +0000 Subject: [PATCH] Add support for Hygon NTB PCI device in ntb_hw_amd driver. Submitted by: Pu Wen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23565 --- sys/dev/ntb/ntb_hw/ntb_hw_amd.c | 15 ++++++++++++++- sys/dev/ntb/ntb_hw/ntb_hw_amd.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c index 43f135576a3..8fcd464c862 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c @@ -101,6 +101,16 @@ static const struct amd_ntb_hw_info amd_ntb_hw_info_list[] = { .msix_vector_count = 24, .quirks = 0, .desc = "AMD Non-Transparent Bridge"}, + + { .vendor_id = NTB_HW_HYGON_VENDOR_ID, + .device_id = NTB_HW_HYGON_DEVICE_ID1, + .mw_count = 3, + .bar_start_idx = 1, + .spad_count = 16, + .db_count = 16, + .msix_vector_count = 24, + .quirks = QUIRK_MW0_32BIT, + .desc = "Hygon Non-Transparent Bridge"}, }; static const struct pci_device_table amd_ntb_devs[] = { @@ -109,7 +119,10 @@ static const struct pci_device_table amd_ntb_devs[] = { PCI_DESCR("AMD Non-Transparent Bridge") }, { PCI_DEV(NTB_HW_AMD_VENDOR_ID, NTB_HW_AMD_DEVICE_ID2), .driver_data = (uintptr_t)&amd_ntb_hw_info_list[1], - PCI_DESCR("AMD Non-Transparent Bridge") } + PCI_DESCR("AMD Non-Transparent Bridge") }, + { PCI_DEV(NTB_HW_HYGON_VENDOR_ID, NTB_HW_HYGON_DEVICE_ID1), + .driver_data = (uintptr_t)&amd_ntb_hw_info_list[0], + PCI_DESCR("Hygon Non-Transparent Bridge") } }; static unsigned g_amd_ntb_hw_debug_level; diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_amd.h b/sys/dev/ntb/ntb_hw/ntb_hw_amd.h index f00094f62f8..99651767aff 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_amd.h +++ b/sys/dev/ntb/ntb_hw/ntb_hw_amd.h @@ -51,6 +51,9 @@ #define NTB_HW_AMD_DEVICE_ID1 0x145B #define NTB_HW_AMD_DEVICE_ID2 0x148B +#define NTB_HW_HYGON_VENDOR_ID 0x19D4 +#define NTB_HW_HYGON_DEVICE_ID1 0x145B + #define NTB_DEF_PEER_CNT 1 #define NTB_DEF_PEER_IDX 0