[edk2-devel][edk2-platforms][PATCH V1 02/13] WhitleyOpenBoardPkg/Build: Reduce duplicate code
Oram, Isaac W
isaac.w.oram at intel.com
Fri Jul 22 18:46:13 UTC 2022
Leverage common includes for default feature values.
Remove PERFORMANCE_ENABLE in favor of PcdPerformanceEnable.
Use DpDynamicCommand instead of standalone DpApp.
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Chasel Chiu <chasel.chiu at intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram at intel.com>
---
...blePerformanceMonitoringInfrastructure.dsc | 5 +--
...anceMonitoringInfrastructurePostMemory.fdf | 5 +--
...manceMonitoringInfrastructurePreMemory.fdf | 2 +-
.../Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 45 ++++++++++++++-----
.../WhitleyOpenBoardPkg/PlatformPkgConfig.dsc | 2 -
5 files changed, 39 insertions(+), 20 deletions(-)
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Dsc/EnablePerformanceMonitoringInfrastructure.dsc b/Platform/Intel/WhitleyOpenBoardPkg/Include/Dsc/EnablePerformanceMonitoringInfrastructure.dsc
index c308e0df4f..7439b2fb36 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Include/Dsc/EnablePerformanceMonitoringInfrastructure.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Include/Dsc/EnablePerformanceMonitoringInfrastructure.dsc
@@ -6,7 +6,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
-!if $(PERFORMANCE_ENABLE) == TRUE
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
[PcdsFixedAtBuild]
gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly|TRUE
@@ -34,7 +34,6 @@
[Components.X64]
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.inf
- MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
- ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
+ ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
!endif
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePostMemory.fdf b/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePostMemory.fdf
index a3576bd7a8..52b79a31d0 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePostMemory.fdf
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePostMemory.fdf
@@ -6,9 +6,8 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
-!if $(PERFORMANCE_ENABLE) == TRUE
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.inf
- INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
- INF ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
+ INF ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
!endif
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePreMemory.fdf b/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePreMemory.fdf
index dbc98f6f1f..18574f67ef 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePreMemory.fdf
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/EnablePerformanceMonitoringInfrastructurePreMemory.fdf
@@ -6,6 +6,6 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
-!if $(PERFORMANCE_ENABLE) == TRUE
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf
!endif
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index cefee8273b..5b5d84779e 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -39,12 +39,39 @@
DEFINE IIO_INSTANCE = UnknownCpu
!endif
+#
+# MinPlatform common include for required feature PCD
+# These PCD must be set before the core include files, CoreCommonLib,
+# CorePeiLib, and CoreDxeLib.
+# Optional MinPlatformPkg features should be enabled after this
+#
+!include MinPlatformPkg/Include/Dsc/MinPlatformFeaturesPcd.dsc.inc
+
+#
+# AdvancedFeature common include for feature enable/disable PCD
+#
+#
!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+#
+# PCD required by advanced features
+#
[PcdsFixedAtBuild]
gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
+#
+# Feature enable/disable flags
+#
[PcdsFeatureFlag]
+ #
+ # MinPlatform control flags
+ #
+ gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |TRUE
+ gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |TRUE
+
#
# Debugging features
#
@@ -124,20 +151,16 @@
# Pcd Section - list of all EDK II PCD Entries defined by this Platform
#
################################################################################
-[PcdsFeatureFlag]
- #
- # MinPlatform control flags
- #
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit |FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit |FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly |FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE
+[PcdsFeatureFlag]
+ #
# don't degrade 64bit MMIO space to 32-bit
+ #
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALSE
+ #
# Server doesn't support capsule update on Reset.
+ #
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|TRUE
gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugSupport|FALSE
@@ -761,13 +784,13 @@
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf {
<LibraryClasses>
- !if $(PERFORMANCE_ENABLE) == TRUE
+ !if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
TimerLib|UefiCpuPkg/Library/SecPeiDxeTimerLibUefiCpu/SecPeiDxeTimerLibUefiCpu.inf
!endif
}
[Components.X64]
- !include WhitleyOpenBoardPkg/Include/Dsc/CoreDxeInclude.dsc
+ !include MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
$(RP_PKG)/Platform/Dxe/PlatformType/PlatformType.inf
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkgConfig.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkgConfig.dsc
index a4ac8b6935..c9620f11d8 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkgConfig.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkgConfig.dsc
@@ -15,8 +15,6 @@
DEFINE CRB_FLAG_ENABLE = TRUE
DEFINE DEBUG_FLAGS_ENABLE = FALSE
-DEFINE PERFORMANCE_ENABLE = TRUE
-
DEFINE SERVER_BIOS_ENABLE = TRUE
DEFINE PCH_SERVER_BIOS_ENABLE = TRUE
--
2.36.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91735): https://edk2.groups.io/g/devel/message/91735
Mute This Topic: https://groups.io/mt/92554228/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list