From: "Oram, Isaac W" <isaac.w.oram@intel.com>
To: devel@edk2.groups.io
Cc: Isaac Oram <isaac.w.oram@intel.com>,
Sai Chaganty <rangasai.v.chaganty@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Eric Dong <eric.dong@intel.com>, Ming Tan <ming.tan@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 01/27] BeepDebugFeaturePkg: Use MinPlatformPkg build include files
Date: Tue, 11 Jan 2022 18:20:01 -0800 [thread overview]
Message-ID: <201dca4c4494241ebb61d4fa32d51385db12b9b4.1641953242.git.isaac.w.oram@intel.com> (raw)
In-Reply-To: <cover.1641953242.git.isaac.w.oram@intel.com>
The BeepDebugFeaturePkg was malformed and did not build anything
and thus wasn't testable in standalone build.
Added gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable
to properly control the advanced feature inclusion.
Use the standard MinPlatform includes for core libraries. This
increases the build time, but reduces complexity when integrating
into a board build. Board build optimization is more valuable than
standalone build optimization.
Enable standalone build to test the library build and the component
builds using edk2 StatusCodeHandler drivers.
Add unique file names for the StatusCodeHandler components to avoid
collisions with any existing board handlers when incorporated in board
DSC and FDF files.
Add PreMemory.fdf and PostMemory.fdf content for including in board FDF
or AdvancedFeaturePkg in the future.
Removed unused sections in DSC and FDF to reduce file clutter.
Removed stale file header content from prior proprietary licensing.
Moved feature customization and common include into the package DSC
file to reduce board complexity when BeepDebugFeature.dsc is included.
Removed the FixedAtBuild build control for beep feature as it would be
redundant with the FeatureFlag control of the whole feature. Build
control is via PcdBeepDebugFeatureEnable and dynamic control is via
PcdStatusCodeUseBeep.
Improved Readme content, format, and coding style use.
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ming Tan <ming.tan@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec | 7 +-
Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc | 28 +++
Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc | 222 ++++++--------------
Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h | 6 +-
Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf | 14 ++
Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf | 13 ++
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf | 5 +-
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf | 3 -
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf | 3 -
Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md | 91 +++++---
10 files changed, 186 insertions(+), 206 deletions(-)
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
index 4f4b36b091..d90611da51 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
@@ -31,6 +31,9 @@
[Guids]
gBeepDebugFeaturePkgTokenSpaceGuid = {0x54f56fb5, 0xea0e, 0x4518, {0xa0, 0x3e, 0x1b, 0xeb, 0x56, 0x94, 0xd2, 0x16}}
-[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+[PcdsFeatureFlag]
+ gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable|FALSE|BOOLEAN|0x00000000
+
+[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
# Beep is a legacy feature, disabled it by default
- gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|FALSE|BOOLEAN|0x00000001
+ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE|BOOLEAN|0x00000001
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
index 47254f9974..56cad020bf 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
@@ -24,6 +24,34 @@
PEI_ARCH = IA32
DXE_ARCH = X64
+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+ BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+
+[PcdsFeatureFlag]
+ #
+ # PCD needed for MinPlatform build includes
+ #
+ gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE
+
+[PcdsDynamicExDefault]
+ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|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/BasePlatformHookLibNull.inf
+
#
# This package always builds the feature.
#
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc
index b24b3e458f..251de6932b 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc
@@ -18,97 +18,16 @@
#
################################################################################
[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
-
-################################################################################
-#
-# PCD Section - list of PCD Entries modified by the feature.
-#
-################################################################################
-
-# Unmark the following and StatusCodeHandler.efi to build the .dsc file directly
-#[PcdsDynamicDefault]
-# gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE
-
-################################################################################
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-################################################################################
-
-!include MdePkg/MdeLibs.dsc.inc
-
-[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
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
-
-[LibraryClasses.common.PEIM]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
-
-[LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA32.SEC]
- #######################################
- # Edk2 Packages
- #######################################
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.X64.DXE_SMM_DRIVER]
- #######################################
- # Edk2 Packages
- #######################################
- SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
- MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
- SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf
- SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
+ !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
+
+ DEFINE BEEP_PEIM_FILENAME = b2356504-8ea3-42bd-912a-4b331990644a
+ DEFINE BEEP_DXE_FILENAME = f1211fa9-d83d-4c79-8726-3afaebba1070
+ DEFINE BEEP_SMM_FILENAME = a82cd452-0f17-4417-b8be-bb8cfdf9fa26
################################################################################
#
@@ -128,77 +47,60 @@
# Feature PEI Components
#
-# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308
-# is completed.
+#
+# By default, make the functional control a patcheable in module PCD
+#
+[PcdsPatchableInModule]
+ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep
+
+[LibraryClasses.Common]
+ BeepLib|Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf
+ BeepMapLib|Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf
+
+[LibraryClasses.PEIM, LibraryClasses.PEI_CORE]
+ StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
+
+[LibraryClasses.DXE_RUNTIME_DRIVER]
+ StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
+
+[LibraryClasses.DXE_SMM_DRIVER]
+ StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
+
[Components.IA32]
- #####################################
- # Beep Debug Feature Package
- #####################################
- # Add library instances here that are not included in package components and should be tested
- # in the package build.
- BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
+ MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf {
+ <Defines>
+ #
+ # Many boards already have StatusCodeHandler components built from the common core code
+ # Providing a unique name avoids collisions. Both status code handler components will
+ # install their listeners with the status code routers.
+ #
+ FILE_GUID = $(BEEP_PEIM_FILENAME)
+ <LibraryClasses>
+ NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
+ }
- # The following is an example for used with StatusCodeHandler:
-# MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf {
-# <LibraryClasses>
-# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
-# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
-# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf
-# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf
-# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.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://bugzilla.tianocore.org/show_bug.cgi?id=2308
-# is completed.
[Components.X64]
- #####################################
- # Beep Debug Feature Package
- #####################################
+ MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf {
+ <Defines>
+ #
+ # Many boards already have StatusCodeHandler components built from the common core code
+ # Providing a unique name avoids collisions. Both status code handler components will
+ # install their listeners with the status code routers.
+ #
+ FILE_GUID = $(BEEP_DXE_FILENAME)
+ <LibraryClasses>
+ NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
+ }
- # Add library instances here that are not included in package components and should be tested
- # in the package build.
- BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
- BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
-
- # The following is an example for used with StatusCodeHandler:
-# MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf {
-# <LibraryClasses>
-# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
-# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
-# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf
-# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf
-# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
-# }
-
-# MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf {
-# <LibraryClasses>
-# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
-# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
-# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf
-# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf
-# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.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 appended to any
-# standard flags that are defined by the build process. They can be
-# applied for any modules or only those modules with the specific
-# module style (EDK or EDKII) specified in [Components] section.
-#
-# For advanced features, it is recommended to enable [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 {
+ <Defines>
+ #
+ # Many boards already have StatusCodeHandler components built from the common core code
+ # Providing a unique name avoids collisions. Both status code handler components will
+ # install their listeners with the status code routers.
+ #
+ FILE_GUID = $(BEEP_SMM_FILENAME)
+ <LibraryClasses>
+ NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
+ }
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h
index f768acc557..0b8f71b097 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h
@@ -15,12 +15,12 @@
Sends the 32-bit value specified by Value to Beep device, and returns Value.
Some implementations of this library function may perform I/O operations
directly to Beep device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
+ ReportStatusCode (), and the status code reporting mechanism will eventually
display the 32-bit value on the status reporting device.
- Beep() must actively prevent recursion. If Beep() is called while
+ Beep () must actively prevent recursion. If Beep () is called while
processing another Post Code Library function, then
- Beep() must return Value immediately.
+ Beep () must return Value immediately.
@param Value Beep count.
**/
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf
new file mode 100644
index 0000000000..447fb88235
--- /dev/null
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf
@@ -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 features
+# can be conditionally included in the flash image by enabling the respective
+# feature via its FeaturePCD.
+#
+# Copyright (C) 2022 Intel Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+INF FILE_GUID = $(BEEP_DXE_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
+INF FILE_GUID = $(BEEP_SMM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf
new file mode 100644
index 0000000000..160f5e3ffd
--- /dev/null
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/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 features
+# can be conditionally included in the flash image by enabling the respective
+# feature via its FeaturePCD.
+#
+# Copyright (C) 2022 Intel Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+INF FILE_GUID = $(BEEP_PEIM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
index 421b246663..5be78a72e8 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
@@ -4,9 +4,6 @@
# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
-# vendor. This file may not be modified, except as allowed by
-# additional terms of your license agreement.
-#
##
[Defines]
@@ -15,7 +12,7 @@
FILE_GUID = C4210E71-0A38-4728-8D25-4876348AA380
MODULE_TYPE = PEIM
CONSTRUCTOR = PeiBeepStatusCodeHandlerLibConstructor
- LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_COR
+ LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_CORE
#
# The following information is for reference only and not required by the build tools.
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
index b9aae39128..2343e35a78 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
@@ -4,9 +4,6 @@
# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
-# vendor. This file may not be modified, except as allowed by
-# additional terms of your license agreement.
-#
##
[Defines]
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
index caa82264ae..4db1748fe3 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
@@ -4,9 +4,6 @@
# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
-# vendor. This file may not be modified, except as allowed by
-# additional terms of your license agreement.
-#
##
[Defines]
diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md
index ee254d0f99..6626c9b764 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md
@@ -6,25 +6,29 @@
More Information:
## Purpose
-The BeepDebugFeaturePkg include some useful beep debug libraries, such as get beep value from status code and beep.
-This is an important capability in firmware development to get and analyze the early error when there is not serial port.
+Very often it is necessary to debug very close to the reset vector or in production systems that lack serial ports, seven segment displays, or useful LED that are typically used to output useful debug messages.
+The BeepDebugFeaturePkg includes some useful beep focused debug libraries.
+
+This isn't intended for production use.
+
+There is not currently seamless integration into the SecCore component that handles the reset vector. In order to debug that early, it will be necessary to use the BeepLib directly in SEC code.
# High-Level Theory of Operation
-It provide a library BeepStatusCodeHandlerLib used by edk2 StatusCodeHandler.efi, used to do beep if needed.
-It also provide a library of BeepMap lib, it map the status code to beep value.
+It provides a library, BeepStatusCodeHandlerLib, used by edk2 StatusCodeHandler.efi, used to do beep if needed.
+It also provide a library of BeepMap lib which maps the status code to a beep value.
A library of Beep lib is needed by platform, and this pkg has a Null implementation.
-In the library contstructor function, BeepStatusCodeHandlerLib register the call back function for ReportStatusCode.
-When called, it call GetBeepFromStatusCode() in BeepMapLib to get beep value from status code, and call Beep() in BeepLib to beep.
+In the library contstructor function, BeepStatusCodeHandlerLib registers the call back function for ReportStatusCode. When called, it calls GetBeepFromStatusCode (); in BeepMapLib to get beep value from status code, and calls Beep () in BeepLib to beep a speaker.
-BeepStatusCodeHandlerLib include 3 libraries for PEI, RuntimeDxe, SMM:
+BeepStatusCodeHandlerLib includes three libraries for PEI, RuntimeDxe, and SMM:
* PeiBeepStatusCodeHandlerLib
* RuntimeDxeBeepStatusCodeHandlerLib
* SmmBeepStatusCodeHandlerLib
## Firmware Volumes
-Linked with StatusCodeHandler.efi, and make sure put the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi.
+These libraries need to be linked into StatusCodeHandler components.
+Make sure one puts the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi.
## Modules
* BeepStatusCodeHandlerLib
@@ -32,13 +36,17 @@ Linked with StatusCodeHandler.efi, and make sure put the StatusCodeHandler.efi a
* BeepLibNull
## BeepStatusCodeHandlerLib
-This library register the call back function for ReportStatusCode, and get beep valude from status code, and do beep.
+This library registers the callback function for ReportStatusCode, gets beep value from status code, and does the beep.
## BeepMapLib
-This library provide a function to get beep value from status code.
+This library provides a function to get a beep value for a status code.
+
+## BeepLibNull
+This library provide a function to perform the beep.
## Key Functions
* In PeiBeepStatusCodeHandlerLib:
+```
EFI_STATUS
EFIAPI
BeepStatusCodeReportWorker (
@@ -49,8 +57,10 @@ This library provide a function to get beep value from status code.
IN CONST EFI_GUID *CallerId,
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
)
+```
* In RuntimeDxeBeepStatusCodeHandlerLib:
+```
EFI_STATUS
EFIAPI
BeepStatusCodeReportWorker (
@@ -60,8 +70,10 @@ This library provide a function to get beep value from status code.
IN EFI_GUID *CallerId,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
+```
* In SmmBeepStatusCodeHandlerLib:
+```
EFI_STATUS
EFIAPI
BeepStatusCodeReportWorker (
@@ -71,55 +83,72 @@ This library provide a function to get beep value from status code.
IN EFI_GUID *CallerId,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
+```
* In BeepMapLib:
+```
UINT32
EFIAPI
GetBeepValueFromStatusCode (
IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value
- )
+ )
+```
* In BeepLib:
+```
VOID
EFIAPI
Beep (
IN UINT32 Value
- )
+ )
+```
## Configuration
-* Link the library to StatusCodeHandler.efi.
- Example:
- MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf {
- <LibraryClasses>
- NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
- }
- Refer to BeepDebugFeature.dsc for other example.
-* Config PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep.
- In platform .dsc file, need to config the type of gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep.
- Use PcdsFixedAtBuild to save binary size, and use PcdsDynamic if want to enable/disable in runtime.
-* Implemented platform's special BeepMapLib if needed.
-* Provide the platform's special BeepLib.
-* Make sure put the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi.
+* Configure PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep.
+ In board DSC file, the board developer needs to configure the type of gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep control desired.
+ [PcdsFixedAtBuild] is the feature default value as this has lowest size.
+ [PcdsDynamicExDefault] is the most common configuration as it provides dynamic control during debugging.
+* Implemented board specific BeepMapLib if custom status code to beep code mapping as needed.
+* Provide the board specific BeepLib to perform beeps on the board specific hardware.
+```The default library does not cause any hardware to beep```
## Data Flows
Status Code (ReportStatusCode) -> Beep Value (GetBeepValueFromStatusCode).
## Control Flows
-ReportStatusCode() -> BeepStatusCodeReportWorker() -> GetBeepValueFromStatusCode() -> Beep()
+ReportStatusCode () -> BeepStatusCodeReportWorker () -> GetBeepValueFromStatusCode () -> Beep ()
## Build Flows
-There is not special build flows.
+Standalone build
+* build -a IA32 -a X64 -p Debugging\BeepDebugFeaturePkg\BeepDebugFeaturePkg.dsc
+AdvanceFeaturePkg build
+* build -a IA32 -a X64 -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
## Test Point Results
-Verify the post code shown is correct.
+None
## Functional Exit Criteria
N/A
## Feature Enabling Checklist
-* Set the PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep to TRUE.
-* Plug out all the memory, check can here the beep.
+* Verify in board DSC file that gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable set to TRUE
+* Verify board specific BeepLib implemented and included in board DSC file.
+* Verify that the board has a PlatformHookLib instance. There is a null library implementation if needed
+```
+ PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
+```
+* Verify that your board has the StatusCodeHandler components (PEIM or driver) desired.
+```
+ Example:
+ MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf {
+ <LibraryClasses>
+ NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
+ }
+ There are default StatusCodeHandlers for PEI, RT, and SMM in BeepDebugFeaturePkg/Include in PreMemory.fdf and PostMemory.fdf for use. But most boards will already have these components and you will just want to add the appropriate *StatusCodeHandlerLib.inf to each component.
+```
+* Build
+* Remove all the memory from the system and verify audible beep is heard when attempting to boot.
## Common Optimizations
-* Implemented platform's special BeepMapLib if needed.
+N/A
--
2.27.0.windows.1
next prev parent reply other threads:[~2022-01-12 2:20 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 2:20 [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build consistency Oram, Isaac W
2022-01-12 2:20 ` Oram, Isaac W [this message]
2022-01-13 2:47 ` [edk2-devel][edk2-platforms][PATCH V1 01/27] BeepDebugFeaturePkg: Use MinPlatformPkg build include files Nate DeSimone
2022-01-19 23:30 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 02/27] BeepDebugFeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:47 ` Nate DeSimone
2022-01-14 5:27 ` Chaganty, Rangasai V
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 03/27] AcpiDebugFeaturePkg: " Oram, Isaac W
2022-01-13 2:48 ` Nate DeSimone
2022-01-14 5:18 ` Chaganty, Rangasai V
2022-01-18 22:59 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 04/27] IpmiFeaturePkg: " Oram, Isaac W
2022-01-13 2:48 ` Nate DeSimone
2022-01-19 0:02 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 05/27] IpmiFeaturePkg: Fix build errors Oram, Isaac W
2022-01-13 2:48 ` Nate DeSimone
2022-01-18 23:38 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 06/27] S3FeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:48 ` Nate DeSimone
2022-01-14 5:19 ` Chaganty, Rangasai V
2022-01-19 1:11 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-14 5:29 ` Chaganty, Rangasai V
2022-01-19 1:26 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-14 5:31 ` Chaganty, Rangasai V
2022-01-19 1:40 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 09/27] SmbiosFeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 10/27] UserAuthFeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 11/27] UserAuthFeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 12/27] VirtualKeyboardFeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 13/27] VirtualKeyboardFeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 14/27] VirtualKeyboardFeaturePkg: Add feature enable PCD Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-14 5:57 ` Chaganty, Rangasai V
2022-01-19 2:31 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 16/27] LogoFeaturePkg: " Oram, Isaac W
2022-01-13 2:49 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 17/27] PostCodeDebugFeaturePkg: Complete as an advanced feature Oram, Isaac W
2022-01-13 2:48 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 18/27] AcpiDebugFeaturePkg: Use MinPlatformPkg build include files Oram, Isaac W
2022-01-13 2:47 ` Nate DeSimone
2022-01-19 23:30 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 19/27] Usb3DebugFeaturePkg: Align with feature design guidelines Oram, Isaac W
2022-01-13 2:47 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use MinPlatform build include files Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-14 6:10 ` Chaganty, Rangasai V
2022-01-19 19:09 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: " Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-14 6:05 ` Chaganty, Rangasai V
2022-01-19 19:13 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 22/27] AdvancedFeaturePkg: Fix all relative package paths Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-14 5:39 ` Chaganty, Rangasai V
2022-01-19 19:17 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 23/27] AdvancedFeaturePkg: Add missing features Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-14 5:36 ` Chaganty, Rangasai V
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: Add an include file for the common SPI FV info Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-14 6:02 ` Chaganty, Rangasai V
2022-01-19 19:20 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 25/27] WhitleyOpenBoardPkg/Build: Use common SPI FV Header include Oram, Isaac W
2022-01-13 2:50 ` Nate DeSimone
2022-01-19 19:34 ` Oram, Isaac W
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 26/27] AdvancedFeaturePkg/Build: Add FDF to create FV for all features Oram, Isaac W
2022-01-13 2:47 ` Nate DeSimone
2022-01-12 2:20 ` [edk2-devel][edk2-platforms][PATCH V1 27/27] WhitleyOpenBoardPkg/Build: Enable Features/Intel features Oram, Isaac W
2022-01-13 2:51 ` Nate DeSimone
2022-01-13 2:47 ` [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build consistency Nate DeSimone
2022-01-13 3:15 ` Oram, Isaac W
2022-01-13 3:52 ` Nate DeSimone
2022-01-13 3:53 ` Nate DeSimone
2022-01-13 19:33 ` Oram, Isaac W
2022-01-19 23:30 ` Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201dca4c4494241ebb61d4fa32d51385db12b9b4.1641953242.git.isaac.w.oram@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox