Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2014 06:14:41 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268735 - head/sys/dev/usb/controller
Message-ID:  <201407160614.s6G6EffU076405@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Jul 16 06:14:41 2014
New Revision: 268735
URL: http://svnweb.freebsd.org/changeset/base/268735

Log:
  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.
  
  MFC after:	3 days
  Tested by:	Huang Wen Hui <huanghwh@gmail.com>

Modified:
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci_pci.c	Wed Jul 16 02:02:46 2014	(r268734)
+++ head/sys/dev/usb/controller/xhci_pci.c	Wed Jul 16 06:14:41 2014	(r268735)
@@ -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, uint3
 	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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407160614.s6G6EffU076405>