[haiku-commits] haiku: hrev49875 - in src: add-ons/kernel/busses/usb bin/screen_blanker

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 23 Nov 2015 20:49:35 +0100 (CET)

hrev49875 adds 2 changesets to branch 'master'
old head: 95c8163a16f784637ad6843086b34589f79bfdc6
new head: 69a973e2f7ece89badb1694aadcad5e0396daae2
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=69a973e2f7ec+%5E95c8163a16f7

----------------------------------------------------------------------------

2bc202c430cc: XHCI USB: Add port routing for Intel WildcatPoint LP USB.

* from FreeBSD.

69a973e2f7ec: screen_blanker: fix warning.

[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 40 insertions(+), 27 deletions(-)
src/add-ons/kernel/busses/usb/xhci.cpp | 60 +++++++++++++----------
src/add-ons/kernel/busses/usb/xhci.h | 2 +
src/add-ons/kernel/busses/usb/xhci_hardware.h | 1 +
src/bin/screen_blanker/ScreenSaverWindow.cpp | 4 +-

############################################################################

Commit: 2bc202c430cc068f217ffbee915a4b3f2b587fbd
URL: http://cgit.haiku-os.org/haiku/commit/?id=2bc202c430cc
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Mon Nov 23 19:47:15 2015 UTC

XHCI USB: Add port routing for Intel WildcatPoint LP USB.

* from FreeBSD.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp
b/src/add-ons/kernel/busses/usb/xhci.cpp
index e6b6354..6b06bcd 100644
--- a/src/add-ons/kernel/busses/usb/xhci.cpp
+++ b/src/add-ons/kernel/busses/usb/xhci.cpp
@@ -240,31 +240,17 @@ XHCI::XHCI(pci_info *info, Stack *stack)

// On Intel's Panther Point and Lynx Point Chipset taking ownership
// of EHCI owned ports, is what we do here.
- if (fPCIInfo->vendor_id == PCI_VENDOR_INTEL
- && (fPCIInfo->device_id == PCI_DEVICE_INTEL_PANTHER_POINT_XHCI
- || fPCIInfo->device_id ==
PCI_DEVICE_INTEL_LYNX_POINT_XHCI
- || fPCIInfo->device_id ==
PCI_DEVICE_INTEL_LYNX_POINT_LP_XHCI
- || fPCIInfo->device_id == PCI_DEVICE_INTEL_BAYTRAIL_XHCI
- || fPCIInfo->device_id ==
PCI_DEVICE_INTEL_WILDCAT_POINT_XHCI)) {
-
- TRACE("Intel xHC Controller\n");
- TRACE("Looking for EHCI owned ports\n");
- uint32 ports = sPCIModule->read_pci_config(fPCIInfo->bus,
- fPCIInfo->device, fPCIInfo->function,
XHCI_INTEL_USB3PRM, 4);
- TRACE("Superspeed Ports: 0x%" B_PRIx32 "\n", ports);
- sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
- fPCIInfo->function, XHCI_INTEL_USB3_PSSEN, 4, ports);
- ports = sPCIModule->read_pci_config(fPCIInfo->bus,
- fPCIInfo->device, fPCIInfo->function,
XHCI_INTEL_USB3_PSSEN, 4);
- TRACE("Superspeed ports now under XHCI : 0x%" B_PRIx32 "\n",
ports);
- ports = sPCIModule->read_pci_config(fPCIInfo->bus,
- fPCIInfo->device, fPCIInfo->function,
XHCI_INTEL_USB2PRM, 4);
- TRACE("USB 2.0 Ports : 0x%" B_PRIx32 "\n", ports);
- sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
- fPCIInfo->function, XHCI_INTEL_XUSB2PR, 4, ports);
- ports = sPCIModule->read_pci_config(fPCIInfo->bus,
- fPCIInfo->device, fPCIInfo->function,
XHCI_INTEL_XUSB2PR, 4);
- TRACE("USB 2.0 ports now under XHCI: 0x%" B_PRIx32 "\n", ports);
+ if (fPCIInfo->vendor_id == PCI_VENDOR_INTEL) {
+ switch (fPCIInfo->device_id) {
+ case PCI_DEVICE_INTEL_PANTHER_POINT_XHCI:
+ case PCI_DEVICE_INTEL_LYNX_POINT_XHCI:
+ case PCI_DEVICE_INTEL_LYNX_POINT_LP_XHCI:
+ case PCI_DEVICE_INTEL_BAYTRAIL_XHCI:
+ case PCI_DEVICE_INTEL_WILDCAT_POINT_XHCI:
+ case PCI_DEVICE_INTEL_WILDCAT_POINT_LP_XHCI:
+ _SwitchIntelPorts();
+ break;
+ }
}

