public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kubacki, Michael A" <michael.a.kubacki@intel.com>
To: devel@edk2.groups.io
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [edk2-platforms][PATCH V2 23/47] Features/Intel/AdvancedFeaturePkg: Add temporary build workaround
Date: Wed, 27 Nov 2019 17:05:50 -0800	[thread overview]
Message-ID: <20191128010614.43628-24-michael.a.kubacki@intel.com> (raw)
In-Reply-To: <20191128010614.43628-1-michael.a.kubacki@intel.com>

This change adds a temporary build workaround to allow the advanced
feature PCDs to be used in conditional statements in DSC files even
if they are not referenced in INF files.

Support to allow a FeaturePCD to be used in a conditional statement
without being referenced in an INF file has been requested in the
following Bugzilla item:
https://bugzilla.tianocore.org/show_bug.cgi?id=2270

This change can be reverted when that Bugzilla is completed and the
change is submitted to edk2.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc                                |  2 +
 Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc | 74 ++++++++++++++++++++
 Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf | 57 +++++++++++++++
 Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.c   | 31 ++++++++
 4 files changed, 164 insertions(+)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 50c0e81048..23e7c6474a 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -30,6 +30,8 @@
   PEI_ARCH                            = IA32
   DXE_ARCH                            = X64
 
+!include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc
+
 ################################################################################
 #
 # Advanced Feature Enable section - all advanced features are enabling for the
diff --git a/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc
new file mode 100644
index 0000000000..227ae00908
--- /dev/null
+++ b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc
@@ -0,0 +1,74 @@
+## @file
+# Build description file for a temporary build workaround.
+#
+# The feature enable PCD for advanced features must be referenced in an INF
+# to be referenced in DSC/FDF files. This DSC only exists in the build to
+# allow the PCDs to be referenced. This workaround does not affect the final
+# flash image or boot in any way.
+#
+# The request to update BaseTools to allow a PCD to be referenced in DSC/FDF
+# files without requiring the PCD to be referenced in an INF file is tracked
+# here: https://bugzilla.tianocore.org/show_bug.cgi?id=2270
+#
+# When the BaseTools update is complete, this file can entirely be removed
+# from this package.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+#
+# BEGIN:Temporary Build Workaround (resolution: https://bugzilla.tianocore.org/show_bug.cgi?id=2270)
+#
+
+# THIS FILE IS TEMPORARY. PLEASE TRY TO LOOK PAST THE "HACKS" ASSOCIATED WITH IT.
+#
+# With the BaseTools change requested, the changes needed to move to the end state are simply:
+#  1. Remove the !include for this file in AdvancedFeatures.dsc
+#  2. Remove this directory
+
+!if $(PLATFORM_NAME) != AdvancedFeaturePkg
+#
+# AdvancedFeaturePkg initializes all FeaturePCDs to TRUE so they can conveniently be built in one package.
+# Board packages will normally only enable (and therefore reference) a small subset of advanced features
+# relative to the board. If an INF does not reference a package DEC file (which will be the case if the
+# feature is not enabled) then the DSC must set ("define") the PCD for the conditional statements based
+# on the PCD to work.
+#
+# AdvancedFeaturePkg has no problem as it naturally has a need to set al PCDs to TRUE for build.
+# The section below sets all PCDs to FALSE in the DSC file so if the feature is not enabled by a board,
+# the build will still be successful.
+#
+[PcdsFeatureFlag]
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable            |FALSE
+  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable                      |FALSE
+  gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable                |FALSE
+  gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable                          |FALSE
+  gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable                  |FALSE
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable            |FALSE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable    |FALSE
+!endif
+
+#
+# The LibraryClasses required to build TemporaryBuildWorkaround.inf
+# (mostly libraries requiring other libraries)
+#
+[LibraryClasses]
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
+
+#
+# The driver that references all feature PCDs to satsify current build limitations
+#
+[Components]
+  AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf
+#
+# END:Temporary Build Workaround (resolution: https://bugzilla.tianocore.org/show_bug.cgi?id=2270)
+#
diff --git a/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf
new file mode 100644
index 0000000000..74176d1989
--- /dev/null
+++ b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf
@@ -0,0 +1,57 @@
+### @file
+# Component information file for a temporary build workaround.
+#
+# The feature enable PCD for this package must be referenced in an INF to be
+# referenced in DSC/FDF files. This driver is only included in the build to
+# allow the PCD to be referenced. This driver is not included in the flash
+# image and does not affect the boot in any way.
+#
+# The request to update BaseTools to allow a PCD to be referenced in DSC/FDF
+# files without requiring the PCD to be referenced in an INF file is tracked
+# here: https://bugzilla.tianocore.org/show_bug.cgi?id=2270
+#
+# When the BaseTools update is complete, this file can entirely be removed
+# from this package.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION       = 0x00010017
+  BASE_NAME         = TemporaryBuildWorkaround
+  FILE_GUID         = 8846A81E-F552-4917-81F5-80B62E4EFBAC
+  VERSION_STRING    = 1.0
+  MODULE_TYPE       = PEIM
+  ENTRY_POINT       = TemporaryBuildWorkaroundEntry
+
+[LibraryClasses]
+  BaseLib
+  PeimEntryPoint
+
+[Packages]
+  MdePkg/MdePkg.dec
+  Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec
+  Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec
+  Network/NetworkFeaturePkg/NetworkFeaturePkg.dec
+  OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+  PowerManagement/S3FeaturePkg/S3FeaturePkg.dec
+  SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+  UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
+
+[FeaturePcd]
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable
+  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable
+  gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable
+  gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable
+  gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable
+
+[Sources]
+  TemporaryBuildWorkaround.c
+
+[Depex]
+ TRUE
diff --git a/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.c b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.c
new file mode 100644
index 0000000000..2cd91b06f0
--- /dev/null
+++ b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.c
@@ -0,0 +1,31 @@
+/** @file
+  Source code file for a temporary build workaround.
+
+  The purpose of this workaround is described in the module INF file.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/BaseLib.h>
+
+/**
+  An empty entry point function.
+
+  @param  FileHandle  Handle of the file being invoked.
+  @param  PeiServices Describes the list of possible PEI Services.
+
+  @retval  EFI_SUCCESS  This function always returns EFI_SUCCESS.
+
+**/
+EFI_STATUS
+EFIAPI
+TemporaryBuildWorkaroundEntry (
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,
+  IN CONST EFI_PEI_SERVICES     **PeiServices
+  )
+{
+  return EFI_SUCCESS;
+}
-- 
2.16.2.windows.1


  parent reply	other threads:[~2019-11-28  1:07 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28  1:05 [edk2-platforms][PATCH V2 00/47] Intel Advanced Feature Refactor Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 01/47] AdvancedFeaturePkg: Package DSC style cleanup Kubacki, Michael A
