git: 42cf33dd1a8d - main - Add new USB host controller PCI ID's.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Sun, 06 Feb 2022 12:19:34 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=42cf33dd1a8d6ff2548c8a7fb267879734ddfde3

commit 42cf33dd1a8d6ff2548c8a7fb267879734ddfde3
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-02-06 12:14:27 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-02-06 12:18:35 +0000

    Add new USB host controller PCI ID's.
    
    Submitted by:   Dmitry Luhtionov <dmitryluhtionov@gmail.com>
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking
---
 sys/dev/usb/controller/ehci_pci.c |  2 ++
 sys/dev/usb/controller/xhci_pci.c | 21 ++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c
index 7783c157046f..dbc2def5b8d2 100644
--- a/sys/dev/usb/controller/ehci_pci.c
+++ b/sys/dev/usb/controller/ehci_pci.c
@@ -117,6 +117,8 @@ ehci_pci_match(device_t self)
 		return ("AMD CS5536 (Geode) USB 2.0 controller");
 	case 0x78081022:
 		return ("AMD FCH USB 2.0 controller");
+	case 0x79081022:
+		return ("AMD FCH USB 2.0 controller");
 
 	case 0x43451002:
 		return "ATI SB200 USB 2.0 controller";
diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c
index 6dbe29b7c791..884200f547ec 100644
--- a/sys/dev/usb/controller/xhci_pci.c
+++ b/sys/dev/usb/controller/xhci_pci.c
@@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$");
 #include <dev/usb/controller/xhcireg.h>
 #include "usb_if.h"
 
+#define	PCI_XHCI_VENDORID_AMD		0x1022
+#define	PCI_XHCI_VENDORID_INTEL		0x8086
+
 static device_probe_t xhci_pci_probe;
 static device_detach_t xhci_pci_detach;
 static usb_take_controller_t xhci_pci_take_controller;
@@ -106,6 +109,8 @@ xhci_pci_match(device_t self)
 		return ("AMD 300 Series USB 3.0 controller");
 	case 0x78141022:
 		return ("AMD FCH USB 3.0 controller");
+	case 0x79141022:
+		return ("AMD FCH USB 3.0 controller");
 
 	case 0x145f1d94:
 		return ("Hygon USB 3.0 controller");
@@ -367,7 +372,21 @@ xhci_pci_attach(device_t self)
 	}
 	device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
 
-	sprintf(sc->sc_vendor, "0x%04x", pci_get_vendor(self));
+	switch (pci_get_vendor(self)) {
+	case PCI_XHCI_VENDORID_AMD:
+		strlcpy(sc->sc_vendor, "AMD", sizeof(sc->sc_vendor));
+		break;
+	case PCI_XHCI_VENDORID_INTEL:
+		strlcpy(sc->sc_vendor, "Intel", sizeof(sc->sc_vendor));
+		break;
+	default:
+		if (bootverbose)
+			device_printf(self, "(New XHCI DeviceId=0x%08x)\n",
+			    pci_get_devid(self));
+		snprintf(sc->sc_vendor, sizeof(sc->sc_vendor),
+		    "(0x%04x)", pci_get_vendor(self));
+		break;
+	}
 
 	if (sc->sc_irq_res != NULL) {
 		err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,