From f3283bfa83c385bf47492439a2ba5985ec24a1bb Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 16 Apr 2008 08:16:14 +0000 Subject: [PATCH] * Increase the amount of tries in the EHCI BIOS handover so it lasts for up to 1 second instead of half a second. Might help with slow BIOSes. * Disable EHCI interrupts if the BIOS handover fails so that we do not flood the system with interrupts if the BIOS later on decides to still comply with our handover request. * Add an unconditional success message to EHCI and UHCI to better see if controllers are present/initialized correctly at all. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24980 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/usb/ehci.cpp | 7 +++++-- src/add-ons/kernel/busses/usb/uhci.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index bc8cb48434..bc4402a4f4 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -181,7 +181,7 @@ EHCI::EHCI(pci_info *info, Stack *stack) sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, fPCIInfo->function, extendedCapPointer + 3, 1, 1); - for (int32 i = 0; i < 10; i++) { + for (int32 i = 0; i < 20; i++) { legacySupport = sPCIModule->read_pci_config(fPCIInfo->bus, fPCIInfo->device, fPCIInfo->function, extendedCapPointer, 4); @@ -193,6 +193,9 @@ EHCI::EHCI(pci_info *info, Stack *stack) } if (legacySupport & EHCI_LEGSUP_BIOSOWNED) { + // in any case disable interrupts so we do not flood the system + // if the BIOS still decides to give up control + WriteOpReg(EHCI_USBINTR, 0); TRACE_ERROR(("usb_ehci: bios won't give up control over the host controller\n")); return; } else if (legacySupport & EHCI_LEGSUP_OSOWNED) { @@ -404,7 +407,7 @@ EHCI::Start() } SetRootHub(fRootHub); - TRACE(("usb_ehci: Host Controller started\n")); + dprintf("usb_ehci: successfully started the controller\n"); return BusManager::Start(); } diff --git a/src/add-ons/kernel/busses/usb/uhci.cpp b/src/add-ons/kernel/busses/usb/uhci.cpp index 94f446470e..2e6f0913e8 100644 --- a/src/add-ons/kernel/busses/usb/uhci.cpp +++ b/src/add-ons/kernel/busses/usb/uhci.cpp @@ -558,6 +558,7 @@ UHCI::Start() TRACE(("usb_uhci: controller is started. status: %u curframe: %u\n", ReadReg16(UHCI_USBSTS), ReadReg16(UHCI_FRNUM))); + dprintf("usb_uhci: successfully started the controller\n"); return BusManager::Start(); }