2019-12-03  8:45   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 02/47] DebugFeaturePkg: " Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 03/47] UserInterfaceFeaturePkg: " Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 04/47] Features/Intel: Add Readme.md Kubacki, Michael A
2019-12-03  9:07   ` Chaganty, Rangasai V
2019-12-03 23:57   ` Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 05/47] Features/Intel/PowerManagement: " Kubacki, Michael A
2019-12-03  9:14   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 06/47] Features/Intel/OutOfBandManagement: " Kubacki, Michael A
2019-12-03  9:22   ` Chaganty, Rangasai V
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 07/47] Features/Intel/SystemInformation: " Kubacki, Michael A
2019-12-03  9:30   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 08/47] Features/Intel/Debugging: " Kubacki, Michael A
2019-12-03  9:32   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 09/47] Features/Intel/UserInterface: " Kubacki, Michael A
2019-12-03  9:36   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 10/47] Features/Intel/Network: " Kubacki, Michael A
2019-12-03  9:38   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 11/47] TemplateFeaturePkg: Add initial package Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 12/47] Features/Intel/S3FeaturePkg: " Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 13/47] Features/Intel/IpmiFeaturePkg: " Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-12-04  7:53   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 14/47] Features/Intel/IpmiFeaturePkg: Add libraries Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-12-04  8:10   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 15/47] Features/Intel/IpmiFeaturePkg: Add modules Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-12-04  8:22   ` Chaganty, Rangasai V
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 16/47] Features/Intel/SmbiosFeaturePkg: Add initial package Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 17/47] Features/Intel/SmbiosFeaturePkg: Update default strings Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 18/47] Features/Intel/AcpiDebugFeaturePkg: Add initial package Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 19/47] Features/Intel/Usb3DebugFeaturePkg: " Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 20/47] Features/Intel/UserAuthFeaturePkg: " Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 21/47] Features/Intel/NetworkFeaturePkg: " Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 22/47] Features/Intel/AdvancedFeaturePkg: Add package Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " Nate DeSimone
2019-11-28  1:05 ` Kubacki, Michael A [this message]
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 24/47] Features/Intel/AdvancedFeaturePkg: Add FDF include files Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 25/47] KabylakeOpenBoardPkg/KabylakeRvp3: Add PEI_ARCH and DXE_ARCH Kubacki, Michael A
2019-11-29  6:42   ` [edk2-devel] " Chiu, Chasel
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 26/47] KabylakeOpenBoardPkg/GalagoPro3: " Kubacki, Michael A
2019-11-29  6:43   ` Chiu, Chasel
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 27/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: " Kubacki, Michael A
2019-11-29  6:43   ` [edk2-devel] " Chiu, Chasel
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 28/47] SimicsOpenBoardPkg/BoardX58Ich10: Use " Kubacki, Michael A
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 29/47] MinPlatformPkg: Add FvAdvancedPreMemory Kubacki, Michael A
2019-11-29  6:43   ` [edk2-devel] " Chiu, Chasel
2019-12-03 23:57   ` Nate DeSimone
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 30/47] KabylakeOpenBoardPkg/KabylakeRvp3: " Kubacki, Michael A
2019-11-29  6:45   ` Chiu, Chasel
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 31/47] KabylakeOpenBoardPkg/GalagoPro3: " Kubacki, Michael A
2019-11-29  6:49   ` Chiu, Chasel
2019-11-28  1:05 ` [edk2-platforms][PATCH V2 32/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: " Kubacki, Michael A
2019-11-29  6:50   ` Chiu, Chasel
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 33/47] Platform/Intel: Add advanced feature build support Kubacki, Michael A
2019-11-29  6:52   ` Chiu, Chasel
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 34/47] Platform/Intel/Readme.md Content update Kubacki, Michael A
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 35/47] KabylakeOpenBoardPkg/GalagoPro3: Enable advanced features Kubacki, Michael A
2019-11-29  7:00   ` Chiu, Chasel
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 36/47] KabylakeOpenBoardPkg/KabylakeRvp3: " Kubacki, Michael A
2019-11-29  7:01   ` Chiu, Chasel
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 37/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: " Kubacki, Michael A
2019-11-29  7:02   ` Chiu, Chasel
2019-11-28  1:06 ` [edk2-platforms][PATCH V2 38/47] SimicsOpenBoardPkg: Use new advanced feature refactor Kubacki, Michael A
2019-12-03 23:57   ` [edk2-devel] " 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=20191128010614.43628-24-michael.a.kubacki@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