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 ED293740048 for ; Tue, 21 Nov 2023 16:50:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gJUdoVF6eiU+JAd49Rk7rpTvHIn6i4ZcL4YfJLMnn5E=; 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=1700585445; v=1; b=DoZZjRTxhhplAEmZRy0PpfOOio1G2x13vEOy3NM+8XsH4yNCCL6WxfMlYTvTgY6NoZoozb7j DJi+Rw/Ax3SQAfk2qZZPhFU+vcim1fNlp8Cb25DJMc+D+NXtT66FCBkfRZ/cw9drmPUMnMsH2Eb 0D1eoNIhVCqEDbI+4LrSDQec= X-Received: by 127.0.0.2 with SMTP id 9a0MYY7687511xNlzjb1VKDP; Tue, 21 Nov 2023 08:50:45 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46876.1700585445021380744 for ; Tue, 21 Nov 2023 08:50:45 -0800 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 74C4D16F2; Tue, 21 Nov 2023 08:51:31 -0800 (PST) X-Received: from e126645.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 214093F6C4; Tue, 21 Nov 2023 08:50:42 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v3 09/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator Date: Tue, 21 Nov 2023 17:50:05 +0100 Message-Id: <20231121165007.1546858-10-pierre.gondois@arm.com> In-Reply-To: <20231121165007.1546858-1-pierre.gondois@arm.com> References: <20231121165007.1546858-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 Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 7BRvDG8h4Lnu5jjCExH1Plqhx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=DoZZjRTx; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Make use of the newly added AmlCreatePsdNode() to generate _PSD objects. _PSD objects allow to describe 'performance control, P-state or CPPC, logical processor dependency', Cf. ACPI 6.4, s8.4.5.5 _PSD (P-State Dependency). Signed-off-by: Pierre Gondois --- .../SsdtCpuTopologyGenerator.c | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c index 8228c7845ac0..ebcf9fb4e482 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c @@ -42,6 +42,7 @@ Requirements: - EArmObjCmRef (OPTIONAL)=0D - EArmObjLpiInfo (OPTIONAL)=0D - GetEArmObjEtInfo (OPTIONAL)=0D + - EArmObjPsdInfo (OPTIONAL)=0D */=0D =0D /** This macro expands to a function that retrieves the GIC=0D @@ -103,6 +104,16 @@ GET_OBJECT_LIST ( 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 +*/=0D +GET_OBJECT_LIST (=0D + EObjNameSpaceArm,=0D + EArmObjPsdInfo,=0D + CM_ARM_PSD_INFO=0D + );=0D +=0D /** Initialize the TokenTable.=0D =0D One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO=0D @@ -256,6 +267,75 @@ WriteAslName ( return EFI_SUCCESS;=0D }=0D =0D +/** Create and add an _PSD 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 (_PSD, Package()=0D + {=0D + NumEntries, // Integer=0D + Revision, // Integer=0D + Domain, // Integer=0D + CoordType, // Integer=0D + NumProcessors, // Integer=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] GicCInfo Pointer to the CM_ARM_GICC_INFO obje= ct=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 +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +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 AML_OBJECT_NODE_HANDLE *Node=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_PSD_INFO *PsdInfo;=0D +=0D + Status =3D GetEArmObjPsdInfo (=0D + CfgMgrProtocol,=0D + GicCInfo->PsdToken,=0D + &PsdInfo,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlCreatePsdNode (=0D + PsdInfo,=0D + Node,=0D + NULL=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D +}=0D +=0D /** Create and add an _CPC Node to Cpu Node.=0D =0D For instance, transform an AML node from:=0D @@ -839,6 +919,14 @@ CreateAmlCpuFromProcHierarchy ( }=0D }=0D =0D + if (GicCInfo->PsdToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuN= ode);=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->CpcToken !=3D CM_NULL_TOKEN) {=0D @@ -1296,6 +1384,14 @@ CreateTopologyFromGicC ( 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 --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111576): https://edk2.groups.io/g/devel/message/111576 Mute This Topic: https://groups.io/mt/102732032/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-