From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C6022740052 for ; Tue, 9 Jan 2024 16:30:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YwPT0yYNSVZThM2JofplT66XByZBJV8YaB2hjvHZf84=; 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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704817840; v=1; b=gQ2NltN1Rgl0y3lTdQBxID9f/NqkY55ktqZavbfwprIYNMPHK2/ene0GFErW3K8S8OHzI/wv OBNduq7YiIk0anMKZnP2ns2XzPoM9oJaFh1CnrNPRvXr9pnReNV9muitXSyMjuU1Nf1Tom0rV6+ 4zaKZFI2WoNu/P17d8LGNclQ= X-Received: by 127.0.0.2 with SMTP id e4upYY7687511xPCx2pYVVfs; Tue, 09 Jan 2024 08:30:40 -0800 X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web11.21064.1704817839936660752 for ; Tue, 09 Jan 2024 08:30:40 -0800 X-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d3e6c86868so27718835ad.1 for ; Tue, 09 Jan 2024 08:30:39 -0800 (PST) X-Gm-Message-State: 6LmFjzLAgKvLzFNi1pqRVs9ix7686176AA= X-Google-Smtp-Source: AGHT+IGJ5v6sh8ThK/9msrKkYU6kFqw3jMekpwkh1x6TNGDRi8/7qT1xFBS6UZ69p07jxMPcvZQRKw== X-Received: by 2002:a17:902:bf4a:b0:1d3:2a94:cb54 with SMTP id u10-20020a170902bf4a00b001d32a94cb54mr6208674pls.53.1704817839032; Tue, 09 Jan 2024 08:30:39 -0800 (PST) X-Received: from localhost.localdomain ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id c12-20020a170902b68c00b001d457090851sm1983596pls.289.2024.01.09.08.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:30:38 -0800 (PST) From: "Sunil V L" To: devel@edk2.groups.io Cc: Sunil V L , Ard Biesheuvel , Leif Lindholm , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [RFC PATCH v1 15/20] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Move GICC from common code Date: Tue, 9 Jan 2024 21:59:39 +0530 Message-Id: <20240109162944.528006-16-sunilvl@ventanamicro.com> In-Reply-To: <20240109162944.528006-1-sunilvl@ventanamicro.com> References: <20240109162944.528006-1-sunilvl@ventanamicro.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 Reply-To: devel@edk2.groups.io,sunilvl@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=gQ2NltN1; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io GICC is ARM specific structure. Different 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. - Implement arch specific functions to get AcpiProcessorUid, CpcToken, EtToken and use them instead of using GICC directly. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Sunil V L --- .../SsdtCpuTopologyLib.inf | 3 + .../SsdtCpuTopologyGenerator.h | 48 +++++ .../ArmSsdtCpuTopologyGenerator.c | 179 +++++++++++++++++ .../SsdtCpuTopologyGenerator.c | 184 +++++------------- 4 files changed, 274 insertions(+), 140 deletions(-) create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/ArmSsdtCpuTopologyGenerator.c diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf index 2d38fb30fb09..6ec4aeeae159 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf @@ -16,6 +16,9 @@ [Defines] CONSTRUCTOR = AcpiSsdtCpuTopologyLibConstructor DESTRUCTOR = AcpiSsdtCpuTopologyLibDestructor +[Sources.ARM, Sources.AARCH64] + ArmSsdtCpuTopologyGenerator.c + [Sources] SsdtCpuTopologyGenerator.c SsdtCpuTopologyGenerator.h diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h index 57ff8009b59d..872c5c010d5c 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h @@ -144,4 +144,52 @@ typedef struct AcpiCpuTopologyGenerator { #pragma pack() +EFI_STATUS +EFIAPI +GetIntCUidTokens ( + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_OBJECT_TOKEN IntCToken, + OUT UINT32 *AcpiProcessorUid, + OUT CM_OBJECT_TOKEN *CpcToken, + OUT CM_OBJECT_TOKEN *EtToken + ); + +EFI_STATUS +EFIAPI +CreateAmlEtNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN UINT32 AcpiProcessorUid, + IN CM_OBJECT_TOKEN EtToken, + IN UINT32 CpuName, + IN AML_OBJECT_NODE_HANDLE *Node + ); + +EFI_STATUS +EFIAPI +CreateAmlCpcNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_OBJECT_TOKEN CpcToken, + IN AML_OBJECT_NODE_HANDLE *Node + ); + +EFI_STATUS +EFIAPI +CreateAmlCpu ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN AML_NODE_HANDLE ParentNode, + IN UINT32 Uid, + IN UINT32 CpuName, + OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL + ); + +EFI_STATUS +EFIAPI +CreateTopologyFromIntC ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN AML_OBJECT_NODE_HANDLE ScopeNode + ); + #endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_ diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/ArmSsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/ArmSsdtCpuTopologyGenerator.c new file mode 100644 index 000000000000..3078c206224f --- /dev/null +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/ArmSsdtCpuTopologyGenerator.c @@ -0,0 +1,179 @@ +/** @file + ARM SSDT Cpu Topology Table Generator Helpers. + + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors + - ACPI for CoreSight version 1.2 Platform Design Document + (https://developer.arm.com/documentation/den0067/a/?lang=en) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. +**/ + +#include +#include +#include +#include +#include +#include + +// Module specific include files. +#include +#include +#include +#include +#include +#include +#include + +#include "SsdtCpuTopologyGenerator.h" + +/** This macro expands to a function that retrieves the GIC + CPU interface Information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArch, + EArchObjGicCInfo, + CM_ARCH_GICC_INFO + ); + +/** Create the processor hierarchy AML tree from CM_ARCH_GICC_INFO + CM objects. + + A processor container is by extension any non-leave device in the cpu topology. + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] ScopeNode Scope node handle ('\_SB' scope). + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +EFI_STATUS +EFIAPI +CreateTopologyFromIntC ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN AML_OBJECT_NODE_HANDLE ScopeNode + ) +{ + EFI_STATUS Status; + CM_ARCH_GICC_INFO *GicCInfo; + UINT32 GicCInfoCount; + UINT32 Index; + AML_OBJECT_NODE_HANDLE CpuNode; + + ASSERT (Generator != NULL); + ASSERT (CfgMgrProtocol != NULL); + ASSERT (ScopeNode != NULL); + + Status = GetEArchObjGicCInfo ( + CfgMgrProtocol, + CM_NULL_TOKEN, + &GicCInfo, + &GicCInfoCount + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // For each CM_ARCH_GICC_INFO object, create an AML node. + for (Index = 0; Index < GicCInfoCount; Index++) { + Status = CreateAmlCpu ( + Generator, + ScopeNode, + GicCInfo[Index].AcpiProcessorUid, + Index, + &CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + break; + } + + // If a CPC info is associated with the + // GicCinfo, create an _CPC method returning them. + if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) { + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo[Index].CpcToken, CpuNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + break; + } + } + + if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) { + Status = CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + GicCInfo[Index].AcpiProcessorUid, + GicCInfo[Index].EtToken, + Index, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + } // for + + return Status; +} + +/** Get UID, CpcToken and EtToken from local interrupt controller structure. + + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] IntCToken Unique Local INTC token to find the correct + INTC info structure. + @param [out] AcpiProcessorUid UID of the CPU. + @param [out] CpcToken CpcToken of the CPU / local INTC. + @param [out] EtToken EtToken of the CPU / local INTC. + + @retval EFI_SUCCESS Success. + @retval EFI_NOT_FOUND INTC structure not found. +**/ +EFI_STATUS +EFIAPI +GetIntCUidTokens ( + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_OBJECT_TOKEN IntCToken, + OUT UINT32 *AcpiProcessorUid, + OUT CM_OBJECT_TOKEN *CpcToken, + OUT CM_OBJECT_TOKEN *EtToken + ) +{ + EFI_STATUS Status; + CM_ARCH_GICC_INFO *GicCInfo; + + Status = GetEArchObjGicCInfo ( + CfgMgrProtocol, + IntCToken, + &GicCInfo, + NULL + ); + if (EFI_ERROR (Status)) { + return Status; + } + + if (AcpiProcessorUid != NULL) { + *AcpiProcessorUid = GicCInfo->AcpiProcessorUid; + } + + if (CpcToken != NULL) { + *CpcToken = GicCInfo->CpcToken; + } + + if (EtToken != NULL) { + *EtToken = GicCInfo->EtToken; + } + + return Status; +} diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c index f0fb209fdc4c..3c87c651711c 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c @@ -32,27 +32,17 @@ #include "SsdtCpuTopologyGenerator.h" -/** ARM standard SSDT Cpu Topology Table Generator. +/** SSDT Cpu Topology Table Generator. Requirements: The following Configuration Manager Object(s) are required by this Generator: - - EArchObjGicCInfo - EArchObjProcHierarchyInfo (OPTIONAL) along with - EArchObjCmRef (OPTIONAL) - EArchObjLpiInfo (OPTIONAL) - GetEArchObjEtInfo (OPTIONAL) */ -/** This macro expands to a function that retrieves the GIC - CPU interface Information from the Configuration Manager. -*/ -GET_OBJECT_LIST ( - EObjNameSpaceArch, - EArchObjGicCInfo, - CM_ARCH_GICC_INFO - ); - /** This macro expands to a function that retrieves the Processor Hierarchy information from the Configuration Manager. @@ -301,7 +291,7 @@ WriteAslName ( @param [in] Generator The SSDT Cpu Topology generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. - @param [in] GicCInfo Pointer to the CM_ARCH_GICC_INFO object + @param [in] CpcToken CPC token of the INTC info describing the Cpu. @param [in] Node CPU Node to which the _CPC node is attached. @@ -310,22 +300,21 @@ WriteAslName ( @retval EFI_INVALID_PARAMETER Invalid parameter. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. **/ -STATIC EFI_STATUS EFIAPI CreateAmlCpcNode ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, - IN CM_ARCH_GICC_INFO *GicCInfo, + IN CM_OBJECT_TOKEN CpcToken, IN AML_OBJECT_NODE_HANDLE *Node ) { - EFI_STATUS Status; + EFI_STATUS Status; CM_ARCH_CPC_INFO *CpcInfo; Status = GetEArchObjCpcInfo ( CfgMgrProtocol, - GicCInfo->CpcToken, + CpcToken, &CpcInfo, NULL ); @@ -357,11 +346,11 @@ CreateAmlCpcNode ( ETE has a system register interface and therefore does not need the MMIO range to be described. - @param [in] Generator The SSDT Cpu Topology generator. - @param [in] ParentNode Parent node to attach the Cpu node to. - @param [in] GicCInfo CM_ARCH_GICC_INFO object used to create the node. - @param [in] CpuName Value used to generate the node name. - @param [out] EtNodePtr If not NULL, return the created Cpu node. + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] ParentNode Parent node to attach the Cpu node to. + @param [in] AcpiProcessorUid ACPI Processor UID of the CPU. + @param [in] CpuName Value used to generate the node name. + @param [out] EtNodePtr If not NULL, return the created Cpu node. @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER Invalid parameter. @@ -373,7 +362,7 @@ EFIAPI CreateAmlEtd ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN AML_NODE_HANDLE ParentNode, - IN CM_ARCH_GICC_INFO *GicCInfo, + IN UINT32 AcpiProcessorUid, IN UINT32 CpuName, OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL ) @@ -399,7 +388,7 @@ CreateAmlEtd ( Status = AmlCodeGenNameInteger ( "_UID", - GicCInfo->AcpiProcessorUid, + AcpiProcessorUid, EtNode, NULL ); @@ -432,34 +421,33 @@ CreateAmlEtd ( @param [in] Generator The SSDT Cpu Topology generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. - @param [in] GicCInfo Pointer to the CM_ARCH_GICC_INFO object - describing the Cpu. + @param [in] AcpiProcessorUid ACPI processor Uid of the local interrupt + controller describing the Cpu. + @param [in] EtToken EtToken of the CPU node name. @param [in] CpuName Value used to generate the CPU node name. @param [in] Node CPU Node to which the ET device node is attached. @retval EFI_SUCCESS The function completed successfully. @retval EFI_UNSUPPORTED Feature Unsupported. - @retval EFI_INVALID_PARAMETER Invalid parameter. - @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. **/ -STATIC EFI_STATUS EFIAPI CreateAmlEtNode ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, - IN CM_ARCH_GICC_INFO *GicCInfo, - IN UINT32 CpuName, + IN UINT32 AcpiProcessorUid, + IN CM_OBJECT_TOKEN EtToken, + IN UINT32 CpuName, IN AML_OBJECT_NODE_HANDLE *Node ) { - EFI_STATUS Status; + EFI_STATUS Status; CM_ARCH_ET_INFO *EtInfo; Status = GetEArchObjEtInfo ( CfgMgrProtocol, - GicCInfo->EtToken, + EtToken, &EtInfo, NULL ); @@ -476,7 +464,7 @@ CreateAmlEtNode ( Status = CreateAmlEtd ( Generator, Node, - GicCInfo, + AcpiProcessorUid, CpuName, NULL ); @@ -708,23 +696,22 @@ GenerateLpiStates ( Name (_HID, "ACPI0007") } - @param [in] Generator The SSDT Cpu Topology generator. - @param [in] ParentNode Parent node to attach the Cpu node to. - @param [in] GicCInfo CM_ARCH_GICC_INFO object used to create the node. - @param [in] CpuName Value used to generate the node name. - @param [out] CpuNodePtr If not NULL, return the created Cpu node. + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] ParentNode Parent node to attach the Cpu node to. + @param [in] AcpiProcessorUid ACPI processor UID of the CPU. + @param [in] CpuName Value used to generate the node name. + @param [out] CpuNodePtr If not NULL, return the created Cpu node. @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER Invalid parameter. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. **/ -STATIC EFI_STATUS EFIAPI CreateAmlCpu ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN AML_NODE_HANDLE ParentNode, - IN CM_ARCH_GICC_INFO *GicCInfo, + IN UINT32 AcpiProcessorUid, IN UINT32 CpuName, OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL ) @@ -735,7 +722,6 @@ CreateAmlCpu ( ASSERT (Generator != NULL); ASSERT (ParentNode != NULL); - ASSERT (GicCInfo != NULL); Status = WriteAslName ('C', CpuName, AslName); if (EFI_ERROR (Status)) { @@ -751,7 +737,7 @@ CreateAmlCpu ( Status = AmlCodeGenNameInteger ( "_UID", - GicCInfo->AcpiProcessorUid, + AcpiProcessorUid, CpuNode, NULL ); @@ -806,8 +792,9 @@ CreateAmlCpuFromProcHierarchy ( ) { EFI_STATUS Status; - CM_ARCH_GICC_INFO *GicCInfo; AML_OBJECT_NODE_HANDLE CpuNode; + UINT32 AcpiProcessorUid; + CM_OBJECT_TOKEN CpcToken, EtToken; ASSERT (Generator != NULL); ASSERT (CfgMgrProtocol != NULL); @@ -815,18 +802,19 @@ CreateAmlCpuFromProcHierarchy ( ASSERT (ProcHierarchyNodeInfo != NULL); ASSERT (ProcHierarchyNodeInfo->GicCToken != CM_NULL_TOKEN); - Status = GetEArchObjGicCInfo ( + Status = GetIntCUidTokens ( CfgMgrProtocol, ProcHierarchyNodeInfo->GicCToken, - &GicCInfo, - NULL + &AcpiProcessorUid, + &CpcToken, + &EtToken ); if (EFI_ERROR (Status)) { ASSERT (0); return Status; } - Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuNode); + Status = CreateAmlCpu (Generator, ParentNode, AcpiProcessorUid, CpuName, &CpuNode); if (EFI_ERROR (Status)) { ASSERT (0); return Status; @@ -843,9 +831,9 @@ CreateAmlCpuFromProcHierarchy ( } // If a CPC info is associated with the - // GicCinfo, create an _CPC method returning them. - if (GicCInfo->CpcToken != CM_NULL_TOKEN) { - Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode); + // IntcInfo, create an _CPC method returning them. + if (CpcToken != CM_NULL_TOKEN) { + Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, CpcToken, CpuNode); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); return Status; @@ -853,11 +841,12 @@ CreateAmlCpuFromProcHierarchy ( } // Add an Embedded Trace node if present. - if (GicCInfo->EtToken != CM_NULL_TOKEN) { + if (EtToken != CM_NULL_TOKEN) { Status = CreateAmlEtNode ( Generator, CfgMgrProtocol, - GicCInfo, + AcpiProcessorUid, + EtToken, CpuName, CpuNode ); @@ -892,7 +881,8 @@ CreateAmlCpuFromProcHierarchy ( container node to. @param [in] ProcHierarchyNodeInfo CM_ARCH_PROC_HIERARCHY_INFO object used to create the node. - @param [in] ProcContainerIndex Index used to generate the node name. + @param [in] ProcContainerName Node name. + @param [in] ProcContainerUid UID of the processor container node. @param [out] ProcContainerNodePtr If success, contains the created processor container node. @@ -1241,92 +1231,6 @@ CreateTopologyFromProcHierarchy ( return Status; } -/** Create the processor hierarchy AML tree from CM_ARCH_GICC_INFO - CM objects. - - A processor container is by extension any non-leave device in the cpu topology. - - @param [in] Generator The SSDT Cpu Topology generator. - @param [in] CfgMgrProtocol Pointer to the Configuration Manager - Protocol Interface. - @param [in] ScopeNode Scope node handle ('\_SB' scope). - - @retval EFI_SUCCESS Success. - @retval EFI_INVALID_PARAMETER Invalid parameter. - @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. -**/ -STATIC -EFI_STATUS -EFIAPI -CreateTopologyFromGicC ( - IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, - IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, - IN AML_OBJECT_NODE_HANDLE ScopeNode - ) -{ - EFI_STATUS Status; - CM_ARCH_GICC_INFO *GicCInfo; - UINT32 GicCInfoCount; - UINT32 Index; - AML_OBJECT_NODE_HANDLE CpuNode; - - ASSERT (Generator != NULL); - ASSERT (CfgMgrProtocol != NULL); - ASSERT (ScopeNode != NULL); - - Status = GetEArchObjGicCInfo ( - CfgMgrProtocol, - CM_NULL_TOKEN, - &GicCInfo, - &GicCInfoCount - ); - if (EFI_ERROR (Status)) { - ASSERT (0); - return Status; - } - - // For each CM_ARCH_GICC_INFO object, create an AML node. - for (Index = 0; Index < GicCInfoCount; Index++) { - Status = CreateAmlCpu ( - Generator, - ScopeNode, - &GicCInfo[Index], - Index, - &CpuNode - ); - if (EFI_ERROR (Status)) { - ASSERT (0); - break; - } - - // If a CPC info is associated with the - // GicCinfo, create an _CPC method returning them. - if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) { - Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - break; - } - } - - if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) { - Status = CreateAmlEtNode ( - Generator, - CfgMgrProtocol, - &GicCInfo[Index], - Index, - CpuNode - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - } - } // for - - return Status; -} - /** Construct the SSDT Cpu Topology ACPI table. This function invokes the Configuration Manager protocol interface @@ -1407,7 +1311,7 @@ BuildSsdtCpuTopologyTable ( if (Status == EFI_NOT_FOUND) { // If hierarchy information is not found generate a flat topology // using CM_ARCH_GICC_INFO objects. - Status = CreateTopologyFromGicC ( + Status = CreateTopologyFromIntC ( Generator, CfgMgrProtocol, ScopeNode -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113477): https://edk2.groups.io/g/devel/message/113477 Mute This Topic: https://groups.io/mt/103622735/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-