From nobody Mon Feb 9 12:10:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+51397+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51397+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1574903233; cv=none; d=zohomail.com; s=zohoarc; b=P2PZXJjXVmuqKwK46BFI49dQA8TuEcpOwst92xHqTeKJXeUhng8Ao+d7M3GWl5q5q/CoP5AMF92v1SqrGtGsOcG8nKqFNWBc6/LaE+mvKI00tWtfR5ZeFix6hcggiWP9sFLIMkuioq2rKgfgomE8Kvnxc9WEBdBKopWU0bdQoy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574903233; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=PfOb4tBiTKCDkYoXCRUCrUPoRBJp4T6Cin0fqxu7gjs=; b=D4/A8a8X9SmC75lYsKqHfavzjQnoHcLHOdk0ZEn+PYihORiBKF574YasFkvaFb4Q0p8A6yl/rF2+yo+/YZrqvXyWTNRXriY3yYSgkLWv958ml7Q5IMmUnYGcHAR+TI/SOKYCOHn83jdFOs0JpappkO4W6oO9E4GHgBrhA93b5oA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51397+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1574903233385347.6242932770058; Wed, 27 Nov 2019 17:07:13 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id D9eMYY1788612xSp1ESm8PkF; Wed, 27 Nov 2019 17:07:12 -0800 X-Received: from mga05.intel.com (mga05.intel.com []) by mx.groups.io with SMTP id smtpd.web09.933.1574903199589090118 for ; Wed, 27 Nov 2019 17:07:11 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 17:07:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="383667727" X-Received: from makuback-desk1.amr.corp.intel.com ([10.7.159.162]) by orsmga005.jf.intel.com with ESMTP; 27 Nov 2019 17:07:11 -0800 From: "Kubacki, Michael A" To: devel@edk2.groups.io Cc: Sai Chaganty , Liming Gao Subject: [edk2-devel] [edk2-platforms][PATCH V2 12/47] Features/Intel/S3FeaturePkg: Add initial package Date: Wed, 27 Nov 2019 17:05:39 -0800 Message-Id: <20191128010614.43628-13-michael.a.kubacki@intel.com> In-Reply-To: <20191128010614.43628-1-michael.a.kubacki@intel.com> References: <20191128010614.43628-1-michael.a.kubacki@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.a.kubacki@intel.com X-Gm-Message-State: xpsv67NKUl2Uh99KF95B80dax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1574903232; bh=DNhvBOjh2FlAtkjT85qHqRSGyqfr+Zclx38rLLG4sSM=; h=Cc:Date:From:Reply-To:Subject:To; b=hRDYOpCohEymAuiq6y0oJV0hxW06i7uUdsMwtPL09SKGr/4bOjQmuhUjsKeIHa3s5J+ /IZVfTK+yc8b/KTctQy7LNQhbT2IVvi2GelUe09vh2mAN9p/xrRUmKaFvv1rFIGl+QLHN AlUTmIxNpnBRc3tiNwTipFZqrp44p06k2fQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Adds a new feature package for the S3 feature. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec | 30 += ++++ Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 122 += +++++++++++++++++++ Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 30 += ++++ Features/Intel/PowerManagement/S3FeaturePkg/Include/PostMemory.fdf | 8 ++ Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 10 ++ Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf | 35 += +++++ Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c | 36 += +++++ Features/Intel/PowerManagement/S3FeaturePkg/Readme.md | 94 += ++++++++++++++ 8 files changed, 365 insertions(+) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec b= /Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec new file mode 100644 index 0000000000..2a723ad3d6 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for S3 support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION =3D 0x00010017 + PACKAGE_NAME =3D S3FeaturePkg + PACKAGE_GUID =3D 600F7249-65BD-44E2-80D7-344BD5250198 + PACKAGE_VERSION =3D 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gS3FeaturePkgTokenSpaceGuid =3D {0x423c5a51, 0x36e9, 0x4aea, {0x92, 0x= dd, 0xdd, 0xae, 0x5b, 0x4a, 0x3d, 0x24}} + +[PcdsFeatureFlag] + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable|FALSE|BOOLEAN|0xA0000001 diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.= dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc new file mode 100644 index 0000000000..647dc3f93a --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc @@ -0,0 +1,122 @@ +## @file +# This is a build description file for the S3 advanced feature. +# This file should be included into another package DSC file to build this= feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile. +# +##########################################################################= ###### +[Defines] +!ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" +!endif +!ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" +!endif + +##########################################################################= ###### +# +# Library Class section - list of all Library Classes needed by this featu= re. +# +##########################################################################= ###### +[LibraryClasses] + ####################################### + # Edk2 Packages + ####################################### + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf + PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf + +[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] + ####################################### + # Edk2 Packages + ####################################### + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf + + ####################################### + # Silicon Initialization Package + ####################################### + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/P= eiSmmAccessLib.inf + +##########################################################################= ###### +# +# Component section - list of all components that need built for this feat= ure. +# +# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed +# into firmware volume images. This section is just a list of module= s to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary f= iles into firmware +# volume images, whose concept is beyond UEFI and is described in PI= specification. +# There may also be modules listed in this section that are not requ= ired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be +# generated for it, but the binary will not be put into any firmware= volume. +# +##########################################################################= ###### + +# +# Feature PEI Components +# + +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzi= lla.tianocore.org/show_bug.cgi?id=3D2308 +# is completed. +[Components.IA32] + ##################################### + # S3 Feature Package + ##################################### + + # Add library instances here that are not included in package components= and should be tested + # in the package build. + + # Add components here that should be included in the package build. + PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf + +# +# Feature DXE Components +# + +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzi= lla.tianocore.org/show_bug.cgi?id=3D2308 +# is completed. +[Components.X64] + ##################################### + # S3 Feature Package + ##################################### + + # Add library instances here that are not included in package components= and should be tested + # in the package build. + + # Add components here that should be included in the package build. + +##########################################################################= ######################### +# +# BuildOptions Section - Define the module specific tool chain flags that = should be used as +# the default flags for a module. These flags are a= ppended to any +# standard flags that are defined by the build proc= ess. They can be +# applied for any modules or only those modules wit= h the specific +# module style (EDK or EDKII) specified in [Compone= nts] section. +# +# For advanced features, it is recommended to enabl= e [BuildOptions] in +# the applicable INF file so it does not affect the= whole board package +# build when this DSC file is active. +# +##########################################################################= ######################### +[BuildOptions] diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc b= /Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc new file mode 100644 index 0000000000..28ee49d429 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for S3 support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + PLATFORM_NAME =3D S3FeaturePkg + PLATFORM_GUID =3D 02E7C519-5A24-4594-8D69-F4117D6E3D25 + PLATFORM_VERSION =3D 0.1 + DSC_SPECIFICATION =3D 0x00010005 + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES =3D IA32|X64 + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER =3D DEFAULT + PEI_ARCH =3D IA32 + DXE_ARCH =3D X64 + +# +# This package always builds the feature. +# +!include Include/S3Feature.dsc diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PostMemory= .fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PostMemory.fdf new file mode 100644 index 0000000000..9e17f853c6 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,8 @@ +## @file +# FDF file for post-memory S3 advanced feature modules. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.= fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf new file mode 100644 index 0000000000..3cd5cd9628 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,10 @@ +## @file +# FDF file for pre-memory S3 advanced feature modules. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + INF PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf b/= Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf new file mode 100644 index 0000000000..46fbb62a46 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf @@ -0,0 +1,35 @@ +### @file +# Component information file for the S3 PEI module. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D S3Pei + FILE_GUID =3D 8683EFB2-FDE1-4AFF-B2DB-E96449FDD4E9 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D PEIM + ENTRY_POINT =3D S3PeiEntryPoint + +[LibraryClasses] + PeimEntryPoint + PeiServicesLib + SmmAccessLib + +[Packages] + MdePkg/MdePkg.dec + IntelSiliconPkg/IntelSiliconPkg.dec + PowerManagement/S3FeaturePkg/S3FeaturePkg.dec + +[Sources] + S3Pei.c + +[FeaturePcd] + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable + +[Depex] + gEfiPeiMemoryDiscoveredPpiGuid diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c b/Fe= atures/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c new file mode 100644 index 0000000000..b0aaa04962 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c @@ -0,0 +1,36 @@ +/** @file + Source code file for S3 PEI module + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + S3 PEI module entry point + + @param[in] FileHandle Not used. + @param[in] PeiServices General purpose services available to e= very PEIM. + + @retval EFI_SUCCESS The function completes successfully + @retval EFI_OUT_OF_RESOURCES Insufficient resources to create databa= se +**/ +EFI_STATUS +EFIAPI +S3PeiEntryPoint ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + EFI_STATUS Status; + + // + // Install EFI_PEI_MM_ACCESS_PPI for S3 resume case + // + Status =3D PeiInstallSmmAccessPpi (); + + return Status; +} diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Readme.md b/Featur= es/Intel/PowerManagement/S3FeaturePkg/Readme.md new file mode 100644 index 0000000000..f9b60b3f0c --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Readme.md @@ -0,0 +1,94 @@ +# Overview +* **Feature Name:** S3 +* **PI Phase(s) Supported:** PEI +* **SMM Required?** Yes + +More Information: +* [A Tour Beyond BIOS - Implementing S3 Resume with EDK II](https://github= .com/tianocore-docs/Docs/raw/master/White_Papers/A_Tour_Beyond_BIOS_Impleme= nting_S3_resume_with_EDKII_V2.pdf) +* [UEFI ACPI & Platform Initialization (PI Specification)](https://uefi.or= g/specifications) + +## Purpose +The S3 feature provides the set of firmware resources and board enabling i= nstructions to enable S3 firmware feature +support in a board package. S3 resume is a power saving feature defined in= the Advanced Configuration and Power +Interface (ACPI) specification. The ACPI specification defines a set of po= wer state transitions. In the context of this +feature, S3 refers to the G1 sleeping - S3 sleeping state. + +**Note: The S3 feature is currently not complete. Additional functionality= will be enabled in the future.** + +# High-Level Theory of Operation +*_TODO_* +A description of how the device works at a high-level. + +The description should not be constrained to implementation details but pr= ovide a simple mental model of how the +feature is supposed to work. + +## Firmware Volumes +*_TODO_* +A bulleted list of the firmware volumes that feature module(s) are placed = in. + +## Modules +*_TODO_* +A bulleted list of the modules that make up the feature. + +## +*_TODO_* +Each module in the feature should have a section that describes the module= in a level of detail that is useful +to better understand the module source code. + +## +*_TODO_* +Each library in the feature should have a section that describes the libra= ry in a level of detail that is useful +to better understand the library source code. + +## Key Functions +*_TODO_* +A bulleted list of key functions for interacting with the feature. + +Not all features need to be listed. Only functions exposed through externa= l interfaces that are important for feature +users to be aware of. + +## Configuration +*_TODO_* +Information that is useful for configuring the feature. + +Not all configuration options need to be listed. This section is used to p= rovide more background on configuration +options than possible elsewhere. + +## Data Flows +*_TODO_* +Architecturally defined data structures and flows for the feature. + +## Control Flows +*_TODO_* +Key control flows for the feature. + +## Build Flows +*_TODO_* +Any special build flows should be described in this section. + +This is particularly useful for features that use custom build tools or re= quire non-standard tool configuration. If the +standard flow in the feature package template is used, this section may be= empty. + +## Test Point Results +*_TODO_* +The test(s) that can verify porting is complete for the feature. + +Each feature must describe at least one test point to verify the feature i= s successful. If the test point is not +implemented, this should be stated. + +## Functional Exit Criteria +*_TODO_* +The testable functionality for the feature. + +This section should provide an ordered list of criteria that a board integ= rator can reference to ensure the feature is +functional on their board. + +## Feature Enabling Checklist +*_TODO_* +An ordered list of required activities to achieve desired functionality fo= r the feature. + +## Common Optimizations +*_TODO_* +Common size or performance tuning options for this feature. + +This section is recommended but not required. If not used, the contents sh= ould be left empty. --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51397): https://edk2.groups.io/g/devel/message/51397 Mute This Topic: https://groups.io/mt/63457554/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-