MdeModulePkg/EhciDxe: Fix legacy handoff logic

references acidanthera/bugtracker#2436
This commit is contained in:
vit9696 2024-10-27 04:30:33 +03:00 committed by Vitaly Cheptsov
parent 431595fc95
commit 0130690719
1 changed files with 11 additions and 0 deletions

View File

@ -309,6 +309,17 @@ EhcClearLegacySupport (
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap + 0x4, 1, &Value);
//
// Disable the SMI in USBLEGCTLSTS firstly
// Not doing this may result in a hardlock soon after
//
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap + 0x4, 1, &Value);
Value &= 0xFFFF0000;
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint32, ExtendCap + 0x4, 1, &Value);
//
// Get EHCI Ownership from legacy bios
//
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);
Value |= (0x1 << 24);
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);