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 5B38F74003C for ; Tue, 12 Dec 2023 09:29:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HYp2azS8Vf41YW9AeROIfzYBqethh7Jux20oe2k+Ayg=; 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=1702373388; v=1; b=PpWV8ltFWeSxCrVR2B0AetSIBODXeulAFNvRHnocW5LRY6MBgHhDRT4hqmhrgIro/Kdr3ciu 6c8KpGVhemuQ+YjCXj0weSrVcJ0g2N5kt4he/2YMKDAu9wCP4dgYBcG74FVp/QVa11LmGsp6/Ny sAlA0LRwo5WzPtSxUY+ekj9k= X-Received: by 127.0.0.2 with SMTP id mUvhYY7687511xYyBSzGJENF; Tue, 12 Dec 2023 01:29:48 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12938.1702373387471149559 for ; Tue, 12 Dec 2023 01:29:47 -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 9E5EC150C; Tue, 12 Dec 2023 01:30:33 -0800 (PST) X-Received: from e126645.arm.com (unknown [10.57.44.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id ECBA03F5A1; Tue, 12 Dec 2023 01:29:45 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ray Ni , Sami Mujawar , Leif Lindholm , Ard Biesheuvel Subject: [edk2-devel] [PATCH v4 08/10] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator Date: Tue, 12 Dec 2023 10:28:45 +0100 Message-Id: <20231212092847.1253756-9-pierre.gondois@arm.com> In-Reply-To: <20231212092847.1253756-1-pierre.gondois@arm.com> References: <20231212092847.1253756-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: POrnAvQvwrHwYwRFCEUW80TYx7686176AA= 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=PpWV8ltF; 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 724f33c660a8..9e3efb49e630 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 @@ -842,6 +922,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 @@ -1299,6 +1387,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 (#112375): https://edk2.groups.io/g/devel/message/112375 Mute This Topic: https://groups.io/mt/103127054/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-