From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.11538.1658515598830308993 for ; Fri, 22 Jul 2022 11:46:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=gOiDzpzj; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658515600; x=1690051600; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nE3QBOkJPH0ph2+vKFfMuSqjoEmEWUKI6SZpNjMwCZc=; b=gOiDzpzjFvh6VjvDZ8COblYpL/Ro7k3CXqPxFod0ywtaOItHKKqP4y0J aOUd9TOaX4KJtnd7AHcDBjr2jb1mZGeEYY7rnzpUiUL4aK1WYyzbz0k+G 2d8eGGIn6zxr347yRv9/2tB1r9gtgJF0CwHtxWXcBMfjmskCNZ9LBmaCh YZaSapSPtGg6qtnO3p7jaM+uqSqDMUQymo4uLx4gJ25bhclCPxxKyMmkA 3/lBdyO2JZePK92RUGWvzhsL37DRuEmBHv7CS5r/7qxPs4JwUtzPu4eeT 9UTHTO6EY92uOyMlTP+vJb7DG4XOvsC5nuDg3442G+hX4CKDLvx2W9eG/ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10416"; a="288138279" X-IronPort-AV: E=Sophos;i="5.93,186,1654585200"; d="scan'208";a="288138279" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2022 11:46:39 -0700 X-IronPort-AV: E=Sophos;i="5.93,186,1654585200"; d="scan'208";a="666767985" Received: from iworam-desk.amr.corp.intel.com ([10.24.80.243]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2022 11:46:39 -0700 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Isaac Oram , Chasel Chiu , Nate DeSimone Subject: [edk2-devel][edk2-platforms][PATCH V1 10/13] PurleyOpenBoardPkg/Build: Reduce unnecessary code Date: Fri, 22 Jul 2022 11:46:21 -0700 Message-Id: X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Leverage common includes to reduce duplicated or low value code. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Isaac Oram --- .../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