MdeModulePkg XhciPei: Minor refinement about IoMmu

1. Call IoMmuInit() after locating gPeiUsbControllerPpiGuid.
2. Call XhcPeiFreeSched() to do cleanup in XhcEndOfPei.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Star Zeng 2017-11-16 18:44:07 +08:00
parent 2c656af04d
commit 0aa1794118

View File

@ -1427,6 +1427,8 @@ XhcEndOfPei (
XhcPeiHaltHC (Xhc, XHC_GENERIC_TIMEOUT); XhcPeiHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
XhcPeiFreeSched (Xhc);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -1461,8 +1463,6 @@ XhcPeimEntry (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
IoMmuInit ();
Status = PeiServicesLocatePpi ( Status = PeiServicesLocatePpi (
&gPeiUsbControllerPpiGuid, &gPeiUsbControllerPpiGuid,
0, 0,
@ -1473,6 +1473,8 @@ XhcPeimEntry (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
IoMmuInit ();
Index = 0; Index = 0;
while (TRUE) { while (TRUE) {
Status = UsbControllerPpi->GetUsbController ( Status = UsbControllerPpi->GetUsbController (