From nobody Sun May 5 02:12:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1510225570642624.6891525671417; Thu, 9 Nov 2017 03:06:10 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 310DF2034AB29; Thu, 9 Nov 2017 03:02:07 -0800 (PST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 14E5F21B00DC1 for ; Thu, 9 Nov 2017 03:02:05 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2017 03:06:07 -0800 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 09 Nov 2017 03:06:06 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 9 Nov 2017 03:06:06 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 9 Nov 2017 03:06:05 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Thu, 9 Nov 2017 19:06:03 +0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=mang.guo@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,369,1505804400"; d="dat'59?scan'59,208,59";a="147883477" From: "Guo, Mang" To: "edk2-devel@lists.01.org" Thread-Topic: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Set MaxPkgCState Thread-Index: AdNZSrtE+FBsO1PJQAy8jgGIwKYRlQ== Date: Thu, 9 Nov 2017 11:06:03 +0000 Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1525779FB@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <22D2C85ED001C54AA20BFE3B0E4751D1525779FB@SHSMSX103.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Set MaxPkgCState X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Wei, David" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Guo Mang --- .../Board/BensonGlacier/BoardInitPostMem/BoardInit.c | 11 +++++++= ++-- .../Board/BensonGlacier/BoardInitPostMem/BoardInitMiscs.h | 7 +++++++ .../Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf | 1 + .../Board/LeafHill/BoardInitPostMem/BoardInit.c | 9 +++++++= +- .../Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h | 6 ++++++ .../Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf | 1 + .../Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c | 4 ++-- .../Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 1 + .../Common/Library/PeiPolicyUpdateLib/PeiCpuPolicyUpdate.c | 2 +- .../Common/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf | 1 + .../Common/PlatformSettings/PlatformDxe/Platform.c | 8 +++----- .../Common/PlatformSettings/PlatformDxe/PlatformDxe.inf | 3 ++- .../Common/PlatformSettings/PlatformSetupDxe/CpuPower.vfi | 6 +++--- Platform/BroxtonPlatformPkg/PlatformPkg.dec | 6 ++++-- 14 files changed, 49 insertions(+), 17 deletions(-) diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostM= em/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitP= ostMem/BoardInit.c index 536c390..ab11aaa 100644 --- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInit.c +++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInit.c @@ -50,6 +50,7 @@ BensonGlacierPostMemInitCallback ( UINT8 FabId; UINT8 ResetType; UINTN BufferSize; + UINT8 MaxPkgCState; =20 Status =3D PeiServicesLocatePpi ( &gBoardPostMemInitDoneGuid, @@ -88,12 +89,18 @@ BensonGlacierPostMemInitCallback ( // BufferSize =3D sizeof (EFI_GUID); PcdSetPtr(PcdBoardVbtFileGuid, &BufferSize, (UINT8 *)&gPeiBensonGlacierV= btGuid); - =20 + // // Set PcdSueCreek // PcdSetBool (PcdSueCreek, TRUE); - =20 + + // + // Set PcdMaxPkgCState + // + MaxPkgCState =3D MAX_PKG_CSTATE_C2; + PcdSet8 (PcdMaxPkgCState, (UINT8) MaxPkgCState); + // // Add init steps here // diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostM= em/BoardInitMiscs.h b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/Board= InitPostMem/BoardInitMiscs.h index 2cf4810..2ac2859 100644 --- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInitMiscs.h +++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInitMiscs.h @@ -94,6 +94,13 @@ #define SUBSYSTEM_DEVICE_ID 0x1234 #define SUBSYSTEM_SVID_SSID (SUBSYSTEM_VENDOR_ID + (SUBSYSTEM_DEVICE_ID = << 16)) =20 +// +// MaxPkgCState identifier. +// +#define MAX_PKG_CSTATE_C0 0x00 +#define MAX_PKG_CSTATE_C1 0x01 +#define MAX_PKG_CSTATE_C2 0x02 + EFI_STATUS BensonGetPlatformInfoHob ( IN CONST EFI_PEI_SERVICES **PeiServices, diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostM= em/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/B= oardInitPostMem/BoardInitPostMem.inf index 5989d30..55ec5b7 100644 --- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInitPostMem.inf +++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/Boar= dInitPostMem.inf @@ -64,6 +64,7 @@ gPlatformModuleTokenSpaceGuid.PcdResetType gPlatformModuleTokenSpaceGuid.PcdBoardVbtFileGuid gPlatformModuleTokenSpaceGuid.PcdSueCreek + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState =20 [Guids] gEfiPlatformInfoGuid diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/Bo= ardInit.c b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/Boa= rdInit.c index af53b8c..7221f84 100644 --- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= .c +++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= .c @@ -58,6 +58,7 @@ LeafHillPostMemInitCallback ( UINT8 FabId; UINT8 ResetType; UINTN BufferSize; + UINT8 MaxPkgCState; =20 Status =3D PeiServicesLocatePpi ( &gBoardPostMemInitDoneGuid, @@ -101,7 +102,13 @@ LeafHillPostMemInitCallback ( // Set PcdSueCreek // PcdSetBool (PcdSueCreek, FALSE); - =20 + + // + // Set PcdMaxPkgCState + // + MaxPkgCState =3D MAX_PKG_CSTATE_C2; + PcdSet8 (PcdMaxPkgCState, (UINT8) MaxPkgCState); + // // Add init steps here // diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/Bo= ardInitMiscs.h b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMe= m/BoardInitMiscs.h index 98100c2..c1ba128 100644 --- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= Miscs.h +++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= Miscs.h @@ -86,6 +86,12 @@ #define SUBSYSTEM_DEVICE_ID 0x1234 #define SUBSYSTEM_SVID_SSID (SUBSYSTEM_VENDOR_ID + (SUBSYSTEM_DEVICE_ID = << 16)) =20 +// +// MaxPkgCState identifier. +// +#define MAX_PKG_CSTATE_C0 0x00 +#define MAX_PKG_CSTATE_C1 0x01 +#define MAX_PKG_CSTATE_C2 0x02 EFI_STATUS LeafHillGetPlatformInfoHob ( IN CONST EFI_PEI_SERVICES **PeiServices, diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/Bo= ardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPo= stMem/BoardInitPostMem.inf index a794d6b..526e903 100644 --- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= PostMem.inf +++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit= PostMem.inf @@ -62,6 +62,7 @@ gPlatformModuleTokenSpaceGuid.PcdResetType gPlatformModuleTokenSpaceGuid.PcdBoardVbtFileGuid gPlatformModuleTokenSpaceGuid.PcdSueCreek + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState =20 [Guids] gEfiPlatformInfoGuid diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib= /PeiFspCpuPolicyInitLib.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiF= spPolicyInitLib/PeiFspCpuPolicyInitLib.c index 4af0dc2..6c176d0 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFsp= CpuPolicyInitLib.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFsp= CpuPolicyInitLib.c @@ -1,7 +1,7 @@ /** @file Implementation of Fsp PCH Policy Initialization. =20 - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -112,7 +112,7 @@ PeiFspCpuPolicyInit ( FspsUpd->FspsConfig.EnableCx =3D SystemConfiguration->Ena= bleCx; FspsUpd->FspsConfig.C1e =3D SystemConfiguration->Ena= bleCxe; FspsUpd->FspsConfig.BiProcHot =3D SystemConfiguration->Ena= bleProcHot; - FspsUpd->FspsConfig.PkgCStateLimit =3D (MAX_PKG_C_STATE) System= Configuration->MaxPkgCState; + FspsUpd->FspsConfig.PkgCStateLimit =3D (MAX_PKG_C_STATE) PcdGet= 8 (PcdMaxPkgCState); FspsUpd->FspsConfig.EnableCx =3D SystemConfiguration->Ena= bleCx; FspsUpd->FspsConfig.CStateAutoDemotion =3D SystemConfiguration->CSt= ateAutoDemotion; FspsUpd->FspsConfig.CStateUnDemotion =3D SystemConfiguration->CSt= ateUnDemotion; diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib= /PeiFspPolicyInitLib.inf b/Platform/BroxtonPlatformPkg/Common/Library/PeiFs= pPolicyInitLib/PeiFspPolicyInitLib.inf index f0e6bf7..5ce0cc2 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFsp= PolicyInitLib.inf +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFsp= PolicyInitLib.inf @@ -85,6 +85,7 @@ gEfiBxtTokenSpaceGuid.PcdPmcGcrBaseAddress gPlatformModuleTokenSpaceGuid.PcdResetType gPlatformModuleTokenSpaceGuid.PcdBoardVbtFileGuid + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState =20 [Ppis] gSiPolicyPpiGuid ## CONSUMES diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/= PeiCpuPolicyUpdate.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicy= UpdateLib/PeiCpuPolicyUpdate.c index 27c4dfc..db5b9a4 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiCpuP= olicyUpdate.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiCpuP= olicyUpdate.c @@ -68,7 +68,7 @@ UpdatePeiCpuPolicy ( PowerMgmtConfig->Cx =3D SystemConfiguration->EnableCx; PowerMgmtConfig->C1e =3D SystemConfiguration->EnableCx= e; PowerMgmtConfig->BiProcHot =3D SystemConfiguration->EnablePr= ocHot; - PowerMgmtConfig->PkgCStateLimit =3D (MAX_PKG_C_STATE) SystemConfi= guration->MaxPkgCState; + PowerMgmtConfig->PkgCStateLimit =3D (MAX_PKG_C_STATE) PcdGet8 (Pc= dMaxPkgCState); PowerMgmtConfig->AutoThermalReporting =3D SystemConfiguration->AutoTher= malReporting; =20 if (BxtStepping () >=3D BxtPB1) { diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/= PeiPolicyUpdateLib.inf b/Platform/BroxtonPlatformPkg/Common/Library/PeiPoli= cyUpdateLib/PeiPolicyUpdateLib.inf index ea8d7fb..d1f8cc2 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPoli= cyUpdateLib.inf +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiPoli= cyUpdateLib.inf @@ -81,6 +81,7 @@ gEfiBxtTokenSpaceGuid.PcdP2SBBaseAddress gEfiBxtTokenSpaceGuid.PcdPmcGcrBaseAddress gPlatformModuleTokenSpaceGuid.PcdResetType + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState =20 [FixedPcd] gPlatformModuleTokenSpaceGuid.PcdFlashAreaSize diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDx= e/Platform.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/Platform= Dxe/Platform.c index 54e80df..b03f825 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platf= orm.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platf= orm.c @@ -773,11 +773,9 @@ InitializePlatform ( mSystemConfiguration.PlatformSettingEn =3D 1; } =20 - mSystemConfiguration.PmicSetupDefault =3D 0; - if (PlatformInfoHob->PmicVersion =3D=3D 0) { - mSystemConfiguration.PmicSetupDefault =3D 1; - mSystemConfiguration.MaxPkgCState =3D 0; - } + mSystemConfiguration.PmicSetupDefault =3D 1; + mSystemConfiguration.MaxPkgCState =3D PcdGet8 (PcdMaxPkgCState); + =20 Status =3D gRT->SetVariable ( L"Setup", diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDx= e/PlatformDxe.inf b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/Pla= tformDxe/PlatformDxe.inf index b15d0ed..8cb63e9 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platf= ormDxe.inf +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platf= ormDxe.inf @@ -133,7 +133,8 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFastPS2Detection gEfiBxtTokenSpaceGuid.PcdP2SBBaseAddress gPlatformModuleTokenSpaceGuid.PcdLogoFileGuid - gPlatformModuleTokenSpaceGuid.PcdLogoDisplay + gPlatformModuleTokenSpaceGuid.PcdLogoDisplay + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState =20 [FeaturePcd] gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSe= tupDxe/CpuPower.vfi b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/P= latformSetupDxe/CpuPower.vfi index e15973a..14490e5 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/= CpuPower.vfi +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/= CpuPower.vfi @@ -64,13 +64,13 @@ form formid =3D CPU_PWR_CONFIGURATION_FORM_ID, oneof varid =3D Setup.MaxPkgCState, prompt =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_SUPPORT_PROMPT), help =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_STATE_SUPPORT_HELP), - option text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_C2), value =3D 2, f= lags =3D DEFAULT | MANUFACTURING | RESET_REQUIRED; + option text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_C2), value =3D 2, f= lags =3D RESET_REQUIRED; option text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_C1), value =3D 1, f= lags =3D RESET_REQUIRED; - option text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_C0), value =3D 0, f= lags =3D RESET_REQUIRED; + option text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_C0), value =3D 0, f= lags =3D DEFAULT | MANUFACTURING | RESET_REQUIRED; endoneof; endif; =20 - suppressif NOT ideqval Setup.PmicSetupDefault =3D=3D 1; + suppressif ideqval Setup.PmicSetupDefault =3D=3D 1; text help =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_STATE_SUPPORT_HELP), text =3D STRING_TOKEN(STR_MAX_PKG_CSTATE_SUPPORT_PROMPT), diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.dec b/Platform/Broxton= PlatformPkg/PlatformPkg.dec index 8bf6dc2..d6a175b 100644 --- a/Platform/BroxtonPlatformPkg/PlatformPkg.dec +++ b/Platform/BroxtonPlatformPkg/PlatformPkg.dec @@ -187,8 +187,10 @@ ## This PCD used for QR code display under EFI Shell gPlatformModuleTokenSpaceGuid.PcdLogoDisplay|FALSE|BOOLEAN|0x80000016 ## This PCD used to select bluetooth device - gPlatformModuleTokenSpaceGuid.PcdBtDevice|0x00|UINT8|0x80000017 - =20 + gPlatformModuleTokenSpaceGuid.PcdBtDevice|0x00|UINT8|0x80000017 + ## This PCD used to select MaxPkgCState + gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState|0x00|UINT8|0x80000018 + ## MemoryCheck value for checking memory before boot OS. ## To save the boot performance, the default MemoryCheck is set to 0. gClientCommonModuleTokenSpaceGuid.PcdPlatformMemoryCheck|0|UINT8|0x40000= 005 --=20 2.10.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel