Skip to content

Commit

Permalink
DynamicTablesPkg: Adds SPMI table generator
Browse files Browse the repository at this point in the history
Adds ACPI SPMI table generator library.
Updates acpi standard table enum with spmi.
Updates arch common namespace object and parser.
Updates the Readme.

Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Pierre Gondois <[email protected]>
Signed-off-by: Abdul Lateef Attar <[email protected]>
  • Loading branch information
Abdul Lateef Attar authored and mergify[bot] committed Oct 3, 2024
1 parent 0958b76 commit f962adc
Show file tree
Hide file tree
Showing 8 changed files with 488 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DynamicTablesPkg/DynamicTables.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[LibraryClasses.common]
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
Expand All @@ -38,6 +39,7 @@
DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
DynamicTablesPkg/Library/Acpi/Common/AcpiTpm2Lib/AcpiTpm2Lib.inf
DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf

# AML Fixup (Common)
DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
Expand Down Expand Up @@ -67,6 +69,8 @@
# Generators
# Common
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf
# X64 specific
NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiWsmtLib/AcpiWsmtLib.inf
NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiHpetLib/AcpiHpetLib.inf
NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
Expand Down Expand Up @@ -97,6 +101,7 @@
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiTpm2Lib/AcpiTpm2Lib.inf
# Arm specific
Expand Down
1 change: 1 addition & 0 deletions DynamicTablesPkg/DynamicTablesPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"CCIDX",
"CCSIDR",
"countof",
"deviceid",
"EArch",
"edynamic",
"EOBJECT",
Expand Down
4 changes: 4 additions & 0 deletions DynamicTablesPkg/Include/AcpiTableGenerator.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ The Dynamic Tables Framework implements the following ACPI table generators:
SSDT table describing a Pci Express bus.
- WSMT : The WSMT generator collates the WSMT protection flag information
from the Configuration Manager and builds the WSMT table.
- SPMI : The SPMI generator collects the SPMI interface and
optionally SPMI interrupt and deviceid (or uid) information from the
Configuration Manager and builds the SPMI table.
*/

/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
Expand Down Expand Up @@ -107,6 +110,7 @@ typedef enum StdAcpiTableId {
EStdAcpiTableIdWsmt, ///< WSMT Generator
EStdAcpiTableIdHpet, ///< HPET Generator
EStdAcpiTableIdSsdtHpet, ///< SSDT HPET Generator
EStdAcpiTableIdSpmi, ///< SPMI Generator
EStdAcpiTableIdMax
} ESTD_ACPI_TABLE_ID;

Expand Down
37 changes: 37 additions & 0 deletions DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.<BR>
Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -50,6 +51,8 @@ typedef enum ArchCommonObjectID {
EArchCommonObjPccSubspaceType5Info, ///< 24 - Pcc Subspace Type 5 Info
EArchCommonObjPsdInfo, ///< 25 - P-State Dependency (PSD) Info
EArchCommonObjTpm2InterfaceInfo, ///< 26 - TPM Interface Info
EArchCommonObjSpmiInterfaceInfo, ///< 27 - SPMI Interface Info
EArchCommonObjSpmiInterruptDeviceInfo, ///< 28 - SPMI Interrupt and Device Info
EArchCommonObjMax
} EARCH_COMMON_OBJECT_ID;

Expand Down Expand Up @@ -691,6 +694,40 @@ typedef struct CmArchCommonTpm2InterfaceInfo {
UINT64 Lasa;
} CM_ARCH_COMMON_TPM2_INTERFACE_INFO;

/** A structure that describes the
SPMI (Service Processor Management Interface) Info.
ID: EArchCommonObjSpmiInterfaceInfo
*/
typedef struct CmArchCommonObjSpmiInterfaceInfo {
/** Interface type */
UINT8 InterfaceType;

/** Base address */
EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE BaseAddress;
} CM_ARCH_COMMON_SPMI_INTERFACE_INFO;

/** A structure that describes the
SPMI (Service Processor Management Interface) Interrupt and Device Info.
ID: EArchCommonObjSpmiInterruptDeviceInfo
*/
typedef struct CmArchCommonObjSpmiInterruptDeviceInfo {
/** Interrupt type */
UINT8 InterruptType;

/** GPE number */
UINT8 Gpe;

/** PCI device flag */
UINT8 PciDeviceFlag;

/** GSI number */
UINT32 GlobalSystemInterrupt;

/** Uid of the device */
UINT32 DeviceId;
} CM_ARCH_COMMON_SPMI_INTERRUPT_DEVICE_INFO;
#pragma pack()

#endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
29 changes: 29 additions & 0 deletions DynamicTablesPkg/Library/Acpi/Common/AcpiSpmiLib/AcpiSpmiLib.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## @file
# SPMI Table Generator
#
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

[Defines]
INF_VERSION = 1.30
BASE_NAME = AcpiSpmiLib
FILE_GUID = 31307BFF-BA0E-42C3-BD73-6C482740120D
VERSION_STRING = 1.0
MODULE_TYPE = DXE_DRIVER
LIBRARY_CLASS = NULL|DXE_DRIVER
CONSTRUCTOR = AcpiSpmiLibConstructor
DESTRUCTOR = AcpiSpmiLibDestructor

[Sources]
SpmiGenerator.c

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
DynamicTablesPkg/DynamicTablesPkg.dec

[LibraryClasses]
BaseLib
IpmiCommandLib
Loading

0 comments on commit f962adc

Please sign in to comment.