Reviewed-by: Sai Chaganty <rangasai.v.chaga...@intel.com> -----Original Message----- From: Oram, Isaac W <isaac.w.o...@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.o...@intel.com>; Chaganty, Rangasai V <rangasai.v.chaga...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use MinPlatform build include files
Also added feature enable flag Cc: Sai Chaganty <rangasai.v.chaga...@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.o...@intel.com> --- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h | 2 +- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf | 13 ++++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf | 11 ++++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc | 62 -------------------- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md | 12 ++-- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec | 6 ++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc | 18 ++++++ 7 files changed, 55 insertions(+), 69 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h index 947813815e..2e50270ee6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/ +++ SpcrDeviceLib.h @@ -12,7 +12,7 @@ /** Get a Serial Port device used for SPCR. - The caller should call FreePool() to free the memory if return value is not NULL. + The caller should call FreePool () to free the memory if return value is not NULL. @retval NULL Can not get device. @retval Others A serial port device path. diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 0000000000..f963f567c2 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemo +++ ry.fdf @@ -0,0 +1,13 @@ +## @file +# FDF file for post-memory SpcrFeature advanced feature. +# +# This file is intended to be included into another package so +advanced features # can be conditionally included in the flash image +by enabling the respective # feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent ## + +INF SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 0000000000..3c461e7fbc --- /dev/null +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemor +++ y.fdf @@ -0,0 +1,11 @@ +## @file +# FDF file for pre-memory SpcrFeature advanced feature. +# +# This file is intended to be included into another package so +advanced features # can be conditionally included in the flash image +by enabling the respective # feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent ## diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc index c51e552df5..b06ddf4fe6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeat +++ ure.dsc @@ -25,40 +25,9 @@ !error "DXE_ARCH must be specified to build this feature!" !endif -################################################################################ -# -# Library Class section - list of all Library Classes needed by this feature. -# -################################################################################ - -!include MdePkg/MdeLibs.dsc.inc - [LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - - ####################################### - # SpcrFeaturePkg Packages - ####################################### SpcrDeviceLib|SpcrFeaturePkg/Library/SpcrDeviceLibNull/SpcrDeviceLibNull.inf -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - ################################################################################ # # Component section - list of all components that need built for this feature. @@ -74,38 +43,7 @@ # ################################################################################ -# -# Feature DXE Components -# - # @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 # is completed. [Components.X64] - ##################################### - # Spcr Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf - #{ -# <LibraryClasses> -# SpcrDeviceLib|SpcrFeaturePkg/Library/SpcrDeviceLibNull/SpcrDeviceLibNull.inf -# } - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md index 0a5d48876d..66138ee0f6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md @@ -22,10 +22,10 @@ Platform can implement its own library to select the serial port device. * SpcrDeviceLibNull ## SpcrAcpiDxe -The main driver of convert the serial port device info to ACPI table. -It will call the function GetSpcrDevice() in the library SpcrDeviceLib to get the serial port device path. +The main driver of convert the serial port device info into an ACPI table. +It will call the function GetSpcrDevice () in the library SpcrDeviceLib to get the serial port device path. If the serial port device path is not NULL, then use gEfiPciIoProtocolGuid to get the PCI info, and use the gEfiSerialIoProtocolGuid to get the serial port info, such as the baud rate etc. -If the serial port device is PCI device 00:16:03 (AMT serial over lan PCI device), then will set the BaseAddress. +If the serial port device is PCI device 00:16:03 (AMT serial over LAN PCI device), then will set the BaseAddress. At last fill the ACPI table as Windows required. ## SpcrDeviceLibNull @@ -37,19 +37,19 @@ Fill the serial port device info used for SPCR to ACPI table. ## Configuration There is not special configuration. -But the platform maybe implemente its own SpcrDeviceLib. +But the platform may implement its own SpcrDeviceLib. ## Data Flows GetSpcrDevice() -> serial port device path -> get PCI info and serial port info -> ACPI table. ## Control Flows -GetSpcrDevice() in SpcrDeviceLib -> SpcrAcpiDxe. +GetSpcrDevice () in SpcrDeviceLib -> SpcrAcpiDxe. ## Build Flows There is not special build flow. ## Test Point Results -* Check the output ACPI table. +There are not test points implemented. ## Functional Exit Criteria * Check the output ACPI table. diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec index 03776abf06..b084fad892 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d +++ ec @@ -21,6 +21,12 @@ [Includes] Include +[Guids] + gSpcrFeaturePkgTokenSpaceGuid = { 0xe978c988, 0xeeba, 0x4671, { 0xb8, +0x0d, 0xcc, 0x8b, 0x89, 0xb5, 0xd1, 0xef }} + +[PcdsFeatureFlag] + +gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable|FALSE|BOOLEAN|0x0000 +0001 + [LibraryClasses] ## @libraryclass Provides an API for get SPCR device. # diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc index 82d2d3ac73..2ee874a58e 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d +++ sc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85707): https://edk2.groups.io/g/devel/message/85707 Mute This Topic: https://groups.io/mt/88365350/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-