* Set the interrupt threshold of the controller when doing the rest of the
initialization as suggested by the EHCI spec and do not touch it again once the controller is running. Doing so would result in undefined behaviour according to EHCI specs. * Set the port routing policy after the controller has started and not before as suggested by the EHCI specs. * Explicitly set the segment register after resetting the host controller and not before, as this likely has no real effect ;-) Might help with some legacy support or UHCI/OHCI to EHCI handover problems. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24925 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -200,15 +200,15 @@ EHCI::EHCI(pci_info *info, Stack *stack)
|
|||||||
// disable interrupts
|
// disable interrupts
|
||||||
WriteOpReg(EHCI_USBINTR, 0);
|
WriteOpReg(EHCI_USBINTR, 0);
|
||||||
|
|
||||||
// reset the segment register
|
|
||||||
WriteOpReg(EHCI_CTRDSSEGMENT, 0);
|
|
||||||
|
|
||||||
// reset the host controller
|
// reset the host controller
|
||||||
if (ControllerReset() < B_OK) {
|
if (ControllerReset() < B_OK) {
|
||||||
TRACE_ERROR(("usb_ehci: host controller failed to reset\n"));
|
TRACE_ERROR(("usb_ehci: host controller failed to reset\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset the segment register
|
||||||
|
WriteOpReg(EHCI_CTRDSSEGMENT, 0);
|
||||||
|
|
||||||
// create semaphores the finisher thread will wait for
|
// create semaphores the finisher thread will wait for
|
||||||
fAsyncAdvanceSem = create_sem(0, "EHCI Async Advance");
|
fAsyncAdvanceSem = create_sem(0, "EHCI Async Advance");
|
||||||
fFinishTransfersSem = create_sem(0, "EHCI Finish Transfers");
|
fFinishTransfersSem = create_sem(0, "EHCI Finish Transfers");
|
||||||
@@ -359,10 +359,7 @@ EHCI::Start()
|
|||||||
WriteOpReg(EHCI_USBCMD, ReadOpReg(EHCI_USBCMD) | EHCI_USBCMD_RUNSTOP
|
WriteOpReg(EHCI_USBCMD, ReadOpReg(EHCI_USBCMD) | EHCI_USBCMD_RUNSTOP
|
||||||
| EHCI_USBCMD_ASENABLE | EHCI_USBCMD_PSENABLE
|
| EHCI_USBCMD_ASENABLE | EHCI_USBCMD_PSENABLE
|
||||||
| (frameListSize << EHCI_USBCMD_FLS_SHIFT)
|
| (frameListSize << EHCI_USBCMD_FLS_SHIFT)
|
||||||
| (2 << EHCI_USBCMD_ITC_SHIFT));
|
| (1 << EHCI_USBCMD_ITC_SHIFT));
|
||||||
|
|
||||||
// route all ports to us
|
|
||||||
WriteOpReg(EHCI_CONFIGFLAG, EHCI_CONFIGFLAG_FLAG);
|
|
||||||
|
|
||||||
bool running = false;
|
bool running = false;
|
||||||
for (int32 i = 0; i < 10; i++) {
|
for (int32 i = 0; i < 10; i++) {
|
||||||
@@ -377,15 +374,15 @@ EHCI::Start()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the interrupt threshold
|
|
||||||
WriteOpReg(EHCI_USBCMD, ReadOpReg(EHCI_USBCMD)
|
|
||||||
| (1 << EHCI_USBCMD_ITC_SHIFT));
|
|
||||||
|
|
||||||
if (!running) {
|
if (!running) {
|
||||||
TRACE(("usb_ehci: Host Controller didn't start\n"));
|
TRACE(("usb_ehci: Host Controller didn't start\n"));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// route all ports to us
|
||||||
|
WriteOpReg(EHCI_CONFIGFLAG, EHCI_CONFIGFLAG_FLAG);
|
||||||
|
snooze(10000);
|
||||||
|
|
||||||
fRootHubAddress = AllocateAddress();
|
fRootHubAddress = AllocateAddress();
|
||||||
fRootHub = new(std::nothrow) EHCIRootHub(RootObject(), fRootHubAddress);
|
fRootHub = new(std::nothrow) EHCIRootHub(RootObject(), fRootHubAddress);
|
||||||
if (!fRootHub) {
|
if (!fRootHub) {
|
||||||
|
|||||||
Reference in New Issue
Block a user