From nobody Mon Sep 16 18:59:42 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+108995+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 1695393337719348.77749539688295; Fri, 22 Sep 2023 07:35:37 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=D2s0uThfrzJ1H3Mw/odfJg13zTOwMrEaQeBgQi9fIHo=; 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=1695393337; v=1; b=ap2oufzjOIUNnS1mCrkcJqJDs/yDlNyJdKqxDIOfeHIz0pg2mxvRriSl/k1mWQzuYTURqi4w L7r+5Shrna/HLODgvcz+wb1KWocRf/YpV7ZEhwwLqdT2ysdHsAxERtYpVX5q3nSjXiCSsUyW3lP zoXs+CnLDTunvwOwqC4Odk+U= X-Received: by 127.0.0.2 with SMTP id O5mUYY1788612xfKYhpn2jr4; Fri, 22 Sep 2023 07:35:37 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.52]) by mx.groups.io with SMTP id smtpd.web11.23363.1695393336088192633 for ; Fri, 22 Sep 2023 07:35:36 -0700 X-Received: from DB8P191CA0011.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::21) by AS2PR08MB9272.eurprd08.prod.outlook.com (2603:10a6:20b:59b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Fri, 22 Sep 2023 14:35:32 +0000 X-Received: from DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::e4) by DB8P191CA0011.outlook.office365.com (2603:10a6:10:130::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.32 via Frontend Transport; Fri, 22 Sep 2023 14:35:32 +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+108995+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 DBAEUR03FT060.mail.protection.outlook.com (100.127.142.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23 via Frontend Transport; Fri, 22 Sep 2023 14:35:32 +0000 X-Received: ("Tessian outbound 0b7d6027328f:v175"); Fri, 22 Sep 2023 14:35:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9eb1f34fa64d8f43 X-CR-MTA-TID: 64aa7808 X-Received: from c33d6ba48db2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B2712DBE-2A5C-4114-8EAD-0298E72AC4A3.1; Fri, 22 Sep 2023 14:35:25 +0000 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c33d6ba48db2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 22 Sep 2023 14:35:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nd1ffyG3cmVHAPuosHdshJh/tiRZtyfowZlBnpqLm7mEtFjSLtNjvMVNIRpWDum0qv3MlWft/h9wFk6juIbvSlHGGWQRaTZUiE+CVpohqbuQ26sg2kbp9h5LPpgZa6ChSGYnu2WOYN+LzelbGZL9D4xVOpGrL1rRuxKakPOXig46yI01CUjqztNtv0i5v0F+w6eyKwjTShw5NzRGb6AnH3MHVfUjjy5/uQ5ksGq052pj4WnFoWfz2LhhW5rCMHpL3KFgTiEopFBDJQFEmAILqnQ9zhtEDBIMXhiFowhHN6LGuiScwxRKZVEGSwjW0XhwPvLgsm+vgUGkwUlvSRReVA== 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=D9EDzR65aCpmBw7bm3Bp8aFmnVkUUodby+QPBijG4YQ=; b=oESeCOy5ddThvCVqHAdUq6sa0/OtEXceB6V5z0fJB5cF4fOv+ZbC5EWarC3sAb0S5Bj1UPUTy93wFH6mpwkrg2VEtj0wMkImK7top+4OvK+PBSPnsO9NEOJL/TjNkAevTgAmPfRXso0FRack0z49KcQWH7/kp09vX1+m9WOF00qvG0YPahuf/nZgV229OWNvV6ZAoeWvpsd7VrukQa8/nmo3VXAD4ADTcXxChP7FzOJ7OFMBCE4GhJT6PkWojypftlwZH8S9SnxJpUrBNeuaOA7TnvdAcbuir0MLm+eURZJmXaopy5n9o4X+CRBtlyOcIMFTdwYjXc7v/IK9qS9ckg== 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 AS9PR04CA0132.eurprd04.prod.outlook.com (2603:10a6:20b:531::27) by AS2PR08MB9595.eurprd08.prod.outlook.com (2603:10a6:20b:609::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.19; Fri, 22 Sep 2023 14:35:24 +0000 X-Received: from AM7EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:531:cafe::92) by AS9PR04CA0132.outlook.office365.com (2603:10a6:20b:531::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.32 via Frontend Transport; Fri, 22 Sep 2023 14:35:24 +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 AM7EUR03FT019.mail.protection.outlook.com (100.127.140.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6813.20 via Frontend Transport; Fri, 22 Sep 2023 14:35:23 +0000 X-Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 22 Sep 2023 14:35:23 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 22 Sep 2023 14:35:22 +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; Fri, 22 Sep 2023 14:35:22 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v3 10/13] DynamicTablesPkg: Add ETE device to CPU node in AML Date: Fri, 22 Sep 2023 15:35:13 +0100 Message-ID: <20230922143516.4764-11-sami.mujawar@arm.com> In-Reply-To: <20230922143516.4764-1-sami.mujawar@arm.com> References: <20230922143516.4764-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT019:EE_|AS2PR08MB9595:EE_|DBAEUR03FT060:EE_|AS2PR08MB9272:EE_ X-MS-Office365-Filtering-Correlation-Id: d966d2c0-7912-4bd3-6779-08dbbb792ce7 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: usgXwHivBHLrL7+WpjC4DFil4slXsvK5ofx9kVwjAjRQMlguEm1sa9E5+n7k9GTr/7eQI2wRRZPRMtgr8I42mYgeTPQkUb7vvxGein4xhNcclz/+P/JpLtNiI9DbbkhUdBKbp6WwRab2xOAVDHmv3SwQVwIVo5/UeVq+bX0ULmzqHb6vrEmXSfJ0stSjgDVR9YaWWFEwDlxzDaP3ttZE1GDBH6rhU3nGcQkRobgt2fG4MU7GFgpcpnU87rNchn/nBdFasBmX20kFls+e4UVt5OyFvO/A3CNt8xgDLRbCrTiI098y2xQoQOeN3L8abzTc9RhOcxK9BkyOv2KFxdYjGOxtPnBaowcfB7U5JnVf2Kjo5PCY3ucdS9+B9e7jCHkYTidco0B7ipcqRTugsoWajNQUxS4X6t/USX8WGjGYbRqd4Ta3dx5+hVmNpkMW8ixvE0wDEy81Tpw/sTe1jk35+CyrfmUcugsi5qbBgcDDkpztScmrvnHB1mz5wh1t+LW3j+9wc0YjiKCA51lbS9qJK+/Qacv3apIjSrzPe9w9zPTb+3fseSVtMvS3JWUhndGLWAMft+eY/pg+FHDZLeOdopfuEE70cXCYvWdSojoz4dVBnuUlh5E4Jd8WZxJNXkpw8CocFRoUtqsDRxDVE+DHR8UP3/fvhl4jQQUSA7EdLMYimv5ZkrziZez3v584zMAksSOPUC8aseMatJW7QzUDBUtd6fSmGVzP+p1ZGmv/c8gcBSSIZeJUwByrTVoMSRPVlnKdtIAtUyV0K03qD2eC410aETxjH3H4IhityeaS9ms= 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)(39860400002)(396003)(136003)(346002)(376002)(1800799009)(82310400011)(230921699003)(451199024)(186009)(46966006)(40470700004)(36840700001)(7696005)(478600001)(6666004)(8936002)(83380400001)(44832011)(70586007)(54906003)(70206006)(8676002)(316002)(6916009)(5660300002)(40460700003)(2616005)(1076003)(41300700001)(36756003)(40480700001)(82740400003)(86362001)(2906002)(4326008)(81166007)(426003)(47076005)(336012)(26005)(36860700001)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9595 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b2bcde83-f3cd-426e-6f09-08dbbb79280a X-Microsoft-Antispam-Message-Info: 4VRbCxVsplxBGwzQLY904LVGJqfjiyPQcTg4BVU9AujFuo2XH/gyME0I2j5D0P04XeY3YKrJ+2uQbwZb1o3jk1LAznS5/ha7A16bIIAdtLnwFsyvkhicgsnQLykvfbs3ifUIPcDZy1MVTvGH7fA2AI2xPGE07Wi9JzfdCqjkx2iSfpxDN+JibfuudHb2Y0rm3bVGT6FnpO5mcU78drGaNOf9ZcpJdDSiKTUnu5ka09uO8mWsR7mUEPR1eijr85sAQEJs8You9jDv03QbA/dMJhagUNmY/zb53CuICEihEzMpYKRfn8iGH60Tsf46quLyw7hlCQBY0TS7nFV5k91NyJVjrLKp57/7kL/AE1JVADd4LTm8GuJUGylf+Scf2fRLC4IFjucsg/mzw+QVWGLy1yOIC71/u7NHHdvazQQNb5gJ7NbAvQtSzn3l8c8TifryUUO7kPLcF8dLIhlhHah1w239d6VlMmssRzYrTAfSfcpe3D4Ey4X2BQ+ziysHFm2RCbVBtqauUsfy6buoga5AvxaMdcvL7IvqbLptLYjGcQvkKoTOX1ipzgy+7w0/GVzPzB/QFBePycgWsLPUkErHw0Hz5cNC2CadKpZEolo8M04Tb2DFrG47oSe/NLCzUTgO+z/frBnhfb99PyuW34rtZs7LK3PRQSf7VCxMAKuyas54jwC0I6DluO+LGHamFk2G10nN8EMxf3QVA3dpy3SURFtpdOTzeblMSCP2L7CaMeaZtFSpyaGbS4Qd0bEMt13TguxtDJ3UebTkPUZ3D3ZJTw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 14:35:32.1700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d966d2c0-7912-4bd3-6779-08dbbb792ce7 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: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9272 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: MA74OpzZTV7ol0iXfjrvRME5x1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695393338286100009 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 Reviewed-by: Pierre Gondois --- Notes: v3: - No code change from v2 patch series. [SAMI] =20 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 (#108995): https://edk2.groups.io/g/devel/message/108995 Mute This Topic: https://groups.io/mt/101522260/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-