From nobody Mon Feb 9 10:57:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85854+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85854+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1642641277; cv=none; d=zohomail.com; s=zohoarc; b=P4t6cJBGONruBw3r315hoeG05OtZte0Hnq9ymwvqQtaUhsLPe4q9+kwnmY3Zgy9xN+IqmTEkwzmXHbwpWSgb5EFTgFS1qoYvqvlbytlTLDz9BYiQozzsZ5yrWqO8UThGukFnwNZL/EY1pvM+0uQ6jiU8QKi+03GgyE1PMLvwg3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642641277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=3GQf9TeWj1PE9nTineQe9WsEnV8K8o8iMbQMy1v73dM=; b=KmyUThZjlEA2OU7eiLkSSUdUc6x0P79QB5a+1oc3ThMvRLUJbOBou0E23rSofYrJx6XXwUeCMJPK9eTpuqWfl9wGJOOmwAj9aTWjBEpZR20gckqaQckzeJ2hh6r5d04jwJmToqBJaLEjnxdeEFWknj8cG/EAJUXyEsCSINj3tn4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85854+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1642641277550272.81330280438385; Wed, 19 Jan 2022 17:14:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0jzzYY1788612xquIkizkwea; Wed, 19 Jan 2022 17:14:37 -0800 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.5672.1642641269163839556 for ; Wed, 19 Jan 2022 17:14:30 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="308578751" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="308578751" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 17:14:28 -0800 X-IronPort-AV: E=Sophos;i="5.88,301,1635231600"; d="scan'208";a="532559816" X-Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 17:14:27 -0800 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Eric Dong , Liming Gao Subject: [edk2-devel][edk2-platforms][PATCH V2 09/14] PostCodeDebugFeaturePkg: Complete as an advanced feature Date: Wed, 19 Jan 2022 17:14:04 -0800 Message-Id: <5b15ea9978292eb68d823ad3f086adfea5ca8658.1642640106.git.isaac.w.oram@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,isaac.w.oram@intel.com X-Gm-Message-State: tgUA8qLmDiyGdNSOvGU5aDTmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642641277; bh=v0wvWSt/d0bQkrJUHzzJTtWxDBmuCG4E3FlhcS/utZ8=; h=Cc:Date:From:Reply-To:Subject:To; b=uyzOWFnteTfGyts+mtrgw7KBBCMJ0AjMzqkm9H2X+WhDGVtxwkf18a0ojO2mCXmZNle AX4jVLs0g/THj0PpKev2jn67xzVl7nYuFlq9tbUQpz7CkGu92/XWuMcx+rBPe/WsMXaoI Vk+3MWnHgWc42K8qcssY3aXKcqLYxN9C8B8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642641279180100046 Content-Type: text/plain; charset="utf-8" Add feature enable PCD. Use MinPlatformPkg build include files. Fix PEI_COR typo in PEI handler lib. Build StatusCodeHandler components with unique filename GUID. Add PreMemory.fdf and PostMemory.fdf include files. Improve Readme formatting and feature enabling checklist. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Isaac Oram --- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeat= ure.dsc | 231 +++++--------------- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf = | 14 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf = | 13 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCod= eHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf | 2 +- Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.d= ec | 11 + Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.d= sc | 30 +++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md = | 31 ++- 7 files changed, 146 insertions(+), 186 deletions(-) diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostC= odeDebugFeature.dsc b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Incl= ude/PostCodeDebugFeature.dsc index 3d886fff38..31b0c02e79 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebu= gFeature.dsc +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebu= gFeature.dsc @@ -12,192 +12,71 @@ # ## =20 -##########################################################################= ###### -# -# 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 + !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 =20 -##########################################################################= ###### -# -# PCD Section - list of PCD Entries modified by the feature. -# -##########################################################################= ###### + DEFINE POST_CODE_PEIM_FILENAME =3D 3ea07dd3-f837-40c0-ac56-f3e18a30d01b + DEFINE POST_CODE_DXE_FILENAME =3D e7d785f5-e2f3-45e3-b0e7-2291a6c6dea6 + DEFINE POST_CODE_SMM_FILENAME =3D 02a955c7-48c0-4178-989b-b3fea4b3c6a2 =20 -# Unmark the following and StatusCodeHandler.efi to build the .dsc file di= rectly -#[PcdsDynamicDefault] -# gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|TRUE +[PcdsDynamicExDefault] + # + # By default, make the functional control DynamicExDefault PCD so that i= t can be enabled when debugging. + # + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode =20 -##########################################################################= ###### -# -# Library Class section - list of all Library Classes needed by this featu= re. -# -##########################################################################= ###### +[LibraryClasses.Common] + PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMa= pLib.inf =20 -!include MdePkg/MdeLibs.dsc.inc +[LibraryClasses.PEIM, LibraryClasses.PEI_CORE] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeH= andlerLib/PeiPostCodeStatusCodeHandlerLib.inf =20 -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplat= e.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf +[LibraryClasses.DXE_RUNTIME_DRIVER] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeH= andlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf =20 -[LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf +[LibraryClasses.DXE_SMM_DRIVER] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeH= andlerLib/SmmPostCodeStatusCodeHandlerLib.inf =20 -[LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA32= .SEC] - ####################################### - # Edk2 Packages - ####################################### - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf - -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf - -[LibraryClasses.common.UEFI_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - -[LibraryClasses.X64.DXE_SMM_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAlloc= ationLib.inf - SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf - SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmRepor= tStatusCodeLib.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] - ##################################### - # PostCode Debug Feature Package - ##################################### =20 - # Add library instances here that are not included in package components= and should be tested - # in the package build. - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCode= StatusCodeHandlerLib.inf + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + # + # Many boards already have StatusCodeHandler components built from t= he common core code + # Providing a unique name avoids collisions. Both status code handl= er components will + # install their listeners with the status code routers. + # + FILE_GUID =3D $(POST_CODE_PEIM_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Pe= iPostCodeStatusCodeHandlerLib.inf + } =20 - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/O= emHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug= .inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCo= deMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Pe= iPostCodeStatusCodeHandlerLib.inf -# } - - # Add components here that should be included in the package build. - -# -# 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] - ##################################### - # PostCode Debug Feature Package - ##################################### + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf { + + # + # Many boards already have StatusCodeHandler components built from t= he common core code + # Providing a unique name avoids collisions. Both status code handl= er components will + # install their listeners with the status code routers. + # + FILE_GUID =3D $(POST_CODE_DXE_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Ru= ntimeDxePostCodeStatusCodeHandlerLib.inf + } =20 - # Add library instances here that are not included in package components= and should be tested - # in the package build. - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxeP= ostCodeStatusCodeHandlerLib.inf - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPostCode= StatusCodeHandlerLib.inf - - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/O= emHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug= .inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCo= deMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Ru= ntimeDxePostCodeStatusCodeHandlerLib.inf -# } - -# MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/O= emHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug= .inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCo= deMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Sm= mPostCodeStatusCodeHandlerLib.inf -# } - - # 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] + MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { + + # + # Many boards already have StatusCodeHandler components built from t= he common core code + # Providing a unique name avoids collisions. Both status code handl= er components will + # install their listeners with the status code routers. + # + FILE_GUID =3D $(POST_CODE_SMM_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Sm= mPostCodeStatusCodeHandlerLib.inf + } diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostM= emory.fdf b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMe= mory.fdf new file mode 100644 index 0000000000..1be9b369a8 --- /dev/null +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.f= df @@ -0,0 +1,14 @@ +## @file +# FDF file for post-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced f= eatures +# can be conditionally included in the flash image by enabling the respec= tive +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID =3D $(POST_CODE_DXE_FILENAME) MdeModulePkg/Universal/StatusC= odeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf +INF FILE_GUID =3D $(POST_CODE_SMM_FILENAME) MdeModulePkg/Universal/StatusC= odeHandler/Smm/StatusCodeHandlerSmm.inf diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMe= mory.fdf b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemo= ry.fdf new file mode 100644 index 0000000000..168ceb1712 --- /dev/null +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,13 @@ +## @file +# FDF file for pre-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced f= eatures +# can be conditionally included in the flash image by enabling the respec= tive +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID =3D $(POST_CODE_PEIM_FILENAME) MdeModulePkg/Universal/Status= CodeHandler/Pei/StatusCodeHandlerPei.inf diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostC= odeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf b/Features/Inte= l/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Pe= iPostCodeStatusCodeHandlerLib.inf index c27578fe90..72df81c77f 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStat= usCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStat= usCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf @@ -15,7 +15,7 @@ FILE_GUID =3D FA32350A-63DB-4AC6-88D1-BC5327EE7ECE MODULE_TYPE =3D PEIM CONSTRUCTOR =3D PeiPostCodeStatusCodeHandlerLibConstr= uctor - LIBRARY_CLASS =3D StatusCodeHandlerLib|SEC PEIM PEI_COR + LIBRARY_CLASS =3D StatusCodeHandlerLib|SEC PEIM PEI_CORE =20 # # The following information is for reference only and not required by the = build tools. diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebug= FeaturePkg.dec b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeD= ebugFeaturePkg.dec index 5ba7b30ab6..42ac756a7c 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeature= Pkg.dec +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeature= Pkg.dec @@ -28,5 +28,16 @@ [Guids] gPostCodeDebugFeaturePkgTokenSpaceGuid =3D {0x68886ac8, 0x7a29, 0x4845= , {0xa7, 0x02, 0xe9, 0x83, 0xc8, 0x7f, 0xfb, 0xab}} =20 +[PcdsFeatureFlag] + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable|FAL= SE|BOOLEAN|0x00000002 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] + ## This PCD allows for dynamic control of post code use if so desired. + # + # The PCD value can be modified at boot time to activate and deactivate= the feature functionality. + # + # Note that this differs from PcdFeatureEnable which deter= mines whether the feature is included + # as an advanced feature in the flash image. If enabled, the feature is= then eligible to be activated/deactivated + # via this PCD. + # gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|FALSE|BO= OLEAN|0x00000001 diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebug= FeaturePkg.dsc b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeD= ebugFeaturePkg.dsc index 4f0bec4a6f..349604098f 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeature= Pkg.dsc +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeature= Pkg.dsc @@ -24,6 +24,36 @@ PEI_ARCH =3D IA32 DXE_ARCH =3D X64 =20 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable = |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable = |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable = |FALSE + +[PcdsDynamicExDefault] + # + # PCD needed for this feature to build + # + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|TRUE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + +[LibraryClasses.Common] + # + # Required by common status code handler infrastructure + # + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf + # # This package always builds the feature. # diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md b/F= eatures/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md index c49db35999..3fc52f1c00 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md @@ -16,7 +16,7 @@ It also provide a library of PostCodeMap lib, it map the = status code to post cod A library of PostCode lib is needed by platform. =20 In the library contstructor function, PostCodeStatusCodeHandlerLib registe= r the call back function for ReportStatusCode. -When called, it call GetPostCodeFromStatusCode() in PostCodeMapLib to get = post code from status code, and call PostCode() in PostCodeLib to show the = post code. +When called, it call GetPostCodeFromStatusCode () in PostCodeMapLib to get= post code from status code, and call PostCode () in PostCodeLib to show th= e post code. =20 PostCodeStatusCodeHandlerLib include 3 libraries for PEI, RuntimeDxe, SMM: * PeiPostCodeStatusCodeHandlerLib @@ -38,6 +38,7 @@ This library provide a function to get post code from sta= tus code. =20 ## Key Functions * In PeiPostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -48,8 +49,10 @@ This library provide a function to get post code from st= atus code. IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` =20 * In RuntimeDxePostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -59,8 +62,10 @@ This library provide a function to get post code from st= atus code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` =20 * In SmmPostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -70,23 +75,28 @@ This library provide a function to get post code from s= tatus code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` =20 * In PostCodeMapLib: +``` UINT32 EFIAPI GetPostCodeFromStatusCode ( IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value ) +``` =20 ## Configuration -* Link the library to StatusCodeHandler.efi. +* Link the library to StatusCodeHandler.efi to add this status code handle= r. +``` Example: MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerR= untimeDxe.inf { NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/= RuntimeDxePostCodeStatusCodeHandlerLib.inf } - Refer to PostCodeDebugFeature.dsc for other example. +``` + Refer to PostCodeDebugFeature.dsc for another example. * Config PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCo= de. In platform .dsc file, need to config the type of gPostCodeDebugFeatureP= kgTokenSpaceGuid.PcdStatusCodeUsePostCode. Use PcdsFixedAtBuild to save binary size, and use PcdsDynamic if want to= enable/disable in runtime. @@ -98,20 +108,23 @@ This library provide a function to get post code from = status code. Status Code (ReportStatusCode) -> Post Code (GetPostCodeFromStatusCode). =20 ## Control Flows -ReportStatusCode() -> PostCodeStatusCodeReportWorker() -> GetPostCodeFromS= tatusCode() -> PostCode() +ReportStatusCode () -> PostCodeStatusCodeReportWorker () -> GetPostCodeFro= mStatusCode () -> PostCode () =20 ## Build Flows -There is not special build flows. +There are not special build flows. =20 ## Test Point Results -Verify the post code shown is correct. +There are no test points defined. =20 ## Functional Exit Criteria N/A =20 ## Feature Enabling Checklist -* Set the PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostC= ode to TRUE. -* The post code can be shown. +* Set the PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatu= reEnable to TRUE. +* Select the PCD type desired and set the PCD gPostCodeDebugFeaturePkgToke= nSpaceGuid.PcdStatusCodeUsePostCode to TRUE. +* Implemented a platform specific PostCodeMapLib if needed. +* Verify the post code can be shown correctly. =20 ## Common Optimizations -* Implemented platform's special PostCodeMapLib if needed. +* Set gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode base= d on a larger, board specific, size + optimization or performance optimization setting. --=20 2.27.0.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 (#85854): https://edk2.groups.io/g/devel/message/85854 Mute This Topic: https://groups.io/mt/88549776/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-