Skip to content

Commit

Permalink
DynamicTablesPkg: Add _PSD and _CPC support for X64
Browse files Browse the repository at this point in the history
Introduce _PSD and _CPC ACPI objects for X64 platforms.

Signed-off-by: Abdul Lateef Attar <[email protected]>
  • Loading branch information
Abdul Lateef Attar authored and Abdul Lateef Attar committed Nov 29, 2024
1 parent ffc3b6d commit 45f3fc2
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 2 deletions.
10 changes: 10 additions & 0 deletions DynamicTablesPkg/Include/X64NameSpaceObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 45f3fc2

Please sign in to comment.