// halt the host controller
@@ -360,6 +346,30 @@ XHCI::~XHCI()
}


+void
+XHCI::_SwitchIntelPorts()
+{
+ TRACE("Intel xHC Controller\n");
+ TRACE("Looking for EHCI owned ports\n");
+ uint32 ports = sPCIModule->read_pci_config(fPCIInfo->bus,
+ fPCIInfo->device, fPCIInfo->function, XHCI_INTEL_USB3PRM, 4);
+ TRACE("Superspeed Ports: 0x%" B_PRIx32 "\n", ports);
+ sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
+ fPCIInfo->function, XHCI_INTEL_USB3_PSSEN, 4, ports);
+ ports = sPCIModule->read_pci_config(fPCIInfo->bus,
+ fPCIInfo->device, fPCIInfo->function, XHCI_INTEL_USB3_PSSEN, 4);
+ TRACE("Superspeed ports now under XHCI : 0x%" B_PRIx32 "\n", ports);
+ ports = sPCIModule->read_pci_config(fPCIInfo->bus,
+ fPCIInfo->device, fPCIInfo->function, XHCI_INTEL_USB2PRM, 4);
+ TRACE("USB 2.0 Ports : 0x%" B_PRIx32 "\n", ports);
+ sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
+ fPCIInfo->function, XHCI_INTEL_XUSB2PR, 4, ports);
+ ports = sPCIModule->read_pci_config(fPCIInfo->bus,
+ fPCIInfo->device, fPCIInfo->function, XHCI_INTEL_XUSB2PR, 4);
+ TRACE("USB 2.0 ports now under XHCI: 0x%" B_PRIx32 "\n", ports);
+}
+
+
status_t
XHCI::Start()
{
diff --git a/src/add-ons/kernel/busses/usb/xhci.h
b/src/add-ons/kernel/busses/usb/xhci.h
index 0b130f0..dab94cb 100644
--- a/src/add-ons/kernel/busses/usb/xhci.h
+++ b/src/add-ons/kernel/busses/usb/xhci.h
@@ -196,6 +196,8 @@ private:
inline uint32 ReadDoorReg32(uint32 reg);
inline void WriteDoorReg32(uint32 reg,
uint32 value);

+ void _SwitchIntelPorts();
+
static pci_module_info * sPCIModule;
static pci_x86_module_info *sPCIx86Module;

diff --git a/src/add-ons/kernel/busses/usb/xhci_hardware.h
b/src/add-ons/kernel/busses/usb/xhci_hardware.h
index 25b23d0..a128ae5 100644
--- a/src/add-ons/kernel/busses/usb/xhci_hardware.h
+++ b/src/add-ons/kernel/busses/usb/xhci_hardware.h
@@ -17,6 +17,7 @@
#define PCI_DEVICE_INTEL_LYNX_POINT_LP_XHCI 0x9c31
#define PCI_DEVICE_INTEL_BAYTRAIL_XHCI 0x0f35
#define PCI_DEVICE_INTEL_WILDCAT_POINT_XHCI 0x8cb1
+#define PCI_DEVICE_INTEL_WILDCAT_POINT_LP_XHCI 0x9cb1

// Intel quirks registers in PCI config
#define XHCI_INTEL_USB3PRM 0xdc // USB
3.0 Port Routing Mask

############################################################################

Revision: hrev49875
Commit: 69a973e2f7ece89badb1694aadcad5e0396daae2
URL: http://cgit.haiku-os.org/haiku/commit/?id=69a973e2f7ec
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Mon Nov 23 19:48:15 2015 UTC

screen_blanker: fix warning.

----------------------------------------------------------------------------

diff --git a/src/bin/screen_blanker/ScreenSaverWindow.cpp
b/src/bin/screen_blanker/ScreenSaverWindow.cpp
index c10e2e9..5f6fded 100644
--- a/src/bin/screen_blanker/ScreenSaverWindow.cpp
+++ b/src/bin/screen_blanker/ScreenSaverWindow.cpp
@@ -37,8 +37,8 @@ ScreenSaverFilter::Filter(BMessage* message, BHandler**
target)
// in test mode, all mouse move events are
ignored
bool transitOnly = false;
if (fTestMode
- || message->FindBool("be:transit_only",
&transitOnly) == B_OK
- && transitOnly)
+ ||
(message->FindBool("be:transit_only", &transitOnly)
+ == B_OK && transitOnly))
return B_DISPATCH_MESSAGE;

// Fall through


Other related posts:

  • » [haiku-commits] haiku: hrev49875 - in src: add-ons/kernel/busses/usb bin/screen_blanker - jerome . duval