)\r
{\r
UINT16 PciStatus;\r
+ UINT16 VendorId;\r
+ UINT16 DeviceId;\r
+ UINT8 ProgInterface;\r
+ UINT8 SubClassCode;\r
+ UINT8 BaseCode;\r
UINT8 CapabilityPtr;\r
UINT8 CapabilityId;\r
\r
+ VendorId = PciRead16 (PcdGet32(PcdUsbEhciPciAddress) + PCI_VENDOR_ID_OFFSET);\r
+ DeviceId = PciRead16 (PcdGet32(PcdUsbEhciPciAddress) + PCI_DEVICE_ID_OFFSET);\r
+ \r
+ if ((VendorId == 0xFFFF) || (DeviceId == 0xFFFF)) {\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
+ ProgInterface = PciRead8 (PcdGet32(PcdUsbEhciPciAddress) + PCI_CLASSCODE_OFFSET);\r
+ SubClassCode = PciRead8 (PcdGet32(PcdUsbEhciPciAddress) + PCI_CLASSCODE_OFFSET + 1);\r
+ BaseCode = PciRead8 (PcdGet32(PcdUsbEhciPciAddress) + PCI_CLASSCODE_OFFSET + 2);\r
+ \r
+ if ((ProgInterface != PCI_IF_EHCI) || (SubClassCode != PCI_CLASS_SERIAL_USB) || (BaseCode != PCI_CLASS_SERIAL)) {\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Enable Ehci Host Controller MMIO Space.\r
//\r
\r
Status = CalculateUsbDebugPortBar(&Handle.DebugPortOffset, &Handle.DebugPortBarNumber);\r
if (RETURN_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "USB Debug Port: EHCI host controller does not support debug port capability!\n"));\r
+ DEBUG ((EFI_D_ERROR, "USB Debug Port: the pci device pointed by PcdUsbEhciPciAddress is not EHCI host controller or does not support debug port capability!\n"));\r
goto Exit;\r
}\r
\r