From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8DD2C1A1E45 for ; Tue, 6 Sep 2016 01:32:21 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP; 06 Sep 2016 01:32:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,291,1470726000"; d="scan'208";a="5132470" Received: from jyao1-mobl.ccr.corp.intel.com ([10.239.192.127]) by orsmga005.jf.intel.com with ESMTP; 06 Sep 2016 01:32:19 -0700 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: David Wei Date: Tue, 6 Sep 2016 16:32:14 +0800 Message-Id: <1473150734-12192-1-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 Subject: [PATCH] Vlv2TbltDevicePkg/PlatformInitPei: Support USB init X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 08:32:21 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Reviewed-by: David Wei --- Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c index 18ecda4..286ccee 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; -- 2.7.4.windows.1