summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg/Library
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-04-18 05:56:04 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-04-18 05:56:04 +0000
commit93723244c8e1fe78ea2b0a7402548bfd07765d50 (patch)
tree33e2e02dac0838ef2340d6d41dd00f463d041830 /SourceLevelDebugPkg/Library
parentdca18202a1c3ef54bc06cce2199e88fb74676cf6 (diff)
Enhance DebugCommunicationLibUsb to reset the debug port when the PORT_ENABLE bit is not set.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14289 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library')
-rw-r--r--SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
index c08d45b78..54aaa71d7 100644
--- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
+++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
@@ -674,10 +674,16 @@ InitializeUsbDebugHardware (
//
if (((MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus) & (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_IN_USE))
!= (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_IN_USE)) || (Handle->Initialized == USBDBG_RESET)) {
+ DEBUG ((
+ EFI_D_INFO,
+ "UsbDbg: Need to reset the host controller. ControlStatus = %08x\n",
+ MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus)
+ ));
//
// If the host controller is halted, then reset and restart it.
//
if ((MmioRead32((UINTN)UsbStatus) & BIT12) != 0) {
+ DEBUG ((EFI_D_INFO, "UsbDbg: Reset the host controller.\n"));
//
// reset the host controller.
//
@@ -712,7 +718,9 @@ InitializeUsbDebugHardware (
return RETURN_NOT_FOUND;
}
- if (Handle->Initialized != USBDBG_INIT_DONE) {
+ if (Handle->Initialized != USBDBG_INIT_DONE ||
+ (MmioRead32 ((UINTN) &UsbDebugPortRegister->ControlStatus) & USB_DEBUG_PORT_ENABLE) == 0) {
+ DEBUG ((EFI_D_INFO, "UsbDbg: Reset the debug port.\n"));
//
// Reset the debug port
//