From: "Oram, Isaac W" <isaac.w.oram@intel.com>
To: devel@edk2.groups.io
Cc: Isaac Oram <isaac.w.oram@intel.com>,
Chasel Chiu <chasel.chiu@intel.com>,
Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 10/13] PurleyOpenBoardPkg/Build: Reduce unnecessary code
Date: Fri, 22 Jul 2022 11:46:21 -0700 [thread overview]
Message-ID: <bb5cd6351f78ab9b117f30f6e9d845a1085eda63.1658513099.git.isaac.w.oram@intel.com> (raw)
In-Reply-To: <cover.1658513099.git.isaac.w.oram@intel.com>
Leverage common includes to reduce duplicated or low value code.
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
.../BoardMtOlympus/PlatformPkgConfig.dsc | 46 +++++-----------
.../BoardMtOlympus/PlatformPkgPcd.dsc | 52 +++++--------------
.../BoardTiogaPass/PlatformPkgConfig.dsc | 48 +++++------------
.../BoardTiogaPass/PlatformPkgPcd.dsc | 52 +++++--------------
4 files changed, 49 insertions(+), 149 deletions(-)
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgConfig.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgConfig.dsc
index 2bd714c01e..2359243310 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgConfig.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgConfig.dsc
@@ -14,40 +14,18 @@
gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
[PcdsFeatureFlag]
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
-!endif
-
- !if $(TARGET) == DEBUG
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
- !else
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
- !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
+
+ #
+ # Commonly used MinPlatform feature configuration logic that maps functionity to stage
+ #
+ !include BoardModulePkg/Include/Dsc/CommonStageConfig.dsc.inc
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|TRUE
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgPcd.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgPcd.dsc
index 050f9b6228..069f463d5e 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgPcd.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkgPcd.dsc
@@ -61,42 +61,18 @@
######################################
# Platform Configuration
######################################
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
-!endif
-
-!if $(TARGET) == DEBUG
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
-!else
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
-!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
+
+ #
+ # Commonly used MinPlatform feature configuration logic that maps functionity to stage
+ #
+ !include BoardModulePkg/Include/Dsc/CommonStageConfig.dsc.inc
[PcdsFeatureFlag.X64]
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard|FALSE
@@ -278,10 +254,6 @@
[PcdsPatchableInModule.common]
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042
-!if gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable == TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdSmiHandlerProfilePropertyMask|0x1
-!endif
-
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000
gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress|0xFED00000
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgConfig.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgConfig.dsc
index cefb81b76e..e393cf3097 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgConfig.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgConfig.dsc
@@ -14,40 +14,18 @@
gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
[PcdsFeatureFlag]
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
-!endif
-
- !if $(TARGET) == DEBUG
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
- !else
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
- !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
+
+ #
+ # Commonly used MinPlatform feature configuration logic that maps functionity to stage
+ #
+ !include BoardModulePkg/Include/Dsc/CommonStageConfig.dsc.inc
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|TRUE
@@ -62,4 +40,4 @@
!if gPlatformTokenSpaceGuid.PcdFastBoot == TRUE
gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable|FALSE
gPlatformTokenSpaceGuid.PcdUpdateConsoleInBds|FALSE
-!endif
\ No newline at end of file
+!endif
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgPcd.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgPcd.dsc
index 5940c40dfc..d8cd559490 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgPcd.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/PlatformPkgPcd.dsc
@@ -61,42 +61,18 @@
######################################
# Platform Configuration
######################################
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
- gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
- gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
- gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
- gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
-!endif
-
-!if $(TARGET) == DEBUG
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
-!else
- gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
-!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
+
+ #
+ # Commonly used MinPlatform feature configuration logic that maps functionity to stage
+ #
+ !include BoardModulePkg/Include/Dsc/CommonStageConfig.dsc.inc
[PcdsFeatureFlag.X64]
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard|FALSE
@@ -281,10 +257,6 @@
[PcdsPatchableInModule.common]
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042
-!if gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable == TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdSmiHandlerProfilePropertyMask|0x1
-!endif
-
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000
gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress|0xFED00000
--
2.36.1.windows.1
next prev parent reply other threads:[~2022-07-22 18:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 18:46 [edk2-devel][edk2-platforms][PATCH V1 00/13] Simplify board porting Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 01/13] MinPlatformPkg/Include: Simplify board creation Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 02/13] WhitleyOpenBoardPkg/Build: Reduce duplicate code Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 03/13] Features/Intel: " Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 04/13] WhitleyOpenBoardPkg/Build: Reduce unnecessary code Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 05/13] MinPlatformPkg/Include: Simplify build logic Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 06/13] BoardModulePkg/Include: Add include for stage behavior logic Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 07/13] WhiskeyLakeOpenBoardPkg/Build: Reduce unnecessary code Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 08/13] TigerLakeOpenBoardPkg/Build: " Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 09/13] SimicsOpenBoardPkg/Build: " Oram, Isaac W
2022-07-22 18:46 ` Oram, Isaac W [this message]
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 11/13] KabylakeOpenBoardPkg/Build: " Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 12/13] CometlakeOpenBoardPkg/Build: " Oram, Isaac W
2022-07-22 18:46 ` [edk2-devel][edk2-platforms][PATCH V1 13/13] MinPlatformPkg: Remove unnecessary feature controls Oram, Isaac W
2022-09-01 0:55 ` [edk2-devel][edk2-platforms][PATCH V1 00/13] Simplify board porting Nate DeSimone
2022-09-01 1:48 ` Isaac Oram
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=bb5cd6351f78ab9b117f30f6e9d845a1085eda63.1658513099.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