Skip to content

Commit

Permalink
MdeModulePkg/EhciDxe: Fix legacy handoff logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 authored and Vitaly Cheptsov committed Oct 27, 2024
1 parent 431595f commit 0130690
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0130690

Please sign in to comment.