diff --git a/DynamicTablesPkg/Include/X64NameSpaceObjects.h b/DynamicTablesPkg/Include/X64NameSpaceObjects.h index f3d4ae37b6897..fa14c8e5da0c8 100644 --- a/DynamicTablesPkg/Include/X64NameSpaceObjects.h +++ b/DynamicTablesPkg/Include/X64NameSpaceObjects.h @@ -242,6 +242,16 @@ typedef struct CmX64LocalApicX2ApicInfo { i.e. a token referencing a CM_ARCH_COMMON_PSTATE_INFO object. */ CM_OBJECT_TOKEN PstateToken; + + /** Optional field: Reference Token for the Psd info of this processor. + i.e. a token referencing a CM_ARCH_COMMON_PSD_INFO object. + */ + CM_OBJECT_TOKEN PsdToken; + + /** Optional field: Reference Token for the Cpc info of this processor. + i.e. a token referencing a CM_ARCH_COMMON_CPC_INFO object. + */ + CM_OBJECT_TOKEN CpcToken; } CM_X64_LOCAL_APIC_X2APIC_INFO; /** diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c index 3bb0c2fe25a8d..1db5ca07a69e4 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c @@ -280,7 +280,6 @@ WriteAslName ( @retval EFI_INVALID_PARAMETER Invalid parameter. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. **/ -STATIC EFI_STATUS EFIAPI CreateAmlPsdNode ( diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h index a5d80177f2fcb..02f623a266c2e 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h @@ -340,4 +340,48 @@ AddArchAmlCpuInfo ( OUT AML_OBJECT_NODE_HANDLE *CpuNode ); +/** Create and add an _PSD Node to Cpu Node. + + For instance, transform an AML node from: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + } + + To: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + Name (_PSD, Package() + { + NumEntries, // Integer + Revision, // Integer + Domain, // Integer + CoordType, // Integer + NumProcessors, // Integer + }) + } + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] PsdToken Token to identify the Psd information. + @param [in] Node CPU Node to which the _CPC node is + attached. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +EFI_STATUS +EFIAPI +CreateAmlPsdNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_OBJECT_TOKEN PsdToken, + IN AML_OBJECT_NODE_HANDLE *Node + ); + #endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_ diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/X64/X64SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/X64/X64SsdtCpuTopologyGenerator.c index 87732bfdc1fea..8cdf55bca5b4b 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/X64/X64SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/X64/X64SsdtCpuTopologyGenerator.c @@ -207,6 +207,22 @@ CreateTopologyFromIntC ( return Status; } } + + if (LocalApicX2ApicInfo[Index].PsdToken != CM_NULL_TOKEN) { + Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, LocalApicX2ApicInfo[Index].PsdToken, CpuNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + + if (LocalApicX2ApicInfo[Index].CpcToken != CM_NULL_TOKEN) { + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, LocalApicX2ApicInfo[Index].CpcToken, CpuNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } } return Status; diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index e2e41166cbbb8..e8ae978c15693 100755 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -957,7 +957,9 @@ STATIC CONST CM_OBJ_PARSER CmX64ObjLocalApicX2ApicInfoParser[] = { { "AcpiProcessorUid", 4, "0x%x", NULL }, { "CstToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, { "CsdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, - { "PstateToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL } + { "PstateToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "PsdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL } }; /** A parser for CmX64IoApicInfoParser.