//\r
if (((MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus) & (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_IN_USE))\r
!= (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_IN_USE)) || (Handle->Initialized == USBDBG_RESET)) {\r
+ DEBUG ((\r
+ EFI_D_INFO,\r
+ "UsbDbg: Need to reset the host controller. ControlStatus = %08x\n",\r
+ MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus)\r
+ ));\r
//\r
// If the host controller is halted, then reset and restart it.\r
//\r
if ((MmioRead32((UINTN)UsbStatus) & BIT12) != 0) {\r
+ DEBUG ((EFI_D_INFO, "UsbDbg: Reset the host controller.\n"));\r
//\r
// reset the host controller.\r
//\r
return RETURN_NOT_FOUND;\r
}\r
\r
- if (Handle->Initialized != USBDBG_INIT_DONE) {\r
+ if (Handle->Initialized != USBDBG_INIT_DONE ||\r
+ (MmioRead32 ((UINTN) &UsbDebugPortRegister->ControlStatus) & USB_DEBUG_PORT_ENABLE) == 0) {\r
+ DEBUG ((EFI_D_INFO, "UsbDbg: Reset the debug port.\n"));\r
//\r
// Reset the debug port\r
//\r