X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FPci%2FEhciDxe%2FEhci.c;h=c7a6a400cff241ccbcfe6d83e330e169a11b676a;hp=4e9e05f0e43134403c89557f84488381721eafe9;hb=167c3fb45674c274219b3af0bc811992cd4d6116;hpb=a2c9b0873a7713df3d491307009b63ad0acd52f0 diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c index 4e9e05f0e4..c7a6a400cf 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c @@ -89,7 +89,7 @@ EhcGetCapability ( *MaxSpeed = EFI_USB_SPEED_HIGH; *PortNumber = (UINT8) (Ehc->HcStructParams & HCSP_NPORTS); - *Is64BitCapable = (UINT8) (Ehc->HcCapParams & HCCP_64BIT); + *Is64BitCapable = (UINT8) Ehc->Support64BitDma; DEBUG ((EFI_D_INFO, "EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable)); @@ -1877,6 +1877,26 @@ EhcDriverBindingStart ( goto CLOSE_PCIIO; } + // + // Enable 64-bit DMA support in the PCI layer if this controller + // supports it. + // + if (EHC_BIT_IS_SET (Ehc->HcCapParams, HCCP_64BIT)) { + Status = PciIo->Attributes ( + PciIo, + EfiPciIoAttributeOperationEnable, + EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, + NULL + ); + if (!EFI_ERROR (Status)) { + Ehc->Support64BitDma = TRUE; + } else { + DEBUG ((EFI_D_WARN, + "%a: failed to enable 64-bit DMA on 64-bit capable controller @ %p (%r)\n", + __FUNCTION__, Controller, Status)); + } + } + Status = gBS->InstallProtocolInterface ( &Controller, &gEfiUsb2HcProtocolGuid,