From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.860.1646952112302807460 for ; Thu, 10 Mar 2022 14:41:52 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=VtsEJ1e4; spf=pass (domain: intel.com, ip: 134.134.136.31, 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=1646952112; x=1678488112; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hW4gzj4vGzLLjcia4XxVXCNis/RStF4i2Syx3543r9w=; b=VtsEJ1e4UbtJYP/f96Xi1HUiCZ1tLylBe/PngYJSR4rRG0hwXROL2X9K C0IB9tP5U+3sw0GdIlv6blyurcHnlVsR/iUM/bXAdqSO5UvThRDqByU2U QfMXJlUvUXHh11O2MH1Hrbtvl1ntIhZFbFkH1vrE/7ilVF7iJY578jdu3 52+VC+Gh7/EMBM78poOsblpp2DeNZwN6WFCZJlC7QaxiU8UmgP0aHHSWa RqSrt8Fgx+bMGe2WXkR0iYc5JKHxLr839cuPikRY1Y5yVk1+jWQeApx4O j7Ell3yX8vtpekfaCSVkEvoe1zN/92AY4ij8zVJmALzYpFAKIxg03OKh2 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="316121251" X-IronPort-AV: E=Sophos;i="5.90,171,1643702400"; d="scan'208";a="316121251" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 14:41:34 -0800 X-IronPort-AV: E=Sophos;i="5.90,171,1643702400"; d="scan'208";a="644643370" Received: from iworam-desk.amr.corp.intel.com ([10.7.150.60]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 14:41:34 -0800 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Nate DeSimone , Chasel Chiu Subject: [edk2-devel][edk2-platforms][PATCH V1 5/9] WhitleyOpenBoardPkg/PlatformSpecificAcpiTableLib: Add library Date: Thu, 10 Mar 2022 14:41:10 -0800 Message-Id: <0477469fab21ad96740518f5e13aa678891bd0d3.1646951441.git.isaac.w.oram@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Enables boards to modify the AcpiPlatform driver behaviors. Cc: Nate DeSimone Cc: Chasel Chiu Signed-off-by: Isaac Oram --- Platform/Intel/WhitleyOpenBoardPkg/Include/Library/PlatformSpecificAcpiTableLib.h | 129 ++++++++++++++++++++ Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/AcpiPlatformLibSpcrNull.c | 23 ++++ Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.c | 50 ++++++++ Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf | 27 ++++ Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 + 5 files changed, 230 insertions(+) diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/PlatformSpecificAcpiTableLib.h b/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/PlatformSpecificAcpiTableLib.h new file mode 100644 index 0000000000..a260703274 --- /dev/null +++ b/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/PlatformSpecificAcpiTableLib.h @@ -0,0 +1,129 @@ +/** @file + This library provides a set of platform only ACPI tables and functions. + + @copyright + Copyright 2012 - 2020 Intel Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _PLATFORM_SPECIFIC_ACPI_TABLE_LIB_H_ +#define _PLATFORM_SPECIFIC_ACPI_TABLE_LIB_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + This function will check ACPI Table is active or not active. + This allows boards to prevent publication of unused tables. + + @param Table - The table to check + + @retval EFI_SUCCESS - The Table is active. + +**/ +EFI_STATUS +PlatformAcpiReportHooksTableIsActive ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + This function will patch to update platform ACPI Table information. + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - The function completed successfully. + +**/ +EFI_STATUS +PatchPlatformSpecificAcpiTableHooks ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + This function will patch to update SPCR Table information. + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - The function completed successfully. + +**/ +EFI_STATUS +PatchSpcrAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + Update the HMAT table. + + @param [in, out] Table The table to be udated. + + @retval EFI SUCCESS Procedure returned successfully. +**/ +EFI_STATUS +PatchHmatAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + Update the PMTT ACPI table + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - Returns Success + +**/ +EFI_STATUS +PatchPlatformMemoryTopologyTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + Update the MSCT ACPI table + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - Returns Success + +**/ +EFI_STATUS +PatchMsctAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + + Update the MIGT ACPI table + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - Returns Success + +**/ +EFI_STATUS +PatchMigtAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +/** + Update the BDAT ACPI table: Multiple instances of the BDAT DATA HOB are placed into one contiguos memory range + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - Returns Success + +**/ +EFI_STATUS +PatchBdatAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ); + +#endif diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/AcpiPlatformLibSpcrNull.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/AcpiPlatformLibSpcrNull.c new file mode 100644 index 0000000000..0f4ffcf86f --- /dev/null +++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/AcpiPlatformLibSpcrNull.c @@ -0,0 +1,23 @@ +/** @file + ACPI Platform Driver Hooks + + @copyright + Copyright 1996 - 2016 Intel Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +// +// Statements that include other files +// +#include + +EFI_STATUS +PatchSpcrAcpiTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ) +{ + EFI_STATUS Status = EFI_SUCCESS; + + return Status; +} diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.c new file mode 100644 index 0000000000..74bce3141d --- /dev/null +++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.c @@ -0,0 +1,50 @@ +/** @file + Hooks for Platform populate different function and Platform only ACPI Table. + + @copyright + Copyright 2013 - 2019 Intel Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +/** + This function will check ACPI Table is active or not active. + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - The Table is active. + +**/ +EFI_STATUS +PlatformAcpiReportHooksTableIsActive ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ) +{ + EFI_ACPI_DESCRIPTION_HEADER *TableHeader; + + TableHeader = (EFI_ACPI_DESCRIPTION_HEADER *) Table; + if (TableHeader->Signature == EFI_ACPI_6_2_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE) { + return EFI_NOT_FOUND; + } + return EFI_SUCCESS; +} + +/** + + This function will patch to update platform level Acpi Table information. + + @param [in, out] Table The table to be udated. + + @retval EFI_SUCCESS - The function completed successfully. + +**/ +EFI_STATUS +PatchPlatformSpecificAcpiTableHooks ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ) +{ + return EFI_SUCCESS; +} diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf new file mode 100644 index 0000000000..48359b6bf5 --- /dev/null +++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf @@ -0,0 +1,27 @@ +## @file +# Hooks to deactive or active platform ACPI Tables and patch platform only ACPI Table. +# +# @copyright +# Copyright 2012 - 2018 Intel Corporation.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[defines] + INF_VERSION = 0x00010005 + BASE_NAME = PlatformSpecificAcpiTableLibNull + FILE_GUID = 6EF9D22E-89E7-45c7-8A3F-8D0207A084E4 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = PlatformSpecificAcpiTableLibNull + +[sources] + PlatformSpecificAcpiTableLibNull.c + AcpiPlatformLibSpcrNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + WhitleyOpenBoardPkg/PlatformPkg.dec + WhitleySiliconPkg/SiliconPkg.dec + WhitleySiliconPkg/CpRcPkg.dec diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc index 9cdb5bc2f6..2ac4a81e81 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc @@ -619,6 +619,7 @@ PlatformOpromPolicyLib|$(RP_PKG)/Library/PlatformOpromPolicyLibNull/PlatformOpromPolicyLibNull.inf VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf CrcLib|WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf + PlatformSpecificAcpiTableLib|WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf [LibraryClasses.Common.SEC, LibraryClasses.Common.PEI_CORE, LibraryClasses.Common.PEIM] FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf -- 2.27.0.windows.1