From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7179A74003A for ; Wed, 19 Jun 2024 22:07:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=45p2EfuG2X5iYuQecA6MJ3KuBln3NO++J8fs1t8r2+M=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1718834827; v=1; b=TL4RwpPeA+sX3JrZ2qbLI4UtjWrRQt/SUZcZrvd38+ecd/+Rq/awhqQR21WYsfRbLuz3Qky9 PqtdSqueZr474x4ClvbiPr1cMRPHYdF8k9/gdeZgP8yYBRA4C2BiJZvZxNAo94M6ZfpjvNeRdky JeXV5h4oZq4dteaQeUGQak77VDwPfdQvITh/nGJ0UcHnWiNBdnW+Gdrkl0cWVICbCEmAu5qJaGC 4T6T4kQe1NATf3Ziz+MOM2ailU9rHQtnimxBE3tMpCxSNj9DrGSqtZD1ki2L5r1WTVOjdWwiOlo SqAaDbTyZPoDn/5DN4UrsYIYtsMV+n9arOriJoD1Mc8cg== X-Received: by 127.0.0.2 with SMTP id q55eYY7687511xtUW0SPBZ7x; Wed, 19 Jun 2024 15:07:06 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.34048.1718834825420466602 for ; Wed, 19 Jun 2024 15:07:05 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D3A031515; Wed, 19 Jun 2024 15:07:29 -0700 (PDT) X-Received: from e126645.home (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0F1193F64C; Wed, 19 Jun 2024 15:07:02 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Pierre Gondois , AbdulLateef Attar , Girish Mahadevan , Jeff Brasen , Jeshua Smith , Leif Lindholm , Meenakshi Aggarwal , Sami Mujawar , Sunil V L , Yeo Reum Yun Subject: [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC Date: Thu, 20 Jun 2024 00:06:21 +0200 Message-Id: <20240619220629.1994362-8-pierre.gondois@arm.com> In-Reply-To: <20240619220629.1994362-1-pierre.gondois@arm.com> References: <20240619220629.1994362-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 19 Jun 2024 15:07:05 -0700 Resent-From: pierre.gondois@arm.com Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: By4XkibU9fTcCN1eUNOBQYW6x7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=TL4RwpPe; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io The GICC is an ARM specific structure. Other architectures have different local interrupt controller structures from which CPU topology can be created. Avoid the GICC reference in common code by: - creating a wrapper CreateTopologyFromIntC() instead of CreateTopologyFromGicC() so that different archs can implement it differently. - implementing arch specific functions to get the AcpiProcessorUid, CpcToken, EtToken and use them instead of using the GicC CM object directly. Suggested-by: Sunil V L Signed-off-by: Pierre Gondois --- .../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++ .../SsdtCpuTopologyGenerator.c | 341 ++------------- .../SsdtCpuTopologyGenerator.h | 196 +++++++++ .../SsdtCpuTopologyLib.inf | 3 + 4 files changed, 647 insertions(+), 301 deletions(-) create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopolog= yLib/Arm/ArmSsdtCpuTopologyGenerator.c diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Ar= m/ArmSsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/Acpi= SsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c new file mode 100644 index 000000000000..140a2e491116 --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSs= dtCpuTopologyGenerator.c @@ -0,0 +1,408 @@ +/** @file=0D + ARM SSDT Cpu Topology Table Generator Helpers.=0D +=0D + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D + @par Reference(s):=0D + - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors=0D + - ACPI for CoreSight version 1.2 Platform Design Document=0D + (https://developer.arm.com/documentation/den0067/a/?lang=3Den)=0D +=0D + @par Glossary:=0D + - ETE - Embedded Trace Extension.=0D + - ETM - Embedded Trace Macrocell.=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +// Module specific include files.=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "SsdtCpuTopologyGenerator.h"=0D +=0D +/** ARM SSDT Cpu Topology Table Generator.=0D +=0D +Requirements:=0D + The following Configuration Manager Object(s) are required by=0D + this Generator:=0D + - EArmObjGicCInfo=0D + - EArmObjEtInfo (OPTIONAL)=0D +*/=0D +=0D +/** This macro expands to a function that retrieves the GIC=0D + CPU interface Information from the Configuration Manager.=0D +*/=0D +GET_OBJECT_LIST (=0D + EObjNameSpaceArm,=0D + EArmObjGicCInfo,=0D + CM_ARM_GICC_INFO=0D + );=0D +=0D +/**=0D + This macro expands to a function that retrieves the ET device=0D + information from the Configuration Manager.=0D +*/=0D +GET_OBJECT_LIST (=0D + EObjNameSpaceArm,=0D + EArmObjEtInfo,=0D + CM_ARM_ET_INFO=0D + );=0D +=0D +/** Create an embedded trace device and add it to the Cpu Node in the=0D + AML namespace.=0D +=0D + This generates the following ASL code:=0D + Device (E002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ARMHC500")=0D + }=0D +=0D + Note: Currently we only support generating ETE nodes. Unlike ETM,=0D + ETE has a system register interface and therefore does not need=0D + the MMIO range to be described.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] ParentNode Parent node to attach the Cpu node to.= =0D + @param [in] AcpiProcessorUid ACPI Processor UID of the CPU.=0D + @param [in] CpuName Value used to generate the node name.= =0D + @param [out] EtNodePtr If not NULL, return the created Cpu no= de.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +CreateAmlEtd (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN AML_NODE_HANDLE ParentNode,=0D + IN UINT32 AcpiProcessorUid,=0D + IN UINT32 CpuName,=0D + OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL=0D + )=0D +{=0D + EFI_STATUS Status;=0D + AML_OBJECT_NODE_HANDLE EtNode;=0D + CHAR8 AslName[AML_NAME_SEG_SIZE + 1];=0D +=0D + ASSERT (Generator !=3D NULL);=0D + ASSERT (ParentNode !=3D NULL);=0D +=0D + Status =3D WriteAslName ('E', CpuName, AslName);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlCodeGenDevice (AslName, ParentNode, &EtNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlCodeGenNameInteger (=0D + "_UID",=0D + AcpiProcessorUid,=0D + EtNode,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlCodeGenNameString (=0D + "_HID",=0D + ACPI_HID_ET_DEVICE,=0D + EtNode,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + // If requested, return the handle to the EtNode.=0D + if (EtNodePtr !=3D NULL) {=0D + *EtNodePtr =3D EtNode;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/** Create and add an Embedded trace device to the Cpu Node.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D + Protocol Interface.=0D + @param [in] AcpiProcessorUid ACPI processor Uid of the local intc= (gicc, other)=0D + describing the Cpu.=0D + @param [in] EtToken Embedded Trace Token of the CPU.=0D + @param [in] CpuName Value used to generate the CPU node = name.=0D + @param [in] CpuNode CPU Node to which the ET device node= is=0D + attached.=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_UNSUPPORTED Feature Unsupported.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +CreateAmlEtNode (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN UINT32 AcpiProcessorUid= ,=0D + IN CM_OBJECT_TOKEN EtToken,=0D + IN UINT32 CpuName,=0D + IN AML_OBJECT_NODE_HANDLE *CpuNode=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_ET_INFO *EtInfo;=0D +=0D + Status =3D GetEArmObjEtInfo (=0D + CfgMgrProtocol,=0D + EtToken,=0D + &EtInfo,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + // Currently we only support creation of a ETE Node.=0D + if (EtInfo->EtType !=3D ArmEtTypeEte) {=0D + return EFI_UNSUPPORTED;=0D + }=0D +=0D + Status =3D CreateAmlEtd (=0D + Generator,=0D + CpuNode,=0D + AcpiProcessorUid,=0D + CpuName,=0D + NULL=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D +}=0D +=0D +/** Create the processor hierarchy AML tree from arch specific CM objects.= =0D +=0D + The Arm architecture will use the CM_ARM_GICC_INFO CM objects for instan= ce.=0D + A processor container is by extension any non-leave device in the cpu to= pology.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] ScopeNode Scope node handle ('\_SB' scope).=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +CreateTopologyFromIntC (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN AML_OBJECT_NODE_HANDLE ScopeNode=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_GICC_INFO *GicCInfo;=0D + UINT32 GicCInfoCount;=0D + UINT32 Index;=0D + AML_OBJECT_NODE_HANDLE CpuNode;=0D +=0D + ASSERT (Generator !=3D NULL);=0D + ASSERT (CfgMgrProtocol !=3D NULL);=0D + ASSERT (ScopeNode !=3D NULL);=0D +=0D + Status =3D GetEArmObjGicCInfo (=0D + CfgMgrProtocol,=0D + CM_NULL_TOKEN,=0D + &GicCInfo,=0D + &GicCInfoCount=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + // For each CM_ARM_GICC_INFO object, create an AML node.=0D + for (Index =3D 0; Index < GicCInfoCount; Index++) {=0D + Status =3D CreateAmlCpu (=0D + Generator,=0D + ScopeNode,=0D + GicCInfo[Index].AcpiProcessorUid,=0D + Index,=0D + &CpuNode=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + break;=0D + }=0D +=0D + // If a CPC info is associated with the=0D + // GicCinfo, create an _CPC method returning them.=0D + if (GicCInfo[Index].CpcToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo[Ind= ex].CpcToken, CpuNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + break;=0D + }=0D + }=0D +=0D + if (GicCInfo[Index].EtToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlEtNode (=0D + Generator,=0D + CfgMgrProtocol,=0D + GicCInfo[Index].AcpiProcessorUid,=0D + GicCInfo[Index].EtToken,=0D + Index,=0D + CpuNode=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D + }=0D + } // for=0D +=0D + return Status;=0D +}=0D +=0D +/** Get generic interrupt information from arch specific CM objects.=0D +=0D + The AcpiProcessorUid, CpcToken, etc. are held in arch specific CM object= s,=0D + in the CM_ARM_GICC_INFO CM object for Arm for instance.=0D + This wrapper allows to get this information from each arch object.=0D +=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] AcpiIdObjectToken AcpiIdObjectToken identifying the CPU to= fetch the=0D + other fields from.=0D + @param [out] AcpiProcessorUid AcpiProcessorUid of the CPU identified b= y=0D + the AcpiIdObjectToken.=0D + @param [out] CpcToken CpcToken of the CPU identified by=0D + the AcpiIdObjectToken.=0D + @param [out] PsdToken PsdToken of the CPU identified by=0D + the AcpiIdObjectToken.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_NOT_FOUND Not found.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +GetIntCInfo (=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_OBJECT_TOKEN AcpiIdObjectToke= n,=0D + OUT UINT32 *AcpiProcessorUi= d,=0D + OUT CM_OBJECT_TOKEN *CpcToken,=0D + OUT CM_OBJECT_TOKEN *PsdToken=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_GICC_INFO *GicCInfo;=0D +=0D + Status =3D GetEArmObjGicCInfo (=0D + CfgMgrProtocol,=0D + AcpiIdObjectToken,=0D + &GicCInfo,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + if (AcpiProcessorUid !=3D NULL) {=0D + *AcpiProcessorUid =3D GicCInfo->AcpiProcessorUid;=0D + }=0D +=0D + if (CpcToken !=3D NULL) {=0D + *CpcToken =3D GicCInfo->CpcToken;=0D + }=0D +=0D + if (PsdToken !=3D NULL) {=0D + *PsdToken =3D GicCInfo->PsdToken;=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/** Add arch specific information to a CPU node in the asl description.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] AcpiIdObjectToken AcpiIdObjectToken identifying the CPU to= fetch the=0D + other fields from.=0D + @param [in] CpuName Value used to generate the CPU node name= .=0D + @param [out] CpuNode CPU Node to which the ET device node is= =0D + attached.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_NOT_FOUND Not found.=0D + @retval EFI_UNSUPPORTED Feature Unsupported.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +AddArchAmlCpuInfo (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_OBJECT_TOKEN AcpiIdObjectToke= n,=0D + IN UINT32 CpuName,=0D + OUT AML_OBJECT_NODE_HANDLE *CpuNode=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_GICC_INFO *GicCInfo;=0D +=0D + Status =3D GetEArmObjGicCInfo (=0D + CfgMgrProtocol,=0D + AcpiIdObjectToken,=0D + &GicCInfo,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + // Add an Embedded Trace node if present.=0D + if (GicCInfo->EtToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlEtNode (=0D + Generator,=0D + CfgMgrProtocol,=0D + GicCInfo->AcpiProcessorUid,=0D + GicCInfo->EtToken,=0D + CpuName,=0D + CpuNode=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D + }=0D +=0D + return Status;=0D +}=0D diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpu= TopologyLib/SsdtCpuTopologyGenerator.c index 2deaa4640c5c..74595131935c 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyGenerator.c @@ -32,28 +32,17 @@ =0D #include "SsdtCpuTopologyGenerator.h"=0D =0D -/** ARM standard SSDT Cpu Topology Table Generator.=0D +/** SSDT Cpu Topology Table Generator.=0D =0D Requirements:=0D The following Configuration Manager Object(s) are required by=0D this Generator:=0D - - EArmObjGicCInfo=0D - EArchCommonObjProcHierarchyInfo (OPTIONAL) along with=0D - EArchCommonObjCmRef (OPTIONAL)=0D - EArchCommonObjLpiInfo (OPTIONAL)=0D - - GetEArmObjEtInfo (OPTIONAL)=0D - EArchCommonObjPsdInfo (OPTIONAL)=0D */=0D =0D -/** This macro expands to a function that retrieves the GIC=0D - CPU interface Information from the Configuration Manager.=0D -*/=0D -GET_OBJECT_LIST (=0D - EObjNameSpaceArm,=0D - EArmObjGicCInfo,=0D - CM_ARM_GICC_INFO=0D - );=0D -=0D /**=0D This macro expands to a function that retrieves the Processor Hierarchy= =0D information from the Configuration Manager.=0D @@ -94,16 +83,6 @@ GET_OBJECT_LIST ( CM_ARCH_COMMON_CPC_INFO=0D );=0D =0D -/**=0D - This macro expands to a function that retrieves the ET device=0D - information from the Configuration Manager.=0D -*/=0D -GET_OBJECT_LIST (=0D - EObjNameSpaceArm,=0D - EArmObjEtInfo,=0D - CM_ARM_ET_INFO=0D - );=0D -=0D /**=0D This macro expands to a function that retrieves the PSD=0D information from the Configuration Manager.=0D @@ -238,7 +217,6 @@ TokenTableAdd ( @retval EFI_SUCCESS Success.=0D @retval EFI_INVALID_PARAMETER Invalid parameter.=0D **/=0D -STATIC=0D EFI_STATUS=0D EFIAPI=0D WriteAslName (=0D @@ -294,8 +272,7 @@ WriteAslName ( @param [in] Generator The SSDT Cpu Topology generator.=0D @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D Protocol Interface.=0D - @param [in] GicCInfo Pointer to the CM_ARM_GICC_INFO obje= ct=0D - describing the Cpu.=0D + @param [in] PsdToken Token to identify the Psd informatio= n.=0D @param [in] Node CPU Node to which the _CPC node is=0D attached.=0D =0D @@ -309,7 +286,7 @@ EFIAPI CreateAmlPsdNode (=0D IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D - IN CM_ARM_GICC_INFO *GicCInfo,=0D + IN CM_OBJECT_TOKEN PsdToken,=0D IN AML_OBJECT_NODE_HANDLE *Node=0D )=0D {=0D @@ -318,7 +295,7 @@ CreateAmlPsdNode ( =0D Status =3D GetEArchCommonObjPsdInfo (=0D CfgMgrProtocol,=0D - GicCInfo->PsdToken,=0D + PsdToken,=0D &PsdInfo,=0D NULL=0D );=0D @@ -381,7 +358,7 @@ CreateAmlPsdNode ( @param [in] Generator The SSDT Cpu Topology generator.=0D @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D Protocol Interface.=0D - @param [in] GicCInfo Pointer to the CM_ARM_GICC_INFO obje= ct=0D + @param [in] CpcToken CPC token of the INTC info=0D describing the Cpu.=0D @param [in] Node CPU Node to which the _CPC node is=0D attached.=0D @@ -390,13 +367,12 @@ CreateAmlPsdNode ( @retval EFI_INVALID_PARAMETER Invalid parameter.=0D @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D **/=0D -STATIC=0D EFI_STATUS=0D EFIAPI=0D CreateAmlCpcNode (=0D IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D - IN CM_ARM_GICC_INFO *GicCInfo,=0D + IN CM_OBJECT_TOKEN CpcToken,=0D IN AML_OBJECT_NODE_HANDLE *Node=0D )=0D {=0D @@ -405,7 +381,7 @@ CreateAmlCpcNode ( =0D Status =3D GetEArchCommonObjCpcInfo (=0D CfgMgrProtocol,=0D - GicCInfo->CpcToken,=0D + CpcToken,=0D &CpcInfo,=0D NULL=0D );=0D @@ -423,147 +399,6 @@ CreateAmlCpcNode ( return Status;=0D }=0D =0D -/** Create an embedded trace device and add it to the Cpu Node in the=0D - AML namespace.=0D -=0D - This generates the following ASL code:=0D - Device (E002)=0D - {=0D - Name (_UID, 2)=0D - Name (_HID, "ARMHC500")=0D - }=0D -=0D - Note: Currently we only support generating ETE nodes. Unlike ETM,=0D - ETE has a system register interface and therefore does not need=0D - the MMIO range to be described.=0D -=0D - @param [in] Generator The SSDT Cpu Topology generator.=0D - @param [in] ParentNode Parent node to attach the Cpu node to.=0D - @param [in] GicCInfo CM_ARM_GICC_INFO object used to create the nod= e.=0D - @param [in] CpuName Value used to generate the node name.=0D - @param [out] EtNodePtr If not NULL, return the created Cpu node.=0D -=0D - @retval EFI_SUCCESS Success.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter.=0D - @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D -**/=0D -STATIC=0D -EFI_STATUS=0D -EFIAPI=0D -CreateAmlEtd (=0D - IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D - IN AML_NODE_HANDLE ParentNode,=0D - IN CM_ARM_GICC_INFO *GicCInfo,=0D - IN UINT32 CpuName,=0D - OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL=0D - )=0D -{=0D - EFI_STATUS Status;=0D - AML_OBJECT_NODE_HANDLE EtNode;=0D - CHAR8 AslName[AML_NAME_SEG_SIZE + 1];=0D -=0D - ASSERT (Generator !=3D NULL);=0D - ASSERT (ParentNode !=3D NULL);=0D -=0D - Status =3D WriteAslName ('E', CpuName, AslName);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - Status =3D AmlCodeGenDevice (AslName, ParentNode, &EtNode);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - Status =3D AmlCodeGenNameInteger (=0D - "_UID",=0D - GicCInfo->AcpiProcessorUid,=0D - EtNode,=0D - NULL=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - Status =3D AmlCodeGenNameString (=0D - "_HID",=0D - ACPI_HID_ET_DEVICE,=0D - EtNode,=0D - NULL=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - // If requested, return the handle to the EtNode.=0D - if (EtNodePtr !=3D NULL) {=0D - *EtNodePtr =3D EtNode;=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/** Create and add an Embedded trace device to the Cpu Node.=0D -=0D - @param [in] Generator The SSDT Cpu Topology generator.=0D - @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D - Protocol Interface.=0D - @param [in] GicCInfo Pointer to the CM_ARM_GICC_INFO obje= ct=0D - describing the Cpu.=0D - @param [in] CpuName Value used to generate the CPU node = name.=0D - @param [in] Node CPU Node to which the ET device node= is=0D - attached.=0D -=0D - @retval EFI_SUCCESS The function completed successfully.=0D - @retval EFI_UNSUPPORTED Feature Unsupported.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter.=0D - @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D -**/=0D -STATIC=0D -EFI_STATUS=0D -EFIAPI=0D -CreateAmlEtNode (=0D - IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D - IN CM_ARM_GICC_INFO *GicCInfo,=0D - IN UINT32 CpuName,=0D - IN AML_OBJECT_NODE_HANDLE *Node=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CM_ARM_ET_INFO *EtInfo;=0D -=0D - Status =3D GetEArmObjEtInfo (=0D - CfgMgrProtocol,=0D - GicCInfo->EtToken,=0D - &EtInfo,=0D - NULL=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - // Currently we only support creation of a ETE Node.=0D - if (EtInfo->EtType !=3D ArmEtTypeEte) {=0D - return EFI_UNSUPPORTED;=0D - }=0D -=0D - Status =3D CreateAmlEtd (=0D - Generator,=0D - Node,=0D - GicCInfo,=0D - CpuName,=0D - NULL=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - return Status;=0D -}=0D -=0D /** Create and add an _LPI method to Cpu/Cluster Node.=0D =0D For instance, transform an AML node from:=0D @@ -789,23 +624,22 @@ GenerateLpiStates ( Name (_HID, "ACPI0007")=0D }=0D =0D - @param [in] Generator The SSDT Cpu Topology generator.=0D - @param [in] ParentNode Parent node to attach the Cpu node to.=0D - @param [in] GicCInfo CM_ARM_GICC_INFO object used to create the nod= e.=0D - @param [in] CpuName Value used to generate the node name.=0D - @param [out] CpuNodePtr If not NULL, return the created Cpu node.=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] ParentNode Parent node to attach the Cpu node to.=0D + @param [in] AcpiProcessorUid ACPI processor UID of the CPU.=0D + @param [in] CpuName Value used to generate the node name.=0D + @param [out] CpuNodePtr If not NULL, return the created Cpu node.= =0D =0D @retval EFI_SUCCESS Success.=0D @retval EFI_INVALID_PARAMETER Invalid parameter.=0D @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D **/=0D -STATIC=0D EFI_STATUS=0D EFIAPI=0D CreateAmlCpu (=0D IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D IN AML_NODE_HANDLE ParentNode,=0D - IN CM_ARM_GICC_INFO *GicCInfo,=0D + IN UINT32 AcpiProcessorUid,=0D IN UINT32 CpuName,=0D OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL=0D )=0D @@ -816,7 +650,6 @@ CreateAmlCpu ( =0D ASSERT (Generator !=3D NULL);=0D ASSERT (ParentNode !=3D NULL);=0D - ASSERT (GicCInfo !=3D NULL);=0D =0D Status =3D WriteAslName ('C', CpuName, AslName);=0D if (EFI_ERROR (Status)) {=0D @@ -832,7 +665,7 @@ CreateAmlCpu ( =0D Status =3D AmlCodeGenNameInteger (=0D "_UID",=0D - GicCInfo->AcpiProcessorUid,=0D + AcpiProcessorUid,=0D CpuNode,=0D NULL=0D );=0D @@ -887,8 +720,10 @@ CreateAmlCpuFromProcHierarchy ( )=0D {=0D EFI_STATUS Status;=0D - CM_ARM_GICC_INFO *GicCInfo;=0D AML_OBJECT_NODE_HANDLE CpuNode;=0D + UINT32 AcpiProcessorUid;=0D + CM_OBJECT_TOKEN CpcToken;=0D + CM_OBJECT_TOKEN PsdToken;=0D =0D ASSERT (Generator !=3D NULL);=0D ASSERT (CfgMgrProtocol !=3D NULL);=0D @@ -896,18 +731,19 @@ CreateAmlCpuFromProcHierarchy ( ASSERT (ProcHierarchyNodeInfo !=3D NULL);=0D ASSERT (ProcHierarchyNodeInfo->AcpiIdObjectToken !=3D CM_NULL_TOKEN);=0D =0D - Status =3D GetEArmObjGicCInfo (=0D + Status =3D GetIntCInfo (=0D CfgMgrProtocol,=0D ProcHierarchyNodeInfo->AcpiIdObjectToken,=0D - &GicCInfo,=0D - NULL=0D + &AcpiProcessorUid,=0D + &CpcToken,=0D + &PsdToken=0D );=0D if (EFI_ERROR (Status)) {=0D ASSERT (0);=0D return Status;=0D }=0D =0D - Status =3D CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuN= ode);=0D + Status =3D CreateAmlCpu (Generator, ParentNode, AcpiProcessorUid, CpuNam= e, &CpuNode);=0D if (EFI_ERROR (Status)) {=0D ASSERT (0);=0D return Status;=0D @@ -923,8 +759,8 @@ CreateAmlCpuFromProcHierarchy ( }=0D }=0D =0D - if (GicCInfo->PsdToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuN= ode);=0D + if (PsdToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, PsdToken, CpuN= ode);=0D if (EFI_ERROR (Status)) {=0D ASSERT_EFI_ERROR (Status);=0D return Status;=0D @@ -932,28 +768,26 @@ CreateAmlCpuFromProcHierarchy ( }=0D =0D // If a CPC info is associated with the=0D - // GicCinfo, create an _CPC method returning them.=0D - if (GicCInfo->CpcToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuN= ode);=0D + // IntcInfo, create an _CPC method returning them.=0D + if (CpcToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, CpcToken, CpuN= ode);=0D if (EFI_ERROR (Status)) {=0D ASSERT_EFI_ERROR (Status);=0D return Status;=0D }=0D }=0D =0D - // Add an Embedded Trace node if present.=0D - if (GicCInfo->EtToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlEtNode (=0D - Generator,=0D - CfgMgrProtocol,=0D - GicCInfo,=0D - CpuName,=0D - CpuNode=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT_EFI_ERROR (Status);=0D - return Status;=0D - }=0D + // Add arch specific information if necessary.=0D + Status =3D AddArchAmlCpuInfo (=0D + Generator,=0D + CfgMgrProtocol,=0D + ProcHierarchyNodeInfo->AcpiIdObjectToken,=0D + CpuName,=0D + CpuNode=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D }=0D =0D return Status;=0D @@ -1342,100 +1176,6 @@ exit_handler: return Status;=0D }=0D =0D -/** Create the processor hierarchy AML tree from CM_ARM_GICC_INFO=0D - CM objects.=0D -=0D - A processor container is by extension any non-leave device in the cpu to= pology.=0D -=0D - @param [in] Generator The SSDT Cpu Topology generator.=0D - @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D - Protocol Interface.=0D - @param [in] ScopeNode Scope node handle ('\_SB' scope).=0D -=0D - @retval EFI_SUCCESS Success.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter.=0D - @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D -**/=0D -STATIC=0D -EFI_STATUS=0D -EFIAPI=0D -CreateTopologyFromGicC (=0D - IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D - IN AML_OBJECT_NODE_HANDLE ScopeNode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CM_ARM_GICC_INFO *GicCInfo;=0D - UINT32 GicCInfoCount;=0D - UINT32 Index;=0D - AML_OBJECT_NODE_HANDLE CpuNode;=0D -=0D - ASSERT (Generator !=3D NULL);=0D - ASSERT (CfgMgrProtocol !=3D NULL);=0D - ASSERT (ScopeNode !=3D NULL);=0D -=0D - Status =3D GetEArmObjGicCInfo (=0D - CfgMgrProtocol,=0D - CM_NULL_TOKEN,=0D - &GicCInfo,=0D - &GicCInfoCount=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - return Status;=0D - }=0D -=0D - // For each CM_ARM_GICC_INFO object, create an AML node.=0D - for (Index =3D 0; Index < GicCInfoCount; Index++) {=0D - Status =3D CreateAmlCpu (=0D - Generator,=0D - ScopeNode,=0D - &GicCInfo[Index],=0D - Index,=0D - &CpuNode=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT (0);=0D - break;=0D - }=0D -=0D - if (GicCInfo->PsdToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, Cp= uNode);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT_EFI_ERROR (Status);=0D - return Status;=0D - }=0D - }=0D -=0D - // If a CPC info is associated with the=0D - // GicCinfo, create an _CPC method returning them.=0D - if (GicCInfo[Index].CpcToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[In= dex], CpuNode);=0D - if (EFI_ERROR (Status)) {=0D - ASSERT_EFI_ERROR (Status);=0D - break;=0D - }=0D - }=0D -=0D - if (GicCInfo[Index].EtToken !=3D CM_NULL_TOKEN) {=0D - Status =3D CreateAmlEtNode (=0D - Generator,=0D - CfgMgrProtocol,=0D - &GicCInfo[Index],=0D - Index,=0D - CpuNode=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ASSERT_EFI_ERROR (Status);=0D - return Status;=0D - }=0D - }=0D - } // for=0D -=0D - return Status;=0D -}=0D -=0D /** Construct the SSDT Cpu Topology ACPI table.=0D =0D This function invokes the Configuration Manager protocol interface=0D @@ -1514,9 +1254,8 @@ BuildSsdtCpuTopologyTable ( }=0D =0D if (Status =3D=3D EFI_NOT_FOUND) {=0D - // If hierarchy information is not found generate a flat topology=0D - // using CM_ARM_GICC_INFO objects.=0D - Status =3D CreateTopologyFromGicC (=0D + // If hierarchy information is not found generate a flat topology.=0D + Status =3D CreateTopologyFromIntC (=0D Generator,=0D CfgMgrProtocol,=0D ScopeNode=0D diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Ss= dtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpu= TopologyLib/SsdtCpuTopologyGenerator.h index 6fb44c7e5887..a5d80177f2fc 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyGenerator.h @@ -144,4 +144,200 @@ typedef struct AcpiCpuTopologyGenerator { =0D #pragma pack()=0D =0D +/** Write a string 'Xxxx\0' in AslName (5 bytes long),=0D + with 'X' being the leading char of the name, and=0D + with 'xxx' being Value in hexadecimal.=0D +=0D + As 'xxx' in hexadecimal represents a number on 12 bits,=0D + we have Value < (1 << 12).=0D +=0D + @param [in] LeadChar Leading char of the name.=0D + @param [in] Value Hex value of the name.=0D + Must be lower than (2 << 12).=0D + @param [in, out] AslName Pointer to write the 'Xxxx' string to.=0D + Must be at least 5 bytes long.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +WriteAslName (=0D + IN CHAR8 LeadChar,=0D + IN UINT32 Value,=0D + IN OUT CHAR8 *AslName=0D + );=0D +=0D +/** Get generic interrupt information from arch specific CM objects.=0D +=0D + The AcpiProcessorUid, CpcToken, etc. are held in arch specific CM object= s,=0D + in the CM_ARM_GICC_INFO CM object for Arm for instance.=0D + This wrapper allows to get this information from each arch object.=0D +=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] AcpiProcessorUid ACPI processor Uid of the local intc= (gicc, other)=0D + other fields from.=0D + @param [out] AcpiProcessorUid AcpiProcessorUid of the CPU identified b= y=0D + the AcpiIdObjectToken.=0D + @param [out] CpcToken CpcToken of the CPU identified by=0D + the AcpiIdObjectToken.=0D + @param [out] PsdToken PsdToken of the CPU identified by=0D + the AcpiIdObjectToken.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_NOT_FOUND Not found.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +GetIntCInfo (=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_OBJECT_TOKEN AcpiIdObjectToke= n,=0D + OUT UINT32 *AcpiProcessorUi= d,=0D + OUT CM_OBJECT_TOKEN *CpcToken,=0D + OUT CM_OBJECT_TOKEN *PsdToken=0D + );=0D +=0D +/** Create and add an _CPC Node to Cpu Node.=0D +=0D + For instance, transform an AML node from:=0D + Device (C002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ACPI0007")=0D + }=0D +=0D + To:=0D + Device (C002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ACPI0007")=0D + Name(_CPC, Package()=0D + {=0D + NumEntries, // Integer=0D + Revision, // Integer=0D + HighestPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + NominalPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + LowestNonlinearPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + LowestPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + GuaranteedPerformanceRegister, // Buffer (Resource Descr= iptor)=0D + DesiredPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + MinimumPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + MaximumPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + PerformanceReductionToleranceRegister, // Buffer (Resource Descr= iptor)=0D + TimeWindowRegister, // Buffer (Resource Descr= iptor)=0D + CounterWraparoundTime, // Integer or Buffer (Res= ource Descriptor)=0D + ReferencePerformanceCounterRegister, // Buffer (Resource Descr= iptor)=0D + DeliveredPerformanceCounterRegister, // Buffer (Resource Descr= iptor)=0D + PerformanceLimitedRegister, // Buffer (Resource Descr= iptor)=0D + CPPCEnableRegister // Buffer (Resource Descr= iptor)=0D + AutonomousSelectionEnable, // Integer or Buffer (Res= ource Descriptor)=0D + AutonomousActivityWindowRegister, // Buffer (Resource Descr= iptor)=0D + EnergyPerformancePreferenceRegister, // Buffer (Resource Descr= iptor)=0D + ReferencePerformance // Integer or Buffer (Res= ource Descriptor)=0D + LowestFrequency, // Integer or Buffer (Res= ource Descriptor)=0D + NominalFrequency // Integer or Buffer (Res= ource Descriptor)=0D + })=0D + }=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D + Protocol Interface.=0D + @param [in] CpcToken CPC token of the INTC info=0D + describing the Cpu.=0D + @param [in] Node CPU Node to which the _CPC node is=0D + attached.=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +CreateAmlCpcNode (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_OBJECT_TOKEN CpcToken,=0D + IN AML_OBJECT_NODE_HANDLE *Node=0D + );=0D +=0D +/** Create a Cpu in the AML namespace.=0D +=0D + This generates the following ASL code:=0D + Device (C002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ACPI0007")=0D + }=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] ParentNode Parent node to attach the Cpu node to.=0D + @param [in] AcpiProcessorUid ACPI processor UID of the CPU.=0D + @param [in] CpuName Value used to generate the node name.=0D + @param [out] CpuNodePtr If not NULL, return the created Cpu node.= =0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +CreateAmlCpu (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN AML_NODE_HANDLE ParentNode,=0D + IN UINT32 AcpiProcessorUid,=0D + IN UINT32 CpuName,=0D + OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL=0D + );=0D +=0D +/** Create the processor hierarchy AML tree from arch specific CM objects.= =0D +=0D + The Arm architecture will use the CM_ARM_GICC_INFO CM objects for instan= ce.=0D + A processor container is by extension any non-leave device in the cpu to= pology.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] ScopeNode Scope node handle ('\_SB' scope).=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +CreateTopologyFromIntC (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN AML_OBJECT_NODE_HANDLE ScopeNode=0D + );=0D +=0D +/** Add arch specific information to a CPU node in the asl description.=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D + Protocol Interface.=0D + @param [in] AcpiIdObjectToken AcpiIdObjectToken identifying the CPU to= fetch the=0D + other fields from.=0D + @param [in] CpuName Value used to generate the CPU node name= .=0D + @param [out] CpuNode CPU Node to which the ET device node is= =0D + attached.=0D +=0D + @retval EFI_SUCCESS Success.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_NOT_FOUND Not found.=0D + @retval EFI_UNSUPPORTED Feature Unsupported.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +AddArchAmlCpuInfo (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_OBJECT_TOKEN AcpiIdObjectToke= n,=0D + IN UINT32 CpuName,=0D + OUT AML_OBJECT_NODE_HANDLE *CpuNode=0D + );=0D +=0D #endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_=0D diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Ss= dtCpuTopologyLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopo= logyLib/SsdtCpuTopologyLib.inf index 2d38fb30fb09..93ede691cdf9 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyLib.inf +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTo= pologyLib.inf @@ -20,6 +20,9 @@ [Sources] SsdtCpuTopologyGenerator.c=0D SsdtCpuTopologyGenerator.h=0D =0D +[Sources.ARM, Sources.AARCH64]=0D + Arm/ArmSsdtCpuTopologyGenerator.c=0D +=0D [Packages.ARM, Packages.AARCH64]=0D ArmPlatformPkg/ArmPlatformPkg.dec=0D =0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119639): https://edk2.groups.io/g/devel/message/119639 Mute This Topic: https://groups.io/mt/106770160/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-