From 35468e2aad64ab8a062d696349220e5581fa2f91 Mon Sep 17 00:00:00 2001 From: zwei4 Date: Fri, 6 Jan 2017 15:29:52 +0800 Subject: Remove platform policies which are not used. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: zwei4 --- .../PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 3 +- .../PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c | 20 +- .../Library/PeiPolicyInitLib/PeiPolicyInit.h | 3 +- .../Library/PeiPolicyInitLib/PeiPolicyInitLib.inf | 6 +- .../Library/PeiPolicyInitLib/PeiSaPolicyInit.c | 57 ----- .../Library/PeiPolicyInitLib/PeiSaPolicyInit.h | 58 ----- .../PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf | 3 +- .../Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.c | 254 --------------------- .../Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.h | 43 ---- .../PlatformPostMemPei/PeiSaPolicyUpdate.h | 3 +- .../PlatformPostMemPei/PlatformInit.c | 124 +--------- .../PlatformPostMemPei/PlatformInit.h | 4 +- .../PlatformPostMemPei/PlatformPostMemPei.inf | 4 +- .../PlatformPreMemPei/PeiSaPolicyUpdate.h | 3 +- .../PlatformPreMemPei/PlatformInit.h | 4 +- .../PlatformPreMemPei/PlatformInitPreMem.c | 108 +-------- .../PlatformPreMemPei/PlatformInitPreMem.h | 8 +- 17 files changed, 15 insertions(+), 690 deletions(-) delete mode 100644 Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.c delete mode 100644 Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.h delete mode 100644 Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.c delete mode 100644 Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.h (limited to 'Platform') diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf index 856d173322..fab0d00aef 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf @@ -1,7 +1,7 @@ ## @file # Library functions for Fsp Policy Initialization Library. # -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -92,7 +92,6 @@ gSiPolicyPpiGuid ## CONSUMES gScPolicyPpiGuid gSiCpuPolicyPpiGuid ## CONSUMES - gSiSaPolicyPpiGuid ## CONSUMES gSaMiscConfigGuid gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMES gMemoryConfigGuid diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c index 04167c59cb..1dc31a08ca 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c @@ -1,7 +1,7 @@ /** @file Implementation of Fsp SA Policy Initialization. - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -188,8 +187,6 @@ PeiFspSaPolicyInit ( ) { EFI_STATUS Status; - SA_MISC_CONFIG *MiscConfig; - SI_SA_POLICY_PPI *SiSaPolicyPpi; VOID *Buffer; UINT32 Size; EFI_GUID PeiLogoGuid = gPeiLogoGuid; @@ -199,20 +196,7 @@ PeiFspSaPolicyInit ( UINTN VariableSize = 0; EFI_BOOT_MODE BootMode; - // - // Locate SiSaPolicyPpi - // - SiSaPolicyPpi = NULL; - MiscConfig = NULL; - Status = PeiServicesLocatePpi( - &gSiSaPolicyPpiGuid, - 0, - NULL, - (VOID **) &SiSaPolicyPpi - ); - if (EFI_ERROR (Status) == FALSE) { - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gSaMiscConfigGuid, (VOID *) &MiscConfig); - } + Status = PeiServicesGetBootMode (&BootMode); diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInit.h b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInit.h index 1e23002370..37661ece06 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInit.h +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInit.h @@ -1,7 +1,7 @@ /** @file Header file for the PolicyInitPei PEIM. - Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -19,7 +19,6 @@ #include #include #include -#include "PeiSaPolicyInit.h" #include "PeiSiPolicyInit.h" #include "PeiCpuPolicyInit.h" diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInitLib.inf b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInitLib.inf index db70e74c83..319684445d 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInitLib.inf +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiPolicyInitLib.inf @@ -1,7 +1,7 @@ ## @file # Component description file for PeiPolicyInit library. # -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -28,7 +28,6 @@ HobLib PeiServicesLib PeiPolicyUpdateLib - PeiSaPolicyLib ConfigBlockLib SteppingLib CpuPolicyLib @@ -44,12 +43,9 @@ PeiPolicyInit.h PeiCpuPolicyInit.c PeiCpuPolicyInit.h - PeiSaPolicyInit.c - PeiSaPolicyInit.h PeiSiPolicyInit.c PeiSiPolicyInit.h [Ppis] - gSiSaPolicyPpiGuid gScPcieDeviceTablePpiGuid diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.c deleted file mode 100644 index 5f0300ec59..0000000000 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.c +++ /dev/null @@ -1,57 +0,0 @@ -/** @file - This file is SampleCode for Intel SA PEI Policy initialization. - - Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "PeiSaPolicyInit.h" - -/** - This PEIM performs SA PEI Policy initialzation. - - @param[in] FirmwareConfiguration It uses to skip specific policy init that depends - on the 'FirmwareConfiguration' varaible. - - @retval EFI_SUCCESS The PPI is installed and initialized. - @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the PPI. - @retval EFI ERRORS The PPI is not successfully installed. - -**/ -EFI_STATUS -PeiSaPolicyInit ( - IN UINT8 FirmwareConfiguration - ) -{ - EFI_STATUS Status; - SI_SA_POLICY_PPI *SiSaPolicyPpi; - - // - // Call SaCreatePolicyDefaults to initialize platform policy structure - // and get all Intel default policy settings. - // - Status = CreateConfigBlocks (&SiSaPolicyPpi); - DEBUG ((DEBUG_INFO, "SiSaPolicyPpi->TableHeader.NumberOfBlocks = 0x%x\n ", SiSaPolicyPpi->TableHeader.NumberOfBlocks)); - ASSERT_EFI_ERROR (Status); - - UpdatePeiSaPolicy (SiSaPolicyPpi); - - // - // Install SiSaPolicyPpi. - // While installed, RC assumes the Policy is ready and finalized. So please - // update and override any setting before calling this function. - // - Status = SiSaInstallPolicyPpi (SiSaPolicyPpi); - ASSERT_EFI_ERROR (Status); - - return Status; -} - diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.h b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.h deleted file mode 100644 index d1ce77b794..0000000000 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyInitLib/PeiSaPolicyInit.h +++ /dev/null @@ -1,58 +0,0 @@ -/** @file - Header file for the SaPolicyInitPei PEIM. - - Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _SA_POLICY_INIT_PEI_H_ -#define _SA_POLICY_INIT_PEI_H_ - -#include -#include -#include -#include -#include - -// -// Functions -// -/** - This PEIM performs SA PEI Policy initialzation \n - - Introduction \n - System Agent PEIM behavior can be controlled by platform policy without modifying reference code directly. - Platform policy PPI is initialized with default settings in this funciton. - Some MRC functions will be initialized in this PEIM to provide the capability for customization. - This policy PPI has to be initialized prior to System Agent initialization PEIM and MRC execution. - - - @pre - - PEI_READ_ONLY_VARIABLE_PPI - - - @result - SI_SA_POLICY_PPI will be installed successfully and ready for System Agent reference code use. - - - Porting Recommendations \n - Policy should be initialized basing on platform design or user selection (like BIOS Setup Menu) - - @param[in] FirmwareConfiguration It uses to skip specific policy init that depends - on the 'FirmwareConfiguration' varaible. - - @retval EFI_SUCCESS The PPI is installed and initialized. - @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the PPI. - @retval EFI ERRORS The PPI is not successfully installed. - -**/ -EFI_STATUS -PeiSaPolicyInit ( - IN UINT8 FirmwareConfiguration - ); -#endif - diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf index 1f61f948cd..df8293d917 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf @@ -1,7 +1,7 @@ ## @file # Module Infomation file for PEI PeiPolicyUpdateLib Library. # -# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -50,7 +50,6 @@ gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMES gScPolicyPpiGuid gSaMiscConfigGuid - gGraphicsConfigGuid gIpuConfigGuid gScSpiPpiGuid diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.c deleted file mode 100644 index 4787f1fe6c..0000000000 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.c +++ /dev/null @@ -1,254 +0,0 @@ -/** @file - Do Platform Stage System Agent initialization. - - Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - UpdatePeiSaPolicy performs SA PEI Policy initialzation - - @param[in, out] SiSaPolicyPpi SI_SA_POLICY PPI - - @retval EFI_SUCCESS The policy is installed and initialized. - -**/ -EFI_STATUS -UpdatePeiSaPolicy ( - IN OUT SI_SA_POLICY_PPI *SiSaPolicyPpi - ) -{ - EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - SYSTEM_CONFIGURATION SystemConfiguration; - UINTN VariableSize; - SA_MISC_CONFIG *MiscConfig = NULL; - GRAPHICS_CONFIG *GtConfig = NULL; - IPU_CONFIG *IpuPolicy = NULL; - VOID* Buffer; - UINT32 Size; - EFI_GUID PeiLogoGuid = { 0x7BB28B99, 0x61BB, 0x11D5, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }; - EFI_GUID TianmaVbtGuid = { 0xE08CA6D5, 0x8D02, 0x43ae, 0xAB, 0xB1, 0x95, 0x2C, 0xC7, 0x87, 0xC9, 0x33 }; - EFI_GUID TrulyFabBVbtTypeCGuid = { 0xDBADD769, 0xE86A, 0x4819, 0x81, 0x20, 0xE9, 0x91, 0x79, 0x2C, 0x0B, 0xC1 }; - EFI_GUID TrulyFabBVbtGuid = { 0x1a03cf12, 0xf54b, 0x4227, 0xa7, 0xa4, 0x6c, 0x97, 0x11, 0x3f, 0xac, 0x71 }; - EFI_GUID TrulyFabBCMVbtGuid = { 0x1fc29068, 0x17cf, 0x4613, 0x98, 0xd, 0x17, 0x2f, 0x97, 0xe7, 0xfa, 0xe5 }; - EFI_GUID TrulyFabBCMTypeCVbtGuid = { 0x2246d69f, 0xd9a6, 0x4f80, 0x90, 0x38, 0x78, 0xc5, 0xcc, 0x74, 0x1d, 0xdf }; - EFI_GUID TrulyFabBPr1TypeCVbtGuid = { 0x190c66ce, 0x475e, 0x4c5e, 0xb7, 0xd0, 0x2f, 0x67, 0x72, 0xba, 0x71, 0x70 }; - EFI_GUID TrulyFabBPr1CMTypeCVbtGuid = { 0xc1b31ace, 0x65db, 0x46d6, 0x9c, 0x7e, 0xa8, 0x2c, 0xce, 0x78, 0x45, 0x38 }; - VBT_INFO VbtInfo; - SC_POLICY_PPI *ScPolicyPpi; - SC_VTD_CONFIG *VtdConfig; - BXT_SERIES SocSeries; - BXT_STEPPING SocStepping; - - DEBUG ((DEBUG_INFO, "Entering Get Config Block function call from UpdatePeiSaPolicy\n")); - - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gSaMiscConfigGuid , (VOID *) &MiscConfig); - ASSERT_EFI_ERROR (Status); - - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gGraphicsConfigGuid, (VOID *) &GtConfig); - ASSERT_EFI_ERROR (Status); - - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gIpuConfigGuid, (VOID *) &IpuPolicy); - ASSERT_EFI_ERROR (Status); - - // - // Locate system configuration variable - // - Status = PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, // GUID - 0, // INSTANCE - NULL, // EFI_PEI_PPI_DESCRIPTOR - (VOID **) &VariableServices // PPI - ); - ASSERT_EFI_ERROR ( Status); - - // - // Locate SC Policy - // - Status = PeiServicesLocatePpi ( - &gScPolicyPpiGuid, - 0, - NULL, - (VOID **) &ScPolicyPpi - ); - ASSERT_EFI_ERROR (Status); - - Status = GetConfigBlock ((VOID *) ScPolicyPpi, &gVtdConfigGuid, (VOID *) &VtdConfig); - ASSERT_EFI_ERROR (Status); - - // - // Get System configuration variables - // - VariableSize = sizeof (SYSTEM_CONFIGURATION); - Status = VariableServices->GetVariable ( - VariableServices, - PLATFORM_SETUP_VARIABLE_NAME, - &gEfiSetupVariableGuid, - NULL, - &VariableSize, - &SystemConfiguration - ); - if (!EFI_ERROR (Status)) { - // - // Get the Platform Configuration from SetupData - // - GtConfig->GttMmAdr = GTTMM_BASE_ADDRESS; - GtConfig->GmAdr = GMADR_BASE_ADDRESS; - GtConfig->PeiGraphicsPeimInit = SystemConfiguration.PeiGraphicsPeimInit; - GtConfig->PmSupport = SystemConfiguration.PmSupport; - GtConfig->EnableRenderStandby = SystemConfiguration.EnableRenderStandby; - GtConfig->CdClock = SystemConfiguration.CdClock; - GtConfig->PavpEnable = SystemConfiguration.PavpEnable; - - GtConfig->ForceWake = 0; - GtConfig->PavpLock = 1; - GtConfig->GraphicsFreqModify = 0; - GtConfig->GraphicsFreqReq = 0; - GtConfig->GraphicsVideoFreq = 0; - GtConfig->PmLock = 1; - GtConfig->DopClockGating = 1; - GtConfig->UnsolicitedAttackOverride = 0; - GtConfig->WOPCMSupport = 1; - GtConfig->WOPCMSize = 0; - GtConfig->PowerGating = 0; - GtConfig->UnitLevelClockGating = 1; - - MiscConfig->FastBoot = 1; - MiscConfig->DynSR = 1; - - IpuPolicy->SaIpuEnable = SystemConfiguration.IpuEn; - - SocSeries = GetBxtSeries (); - SocStepping = BxtStepping (); - if ((SocSeries == BxtP && SocStepping <= BxtPB2) || (SocSeries != BxtP && SocStepping < BxtC0)) { - if (IpuPolicy->SaIpuEnble == 1) { - VtdConfig->VtdEnable = 0; - } - } - - IpuPolicy->IpuAcpiMode = SystemConfiguration.IpuAcpiMode; - IpuPolicy->IpuMmAdr = IPUMM_BASE_ADDRESS; - } - - PeiGetSectionFromFv (PeiLogoGuid, &Buffer, &Size); - if (Buffer == NULL) { - DEBUG ((DEBUG_ERROR, "Could not locate Pei Logo")); - } - GtConfig->LogoPtr = Buffer; - GtConfig->LogoSize = Size; - DEBUG ((DEBUG_INFO, "LogoPtr from PeiGetSectionFromFv is 0x%x\n", Buffer)); - DEBUG ((DEBUG_INFO, "LogoSize from PeiGetSectionFromFv is 0x%x\n", Size)); - - // - // VBT selection may depend on SystemConfiguration->PanelSel value - // - PeiGetSectionFromFv (TianmaVbtGuid, &Buffer, &Size); - - if (Buffer == NULL) { - DEBUG ((DEBUG_ERROR, "Could not locate VBT")); - } - GtConfig->GraphicsConfigPtr = Buffer; - - // - // Build the VBT data into HOB for DXE GOP - // - VbtInfo.VbtAddress = (EFI_PHYSICAL_ADDRESS) Buffer; - VbtInfo.VbtSize = Size; - DEBUG ((DEBUG_INFO, "VbtInfo VbtAddress is 0x%x\n", Buffer)); - DEBUG ((DEBUG_INFO, "VbtInfo VbtSize is 0x%x\n", Size)); - - BuildGuidDataHob ( - &gVbtInfoGuid, - &VbtInfo, - sizeof (VbtInfo) - ); - - return EFI_SUCCESS; -} - - -/** - PeiGetSectionFromFv finds the file in FV and gets file Address and Size - - @param[in] NameGuid File GUID - @param[out] Address Pointer to the File Address - @param[out] Size Pointer to File Size - - @retval EFI_SUCCESS Successfull in reading the section from FV - -**/ -EFI_STATUS -EFIAPI -PeiGetSectionFromFv ( - IN CONST EFI_GUID NameGuid, - OUT VOID **Address, - OUT UINT32 *Size - ) -{ - EFI_STATUS Status; - EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; - EFI_FV_FILE_INFO FvFileInfo; - PEI_CORE_INSTANCE *PrivateData; - UINTN CurrentFv; - PEI_CORE_FV_HANDLE *CoreFvHandle; - EFI_PEI_FILE_HANDLE VbtFileHandle; - EFI_GUID *VbtGuid; - EFI_COMMON_SECTION_HEADER *Section; - CONST EFI_PEI_SERVICES **PeiServices; - - PeiServices = GetPeiServicesTablePointer (); - - PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices); - - Status = PeiServicesLocatePpi ( - &gEfiFirmwareFileSystem2Guid, - 0, - NULL, - (VOID **) &FvPpi - ); - ASSERT_EFI_ERROR (Status); - - CurrentFv = PrivateData->CurrentPeimFvCount; - CoreFvHandle = &(PrivateData->Fv[CurrentFv]); - - Status = FvPpi->FindFileByName (FvPpi, &NameGuid, &CoreFvHandle->FvHandle, &VbtFileHandle); - if (!EFI_ERROR (Status) && VbtFileHandle != NULL) { - DEBUG ((DEBUG_INFO, "Find SectionByType \n")); - Status = FvPpi->FindSectionByType (FvPpi, EFI_SECTION_RAW, VbtFileHandle, (VOID **) &VbtGuid); - if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "GetFileInfo \n")); - Status = FvPpi->GetFileInfo (FvPpi, VbtFileHandle, &FvFileInfo); - Section = (EFI_COMMON_SECTION_HEADER *) FvFileInfo.Buffer; - if (IS_SECTION2 (Section)) { - ASSERT (SECTION2_SIZE (Section) > 0x00FFFFFF); - *Size = SECTION2_SIZE (Section) - sizeof (EFI_COMMON_SECTION_HEADER2); - *Address = ((UINT8 *) Section + sizeof (EFI_COMMON_SECTION_HEADER2)); - } else { - *Size = SECTION_SIZE (Section) - sizeof (EFI_COMMON_SECTION_HEADER); - *Address = ((UINT8 *) Section + sizeof (EFI_COMMON_SECTION_HEADER)); - } - } - } - - return EFI_SUCCESS; -} - diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.h b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.h deleted file mode 100644 index ae1fd09602..0000000000 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiSaPolicyUpdate.h +++ /dev/null @@ -1,43 +0,0 @@ -/** @file - Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _PEI_SA_POLICY_UPDATE_H_ -#define _PEI_SA_POLICY_UPDATE_H_ - -// -// External include files do NOT need to be explicitly specified in real EDKII -// environment -// -#include -#include -#include -#include -#include -#include - -extern EFI_GUID gVbtInfoGuid; - -typedef struct { - EFI_PHYSICAL_ADDRESS VbtAddress; - UINT32 VbtSize; -} VBT_INFO; - -EFI_STATUS -EFIAPI -PeiGetSectionFromFv ( - IN CONST EFI_GUID NameGuid, - OUT VOID **Address, - OUT UINT32 *Size - ); -#endif - diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PeiSaPolicyUpdate.h b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PeiSaPolicyUpdate.h index d9f5be520f..077f63bbfe 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PeiSaPolicyUpdate.h +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PeiSaPolicyUpdate.h @@ -1,5 +1,5 @@ /** @file - Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -22,7 +22,6 @@ #include #include #include -#include #include #endif diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c index 84ff11700c..6e8d4ab24c 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c @@ -1,7 +1,7 @@ /** @file Do platform specific PEI stage initializations. - Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -287,126 +287,20 @@ BXTPolicyInit ( IN SYSTEM_CONFIGURATION *SystemConfiguration ) { - EFI_STATUS Status; - SI_SA_POLICY_PPI *SiSaPolicyPpi; - SA_MISC_CONFIG *MiscConfig = NULL; - GRAPHICS_CONFIG *GtConfig = NULL; - IPU_CONFIG *IpuPolicy = NULL; -#if (ENBDT_PF_ENABLE == 1) - HYBRID_GRAPHICS_CONFIG *HgConfig = NULL; -#endif VOID* Buffer; UINT32 Size; EFI_GUID PeiLogoGuid = { 0x7BB28B99, 0x61BB, 0x11D5, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }; EFI_GUID TianmaVbtGuid = { 0xE08CA6D5, 0x8D02, 0x43ae, 0xAB, 0xB1, 0x95, 0x2C, 0xC7, 0x87, 0xC9, 0x33 }; VBT_INFO VbtInfo; - EFI_BOOT_MODE BootMode; - - DEBUG ((DEBUG_INFO, " BXTPolicyInit: SystemAgent PEI Platform Policy Initialization begin \n")); - - Status = CreateConfigBlocks (&SiSaPolicyPpi); - DEBUG ((DEBUG_INFO, "SiSaPolicyPpi->TableHeader.NumberOfBlocks = 0x%x\n ", SiSaPolicyPpi->TableHeader.NumberOfBlocks )); - ASSERT_EFI_ERROR (Status); - - - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gSaMiscConfigGuid , (VOID *) &MiscConfig); - ASSERT_EFI_ERROR (Status); - - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gGraphicsConfigGuid, (VOID *) &GtConfig); - ASSERT_EFI_ERROR (Status); - Status = GetConfigBlock ((VOID *) SiSaPolicyPpi, &gIpuConfigGuid, (VOID *) &IpuPolicy); - ASSERT_EFI_ERROR (Status); - -#if (ENBDT_PF_ENABLE == 1) - Status = GetConfigBlock((VOID *) SiSaPolicyPpi, &gHybridGraphicsConfigGuid, (VOID *) &HgConfig); - ASSERT_EFI_ERROR(Status); -#endif - if (!EFI_ERROR (Status)) { - // - // Get the Platform Configuration from SetupData - // - GtConfig->GttMmAdr = GTTMM_BASE_ADDRESS; - GtConfig->GmAdr = GMADR_BASE_ADDRESS; - GtConfig->PeiGraphicsPeimInit = SystemConfiguration->PeiGraphicsPeimInit; - GtConfig->PmSupport = SystemConfiguration->PmSupport; - GtConfig->EnableRenderStandby = SystemConfiguration->EnableRenderStandby; - GtConfig->CdClock = SystemConfiguration->CdClock; - GtConfig->PavpEnable = SystemConfiguration->PavpEnable; - - GtConfig->ForceWake = 0; - GtConfig->PavpLock = 1; - GtConfig->GraphicsFreqModify = 0; - GtConfig->GraphicsFreqReq = 0; - GtConfig->GraphicsVideoFreq = 0; - GtConfig->PmLock = 1; - GtConfig->DopClockGating = 1; - GtConfig->UnsolicitedAttackOverride = 0; - GtConfig->WOPCMSupport = 1; - GtConfig->WOPCMSize = 0; - GtConfig->PowerGating = 0; - GtConfig->UnitLevelClockGating = 1; - - MiscConfig->FastBoot = 1; - MiscConfig->DynSR = 1; - IpuPolicy->SaIpuEnable = SystemConfiguration->IpuEn; - IpuPolicy->IpuAcpiMode = SystemConfiguration->IpuAcpiMode; - IpuPolicy->IpuMmAdr = IPUMM_BASE_ADDRESS; - -#if (ENBDT_PF_ENABLE == 1) - // - // In Hybrid Gfx mode PCIe needs to be always enabled - // and IGFX must be set as Primary Display. - // - if (SystemConfiguration->PrimaryVideoAdaptor == 4) { - HgConfig->HgEnabled = 1; - HgConfig->HgSubSystemId = 0x2112; - } else { - HgConfig->HgEnabled = 0; - HgConfig->HgSubSystemId = 0x2212; - } - - HgConfig->HgDelayAfterPwrEn = SystemConfiguration->DelayAfterPwrEn; - HgConfig->HgDelayAfterHoldReset = SystemConfiguration->DelayAfterHoldReset; - // - // Configure below based on the OEM platfrom design - // Hybrid Graphics Enabled - 0= Disabled, 1=Enabled - // - if (HgConfig->HgEnabled == 1) { - // - // dGPU HLD RST GPIO assigned - // - HgConfig->HgDgpuHoldRst.CommunityOffset = (((UINT32) GPIO_MMIO_OFFSET_W) << 16); - HgConfig->HgDgpuHoldRst.PinOffset = 0x05B0; - HgConfig->HgDgpuHoldRst.Active = 0; - // - // dGPU PWR Enable GPIO assigned - // - HgConfig->HgDgpuPwrEnable.CommunityOffset = (((UINT32) GPIO_MMIO_OFFSET_N) << 16); - HgConfig->HgDgpuPwrEnable.PinOffset = 0x0598; - HgConfig->HgDgpuPwrEnable.Active = 1; - - HgConfig->RootPortDev = PCI_DEVICE_NUMBER_SC_PCIE_DEVICE_2; - HgConfig->RootPortFun = PCI_FUNCTION_NUMBER_PCIE_ROOT_PORT_3; + DEBUG ((DEBUG_INFO, " BXTPolicyInit: SystemAgent PEI Platform Policy Initialization begin \n")); - DEBUG ((DEBUG_INFO, "HG::Hybrid Graphics Policy updated\n")); - } -#endif - } - - Status = (*PeiServices)->GetBootMode ((CONST EFI_PEI_SERVICES **) PeiServices, &BootMode); - ASSERT_EFI_ERROR (Status); PeiGetSectionFromFv (PeiLogoGuid, &Buffer, &Size); if (Buffer == NULL) { DEBUG (( DEBUG_ERROR, "Could not locate PeiLogo")); } - GtConfig->LogoPtr = Buffer; - GtConfig->LogoSize = Size; - DEBUG ((DEBUG_INFO, "LogoPtr from PeiGetSectionFromFv is 0x%x\n", Buffer)); - DEBUG ((DEBUG_INFO, "LogoSize from PeiGetSectionFromFv is 0x%x\n", Size)); - DEBUG ((DEBUG_INFO, "SystemConfiguration->PanelSel = 0x%x\n", SystemConfiguration->PanelSel)); // // May need a different VBT depending on PanelSel @@ -417,11 +311,6 @@ BXTPolicyInit ( DEBUG (( DEBUG_ERROR, "Could not locate VBT")); } - if (BootMode == BOOT_ON_S3_RESUME) { - GtConfig->GraphicsConfigPtr = NULL; - } else { - GtConfig->GraphicsConfigPtr = Buffer; - } // // Build the VBT data into HOB for DXE GOP @@ -437,16 +326,7 @@ BXTPolicyInit ( sizeof (VbtInfo) ); - // - // Install SiSaPolicyPpi. - // While installed, RC assumes the Policy is ready and finalized. So please - // update and override any setting before calling this function. - // - Status = SiSaInstallPolicyPpi (SiSaPolicyPpi); - ASSERT_EFI_ERROR (Status); - DEBUG ((DEBUG_INFO, " SystemAgent PEI Platform Policy Initialization Done \n")); - ASSERT_EFI_ERROR (Status); return EFI_SUCCESS; } diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.h b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.h index 09813e904f..c931b07ff3 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.h +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.h @@ -1,7 +1,7 @@ /** @file Platform Early Stage header file. - Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -57,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf index cd8b617017..762eff2a2b 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf @@ -1,7 +1,7 @@ ## @file # Component description file for PlatformInit module. # -# Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -50,7 +50,6 @@ SteppingLib SideBandLib ConfigBlockLib - PeiSaPolicyLib PeiPolicyUpdateLib PeiPolicyInitLib CpuPolicyLib @@ -75,7 +74,6 @@ gEfiPeiSmbus2PpiGuid gScPolicyPpiGuid gEfiPeiVirtualBlockIoPpiGuid - gSiSaPolicyPpiGuid gDramPolicyPpiGuid gBiosGuardConfigGuid gCpuConfigGuid diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PeiSaPolicyUpdate.h b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PeiSaPolicyUpdate.h index d9f5be520f..077f63bbfe 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PeiSaPolicyUpdate.h +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PeiSaPolicyUpdate.h @@ -1,5 +1,5 @@ /** @file - Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -22,7 +22,6 @@ #include #include #include -#include #include #endif diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInit.h b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInit.h index 09813e904f..c931b07ff3 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInit.h +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInit.h @@ -1,7 +1,7 @@ /** @file Platform Early Stage header file. - Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -57,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c index 8348bf7233..cab3847649 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c @@ -1,7 +1,7 @@ /** @file Source code file for Platform Init Pre-Memory PEI module. - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -32,8 +32,6 @@ #include #include #include -#include -#include #include #include #include @@ -65,7 +63,6 @@ #include #include #include -#include #include "Smip.h" #include "Stall.h" #include "FvCallback.h" @@ -288,59 +285,6 @@ CopyMemSse4 ( } -/** - This function get SA setup config in PEI. - - @param[in, out] SaPreMemConfig Pointer to SA Pre Mem Config Block - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_DEVICE_ERROR Memory test failed. It's not safe to use this range of memory. - -**/ -EFI_STATUS -EFIAPI -UpdateSaPreMemPolicy ( - IN OUT SA_PRE_MEM_CONFIG *SaPreMemConfig - ) -{ - EFI_STATUS Status; - UINTN VariableSize = 0; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - SYSTEM_CONFIGURATION SystemConfiguration; - - Status = PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NULL, (VOID **) &VariableServices); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - VariableSize = sizeof (SYSTEM_CONFIGURATION); - Status = VariableServices->GetVariable ( - VariableServices, - PLATFORM_SETUP_VARIABLE_NAME, - &gEfiSetupVariableGuid, - NULL, - &VariableSize, - &SystemConfiguration - ); - - if (Status == EFI_SUCCESS) { - SaPreMemConfig->IgdDvmt50PreAlloc = SystemConfiguration.IgdDvmt50PreAlloc; - SaPreMemConfig->ApertureSize = SystemConfiguration.IgdApertureSize; - SaPreMemConfig->GttSize = SystemConfiguration.GTTSize; - SaPreMemConfig->InternalGraphics = SystemConfiguration.Igd; - SaPreMemConfig->PrimaryDisplay = SystemConfiguration.PrimaryVideoAdaptor; - if (SystemConfiguration.PrimaryVideoAdaptor == 4) { - // - // When Primary Display is selected as HG, Display is driven on-board and PrimaryDisplay should be set as 0. (IGD) - // - SaPreMemConfig->PrimaryDisplay = 0; - } - } - - return Status; -} - - #if defined(PRAM_SUPPORT) /** @@ -757,53 +701,6 @@ PeiScPreMemPolicyInit ( } -/** - This function performs SA PreMem Policy initialization. - - @retval EFI_SUCCESS The PPI is installed and initialized. - @retval EFI ERRORS The PPI is not successfully installed. - @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the driver - -**/ -EFI_STATUS -EFIAPI -PeiSaPreMemPolicyInit ( - VOID - ) -{ - EFI_STATUS Status; - SI_SA_POLICY_PPI *SaPolicyPpi; - SA_PRE_MEM_CONFIG *SaPreMemConfig = NULL; - - // - // Call SaCreatePreMemConfigBlocks to initialize SA Policy structure - // and get all Intel default policy settings. - // - Status = SaCreatePreMemConfigBlocks (&SaPolicyPpi); - ASSERT_EFI_ERROR (Status); - - // - // Update and override all platform related and customized settings below. - // - Status = GetConfigBlock ((VOID *) SaPolicyPpi, &gSaPreMemConfigGuid, (VOID *) &SaPreMemConfig); - ASSERT_EFI_ERROR (Status); - - // - // Update SA Pre-mem policies with setup values - // - UpdateSaPreMemPolicy (SaPreMemConfig); - - // - // Install SaPreMemPolicyPpi. - // While installed, RC assumes the Policy is ready and finalized. So please - // update and override any setting before calling this function. - // - Status = SaInstallPreMemPolicyPpi (SaPolicyPpi); - ASSERT_EFI_ERROR (Status); - - return Status; -} - #if (ENBDT_PF_ENABLE == 1) // @@ -1192,9 +1089,6 @@ PlatformInitPreMemEntryPoint ( // RtcPowerFailureHandler (); - Status = PeiSaPreMemPolicyInit(); - ASSERT_EFI_ERROR (Status); - #if (ENBDT_PF_ENABLE == 1) if (GetBxtSeries() == BxtP) { // diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.h b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.h index ca571ec8ed..17b4dad36d 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.h +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.h @@ -1,7 +1,7 @@ /** @file The header file of Platform PEIM. - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -72,12 +72,6 @@ SeCUmaEntry ( IN CONST EFI_PEI_SERVICES **PeiServices ); -EFI_STATUS -EFIAPI -UpdateSaPreMemPolicy ( - IN OUT SA_PRE_MEM_CONFIG *SaPreMemConfig - ); - EFI_STATUS EFIAPI GetBiosReservedMemoryPolicy ( -- cgit v1.2.3