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
This commit is contained in:
Michael Lotz 2008-04-01 20:40:45 +00:00
parent a93bd0c452
commit 111522f174
2 changed files with 8 additions and 6 deletions

View File

@ -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) {

View File

@ -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