MdeModulePkg/XhciPei: Support IoMmu.

Update XHCI driver to consume IOMMU_PPI to allocate DMA buffer.

If no IOMMU_PPI exists, this driver still calls PEI service
to allocate DMA buffer, with assumption that DRAM==DMA.

This is a compatible change.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Jiewen Yao
2017-09-07 16:06:27 +08:00
parent 8a4ed1188b
commit b575ca32c8
8 changed files with 492 additions and 34 deletions

View File

@@ -29,6 +29,7 @@ struct _USBHC_MEM_BLOCK {
UINT8 *Buf;
UINT8 *BufHost;
UINTN BufLen; // Memory size in bytes
VOID *Mapping;
USBHC_MEM_BLOCK *Next;
};
@@ -112,6 +113,7 @@ UsbHcGetHostAddrForPciAddr (
@param HostAddress The system memory address to map to the PCI controller.
@param DeviceAddress The resulting map address for the bus master PCI controller to
use to access the hosts HostAddress.
@param Mapping A resulting value to pass to Unmap().
@retval EFI_SUCCESS Success to allocate aligned pages.
@retval EFI_INVALID_PARAMETER Pages or Alignment is not valid.
@@ -123,7 +125,8 @@ UsbHcAllocateAlignedPages (
IN UINTN Pages,
IN UINTN Alignment,
OUT VOID **HostAddress,
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
OUT VOID **Mapping
);
/**
@@ -131,12 +134,14 @@ UsbHcAllocateAlignedPages (
@param HostAddress The system memory address to map to the PCI controller.
@param Pages The number of pages to free.
@param Mapping The mapping value returned from Map().
**/
VOID
UsbHcFreeAlignedPages (
IN VOID *HostAddress,
IN UINTN Pages
IN UINTN Pages,
IN VOID *Mapping
);
#endif