mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[USBEHCI]
- Implement ResetController and call it before setting up the controller - Don't disable 64-bit addressing until the BIOS gives up control of the controller - Comment out manually clearing the SMI interrupt and the BIOS owned flag by request of janderwald - EHCI no longer hangs for me on real hardware during controller initialization svn path=/branches/usb-bringup-trunk/; revision=55450
This commit is contained in:
@@ -566,17 +566,6 @@ CUSBHardwareDevice::StartController(void)
|
||||
UCHAR Value;
|
||||
LARGE_INTEGER Timeout;
|
||||
|
||||
//
|
||||
// check caps
|
||||
//
|
||||
if (m_Capabilities.HCCParams.CurAddrBits)
|
||||
{
|
||||
//
|
||||
// disable 64-bit addressing
|
||||
//
|
||||
EHCI_WRITE_REGISTER_ULONG(EHCI_CTRLDSSEGMENT, 0x0);
|
||||
}
|
||||
|
||||
//
|
||||
// are extended caps supported
|
||||
//
|
||||
@@ -648,7 +637,7 @@ CUSBHardwareDevice::StartController(void)
|
||||
//
|
||||
DPRINT1("[EHCI] acquired ownership\n");
|
||||
}
|
||||
|
||||
#if 0
|
||||
//
|
||||
// explictly clear the bios owned flag 2.1.7
|
||||
//
|
||||
@@ -660,15 +649,11 @@ CUSBHardwareDevice::StartController(void)
|
||||
//
|
||||
Caps = 4;
|
||||
m_BusInterface.SetBusData(m_BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Caps, ExtendedCapsSupport+4, sizeof(ULONG));
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 1
|
||||
//
|
||||
// Stop the controller if its running
|
||||
//
|
||||
@@ -678,7 +663,22 @@ CUSBHardwareDevice::StartController(void)
|
||||
DPRINT1("Stopping Controller %x\n", UsbSts);
|
||||
StopController();
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Reset the controller
|
||||
//
|
||||
ResetController();
|
||||
|
||||
//
|
||||
// check caps
|
||||
//
|
||||
if (m_Capabilities.HCCParams.CurAddrBits)
|
||||
{
|
||||
//
|
||||
// disable 64-bit addressing
|
||||
//
|
||||
EHCI_WRITE_REGISTER_ULONG(EHCI_CTRLDSSEGMENT, 0x0);
|
||||
}
|
||||
|
||||
//
|
||||
// Enable Interrupts and start execution
|
||||
@@ -693,7 +693,6 @@ CUSBHardwareDevice::StartController(void)
|
||||
DPRINT1("Interrupt Mask %x\n", Status);
|
||||
ASSERT((Status & Mask) == Mask);
|
||||
|
||||
|
||||
//
|
||||
// Assign the SyncList Register
|
||||
//
|
||||
@@ -827,8 +826,28 @@ CUSBHardwareDevice::StopController(void)
|
||||
NTSTATUS
|
||||
CUSBHardwareDevice::ResetController(void)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
EHCI_USBCMD_CONTENT UsbCmd;
|
||||
ULONG FailSafe;
|
||||
|
||||
GetCommandRegister(&UsbCmd);
|
||||
UsbCmd.HCReset = TRUE;
|
||||
SetCommandRegister(&UsbCmd);
|
||||
|
||||
for (FailSafe = 100; FailSafe > 1; FailSafe--)
|
||||
{
|
||||
KeStallExecutionProcessor(100);
|
||||
GetCommandRegister(&UsbCmd);
|
||||
if (!UsbCmd.HCReset)
|
||||
break;
|
||||
}
|
||||
|
||||
if (UsbCmd.HCReset)
|
||||
{
|
||||
DPRINT1("EHCI ERROR: Controller is not responding to reset request!\n");
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
|
||||
Reference in New Issue
Block a user