summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2014-07-19 19:56:23 +0000
committerhselasky <hselasky@FreeBSD.org>2014-07-19 19:56:23 +0000
commit86c94c699f2cd2707dc9074cbcd07956fe44394b (patch)
treed6585acd495235cc1cad7e5e01e1a6dcc5417d67 /sys/dev/usb/controller
parent7c6dab81e9ffdaf6c97b1a66af829d8d68b17bf1 (diff)
downloadFreeBSD-src-86c94c699f2cd2707dc9074cbcd07956fe44394b.zip
FreeBSD-src-86c94c699f2cd2707dc9074cbcd07956fe44394b.tar.gz
MFC r268735:
Improve support for Intel Lynx Point USB 3.0 controllers by using the USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware does not always accept when writing -1U to the port switching registers.
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/xhci_pci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c
index 3d18d34..f0b789a 100644
--- a/sys/dev/usb/controller/xhci_pci.c
+++ b/sys/dev/usb/controller/xhci_pci.c
@@ -150,6 +150,8 @@ static int
xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear)
{
uint32_t temp;
+ uint32_t usb3_mask;
+ uint32_t usb2_mask;
temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) |
pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4);
@@ -158,10 +160,11 @@ xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear)
temp &= ~clear;
/* Don't set bits which the hardware doesn't support */
- temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4);
+ usb3_mask = pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4);
+ usb2_mask = pci_read_config(self, PCI_XHCI_INTEL_USB2PRM, 4);
- pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4);
- pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4);
+ pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp & usb3_mask, 4);
+ pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp & usb2_mask, 4);
device_printf(self, "Port routing mask set to 0x%08x\n", temp);
OpenPOWER on IntegriCloud