mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
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
This commit is contained in:
parent
dca18202a1
commit
93723244c8
@ -674,10 +674,16 @@ InitializeUsbDebugHardware (
|
|||||||
//
|
//
|
||||||
if (((MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus) & (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_IN_USE))
|
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)) {
|
!= (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 the host controller is halted, then reset and restart it.
|
||||||
//
|
//
|
||||||
if ((MmioRead32((UINTN)UsbStatus) & BIT12) != 0) {
|
if ((MmioRead32((UINTN)UsbStatus) & BIT12) != 0) {
|
||||||
|
DEBUG ((EFI_D_INFO, "UsbDbg: Reset the host controller.\n"));
|
||||||
//
|
//
|
||||||
// reset the host controller.
|
// reset the host controller.
|
||||||
//
|
//
|
||||||
@ -712,7 +718,9 @@ InitializeUsbDebugHardware (
|
|||||||
return RETURN_NOT_FOUND;
|
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
|
// Reset the debug port
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user