From nobody Thu Dec 26 15:46:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+108593+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1694609409741688.997229542248; Wed, 13 Sep 2023 05:50:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=BJqFwrw6NdxaCKKtfowkIjizS0VMCYTxQRzJfRthFVU=; c=relaxed/simple; d=groups.io; h=Received-SPF:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:NoDisclaimer:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1694609409; v=1; b=wMjeVK4D2dvxYCji6bL+Q7vetM5M4fIZsQz8IfHZbTBKS74L2TMRTtGhRw8VuK3rlnEWmGoK MJBoSGOmpqtmdiU4cGZvyzQESqozYd4s+Wttf1cSUm05OQfsTsQ8il5zfmGawyejQNuWrrQ8v78 QooEDmtV2F3fGfgtNSOwGs7g= X-Received: by 127.0.0.2 with SMTP id 0DSyYY1788612xkSHg7NtfUb; Wed, 13 Sep 2023 05:50:09 -0700 X-Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.86]) by mx.groups.io with SMTP id smtpd.web11.10995.1694609408391383077 for ; Wed, 13 Sep 2023 05:50:08 -0700 X-Received: from AM0PR02CA0220.eurprd02.prod.outlook.com (2603:10a6:20b:28f::27) by GV1PR08MB8644.eurprd08.prod.outlook.com (2603:10a6:150:85::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Wed, 13 Sep 2023 12:49:59 +0000 X-Received: from AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:28f:cafe::cb) by AM0PR02CA0220.outlook.office365.com (2603:10a6:20b:28f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.19 via Frontend Transport; Wed, 13 Sep 2023 12:49:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+108593+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT006.mail.protection.outlook.com (100.127.141.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.16 via Frontend Transport; Wed, 13 Sep 2023 12:49:59 +0000 X-Received: ("Tessian outbound b5a0f4347031:v175"); Wed, 13 Sep 2023 12:49:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 43e774a95c10e0e5 X-CR-MTA-TID: 64aa7808 X-Received: from 7737343a2284.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1482BA0C-B354-4EA4-A0D1-774C505D66D3.1; Wed, 13 Sep 2023 12:49:47 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7737343a2284.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 13 Sep 2023 12:49:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ftjzR8CfFDuH/i1Qsk7JbquOcVw/xHYmFZ4XkaO3ufDpHsoj8BthZz0dhNjxKEaGprCas93ElgtrPw+5aBraXoNr1ttu52MuCkDxtEWLa4p+jhNDaZJ+KY+ymL9Ykqk/sVCuhYiDL54g77oB0npzuF6x17LHWIQTZC9dY6D9NXzf5F8VuWSOnhkvpmHRQFFuQBN6erBuAMg535TqjhiVNYti7a4T2s3S0oUGWzg20uPuMcJr3LlBsIzt8f9PIkXap0xPuyoIx2HaphKzs2UYhlwnNSQz29ACcFrQ0OsVVmd5xUyd/CiIEB/fXDSlvEiorGf9QypbvaeLpfNzodsFRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T7emMewkIyb+t39DGp6dta3uR+WVAWG4Qd6bPckEQww=; b=RtblglXnKk+5F7JBcJydT9SQKx2KSXW57hKqIxcXemba47XTmxic6YMHVEVc/CgazXsCVU/buYrCMX7BgX1iLfqiGI7118uVdZb5eI009OzVmRlBv3Q3LIJzCJuVLV8g+C46qc8RF/z9fNJbQVYqQvBOsd56ajqAqi3Z7184gA8kia9mLhfMvU7XGTs+4J4Vl9d13UVM3VRcGBrwcAo6ei3rGir4W1bMSpLKbDX18Fm0/1bFlBtO7GuC0+z81LLKsG6vRLGL2CQ2wwwhGdjOm3RbegolBaSQLnsFDh1HEAQfmRQKx8LHqgUCW/WUdcF3hCXMBZHiAkfUso4o/JXDdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DUZPR01CA0256.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b5::16) by DBBPR08MB6250.eurprd08.prod.outlook.com (2603:10a6:10:1f5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.37; Wed, 13 Sep 2023 12:49:45 +0000 X-Received: from DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b5:cafe::59) by DUZPR01CA0256.outlook.office365.com (2603:10a6:10:4b5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.19 via Frontend Transport; Wed, 13 Sep 2023 12:49:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT057.mail.protection.outlook.com (100.127.142.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6792.19 via Frontend Transport; Wed, 13 Sep 2023 12:49:44 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 13 Sep 2023 12:49:41 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Wed, 13 Sep 2023 12:49:40 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 10/11] DynamicTablesPkg: Add ETE device to CPU node in AML Date: Wed, 13 Sep 2023 13:49:34 +0100 Message-ID: <20230913124935.38768-11-sami.mujawar@arm.com> In-Reply-To: <20230913124935.38768-1-sami.mujawar@arm.com> References: <20230913124935.38768-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT057:EE_|DBBPR08MB6250:EE_|AM7EUR03FT006:EE_|GV1PR08MB8644:EE_ X-MS-Office365-Filtering-Correlation-Id: 3630c0c4-afd1-4bef-ea69-08dbb457f0a9 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nPbuOks3Lvgd7IKEnpvldsXE0pwzJpOjkDCa5QuVfF0L6ovdvoUOzcMFljevs39Fn95ysd8r1qkOlM5WhARV69IlyNkYeo3sOhEdGVEDLL3nwvm9jVJE47qXizg/odtvtL3MF7f/Gc/Hxsi3fgv4Rfy9Q93ZMeQGPPzhgWKnpZjqAJ8NSfuY+Ivuf02hNscq2SlX/jWMOYDDAMNmxKxmmY6O80zYKHKU83faTTciMcjQq3CQwn1iClstsb/hKD5WaWNCjnusD7IjXO9fYFAJ7Xl+e7MTbDDm7emmt+2ODSYohMBF2l5CoXKpB+qk6IY60eFQeCrlDXlX/wokm2XqDUZ301i67OmPek1+yTOPrfO77XFb8tT60DCW0XE2kAL3XXhJuUTKEdjeuijg2GbFttv2SN7qz8um3qqkVCNpmjWqi2P1lanTXn0o1IEfCE+nB16fFP9Qw5zGZyDPrBlwXEH2O+0e6KxPfLRfsdhLvykqvvm896I4aBLdoutGc4zucfu87nd87eD3zAQp1blHIsNEGVSJYn+YvwDcsrz/S/BfxaZaRDxN/6HknGW6yyUPp0XxGZlNCiCtpJ7/TJ/ucKjWgXWsrQ2vGPoGcYi7t+FzvwRq8FRklG7FzdzRZBAp7vNyQ0NbRtQ44OMGRi7tpO/IbnNIq1Vcrgr6NQSeUnBTv1Ha/P4kNKdUdqHFdKlVIz0V9HXxqBKkzDyTFBHe+l3l3rW62WiLa03FoCYKkd1B8BNHQq6Sk9eH9zmJhFIqttUJJ/GJsfdzbWh2RhqKHg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(136003)(376002)(39860400002)(186009)(1800799009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(1076003)(2616005)(336012)(426003)(478600001)(81166007)(36756003)(82740400003)(6666004)(356005)(7696005)(47076005)(41300700001)(316002)(6916009)(70586007)(54906003)(70206006)(36860700001)(26005)(83380400001)(44832011)(5660300002)(4326008)(8936002)(2906002)(8676002)(40460700003)(86362001)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6250 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9bd6fa6c-937d-4ed4-18ea-08dbb457e7f1 X-Microsoft-Antispam-Message-Info: FwHZKAKFM5M6a2WpWNRuJarLQHRxPojgO2/D9sOFp7w6+jA4xQGngZRunuB1p5LuuG/azqIMgyVrQP5GRDzQt7dMqT8SkkELbo86gXWDC2p50aZcv6GgfNE+AMleO1wYrBdDKZbh5oP8zuK3rz2zljxjiwdC23W2fpPZhSGOgogISb4rjtfdm4jRVeJTLZiEe6q5PZMqu3saebOUIBDfDhfMsl5xm4PpGG5t+IYkYjtWH/n81TJDebChqOoM4/L8Pr6Am6zgMP/vqQbs0jm8NFyrtzbrDj1FasJFky9/Tn+WD4FduWOrGd+mjqLzic7TY75Bbm1ceqK11pdDZOvRhzMJldcORS3BzJ9lv3sTQoywW4RUGQrvckeZfpRPubzqCLB6Z4DFnxeNknN4Z0BsE1IstLG9HKb9ha6/f1LtCs1fmU2Q1fn+Ig42B02iv6Uz3aCB6Wr/mqn5eXzKgPnTRWytRFl0mcgInXTynzQEnDbzNL5qq3CGV8S4canDaCwFbVaWyu6i3IH6xKH2ulgVCWJyd/OK742htIhRzA+Fn5Q8Y9D8OLchpcrNRg/PUjBzN58BTs+/TbLpHnOC+HxbpdW3yNW51d5zUdPdcnoYWjdIIAHM0QbMAvw9BUNkR1apzx+18/xEd8KT+7n4JHRL344pxPgtbPq8P2gCKRbUGc+KHVOshGT2e/g3Kp+1qf3btp4pjFFcNFNH6Nq2s6VhRfpsLpCKO8yKXnSNJZZzjlg= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2023 12:49:59.5097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3630c0c4-afd1-4bef-ea69-08dbb457f0a9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8644 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,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NuHpzKlOfhxmaOm8dEP6Ldg0x1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1694609411368100019 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Coresight Embedded Trace Extension (ETE) feature can be detected by the platform firmware by examining the debug feature register ID_AA64DFR0_EL1.TraceVer field. The platform configuration manager can then describe the ETE by creating CM_ARM_ET_INFO object(s) and referencing these in CM_ARM_GICC_INFO.EtToken. The 'Table 3: Compatible IDs for architected CoreSight components' in the 'ACPI for CoreSight 1.2 Platform Design Document' specifies the HID value for Coresight ETE and CoreSight Embedded Trace Macrocell (ETM) v4.x as ARMH C500. Therefore, update the SsdtCpuTopologyGenerator to add an ETE device to the CPU node in the AML CPU hierarchy so that an OS can utilise this information. Note: Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE, the AML description does not describe any memory mapped registers. However, support for ETM can be added in the future. Signed-off-by: Sami Mujawar --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopolog= yGenerator.c | 186 +++++++++++++++++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopolog= yGenerator.h | 11 +- 2 files changed, 195 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c index 6fb131b664820adca63c9efa6d8b0e17fc64284e..6fbba12a010bf987797f0901a03= 2735e8e0be598 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c @@ -1,11 +1,17 @@ /** @file SSDT Cpu Topology Table Generator. =20 - Copyright (c) 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @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=3Den) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ =20 #include @@ -35,6 +41,7 @@ Requirements: - EArmObjProcHierarchyInfo (OPTIONAL) along with - EArmObjCmRef (OPTIONAL) - EArmObjLpiInfo (OPTIONAL) + - GetEArmObjEtInfo (OPTIONAL) */ =20 /** This macro expands to a function that retrieves the GIC @@ -86,6 +93,16 @@ GET_OBJECT_LIST ( CM_ARM_CPC_INFO ); =20 +/** + This macro expands to a function that retrieves the ET device + information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjEtInfo, + CM_ARM_ET_INFO + ); + /** Initialize the TokenTable. =20 One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO @@ -326,6 +343,144 @@ CreateAmlCpcNode ( return Status; } =20 +/** Create an embedded trace device and add it to the Cpu Node in the + AML namespace. + + This generates the following ASL code: + Device (E002) + { + Name (_UID, 2) + Name (_HID, "ARMHC500") + } + + Note: Currently we only support generating ETE nodes. Unlike ETM, + 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] 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. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlEtd ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN AML_NODE_HANDLE ParentNode, + IN UINT32 CpuName, + OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE EtNode; + CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; + + ASSERT (Generator !=3D NULL); + ASSERT (ParentNode !=3D NULL); + + Status =3D WriteAslName ('E', CpuName, AslName); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status =3D AmlCodeGenDevice (AslName, ParentNode, &EtNode); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status =3D AmlCodeGenNameInteger ( + "_UID", + CpuName, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status =3D AmlCodeGenNameString ( + "_HID", + ACPI_HID_ET_DEVICE, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // If requested, return the handle to the EtNode. + if (EtNodePtr !=3D NULL) { + *EtNodePtr =3D EtNode; + } + + return Status; +} + +/** Create and add an Embedded trace device to the Cpu Node. + + @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_ARM_GICC_INFO obje= ct + describing the Cpu. + @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_ARM_GICC_INFO *GicCInfo, + IN UINT32 CpuName, + IN AML_OBJECT_NODE_HANDLE *Node + ) +{ + EFI_STATUS Status; + CM_ARM_ET_INFO *EtInfo; + + Status =3D GetEArmObjEtInfo ( + CfgMgrProtocol, + GicCInfo->EtToken, + &EtInfo, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // Currently we only support creation of a ETE Node. + if (EtInfo->EtType !=3D ArmEtTypeEte) { + return EFI_UNSUPPORTED; + } + + Status =3D CreateAmlEtd ( + Generator, + Node, + CpuName, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; +} + /** Create and add an _LPI method to Cpu/Cluster Node. =20 For instance, transform an AML node from: @@ -694,6 +849,21 @@ CreateAmlCpuFromProcHierarchy ( } } =20 + // Add an Embedded Trace node if present. + if (GicCInfo->EtToken !=3D CM_NULL_TOKEN) { + Status =3D CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + GicCInfo, + CpuName, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + return Status; } =20 @@ -1135,6 +1305,20 @@ CreateTopologyFromGicC ( break; } } + + if (GicCInfo[Index].EtToken !=3D CM_NULL_TOKEN) { + Status =3D CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + &GicCInfo[Index], + Index, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } } // for =20 return Status; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.h index 48e4455490e9a211e8d4e0a18adcf079fd5d2d24..0c7a0b0601ab221bc416ecb4be4= 36c0dafca1824 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.h @@ -1,11 +1,17 @@ /** @file SSDT Cpu Topology Table Generator. =20 - Copyright (c) 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @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=3Den) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ =20 #ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_ @@ -49,6 +55,9 @@ /// HID for a processor device. #define ACPI_HID_PROCESSOR_DEVICE "ACPI0007" =20 +/// HID for a ETM/ETE device. +#define ACPI_HID_ET_DEVICE "ARMHC500" + /// HID for a processor container device. #define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010" =20 --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108593): https://edk2.groups.io/g/devel/message/108593 Mute This Topic: https://groups.io/mt/101335846/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-