diff options
author | Jiewen Yao <jiewen.yao@intel.com> | 2016-09-06 16:24:31 +0800 |
---|---|---|
committer | Jiewen Yao <jiewen.yao@intel.com> | 2016-09-07 16:43:54 +0800 |
commit | a27bdc0556d5e87df0e81287f541739a4b77c1f6 (patch) | |
tree | f48125415e899264f684b9ada928566ae573a1c0 /Vlv2TbltDevicePkg | |
parent | 3093f45c44eaea11e2f2552af7ff5c5b370a93d7 (diff) | |
download | edk2-platforms-a27bdc0556d5e87df0e81287f541739a4b77c1f6.tar.xz |
Vlv2TbltDevicePkg/PlatformInitPei: Support USB init
In order to support recovery in PEI phase, a platform need initialize
USB controller. This logic is missing in current PchInitPeim.
We removed MultiPlatformInfoInit() because it is already done in
PlatformEarlyInitEntry().
We also initialize XhciMemBaseAddr to 0, or it is garbage value.
Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
Diffstat (limited to 'Vlv2TbltDevicePkg')
-rw-r--r-- | Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c index 18ecda4a13..670fefc1c3 100644 --- a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c +++ b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c @@ -53,6 +53,11 @@ PchInitInterrupt ( IN SYSTEM_CONFIGURATION *SystemConfiguration
);
+EFI_STATUS
+InstallPeiPchUsbPolicy (
+ IN CONST EFI_PEI_SERVICES **PeiServices
+ );
+
#ifndef __GNUC__
#pragma warning (push)
#pragma warning (disable : 4245)
@@ -541,8 +546,18 @@ PlatformPchInit ( IN UINT16 PlatformType
)
{
+ EFI_STATUS Status;
+ EFI_BOOT_MODE BootMode;
+
+ Status = PeiServicesGetBootMode (&BootMode);
+ ASSERT_EFI_ERROR (Status);
+
IchRcrbInit (PeiServices, SystemConfiguration);
+ if (BootMode == BOOT_IN_RECOVERY_MODE) {
+ InstallPeiPchUsbPolicy(PeiServices);
+ }
+
//
// PCH Policy Initialization based on Setup variable.
//
@@ -721,7 +736,8 @@ InstallPeiPchUsbPolicy ( EFI_PEI_PPI_DESCRIPTOR *PeiPchUsbPolicyPpiDesc;
PCH_USB_POLICY_PPI *PeiPchUsbPolicyPpi;
PCH_USB_CONFIG *UsbConfig;
- EFI_PLATFORM_INFO_HOB PlatformInfo;
+
+ DEBUG ((EFI_D_INFO, "InstallPeiPchUsbPolicy...\n"));
//
// Allocate descriptor and PPI structures. Since these are dynamically updated
@@ -745,12 +761,6 @@ InstallPeiPchUsbPolicy ( UsbConfig->UsbPerPortCtl = PCH_DEVICE_DISABLE;
UsbConfig->Ehci1Usbr = PCH_DEVICE_DISABLE;
- //
- // Initialize PlatformInfo HOB
- //
- ZeroMem (&PlatformInfo, sizeof(PlatformInfo));
- MultiPlatformInfoInit(PeiServices, &PlatformInfo);
-
UsbConfig->Usb20OverCurrentPins[0] = PchUsbOverCurrentPin0;
UsbConfig->Usb20OverCurrentPins[1] = PchUsbOverCurrentPin0;
@@ -784,6 +794,8 @@ InstallPeiPchUsbPolicy ( PeiPchUsbPolicyPpi->EhciMemLength = (UINT32) 0x400 * PchEhciControllerMax;
+ PeiPchUsbPolicyPpi->XhciMemBaseAddr = 0;
+
PeiPchUsbPolicyPpi->UsbConfig = UsbConfig;
PeiPchUsbPolicyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
|