UINTN Index;\r
UINT8 TotalUsb3Port;\r
EFI_PHYSICAL_ADDRESS XhciOpRegister;\r
+ UINT32 Dcddi1;\r
\r
XhciOpRegister = Handle->XhciOpRegister;\r
TotalUsb3Port = MmioRead32 (((UINTN) Handle->XhciMmioBase + XHC_HCSPARAMS1_OFFSET)) >> 24;\r
\r
if (Handle->Initialized == USB3DBG_NOT_ENABLED) {\r
+ Dcddi1 = XhcReadDebugReg (Handle,XHC_DC_DCDDI1);\r
+ if (Dcddi1 != (UINT32)((XHCI_DEBUG_DEVICE_VENDOR_ID << 16) | XHCI_DEBUG_DEVICE_PROTOCOL)) {\r
+ //\r
+ // The debug capability has been reset by other code, return device error.\r
+ //\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
//\r
// If XHCI supports debug capability, hardware resource has been allocated, \r
// but it has not been enabled, try to enable again.\r