From 111522f174b7770de0e31bd3429a740a3ed372af Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 1 Apr 2008 20:40:45 +0000 Subject: [PATCH] When initializing a UHCI controller, ensure that the interrupts are disabled before routing them from the BIOS. Also clear pending SMIs when disabling legacy support. Might help with some legacy support issues and probably introduces others instead... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24728 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/usb/uhci.cpp | 9 +++++---- src/add-ons/kernel/busses/usb/uhci_hardware.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/uhci.cpp b/src/add-ons/kernel/busses/usb/uhci.cpp index 2b882f09e6..3b13824d71 100644 --- a/src/add-ons/kernel/busses/usb/uhci.cpp +++ b/src/add-ons/kernel/busses/usb/uhci.cpp @@ -332,13 +332,14 @@ UHCI::UHCI(pci_info *info, Stack *stack) sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, fPCIInfo->function, PCI_command, 2, command); - // make sure we gain control of the UHCI controller instead of the BIOS - sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, - fPCIInfo->function, PCI_LEGSUP, 2, PCI_LEGSUP_USBPIRQDEN); - // disable interrupts WriteReg16(UHCI_USBINTR, 0); + // make sure we gain control of the UHCI controller instead of the BIOS + sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, + fPCIInfo->function, PCI_LEGSUP, 2, PCI_LEGSUP_USBPIRQDEN + | PCI_LEGSUP_CLEAR_SMI); + // do a global and host reset GlobalReset(); if (ControllerReset() < B_OK) { diff --git a/src/add-ons/kernel/busses/usb/uhci_hardware.h b/src/add-ons/kernel/busses/usb/uhci_hardware.h index 217c19ff41..47e35f1df9 100644 --- a/src/add-ons/kernel/busses/usb/uhci_hardware.h +++ b/src/add-ons/kernel/busses/usb/uhci_hardware.h @@ -19,8 +19,9 @@ // ** -- Only writable with words! // PCI register -#define PCI_LEGSUP 0xC0 -#define PCI_LEGSUP_USBPIRQDEN 0x2000 +#define PCI_LEGSUP 0xC0 +#define PCI_LEGSUP_USBPIRQDEN 0x2000 +#define PCI_LEGSUP_CLEAR_SMI 0x8f00 // Registers #define UHCI_USBCMD 0x00 // USB Command - word - R/W