forked from tianocore/edk2-platforms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WhitleyOpenBoardPkg/PlatformSpecificAcpiTableLib: Add library
Enables boards to modify the AcpiPlatform driver behaviors. 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
Showing
5 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
129 changes: 129 additions & 0 deletions
129
Platform/Intel/WhitleyOpenBoardPkg/Include/Library/PlatformSpecificAcpiTableLib.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/** @file | ||
This library provides a set of platform only ACPI tables and functions. | ||
@copyright | ||
Copyright 2012 - 2020 Intel Corporation. <BR> | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef _PLATFORM_SPECIFIC_ACPI_TABLE_LIB_H_ | ||
#define _PLATFORM_SPECIFIC_ACPI_TABLE_LIB_H_ | ||
|
||
#include <IndustryStandard/Acpi.h> | ||
#include <Library/AcpiPlatformLib.h> | ||
|
||
#include <Library/BaseMemoryLib.h> | ||
#include <Library/DevicePathLib.h> | ||
#include <Protocol/DevicePath.h> | ||
#include <Protocol/SerialIo.h> | ||
#include <Protocol/SuperIo.h> | ||
#include <Guid/GlobalVariable.h> | ||
#include <IndustryStandard/SerialPortConsoleRedirectionTable.h> | ||
|
||
/** | ||
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 |
23 changes: 23 additions & 0 deletions
23
...el/WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/AcpiPlatformLibSpcrNull.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** @file | ||
ACPI Platform Driver Hooks | ||
@copyright | ||
Copyright 1996 - 2016 Intel Corporation. <BR> | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
// | ||
// Statements that include other files | ||
// | ||
#include <Library/PlatformSpecificAcpiTableLib.h> | ||
|
||
EFI_STATUS | ||
PatchSpcrAcpiTable ( | ||
IN OUT EFI_ACPI_COMMON_HEADER *Table | ||
) | ||
{ | ||
EFI_STATUS Status = EFI_SUCCESS; | ||
|
||
return Status; | ||
} |
50 changes: 50 additions & 0 deletions
50
...yOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @file | ||
Hooks for Platform populate different function and Platform only ACPI Table. | ||
@copyright | ||
Copyright 2013 - 2019 Intel Corporation. <BR> | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <PiDxe.h> | ||
#include <Library/PlatformSpecificAcpiTableLib.h> | ||
|
||
/** | ||
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; | ||
} |
27 changes: 27 additions & 0 deletions
27
...penBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. <BR> | ||
# | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters