Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
WhitleyOpenBoardPkg/Build: Reduce duplicate code
Browse files Browse the repository at this point in the history
Leverage common includes for default feature values.
Remove PERFORMANCE_ENABLE in favor of PcdPerformanceEnable.
Use DpDynamicCommand instead of standalone DpApp.

Cc: Nate DeSimone <[email protected]>
Cc: Chasel Chiu <[email protected]>
Signed-off-by: Isaac Oram <[email protected]>
Reviewed-by: Nate DeSimone <[email protected]>
  • Loading branch information
iworam committed Sep 1, 2022
1 parent afefb4d commit fc2cff4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

!if $(PERFORMANCE_ENABLE) == TRUE
!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE

[PcdsFixedAtBuild]
gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly|TRUE
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
43 changes: 33 additions & 10 deletions Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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

# 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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions Platform/Intel/WhitleyOpenBoardPkg/PlatformPkgConfig.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fc2cff4

Please sign in to comment.