]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".
authorHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 3 Mar 2022 16:32:20 +0000 (17:32 +0100)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 17 Mar 2022 12:26:03 +0000 (13:26 +0100)
Tested by: br@
Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 33cbbf268f7d0f3daff0c2aa06836d932faf56a9)
(cherry picked from commit ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f)

sys/dev/usb/controller/xhci.c
sys/dev/usb/controller/xhci.h
sys/dev/usb/controller/xhci_pci.c

index 9c0f53de49244f951a8b44e5adb6f80d74517596..450f8dbbd9a3494a14b726d7c854e49203e7c7fa 100644 (file)
@@ -2,7 +2,7 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+ * Copyright (c) 2010-2022 Hans Petter Selasky
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -99,6 +99,10 @@ static int xhcictlquirk = 1;
 SYSCTL_INT(_hw_usb_xhci, OID_AUTO, ctlquirk, CTLFLAG_RWTUN,
     &xhcictlquirk, 0, "Set to enable control endpoint quirk");
 
+static int xhcidcepquirk;
+SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dcepquirk, CTLFLAG_RWTUN,
+    &xhcidcepquirk, 0, "Set to disable endpoint deconfigure command");
+
 #ifdef USB_DEBUG
 static int xhcidebug;
 static int xhciroute;
@@ -1531,8 +1535,11 @@ xhci_cmd_configure_ep(struct xhci_softc *sc, uint64_t input_ctx,
        temp = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_CONFIGURE_EP) |
            XHCI_TRB_3_SLOT_SET(slot_id);
 
-       if (deconfigure)
+       if (deconfigure) {
+               if (sc->sc_no_deconfigure != 0 || xhcidcepquirk != 0)
+                       return (0);     /* Success */
                temp |= XHCI_TRB_3_DCEP_BIT;
+       }
 
        trb.dwTrb3 = htole32(temp);
 
index 802207208569396999e0ab096b1c2b668cb85dbf..08f4e42b5fcd7069e9cc46ddb659e0007fc31eac 100644 (file)
@@ -3,7 +3,7 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+ * Copyright (c) 2010-2022 Hans Petter Selasky
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -529,6 +529,9 @@ struct xhci_softc {
        /* size of context */
        uint8_t                 sc_ctx_is_64_byte;
 
+       /* deconfiguring USB device is not fully supported */
+       uint8_t                 sc_no_deconfigure;
+
        /* Isochronous Scheduling Threshold */
        uint8_t                 sc_ist;
 
index bb9baee6800dcbeb6b9a3d2f7d491c73b38d2274..be12d8c33382ed30f630229f630b978c7ae168e3 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+ * Copyright (c) 2010-2022 Hans Petter Selasky
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -287,6 +287,9 @@ xhci_pci_attach(device_t self)
        sc->sc_io_size = rman_get_size(sc->sc_io_res);
 
        switch (pci_get_devid(self)) {
+       case 0x8241104c:        /* TUSB73x0 USB3.0 xHCI Controller */
+               sc->sc_no_deconfigure = 1;
+               break;
        case 0x01941033:        /* NEC uPD720200 USB 3.0 controller */
        case 0x00141912:        /* NEC uPD720201 USB 3.0 controller */
                /* Don't use 64-bit DMA on these controllers. */
@@ -310,6 +313,8 @@ xhci_pci_attach(device_t self)
                sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP;
                sc->sc_ctlstep = 1;
                break;
+       default:
+               break;
        }
 
        if (xhci_init(sc, self, usedma32)) {