From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111568+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111568+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585431; cv=none; d=zohomail.com; s=zohoarc; b=PadV7NvIhz2ocjQaHdt2ZxHgsAX3nZm7cJ6U82ZWaJAsWSi3+ERJBx/xBUYvodJp46ypmVg6t0hPFosJd+gyWv5tHuTaQDo8XiAnzb+LBvKLHXNRg9GqNb3KCjhNLMXuCK1O8DYbPndPLJQnOYXq5jXqVrioGDrswqtHhHxb5gI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585431; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=zjAORCDunNMySpRlJkKPl74e4HQM1OeUVNHpZnD3xSM=; b=jPqsp49qW7M39zjOth3qs3gsHy8QnEyhPFJJCFoZbOqEb20SU+weB77s9PnoIMhodwpsyy1CRLrvCDcJhR5reson1UzWeqyBbBJg0rg2jkI9ATZJPGrID4tDAP7vIcSWOx/Ux/duusnlhrohysQryMIAKw1H7sK7BEONcBRWUc4= ARC-Authentication-Results: i=1; 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+111568+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585431756992.7636596288112; Tue, 21 Nov 2023 08:50:31 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+HBsc/SI/mjDx5KOyM+mDsdgZv+k1MMLrsE53gKaDSQ=; 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=1700585431; v=1; b=CW36gAag/D4Zhb0vYy55cwI7l0wynCqvHq7NOSzAh8R8AdWII6BtUw1A6Icabyko+8aFdu0S theogfQUmmOU/jiGPvcvKOrli+6BCE3CyyudCAPSxxar/0xs+a8bgPkqojt5D4LpZjZC4S7H/w9 XfiKkmWQ5QcrTLeRJmLkqiK8= X-Received: by 127.0.0.2 with SMTP id SqGOYY1788612xBYKTmuu5UO; Tue, 21 Nov 2023 08:50:31 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46786.1700585430784054377 for ; Tue, 21 Nov 2023 08:50:30 -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 3B083168F; Tue, 21 Nov 2023 08:51:17 -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 DC6743F6C4; Tue, 21 Nov 2023 08:50:28 -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 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION Date: Tue, 21 Nov 2023 17:49:57 +0100 Message-Id: <20231121165007.1546858-2-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: d4q8d0TIf3NqPMU0rCqbJtxgx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585433082100005 Content-Type: text/plain; charset="utf-8" Rename PERFORMANCE_PROTOCOL_VERSION to reflect the different versions of the protocol. The macro is neither used in edk2 nor in edk2-platforms. Signed-off-by: Pierre Gondois Reviewed-by: Leif Lindholm --- .../Include/Protocol/ArmScmiPerformanceProtocol.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/= Include/Protocol/ArmScmiPerformanceProtocol.h index 7e548e4765c2..a28f0f766e37 100644 --- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h +++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h @@ -1,12 +1,12 @@ /** @file =20 - Copyright (c) 2017-2021, Arm Limited. All rights reserved. + Copyright (c) 2017-2023, Arm Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + System Control and Management Interface V3.2, latest version at: + - https://developer.arm.com/documentation/den0056/latest/ + **/ =20 #ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_ @@ -14,7 +14,10 @@ =20 #include =20 -#define PERFORMANCE_PROTOCOL_VERSION 0x10000 +/// Arm Scmi performance protocol versions. +#define PERFORMANCE_PROTOCOL_VERSION_V1 0x10000 +#define PERFORMANCE_PROTOCOL_VERSION_V2 0x20000 +#define PERFORMANCE_PROTOCOL_VERSION_V3 0x30000 =20 #define ARM_SCMI_PERFORMANCE_PROTOCOL_GUID { \ 0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0x= ad} \ --=20 2.25.1 -=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 (#111568): https://edk2.groups.io/g/devel/message/111568 Mute This Topic: https://groups.io/mt/102732016/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111569+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111569+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585433; cv=none; d=zohomail.com; s=zohoarc; b=IxGS7h1dMYNVMgyZX46vT8WZvg90+ZveVZkvVB+oOkUoNMGBrsT9VcywubUQtjVMqGSMYSSSUK3bzIUBrSmNfbgeoxgzwRRy4h2SgT5lzTGskTQU/28VxEv3ZYCvG2o0cUnP2XooFKtpwT2VPWSmBa0sAQbLICdIY6l+sNe5iUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585433; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=gSnX+3+gmUJx9VX1Nbt9s6k1dckXCKAERBpnawGMBSw=; b=itts0IqGpyEvhRnn6uKw/Da7fqpEnbh/Yao7wEUCtvNfZ6NR3fLJ4qc9UqQ4R+LKt+hp3chdrkrJwMGF1GSDPUr91wmeP8B1UFSJgTRRrzFS52xAm36eylc9I0wZBQnwx0ibMb/H7zzNQXME0EvhDFsuBishnPKt1nnlGZMxswQ= ARC-Authentication-Results: i=1; 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+111569+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170058543338587.02796416115154; Tue, 21 Nov 2023 08:50:33 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=ZbB8vs4spAGzjyNUsIG9sslnYnHCsDeHulIDpHXdXco=; 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=1700585433; v=1; b=RrlOW6XaaDpHZACw4xiLtNo08dizswst7j2MJjw/sWAOmMZQWSGWUdXF92zYVrnzK/ElJDFh SYfyZj5gJLjpSLuh9SXXqWZZSyeyd5fwF1WjGf1k9ndSYXcryPQtDqcfNSQQIJkfrJpzqRQY8pJ dCnFLL8g+sYnSluNnLkmaqNw= X-Received: by 127.0.0.2 with SMTP id Y51LYY1788612xDa1tqKLuGj; Tue, 21 Nov 2023 08:50:33 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46861.1700585432361858624 for ; Tue, 21 Nov 2023 08:50:32 -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 94E30169C; Tue, 21 Nov 2023 08:51:18 -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 AB5933F6C4; Tue, 21 Nov 2023 08:50:30 -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 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support Date: Tue, 21 Nov 2023 17:49:58 +0100 Message-Id: <20231121165007.1546858-3-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: 0wodUSuwRhLmKCq375ZG1V47x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585435104100012 Content-Type: text/plain; charset="utf-8" The PERFORMANCE_DESCRIBE_FASTCHANNEL Scmi command is available since SCMI v2.0 and allows to query information about the supported fast-channels of the Scmi performance protocol. Add support for this command. Also move SCMI_MESSAGE_ID_PERFORMANCE enum definition up in the file to use it in SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL function declaration. Reviewed-by: Leif Lindholm Signed-off-by: Pierre Gondois --- .../ArmScmiDxe/ScmiPerformanceProtocol.c | 80 +++++++++++++++-- .../Protocol/ArmScmiPerformanceProtocol.h | 88 +++++++++++++++++-- 2 files changed, 154 insertions(+), 14 deletions(-) diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c b/ArmPkg/D= rivers/ArmScmiDxe/ScmiPerformanceProtocol.c index 0f89808fbdf9..91efce4bf22d 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c @@ -1,12 +1,12 @@ /** @file =20 - Copyright (c) 2017-2021, Arm Limited. All rights reserved.
+ Copyright (c) 2017-2023, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + System Control and Management Interface V3.2, latest version at: + - https://developer.arm.com/documentation/den0056/latest/ + **/ =20 #include @@ -416,6 +416,75 @@ PerformanceLevelGet ( return EFI_SUCCESS; } =20 +/** Discover the attributes of the FastChannel for the specified + performance domain and the specified message. + + @param[in] This A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance. + @param[in] DomainId Identifier for the performance domain. + @param[in] MessageId Message Id of the FastChannel to discover. + Must be one of: + - PERFORMANCE_LIMITS_SET + - PERFORMANCE_LIMITS_GET + - PERFORMANCE_LEVEL_SET + - PERFORMANCE_LEVEL_GET + @param[out] FastChannel If success, contains the FastChannel description. + + @retval EFI_SUCCESS Performance level got successfully. + @retval EFI_DEVICE_ERROR SCP returns an SCMI error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_TIMEOUT Time out. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +DescribeFastchannel ( + IN SCMI_PERFORMANCE_PROTOCOL *This, + IN UINT32 DomainId, + IN SCMI_MESSAGE_ID_PERFORMANCE MessageId, + OUT SCMI_PERFORMANCE_FASTCHANNEL *FastChannel + ) +{ + EFI_STATUS Status; + SCMI_COMMAND Cmd; + UINT32 PayloadLength; + UINT32 *ReturnValues; + UINT32 *MessageParams; + + if ((This =3D=3D NULL) || + (FastChannel =3D=3D NULL)) + { + return EFI_INVALID_PARAMETER; + } + + Status =3D ScmiCommandGetPayload (&MessageParams); + if (EFI_ERROR (Status)) { + return Status; + } + + *MessageParams++ =3D DomainId; + *MessageParams =3D MessageId; + + Cmd.ProtocolId =3D ScmiProtocolIdPerformance; + Cmd.MessageId =3D ScmiMessageIdPerformanceDescribeFastchannel; + PayloadLength =3D sizeof (DomainId) + sizeof (MessageId); + + Status =3D ScmiCommandExecute ( + &Cmd, + &PayloadLength, + &ReturnValues + ); + if (EFI_ERROR (Status)) { + return Status; + } + + CopyMem ( + FastChannel, + ReturnValues, + sizeof (SCMI_PERFORMANCE_FASTCHANNEL) + ); + + return Status; +} + // Instance of the SCMI performance management protocol. STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol =3D { PerformanceGetVersion, @@ -425,7 +494,8 @@ STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProt= ocol =3D { PerformanceLimitsSet, PerformanceLimitsGet, PerformanceLevelSet, - PerformanceLevelGet + PerformanceLevelGet, + DescribeFastchannel, }; =20 /** Initialize performance management protocol and install on a given Hand= le. diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/= Include/Protocol/ArmScmiPerformanceProtocol.h index a28f0f766e37..c69efe7408e1 100644 --- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h +++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h @@ -79,8 +79,58 @@ typedef struct { UINT32 RangeMin; } SCMI_PERFORMANCE_LIMITS; =20 +/// Doorbell Support bit. +#define SCMI_PERF_FC_ATTRIB_HAS_DOORBELL BIT0 + +/// Performance protocol describe fastchannel +typedef struct { + /// Attributes. + UINT32 Attributes; + + /// Rate limit. + UINT32 RateLimit; + + /// Lower 32 bits of the FastChannel address. + UINT32 ChanAddrLow; + + /// Higher 32 bits of the FastChannel address. + UINT32 ChanAddrHigh; + + /// Size of the FastChannel in bytes. + UINT32 ChanSize; + + /// Lower 32 bits of the doorbell address. + UINT32 DoorbellAddrLow; + + /// Higher 32 bits of the doorbell address. + UINT32 DoorbellAddrHigh; + + /// Mask of lower 32 bits to set when writing to the doorbell register. + UINT32 DoorbellSetMaskLow; + + /// Mask of higher 32 bits to set when writing to the doorbell register. + UINT32 DoorbellSetMaskHigh; + + /// Mask of lower 32 bits to preserve when writing to the doorbell regis= ter. + UINT32 DoorbellPreserveMaskLow; + + /// Mask of higher 32 bits to preserve when writing to the doorbell regi= ster. + UINT32 DoorbellPreserveMaskHigh; +} SCMI_PERFORMANCE_FASTCHANNEL; + #pragma pack() =20 +/// SCMI Message Ids for the Performance Protocol. +typedef enum { + ScmiMessageIdPerformanceDomainAttributes =3D 0x3, + ScmiMessageIdPerformanceDescribeLevels =3D 0x4, + ScmiMessageIdPerformanceLimitsSet =3D 0x5, + ScmiMessageIdPerformanceLimitsGet =3D 0x6, + ScmiMessageIdPerformanceLevelSet =3D 0x7, + ScmiMessageIdPerformanceLevelGet =3D 0x8, + ScmiMessageIdPerformanceDescribeFastchannel =3D 0xB, +} SCMI_MESSAGE_ID_PERFORMANCE; + /** Return version of the performance management protocol supported by SCP. firmware. =20 @@ -238,6 +288,34 @@ EFI_STATUS OUT UINT32 *Level ); =20 +/** Discover the attributes of the FastChannel for the specified + performance domain and the specified message. + + @param[in] This A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance. + @param[in] DomainId Identifier for the performance domain. + @param[in] MessageId Message Id of the FastChannel to discover. + Must be one of: + - PERFORMANCE_LIMITS_SET + - PERFORMANCE_LIMITS_GET + - PERFORMANCE_LEVEL_SET + - PERFORMANCE_LEVEL_GET + @param[out] FastChannel If success, contains the FastChannel description. + + @retval EFI_SUCCESS Performance level got successfully. + @retval EFI_DEVICE_ERROR SCP returns an SCMI error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_TIMEOUT Time out. + @retval EFI_UNSUPPORTED Unsupported. +**/ +typedef +EFI_STATUS +(EFIAPI *SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL)( + IN SCMI_PERFORMANCE_PROTOCOL *This, + IN UINT32 DomainId, + IN SCMI_MESSAGE_ID_PERFORMANCE MessageId, + OUT SCMI_PERFORMANCE_FASTCHANNEL *FastChannel + ); + typedef struct _SCMI_PERFORMANCE_PROTOCOL { SCMI_PERFORMANCE_GET_VERSION GetVersion; SCMI_PERFORMANCE_GET_ATTRIBUTES GetProtocolAttributes; @@ -247,15 +325,7 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL { SCMI_PERFORMANCE_LIMITS_GET LimitsGet; SCMI_PERFORMANCE_LEVEL_SET LevelSet; SCMI_PERFORMANCE_LEVEL_GET LevelGet; + SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL DescribeFastchannel; } SCMI_PERFORMANCE_PROTOCOL; =20 -typedef enum { - ScmiMessageIdPerformanceDomainAttributes =3D 0x3, - ScmiMessageIdPerformanceDescribeLevels =3D 0x4, - ScmiMessageIdPerformanceLimitsSet =3D 0x5, - ScmiMessageIdPerformanceLimitsGet =3D 0x6, - ScmiMessageIdPerformanceLevelSet =3D 0x7, - ScmiMessageIdPerformanceLevelGet =3D 0x8, -} SCMI_MESSAGE_ID_PERFORMANCE; - #endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */ --=20 2.25.1 -=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 (#111569): https://edk2.groups.io/g/devel/message/111569 Mute This Topic: https://groups.io/mt/102732017/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111570+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111570+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585434; cv=none; d=zohomail.com; s=zohoarc; b=Ie+fyk+S+VpN+bxaxbxW4IF6hMEhuTlC0UJ1+WJ/dFcMu6q/Ul+jsdEEDb7cyOes2ZdLPurODYsrxipk6ZcdAqboj6YpbDzAuoTN1QFF5no2MTa9/D4dFPCKIDk5fgPenPrb9YMjNRiVFQ30ekWvyjda3IEdtyyOabvgmYhAaz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585434; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=xjS5gwcgJrpAlK2CLCt71WfwtTPjkU1mcgvPAbVczjs=; b=cwqfRpqltBpsgXoKg8iYSkPm8WDvPcC7xItIPwFLwjumT1ruxMq96DynV0ID3QXlXRz1YvcwOvy+gevDc5GLbroXzLMmZJlaKc6+QkpYsCXUwG5LfM9J+tpQAUcGRdj5crJUIzIrljKmQiRfugydLLIXrU8YGSjqNoUjb1bRNpk= ARC-Authentication-Results: i=1; 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+111570+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585434879307.2937166486681; Tue, 21 Nov 2023 08:50:34 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=OZcRrj8UGB4MLDTLtBRqCPThP3a+hUcnfnwEVd0Dk8I=; 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=1700585434; v=1; b=PgaC+NZcwCJqlW8HaAQJoK+tb7wdER+vpnlS5MnfyzCfwL60n4CzhviaLovsAo8Uy2Coi4s/ SRT9LyJdwpEyakqMqp82l+chDrVDBPP6xn5kslK+dYnbw2O0Pr03Qizu+8XqItwhkn9MO6JFY/h G4+7PPOtn8uVMbAw4y90i6DI= X-Received: by 127.0.0.2 with SMTP id tUoHYY1788612xbm25Rkufx4; Tue, 21 Nov 2023 08:50:34 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46862.1700585433925585577 for ; Tue, 21 Nov 2023 08:50:34 -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 4D1D716F2; Tue, 21 Nov 2023 08:51:20 -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 121643F6C4; Tue, 21 Nov 2023 08:50:31 -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 03/11] MdePkg/Acpi65: Add _PSD/_CPC/State Coordination Types macros Date: Tue, 21 Nov 2023 17:49:59 +0100 Message-Id: <20231121165007.1546858-4-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: HO25wlP6q9RN6kzWwkTv63jVx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585435067100011 Content-Type: text/plain; charset="utf-8" Add macros for: - _PSD version - _CPC version - C-state/T-state/P-state Coordination Types These objects were present in previous ACPI specification version, but are only added to the latest availbable version (6.5). Signed-off-by: Pierre Gondois --- MdePkg/Include/IndustryStandard/Acpi65.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/Indu= stryStandard/Acpi65.h index d79d0b2b5f9c..ec7c34e8e190 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -18,6 +18,29 @@ // #pragma pack(1) =20 +/// +/// C-state/T-state/P-state Coordination Types +/// Cf. s8.3 Power, Performance, and Throttling State Dependencies +/// +#define EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ALL 0xFC +#define EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ANY 0xFD +#define EFI_ACPI_6_5_AML_STATE_COORD_TYPE_HW_ALL 0xFE + +/// +/// _PSD Revision +/// Cf. s8.4.5.5 _PSD (P-State Dependency) +/// +#define EFI_ACPI_6_5_AML_PSD_REVISION_V0 0 + +/// +/// _CPC Revision +/// Cf. s8.4.6.1 _CPC (Continuous Performance Control) +/// +#define EFI_ACPI_6_5_AML_CPC_REVISION_V0 0 +#define EFI_ACPI_6_5_AML_CPC_REVISION_V1 1 +#define EFI_ACPI_6_5_AML_CPC_REVISION_V2 2 +#define EFI_ACPI_6_5_AML_CPC_REVISION_V3 3 + /// /// ACPI 6.5 Generic Address Space definition /// --=20 2.25.1 -=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 (#111570): https://edk2.groups.io/g/devel/message/111570 Mute This Topic: https://groups.io/mt/102732018/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111571+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111571+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585436; cv=none; d=zohomail.com; s=zohoarc; b=YM/86HkxKpEepnL23M23wukhs0dGkgPm84F1iF4xC+u40yHX2qZzDwYCV9P5R3OOZE7/CZHyt/lfjxCH17Wrmq6FeS3ZKUDhs5if/XDSvz+pLy+h62wXt61YWyVryUizYu4x8XnffCWTvVZW7Zo3zi6z0B1m8AdOkKS+X5mO6wY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585436; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=sORIWUxzfGlw0PKwgWNZ9qortURnY2VN2HNppYryq50=; b=ivcLqu/h6DRVai9FIRAz00G/JbEC0uWrhMVVaI+Ppx3FkJyEPvTDtmdSs4ms5Iymojk2lp31qOKiaBgyJqA18jAHplBvsDiXTCtFDnt00dLD+3ZSYnngmVwHH5xr8JEb+5ThCSiBNwEfkQi2/26weuNBx2VIBR3nhR32F12oCPw= ARC-Authentication-Results: i=1; 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+111571+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585436413312.86249038008464; Tue, 21 Nov 2023 08:50:36 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=bmxHFflXbwpdunhZKl1661YENYttmlUMct6acL8BIlU=; 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=1700585436; v=1; b=Xq8MrlpuMBgJSuGp/ru4siUco3M3Bu5hmAMp+Pgbz8/wSIfRq1yTd+M1l58vhY03mhTaLIK7 zZ8YCdxXDkk8kv/jtajeZpyIpQp2CXEgD0seQRlEu0ljDpFFc6HSjJOKxKp+8w/rhIEAPvKfYnX 18RaTZwnNG2EF/yC+ub5hRKc= X-Received: by 127.0.0.2 with SMTP id lRqBYY1788612x7OAYJRMs6m; Tue, 21 Nov 2023 08:50:36 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46791.1700585435541473580 for ; Tue, 21 Nov 2023 08:50:35 -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 1329B1AED; Tue, 21 Nov 2023 08:51:22 -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 E0D7A3F6C4; Tue, 21 Nov 2023 08:50:33 -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 04/11] DynamicTablesPkg: Use new CPC revision macro Date: Tue, 21 Nov 2023 17:50:00 +0100 Message-Id: <20231121165007.1546858-5-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: ugSTTS5tU1qBngnJxDbK2Nnrx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585437098100017 Content-Type: text/plain; charset="utf-8" Make use of the newly added CPC revision macro. Signed-off-by: Pierre Gondois --- DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index a6db34fb970f..1ff8430c29c3 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3523,7 +3523,7 @@ AmlCreateCpcNode ( } =20 // Revision 3 per ACPI 6.4 specification - if (CpcInfo->Revision =3D=3D 3) { + if (CpcInfo->Revision =3D=3D EFI_ACPI_6_5_AML_CPC_REVISION_V3) { // NumEntries 23 per ACPI 6.4 specification NumberOfEntries =3D 23; } else { --=20 2.25.1 -=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 (#111571): https://edk2.groups.io/g/devel/message/111571 Mute This Topic: https://groups.io/mt/102732020/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111572+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111572+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585438; cv=none; d=zohomail.com; s=zohoarc; b=DBpVpZoCh//8C7Rx8ShiwZHoClg0tFMajrWOlOxRJXfRmiosUNgA5BIk9MJXLG3Db8MjDyzy1eEOR7JWt72eD/1T3U9fmSxN+VsfIzPjhp4N6+4a21czO1VcV9lzPU4VEIGtS/XDBWcDfgs7aoIQSgWFhJAo4kyhR3ZTs0MnjI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585438; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=vEB15atovXSkXxrqYJd0GvrT/Jaa3QdzNrPvitUUu/U=; b=Hr7p3HNkEjv+5qiibnVQO45HF5OFjIIxMxJa/m0bpa0RB5dHzD7Qiv4omTBuhDZoNYDIxTnCN9wvVY50g0QNEhXdliM7Y2AaHmg4qZv1LbBmOvz0wWS9yvW2r3Utp6Rkifar5MCWqqIK//ft+kXdn+tXDnMp2VieqI6KvVdJU6o= ARC-Authentication-Results: i=1; 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+111572+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585438285997.1341870456155; Tue, 21 Nov 2023 08:50:38 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=RdYdK9TodnXxi/SKHRn6i9t+K+Toou05m7XX+qGRmAA=; 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=1700585438; v=1; b=VrnJTjZ61zHxF8udClLirwXIgf/4Ko3W3cRrXPjH75RSMJ5jeJpgpfKdrYFZd0B1JJ4zID7H BcF2IUPmkUohk13P1gYjvo3bEa7l82zt5G39OoHtboiySUcelRa1bJl5DxCrfNr2SUHFp0m6UDZ dJp/VsZOtXcS/ypryldrmrVA= X-Received: by 127.0.0.2 with SMTP id rAIhYY1788612xp3F78Z12WI; Tue, 21 Nov 2023 08:50:38 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46795.1700585437471369378 for ; Tue, 21 Nov 2023 08:50:37 -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 DB5421BA8; Tue, 21 Nov 2023 08:51:23 -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 8484F3F6C4; Tue, 21 Nov 2023 08:50:35 -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 05/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h Date: Tue, 21 Nov 2023 17:50:01 +0100 Message-Id: <20231121165007.1546858-6-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: 7C7Zykx6VmihrS9JbusUQISEx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585439109100021 Content-Type: text/plain; charset="utf-8" The DynamicTables framework uses the AmlLib to generate some Aml objects. It is done by using structured known by both frameworks, e.g. the AML_CPC_INFO/CM_ARM_CPC_INFO structures. To prepare adding similar structures (e.g. representing _PSD information), rename AmlCpcInfo.h to AcpiObjects.h. This new file will contain all the structures used by the AmlLib and the DynamicTables framework. Signed-off-by: Pierre Gondois --- DynamicTablesPkg/Include/{AmlCpcInfo.h =3D> AcpiObjects.h} | 0 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 2 +- DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h | 2 +- DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename DynamicTablesPkg/Include/{AmlCpcInfo.h =3D> AcpiObjects.h} (100%) diff --git a/DynamicTablesPkg/Include/AmlCpcInfo.h b/DynamicTablesPkg/Inclu= de/AcpiObjects.h similarity index 100% rename from DynamicTablesPkg/Include/AmlCpcInfo.h rename to DynamicTablesPkg/Include/AcpiObjects.h diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 8c00bdac20bb..453cc3fe83fa 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -13,7 +13,7 @@ #ifndef ARM_NAMESPACE_OBJECTS_H_ #define ARM_NAMESPACE_OBJECTS_H_ =20 -#include +#include #include =20 #pragma pack(1) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 71e8539b306c..be78c00b6109 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -36,7 +36,7 @@ @} */ =20 -#include +#include #include =20 #ifndef AML_HANDLE diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index 1ff8430c29c3..89ca2c8a92e7 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -11,7 +11,7 @@ #include =20 #include -#include +#include #include #include #include --=20 2.25.1 -=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 (#111572): https://edk2.groups.io/g/devel/message/111572 Mute This Topic: https://groups.io/mt/102732022/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111573+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111573+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585440; cv=none; d=zohomail.com; s=zohoarc; b=Aj4Tm5QKujmbVhNK+hCOGNalmZD1fyuASeV6tyImSzAdzGkD3fFpl5kMM5/D9J1DrS77+LQwZ0hPUAo4bAlVzQViDFA0BGRp4xyd5H4aMjsZmgq/ftIJ2E3mptwVA9CwghOBXpUAwYTAF1gWWmACeap9RWWc9JLKsxzC6vUAYks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585440; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=NWOjg+NRPHY6vylOUv6rUwqIx4PmAgb61NcJ/J4RSRw=; b=i9W3GuNZRgMWUyzSwExWj/h9iLcUew0F3Ndfpy9yZvJP+kgCfKFOeSvnC8Wc05B6Ju1BPmfCK8WaCrRD2DjWMPgufjrI8Y+yX8yUXuqwo42NCl5/aJO3IDVNGz2MuUiOEQfSLJ6QT/lFPYvV85daB9PR0YA0B+J5maH1kh0VyW4= ARC-Authentication-Results: i=1; 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+111573+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585440212574.6577303524881; Tue, 21 Nov 2023 08:50:40 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=on0wRJ7rquGTLsI0sixJKAUHLdhBP4+zTrhqUQJrkTs=; 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=1700585439; v=1; b=t2eQ1Mw1TcHACmnizqdcl24oKN8AQtKtBQ8vcgTiUvvdoVJ2GeRuvhlbPGnvAp1lG1u6UbL8 oQohFio65TkY7fY297kR8xQ3qUCqHnzdxLOQbXQwEMoMhG9u/ja/vgp61U0RMeM8AgvOB5LGyFr 2ABasFG5wdaRjbegeUcIc48k= X-Received: by 127.0.0.2 with SMTP id yblQYY1788612xHcTYeoelBq; Tue, 21 Nov 2023 08:50:39 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46868.1700585439275642517 for ; Tue, 21 Nov 2023 08:50:39 -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 B54B51042; Tue, 21 Nov 2023 08:51:25 -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 5F7853F6C4; Tue, 21 Nov 2023 08:50:37 -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 06/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object Date: Tue, 21 Nov 2023 17:50:02 +0100 Message-Id: <20231121165007.1546858-7-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: 13x36hEZYaV3MkTKhNJ5o9mVx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585441273100025 Content-Type: text/plain; charset="utf-8" Add an object describing _PSD information, cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). Also add the corresponding CmObjParser. Signed-off-by: Pierre Gondois --- DynamicTablesPkg/Include/AcpiObjects.h | 20 +++++++++++++++++++ .../Include/ArmNameSpaceObjects.h | 10 ++++++++++ .../ConfigurationManagerObjectParser.c | 11 ++++++++++ 3 files changed, 41 insertions(+) diff --git a/DynamicTablesPkg/Include/AcpiObjects.h b/DynamicTablesPkg/Incl= ude/AcpiObjects.h index 8981c229544a..2bdabb2724bd 100644 --- a/DynamicTablesPkg/Include/AcpiObjects.h +++ b/DynamicTablesPkg/Include/AcpiObjects.h @@ -1,6 +1,7 @@ /** @file =20 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved= .
+ Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -119,6 +120,25 @@ typedef struct AmlCpcInfo { UINT32 NominalFrequencyInteger; } AML_CPC_INFO; =20 +/** A structure that describes a + P-State Dependency (PSD) Info. + + Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). +*/ +typedef struct AmlPsdInfo { + /// Revision. + UINT8 Revision; + + /// Domain Id. + UINT32 Domain; + + /// Coordination type. + UINT32 CoordType; + + /// Number of processors belonging to the Domain. + UINT32 NumProc; +} AML_PSD_INFO; + #pragma pack() =20 #endif //AML_CPC_INFO_H_ diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 453cc3fe83fa..3748cb7c8085 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -72,6 +72,7 @@ typedef enum ArmObjectID { EArmObjPccSubspaceType4Info, ///< 47 - P= cc Subspace Type 4 Info EArmObjPccSubspaceType5Info, ///< 48 - P= cc Subspace Type 5 Info EArmObjEtInfo, ///< 49 - E= mbedded Trace Extension/Module Info + EArmObjPsdInfo, ///< 50 - P= -State Dependency (PSD) Info EArmObjMax } EARM_OBJECT_ID; =20 @@ -1327,6 +1328,15 @@ typedef struct CmArmEtInfo { ARM_ET_TYPE EtType; } CM_ARM_ET_INFO; =20 +/** A structure that describes a + P-State Dependency (PSD) Info. + + Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). + + ID: EArmObjPsdInfo +*/ +typedef AML_PSD_INFO CM_ARM_PSD_INFO; + #pragma pack() =20 #endif // ARM_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationMa= nagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Config= urationManagerObjectParser.c index ce494816ed88..cceff56756fc 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -669,6 +669,15 @@ STATIC CONST CM_OBJ_PARSER CmArmEtInfo[] =3D { { "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL } }; =20 +/** A parser for EArmObjPsdInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmPsdInfoParser[] =3D { + { "Revision", 1, "0x%llx", NULL }, + { "DomainId", 4, "0x%x", NULL }, + { "CoordType", 4, "0x%x", NULL }, + { "NumProc", 4, "0x%x", NULL }, +}; + /** A parser for Arm namespace objects. */ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] =3D { @@ -767,6 +776,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectPar= ser[] =3D { ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) }, { "EArmObjEtInfo", CmArmEtInfo, ARRAY_SIZE (CmArmEtInfo) }, + { "EArmObjPsdInfo", CmArmPsdInfoParser, + ARRAY_SIZE (CmArmPsdInfoParser) }, { "EArmObjMax", NULL, = 0 }, }; =20 --=20 2.25.1 -=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 (#111573): https://edk2.groups.io/g/devel/message/111573 Mute This Topic: https://groups.io/mt/102732024/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111574+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111574+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585442; cv=none; d=zohomail.com; s=zohoarc; b=fNT/U4mqbxNC1cnYE+/tqR7G8P2bwZANlrO3pCo2xTBg5zTjZNGLsH8bylqjbIPw85kMC7aqbTiL9NRhutzHEcuYmicQyEetxvd4UM3POI+hw0j3VYIrZuSCDkEkp4cQ+fZXYGVKU1p+kDqjyPPSdeiq66IB5oHtNeFaHag/ky8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585442; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=h7HZNwo7aQ2V0AzAXgLFT827uF+X9m2Y5/VsF8PS32U=; b=RsQrZDR8MF8AJRCtSNG0gORKLqXRUod4fF8OXcBu0DHMb9TUBdvodonlGpRBhsYL7Q4bLADNQeJUDaOYj1uTyEpcDGkeKTiyNu7y6j/WAymtcEqdsyN5rhsbrqFpb9pRmyDKo1gPpnI5gK8qzQj3eafl+OSgp8r3cRYaMeE5BTQ= ARC-Authentication-Results: i=1; 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+111574+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585442191642.9754724085933; Tue, 21 Nov 2023 08:50:42 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=p4ENFGxfis4LfaGfRR6iBEBQvGWEUuxygA9ur2xHrJU=; 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=1700585441; v=1; b=YE1B8HOS9w6cgjs9p8uR10upY+i4KDCK2ChFtYxnd3G+Kj1IiOV1Sb+YaGTZvsndWT3Z49xP NZAeYYrbxEKLczhmqBwgIZd6ytWhNdk2UZbH/Tgx2qC4jHtOIAZUMSv1ozi5oKO8W3Ap+N0mz6o NaRMHPhFgmTtTs6YUDuDIhiI= X-Received: by 127.0.0.2 with SMTP id 7SODYY1788612x8BNXHnvikW; Tue, 21 Nov 2023 08:50:41 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46801.1700585441219564898 for ; Tue, 21 Nov 2023 08:50:41 -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 A980B168F; Tue, 21 Nov 2023 08:51:27 -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 54D173F6C4; Tue, 21 Nov 2023 08:50:39 -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 07/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object Date: Tue, 21 Nov 2023 17:50:03 +0100 Message-Id: <20231121165007.1546858-8-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: uKaN0pRpVuKOPzLKk04mqOWIx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585443165100029 Content-Type: text/plain; charset="utf-8" The _PSD object (cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency) allows to describe CPU's power state dependencies. Add a PsdToken field to the CM_ARM_GICC_INFO object so that interdependent CPUs can reference the same CM_ARM_PSD_INFO object. Signed-off-by: Pierre Gondois --- DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 5 +++++ .../Common/TableHelperLib/ConfigurationManagerObjectParser.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 3748cb7c8085..3805c5824773 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -218,6 +218,11 @@ typedef struct CmArmGicCInfo { i.e. a token referencing a CM_ARM_ET_INFO object. */ CM_OBJECT_TOKEN EtToken; + + /** Optional field: Reference Token for the Psd info of this processor. + i.e. a token referencing a CM_ARM_PSD_INFO object. + */ + CM_OBJECT_TOKEN PsdToken; } CM_ARM_GICC_INFO; =20 /** A structure that describes the diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationMa= nagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Config= urationManagerObjectParser.c index cceff56756fc..178e1821393d 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -85,7 +85,8 @@ STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser[] =3D { { "AffinityFlags", 4, "0x%x", N= ULL }, { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL }, { "TRBEInterrupt", 2, "0x%x", N= ULL }, - { "EtToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL } + { "EtToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL }, + { "PsdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL }, }; =20 /** A parser for EArmObjGicDInfo. --=20 2.25.1 -=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 (#111574): https://edk2.groups.io/g/devel/message/111574 Mute This Topic: https://groups.io/mt/102732026/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111575+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111575+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585444; cv=none; d=zohomail.com; s=zohoarc; b=csUm8HAE1i/55DfWQX4ljvw3JSWSvow0ZpF3vBxPawiuDd0nnVFRoPewNvNn3JYJTwrhvee5SeAHfqdBZnD8CNab1yS+NG+2qsxUMWZ5nD+v/ElMJoUusyzz2NASunf7KCVubVXy86n0Px8gJtmbpYZWgIBEJMKBTgVesLjNdv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585444; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=E+iA/Lg5fzo2/qccIk+b0nqlKc0ZTv+Ruc1Tl+A/1Zc=; b=irqczW5uuDmxLG+gcjBcg8+5AdES58z/dCfzXtqP7rLoWI1IXeMWPToL/tbfAE368syVh2sRJP0ZXMciSMBiqu49V4FpTssK0e225Ne0D9zt3LaWmDcOy0CV33plSp2SV2MmTM3vRniZk5L1hVTltOG7CbgJGM43fWkh/WjPwk0= ARC-Authentication-Results: i=1; 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+111575+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585444180897.6234296936694; Tue, 21 Nov 2023 08:50:44 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6/sNEA2723xHAQ4q2k5J46UBwddXjg8JFFQdRW3qe+c=; 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=1700585443; v=1; b=WN6u9XVcm1KrICUxPqE9p+3bqAUYMCqR90DF2qqDUhOlmvyrQLWvaU6E0tZznONuHHTggUqJ G8lsoo8d+BlTutCfj8BUrlD5iY3nQ6wPMIp2QVR6iVeOMw2Z+q2j80YsSq/KynG4TXz52KSsBqW XLO7Sy5SbzLfvMqK5OZ3OGwQ= X-Received: by 127.0.0.2 with SMTP id 8Rv5YY1788612x0iJIH5iBIv; Tue, 21 Nov 2023 08:50:43 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.46803.1700585443037446923 for ; Tue, 21 Nov 2023 08:50:43 -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 81AD6169C; Tue, 21 Nov 2023 08:51:29 -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 47A403F6C4; Tue, 21 Nov 2023 08:50:41 -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 08/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD Date: Tue, 21 Nov 2023 17:50:04 +0100 Message-Id: <20231121165007.1546858-9-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: 9xauQmaR0q8zD5Ow5Za6aT3tx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585445123100031 Content-Type: text/plain; charset="utf-8" Add AmlCreatePsdNode() to the AmlLib to generate _PSD objects. _PSD objects allow to describe 'performance control, P-state or CPPC, logical processor dependency', Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). Signed-off-by: Pierre Gondois --- .../Include/Library/AmlLib/AmlLib.h | 35 +++- .../Common/AmlLib/CodeGen/AmlCodeGen.c | 188 +++++++++++++++++- 2 files changed, 221 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index be78c00b6109..fb1b0e24faf3 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -1,7 +1,7 @@ /** @file AML Lib. =20 - Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1628,4 +1628,37 @@ AmlAddNameStringToNamedPackage ( IN AML_OBJECT_NODE_HANDLE NamedNode ); =20 +/** Create a _PSD node. + + Creates and optionally adds the following node + Name(_PSD, Package() + { + NumEntries, // Integer + Revision, // Integer + Domain, // Integer + CoordType, // Integer + NumProc, // Integer + }) + + Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency) + + @ingroup CodeGenApis + + @param [in] PsdInfo PsdInfo object + @param [in] ParentNode If provided, set ParentNode as the parent + of the node created. + @param [out] NewPsdNode If success and provided, contains the created = node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCreatePsdNode ( + IN AML_PSD_INFO *PsdInfo, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewPsdNode OPTIONAL + ); + #endif // AML_LIB_H_ diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index 89ca2c8a92e7..a96d2b8a048a 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -1,7 +1,7 @@ /** @file AML Code Generation. =20 - Copyright (c) 2020 - 2022, Arm Limited. All rights reserved.
+ Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -3849,3 +3849,189 @@ exit_handler: =20 return Status; } + +/** Create a _PSD node. + + Creates and optionally adds the following node + Name(_PSD, Package() + { + NumEntries, // Integer + Revision, // Integer + Domain, // Integer + CoordType, // Integer + NumProc, // Integer + }) + + Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency) + + @ingroup CodeGenApis + + @param [in] PsdInfo PsdInfo object + @param [in] ParentNode If provided, set ParentNode as the parent + of the node created. + @param [out] NewPsdNode If success and provided, contains the created = node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCreatePsdNode ( + IN AML_PSD_INFO *PsdInfo, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewPsdNode OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE PsdNode; + AML_OBJECT_NODE_HANDLE PsdPackage; + AML_OBJECT_NODE_HANDLE IntegerNode; + UINT32 NumberOfEntries; + + if ((PsdInfo =3D=3D NULL) || + ((ParentNode =3D=3D NULL) && (NewPsdNode =3D=3D NULL))) + { + Status =3D EFI_INVALID_PARAMETER; + ASSERT_EFI_ERROR (Status); + return Status; + } + + // Revision 3 per ACPI 6.5 specification + if (PsdInfo->Revision =3D=3D EFI_ACPI_6_5_AML_PSD_REVISION_V0) { + // NumEntries 5 per ACPI 6.5 specification + NumberOfEntries =3D 5; + } else { + Status =3D EFI_INVALID_PARAMETER; + ASSERT_EFI_ERROR (Status); + return Status; + } + + if (((PsdInfo->CoordType !=3D EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ALL) = && + (PsdInfo->CoordType !=3D EFI_ACPI_6_5_AML_STATE_COORD_TYPE_SW_ANY) = && + (PsdInfo->CoordType !=3D EFI_ACPI_6_5_AML_STATE_COORD_TYPE_HW_ALL))= || + (PsdInfo->NumProc =3D=3D 0)) + { + Status =3D EFI_INVALID_PARAMETER; + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlCodeGenNamePackage ("_PSD", NULL, &PsdNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + // Get the Package object node of the _PSD node, + // which is the 2nd fixed argument (i.e. index 1). + PsdPackage =3D (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument ( + PsdNode, + EAmlParseIndexTerm1 + ); + if ((PsdPackage =3D=3D NULL) = || + (AmlGetNodeType ((AML_NODE_HANDLE)PsdPackage) !=3D EAmlNodeObject) = || + (!AmlNodeHasOpCode (PsdPackage, AML_PACKAGE_OP, 0))) + { + Status =3D EFI_INVALID_PARAMETER; + ASSERT_EFI_ERROR (Status); + goto error_handler; + } + + // NumEntries + Status =3D AmlCodeGenInteger (NumberOfEntries, &IntegerNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)PsdPackage, + (AML_NODE_HANDLE)IntegerNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (IntegerNode); + return Status; + } + + // Revision + Status =3D AmlCodeGenInteger (PsdInfo->Revision, &IntegerNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)PsdPackage, + (AML_NODE_HANDLE)IntegerNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (IntegerNode); + return Status; + } + + // Domain + Status =3D AmlCodeGenInteger (PsdInfo->Domain, &IntegerNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)PsdPackage, + (AML_NODE_HANDLE)IntegerNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (IntegerNode); + return Status; + } + + // CoordType + Status =3D AmlCodeGenInteger (PsdInfo->CoordType, &IntegerNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)PsdPackage, + (AML_NODE_HANDLE)IntegerNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (IntegerNode); + return Status; + } + + // Num Processors + Status =3D AmlCodeGenInteger (PsdInfo->NumProc, &IntegerNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)PsdPackage, + (AML_NODE_HANDLE)IntegerNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (IntegerNode); + return Status; + } + + Status =3D LinkNode (PsdNode, ParentNode, NewPsdNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto error_handler; + } + + return Status; + +error_handler: + AmlDeleteTree ((AML_NODE_HANDLE)PsdNode); + return Status; +} --=20 2.25.1 -=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 (#111575): https://edk2.groups.io/g/devel/message/111575 Mute This Topic: https://groups.io/mt/102732028/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111576+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111576+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585445; cv=none; d=zohomail.com; s=zohoarc; b=GSqkCZdF5mU3zaoytXhr0CCADxSO1asPaaZ/tY+lj+FeY0mmfrk+/FDFDMu/tCDnnMwz0hJbCK4x6vXgXO8Ck/IEEzfEOcry0oeX+ttSy6KivWe1W8xpvYCcUXj25i4ae0oA9Yb2K5gem/Hx8TACA2VkN++o5lM5EaoSvu83gyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585445; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=tYSNwyRp0Ks3RIwDI5lah7eVIsDASKs9tdd770T/TiM=; b=URc0K2EOJyfKrxSHM4C0erfeaa72IG9bkewNOob4wHU2/2xRoWWDOycmFFpiA6fPLuEvQbrIKeIJ+8xUXcOA/fFWAufH0/WvvDXQAuyJGi+XkO5YDfceZIy2F1dMG2hSDjb4rJY2W9lJJzQ+xDzYJ1E9b2WkWOeXQKaQdQmWdIY= ARC-Authentication-Results: i=1; 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+111576+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585445884370.2243278319087; Tue, 21 Nov 2023 08:50:45 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=QcjRkIbav1sV7JdKlMXT5q5toGZIxt05dvAvBLRgd+k=; 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=voaomqjngbO9x7lcbsvxXamyKMfSCI3xL0FthOTNkUGz9lLce87YTzCDc43i0KzGWTMBeo90 UkTsOncq0P5pd9bvtQ4f4E+0wxqDx6Q6PttcZZnYvLMqOQWtxB/3ORetglD+BOwkKYUkGtDYDG/ EC1LfqFM8AqJrSmncVxgOYvI= X-Received: by 127.0.0.2 with SMTP id OJADYY1788612xie9rhJxWgt; 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: 1vMF0VnSPHn7FZwQK6IIYuwBx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585447151100035 Content-Type: text/plain; charset="utf-8" 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) - EArmObjLpiInfo (OPTIONAL) - GetEArmObjEtInfo (OPTIONAL) + - EArmObjPsdInfo (OPTIONAL) */ =20 /** This macro expands to a function that retrieves the GIC @@ -103,6 +104,16 @@ GET_OBJECT_LIST ( CM_ARM_ET_INFO ); =20 +/** + This macro expands to a function that retrieves the PSD + information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjPsdInfo, + CM_ARM_PSD_INFO + ); + /** Initialize the TokenTable. =20 One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO @@ -256,6 +267,75 @@ WriteAslName ( return EFI_SUCCESS; } =20 +/** Create and add an _PSD Node to Cpu Node. + + For instance, transform an AML node from: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + } + + To: + Device (C002) + { + Name (_UID, 2) + Name (_HID, "ACPI0007") + Name (_PSD, Package() + { + NumEntries, // Integer + Revision, // Integer + Domain, // Integer + CoordType, // Integer + NumProcessors, // Integer + }) + } + + @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] Node CPU Node to which the _CPC node is + attached. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlPsdNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_ARM_GICC_INFO *GicCInfo, + IN AML_OBJECT_NODE_HANDLE *Node + ) +{ + EFI_STATUS Status; + CM_ARM_PSD_INFO *PsdInfo; + + Status =3D GetEArmObjPsdInfo ( + CfgMgrProtocol, + GicCInfo->PsdToken, + &PsdInfo, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AmlCreatePsdNode ( + PsdInfo, + Node, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; +} + /** Create and add an _CPC Node to Cpu Node. =20 For instance, transform an AML node from: @@ -839,6 +919,14 @@ CreateAmlCpuFromProcHierarchy ( } } =20 + if (GicCInfo->PsdToken !=3D CM_NULL_TOKEN) { + Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuN= ode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + // If a CPC info is associated with the // GicCinfo, create an _CPC method returning them. if (GicCInfo->CpcToken !=3D CM_NULL_TOKEN) { @@ -1296,6 +1384,14 @@ CreateTopologyFromGicC ( break; } =20 + if (GicCInfo->PsdToken !=3D CM_NULL_TOKEN) { + Status =3D CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, Cp= uNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + // If a CPC info is associated with the // GicCinfo, create an _CPC method returning them. if (GicCInfo[Index].CpcToken !=3D CM_NULL_TOKEN) { --=20 2.25.1 -=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 (#111576): https://edk2.groups.io/g/devel/message/111576 Mute This Topic: https://groups.io/mt/102732032/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111577+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111577+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585447; cv=none; d=zohomail.com; s=zohoarc; b=mrucPT3Ows1Fn5s+gzP2PNa0DICajxGx0bOv2JSric4reyKZkq9Kyn6hX9HbdKlAA4ocsbPvkgpPEIQtqLOuhEOiiLxMACWW1mdFnE+PxCCuep0Q90NL8wPiW3A/GraDpPX9fa9gDxpxEfxe+xE95yfEO5z8ZavyndhoKXCZFCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585447; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=yG5fv2BWf0AWNaTSlR1ALwtZbz3MoGcLjcOq5ounvI8=; b=GZW+T7WdrI2w3FtJN4mQ0ORec7m0ENrRmyleorC4V/giF/+5YwTvlgDAa5VNHbcmY1s7Hi12waDxA7H2mS19Eai+w0uxk3Dfd5GStfXWdFiihpp8iIDoJr/m0H9Do2RaRboTYWmc2h2IcPVWCFPzz+IXKYB+VsKMWqdNrVhpwu0= ARC-Authentication-Results: i=1; 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+111577+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585447772431.15215762166247; Tue, 21 Nov 2023 08:50:47 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=0IujVhtWPGTitXgVjqTgX2nHbjfUheNpZldlaOXVRbQ=; 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=1700585447; v=1; b=kYz5iTmJ/w4mZRZwHGUt0nFO7Cbdr4h/fN2Y/uWIbYPAMIhvK0Wo6otUxK0Ogq+hgK5PPWSZ mY1c87yPQmWFPKbtQ4D8QTV1iGUrfLkPauUowD1ndFMZtMg4XoKVCiufDA0+zv7R5Vyb9VL1fmK FrK7f9qZcPLighdrOBo8AE4E= X-Received: by 127.0.0.2 with SMTP id nDV4YY1788612xgtBePjyGH2; Tue, 21 Nov 2023 08:50:47 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46877.1700585446872819934 for ; Tue, 21 Nov 2023 08:50: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 62FF91042; Tue, 21 Nov 2023 08:51:33 -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 149BA3F6C4; Tue, 21 Nov 2023 08:50:44 -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 10/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib Date: Tue, 21 Nov 2023 17:50:06 +0100 Message-Id: <20231121165007.1546858-11-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: V5afhRVyiA6gCzKA5oa2zMGRx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585449185100043 Content-Type: text/plain; charset="utf-8" The SCP holds some power information that could be advertised through the _CPC object. The communication with the SCP is done through SCMI protocols (c.f. ArmScmiDxe). Use the SCMI protocols to query information and feed it to the DynamicTablesPkg. Signed-off-by: Pierre Gondois Acked-by: Leif Lindholm --- DynamicTablesPkg/DynamicTables.dsc.inc | 1 + DynamicTablesPkg/DynamicTablesPkg.dec | 3 + DynamicTablesPkg/DynamicTablesPkg.dsc | 1 + .../Library/DynamicTablesScmiInfoLib.h | 33 ++ .../DynamicTablesScmiInfoLib.c | 297 ++++++++++++++++++ .../DynamicTablesScmiInfoLib.inf | 31 ++ 6 files changed, 366 insertions(+) create mode 100644 DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoL= ib.h create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/Dynam= icTablesScmiInfoLib.c create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/Dynam= icTablesScmiInfoLib.inf diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/Dyna= micTables.dsc.inc index 9d4312c4e87d..41947012b92b 100644 --- a/DynamicTablesPkg/DynamicTables.dsc.inc +++ b/DynamicTablesPkg/DynamicTables.dsc.inc @@ -15,6 +15,7 @@ [BuildOptions] [LibraryClasses.common] AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLi= b.inf AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf + DynamicTablesScmiInfoLib|DynamicTablesPkg/Library/DynamicTablesScmiInfoL= ib/DynamicTablesScmiInfoLib.inf SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/Ss= dtPcieSupportLib.inf SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFix= upLib/SsdtSerialPortFixupLib.inf TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelpe= rLib.inf diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/Dynam= icTablesPkg.dec index cfbcbb9569f1..aa422ce9f6fd 100644 --- a/DynamicTablesPkg/DynamicTablesPkg.dec +++ b/DynamicTablesPkg/DynamicTablesPkg.dec @@ -42,6 +42,9 @@ [LibraryClasses] ## @libraryclass Defines a set of SMBIOS string helper methods. SmbiosStringTableLib|Include/Library/SmbiosStringTableLib.h =20 + ## @libraryclass Defines a set of APIs to populate CmObj using SCMI. + DynamicTablesScmiInfoLib|Include/Library/DynamicTablesScmiInfoLib.h + [Protocols] # Configuration Manager Protocol GUID gEdkiiConfigurationManagerProtocolGuid =3D { 0xd85a4835, 0x5a82, 0x4894,= { 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } } diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/Dynam= icTablesPkg.dsc index bd5084a9008f..853ea2a1e4c2 100644 --- a/DynamicTablesPkg/DynamicTablesPkg.dsc +++ b/DynamicTablesPkg/DynamicTablesPkg.dsc @@ -39,6 +39,7 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf =20 [Components.common] + DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoL= ib.inf DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf diff --git a/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h b/= DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h new file mode 100644 index 000000000000..ff6b47d51fe8 --- /dev/null +++ b/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h @@ -0,0 +1,33 @@ +/** @file + Arm SCMI Info Library. + + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef ARM_SCMI_INFO_LIB_H_ +#define ARM_SCMI_INFO_LIB_H_ + +#include + +/** Populate a AML_CPC_INFO object based on SCMI information. + + @param[in] DomainId Identifier for the performance domain. + @param[out] CpcInfo If success, this structure was populated from + information queried to the SCP. + + @retval EFI_SUCCESS Success. + @retval EFI_DEVICE_ERROR Device error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_TIMEOUT Time out. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +DynamicTablesScmiInfoGetFastChannel ( + IN UINT32 DomainId, + OUT AML_CPC_INFO *CpcInfo + ); + +#endif // ARM_SCMI_INFO_LIB_H_ diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTable= sScmiInfoLib.c b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicT= ablesScmiInfoLib.c new file mode 100644 index 000000000000..b59da3d6bb51 --- /dev/null +++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiIn= foLib.c @@ -0,0 +1,297 @@ +/** @file + Arm SCMI Info Library. + + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
+ + Arm Functional Fixed Hardware Specification: + - https://developer.arm.com/documentation/den0048/latest/ + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include +#include + +/** Arm FFH registers + + Cf. Arm Functional Fixed Hardware Specification + s3.2 Performance management and Collaborative Processor Performance Cont= rol +*/ +#define ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER 0x0 +#define ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER 0x1 + +/// Arm SCMI performance protocol. +STATIC SCMI_PERFORMANCE_PROTOCOL *ScmiPerfProtocol; + +/** Arm SCMI Info Library constructor. + + @param ImageHandle Image of the loaded driver. + @param SystemTable Pointer to the System Table. + + @retval EFI_SUCCESS Success. + @retval EFI_DEVICE_ERROR Device error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_NOT_FOUND Not Found + @retval EFI_TIMEOUT Timeout. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +DynamicTablesScmiInfoLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT32 Version; + + Status =3D gBS->LocateProtocol ( + &gArmScmiPerformanceProtocolGuid, + NULL, + (VOID **)&ScmiPerfProtocol + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D ScmiPerfProtocol->GetVersion (ScmiPerfProtocol, &Version); + if (EFI_ERROR (Status)) { + return Status; + } + + // FastChannels were added in SCMI v2.0 spec. + if (Version < PERFORMANCE_PROTOCOL_VERSION_V2) { + DEBUG (( + DEBUG_ERROR, + "DynamicTablesScmiInfoLib requires SCMI version > 2.0\n" + )); + return EFI_UNSUPPORTED; + } + + return Status; +} + +/** Get the OPPs/performance states of a power domain. + + This function is a wrapper around the SCMI PERFORMANCE_DESCRIBE_LEVELS + command. The list of discrete performance states is returned in a buffer + that must be freed by the caller. + + @param[in] DomainId Identifier for the performance domain. + @param[out] LevelArray If success, pointer to the list of list of + performance state. This memory must be freed= by + the caller. + @param[out] LevelArrayCount If success, contains the number of states in + LevelArray. + + @retval EFI_SUCCESS Success. + @retval EFI_DEVICE_ERROR Device error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_TIMEOUT Time out. + @retval EFI_UNSUPPORTED Unsupported. +**/ +STATIC +EFI_STATUS +EFIAPI +DynamicTablesScmiInfoDescribeLevels ( + IN UINT32 DomainId, + OUT SCMI_PERFORMANCE_LEVEL **LevelArray, + OUT UINT32 *LevelArrayCount + ) +{ + EFI_STATUS Status; + SCMI_PERFORMANCE_LEVEL *Array; + UINT32 Count; + UINT32 Size; + + if ((ScmiPerfProtocol =3D=3D NULL) || + (LevelArray =3D=3D NULL) || + (LevelArrayCount =3D=3D NULL)) + { + return EFI_INVALID_PARAMETER; + } + + // First call to get the number of levels. + Size =3D 0; + Status =3D ScmiPerfProtocol->DescribeLevels ( + ScmiPerfProtocol, + DomainId, + &Count, + &Size, + NULL + ); + if (Status !=3D EFI_BUFFER_TOO_SMALL) { + // EFI_SUCCESS is not a valid option. + if (Status =3D=3D EFI_SUCCESS) { + return EFI_INVALID_PARAMETER; + } else { + return Status; + } + } + + Array =3D AllocateZeroPool (Size); + if (Array =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + + // Second call to get the descriptions of the levels. + Status =3D ScmiPerfProtocol->DescribeLevels ( + ScmiPerfProtocol, + DomainId, + &Count, + &Size, + Array + ); + if (EFI_ERROR (Status)) { + return Status; + } + + *LevelArray =3D Array; + *LevelArrayCount =3D Count; + + return Status; +} + +/** Populate a AML_CPC_INFO object based on SCMI information. + + @param[in] DomainId Identifier for the performance domain. + @param[out] CpcInfo If success, this structure was populated from + information queried to the SCP. + + @retval EFI_SUCCESS Success. + @retval EFI_DEVICE_ERROR Device error. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_TIMEOUT Time out. + @retval EFI_UNSUPPORTED Unsupported. +**/ +EFI_STATUS +EFIAPI +DynamicTablesScmiInfoGetFastChannel ( + IN UINT32 DomainId, + OUT AML_CPC_INFO *CpcInfo + ) +{ + EFI_STATUS Status; + SCMI_PERFORMANCE_FASTCHANNEL FcLevelGet; + SCMI_PERFORMANCE_FASTCHANNEL FcLimitsSet; + SCMI_PERFORMANCE_DOMAIN_ATTRIBUTES DomainAttributes; + + SCMI_PERFORMANCE_LEVEL *LevelArray; + UINT32 LevelCount; + + UINT64 FcLevelGetAddr; + UINT64 FcLimitsMaxSetAddr; + UINT64 FcLimitsMinSetAddr; + + if ((ScmiPerfProtocol =3D=3D NULL) || + (CpcInfo =3D=3D NULL)) + { + return EFI_INVALID_PARAMETER; + } + + Status =3D ScmiPerfProtocol->DescribeFastchannel ( + ScmiPerfProtocol, + DomainId, + ScmiMessageIdPerformanceLevelSet, + &FcLevelGet + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D ScmiPerfProtocol->DescribeFastchannel ( + ScmiPerfProtocol, + DomainId, + ScmiMessageIdPerformanceLimitsSet, + &FcLimitsSet + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D ScmiPerfProtocol->GetDomainAttributes ( + ScmiPerfProtocol, + DomainId, + &DomainAttributes + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D DynamicTablesScmiInfoDescribeLevels (DomainId, &LevelArray, &= LevelCount); + if (EFI_ERROR (Status)) { + return Status; + } + + /* Do some safety checks. + Only support FastChannels (and not doorbells) as this is + the only mechanism supported by SCP. + FcLimits[Get|Set] require 2 UINT32 values (max, then min) and + FcLimits[Get|Set] require 1 UINT32 value (level). + */ + if ((FcLevelGet.ChanSize !=3D sizeof (UINT32)) || + ((FcLevelGet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) =3D=3D + SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) || + (FcLimitsSet.ChanSize !=3D 2 * sizeof (UINT32)) || + ((FcLimitsSet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) =3D=3D + SCMI_PERF_FC_ATTRIB_HAS_DOORBELL)) + { + Status =3D EFI_INVALID_PARAMETER; + goto exit_handler; + } + + FcLevelGetAddr =3D ((UINT64)FcLevelGet.ChanAddrHigh << 32) | + FcLevelGet.ChanAddrLow; + FcLimitsMaxSetAddr =3D ((UINT64)FcLimitsSet.ChanAddrHigh << 32) | + FcLimitsSet.ChanAddrLow; + FcLimitsMinSetAddr =3D FcLimitsMaxSetAddr + 0x4; + + CpcInfo->Revision =3D EFI_ACPI_6_5_AML_CPC_REVI= SION_V3; + CpcInfo->HighestPerformanceInteger =3D LevelArray[LevelCount - 1= ].Level; + CpcInfo->NominalPerformanceInteger =3D DomainAttributes.Sustaine= dPerfLevel; + CpcInfo->LowestNonlinearPerformanceInteger =3D LevelArray[0].Level; + CpcInfo->LowestPerformanceInteger =3D LevelArray[0].Level; + + CpcInfo->DesiredPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6_5_S= YSTEM_MEMORY; + CpcInfo->DesiredPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->DesiredPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->DesiredPerformanceRegister.AccessSize =3D EFI_ACPI_6_5_D= WORD; + CpcInfo->DesiredPerformanceRegister.Address =3D FcLevelGetAddr; + + CpcInfo->MinimumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6_5_S= YSTEM_MEMORY; + CpcInfo->MinimumPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->MinimumPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->MinimumPerformanceRegister.AccessSize =3D EFI_ACPI_6_5_D= WORD; + CpcInfo->MinimumPerformanceRegister.Address =3D FcLimitsMinSet= Addr; + + CpcInfo->MaximumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6_5_S= YSTEM_MEMORY; + CpcInfo->MaximumPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->MaximumPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->MaximumPerformanceRegister.AccessSize =3D EFI_ACPI_6_5_D= WORD; + CpcInfo->MaximumPerformanceRegister.Address =3D FcLimitsMaxSet= Addr; + + CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId =3D EFI_A= CPI_6_5_FUNCTIONAL_FIXED_HARDWARE; + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitWidth =3D 0x40; + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitOffset =3D 0; + CpcInfo->ReferencePerformanceCounterRegister.AccessSize =3D ARM_F= FH_REFERENCE_PERF_COUNTER_REGISTER; + CpcInfo->ReferencePerformanceCounterRegister.Address =3D 0x4; + + CpcInfo->DeliveredPerformanceCounterRegister.AddressSpaceId =3D EFI_A= CPI_6_5_FUNCTIONAL_FIXED_HARDWARE; + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitWidth =3D 0x40; + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitOffset =3D 0; + CpcInfo->DeliveredPerformanceCounterRegister.AccessSize =3D ARM_F= FH_DELIVERED_PERF_COUNTER_REGISTER; + CpcInfo->DeliveredPerformanceCounterRegister.Address =3D 0x4; + + // SCMI should advertise performance values on a unified scale. So frequ= ency + // values are not available. LowestFrequencyInteger and + // NominalFrequencyInteger are populated in the ConfigurationManager. + +exit_handler: + FreePool (LevelArray); + return Status; +} diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTable= sScmiInfoLib.inf b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/Dynami= cTablesScmiInfoLib.inf new file mode 100644 index 000000000000..d49277f82bc3 --- /dev/null +++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiIn= foLib.inf @@ -0,0 +1,31 @@ +## @file +# Arm SCMI Info Library. +# +# Copyright (c) 2022 - 2023, Arm Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D DynamicTablesScmiInfoLib + FILE_GUID =3D 1A7CDB04-9FFC-40DA-A87C-A5ACADAF8136 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + LIBRARY_CLASS =3D DynamicTablesScmiInfoLib + CONSTRUCTOR =3D DynamicTablesScmiInfoLibConstructor + +[Sources] + DynamicTablesScmiInfoLib.c + +[Packages] + ArmPkg/ArmPkg.dec + DynamicTablesPkg/DynamicTablesPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + +[Protocols] + gArmScmiPerformanceProtocolGuid ## CONSUMES + +[Depex] + gArmScmiPerformanceProtocolGuid --=20 2.25.1 -=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 (#111577): https://edk2.groups.io/g/devel/message/111577 Mute This Topic: https://groups.io/mt/102732033/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- From nobody Fri May 10 08:04:11 2024 Delivered-To: importer@patchew.org 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+111578+1787277+3901457@groups.io; helo=mail02.groups.io; 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+111578+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1700585449; cv=none; d=zohomail.com; s=zohoarc; b=Bo5bEYpzfsy1FYN7D23z4/1BOB1649JhhxDFoOQKst2PNCA6BqA1DzkKPwXSAyv2hsmx4rWSxMG7XtQGBfkODPf7cC5Yzw7hZxdLkH75GCKkZulJhZDnqd8NI+sBuSqESHXlNyt5AhvMXRTQuPXT9aapDUde5v9EevLzP6bWlFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700585449; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=Od/4UgxaH+zOLp1BgFiXKiFftzg/ljkn9E/Vu0yEgbo=; b=XoZSB/SYQ/8/hp0AXDjsmPB8FY01swI4CTJTOzJapGXsgvJ6w4UpXVMPn47JWOGe9gbOEt14tpoavy6rt1rhheXoqd+/WWOEJ325a9PKejckl7AzOfnavsP251e9xVK+0j4xnq1/H8MCLGDxkkHkbOwjJgCuUdB9uhgQs9KLbHU= ARC-Authentication-Results: i=1; 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+111578+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700585449746845.586424935984; Tue, 21 Nov 2023 08:50:49 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=eNFE4j2VNHh7evtZ/JQyDtjJKtttBmJHZSUGzBBwLRQ=; 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=1700585449; v=1; b=UDOdAWOEU2Iw7PmiALu/3jgt4H5vt8JgxmQm2axUdd0Wn/zMjzenZ4Myjjp2QZKojkUB22gw WpqthTAxrxFF2rGY9cHTbcDdDwDERJnjJlN7Ltabxex1qSJoR20iH76hx0tN+v9mNhWW9m6ETKh Psadf3g9ZB79+p5GV5T4Zrq0= X-Received: by 127.0.0.2 with SMTP id OftNYY1788612x1ThdIW7N7U; Tue, 21 Nov 2023 08:50:49 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.46878.1700585448803493903 for ; Tue, 21 Nov 2023 08:50:49 -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 41276168F; Tue, 21 Nov 2023 08:51:35 -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 06B443F6C4; Tue, 21 Nov 2023 08:50:46 -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 11/11] DynamicTablesPkg: Remove check for _CPC field Date: Tue, 21 Nov 2023 17:50:07 +0100 Message-Id: <20231121165007.1546858-12-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: YbR0mCoxOZhrau4lDLIlM8wQx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700585451142100047 Content-Type: text/plain; charset="utf-8" When generating _CPC objects, some fields are mandatory by spec [1]. Some fields cannot be supported by a the Juno platform, which is used to test the _CPC generation. Therefore, don't prevent the generation of _CPC objects if the fields below are missing, and let the OS handle the missing information. _CPC fields that are exempted from checks: - PerformanceLimitedRegister - ReferencePerformanceCounterRegister - DeliveredPerformanceCounterRegister Also warn if one of the following optional fields is missing: - HighestPerformance[Buffer|Integer] - NominalPerformance[Buffer|Integer] [1] Cf. non-optional fields in: ACPI 6.5, s8.4.6.1 '_CPC (Continuous Performance Control)' Signed-off-by: Pierre Gondois --- .../Common/AmlLib/CodeGen/AmlCodeGen.c | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index a96d2b8a048a..9b72c4408016 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3531,6 +3531,21 @@ AmlCreateCpcNode ( return EFI_INVALID_PARAMETER; } =20 + // The following fields are theoretically mandatory, but not supported + // by some platforms. Just warn if they are missing: + // - PerformanceLimitedRegister + // - ReferencePerformanceCounterRegister + // - DeliveredPerformanceCounterRegister + if (IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister) || + IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= || + IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)= ) { + DEBUG (( + DEBUG_WARN, + "Missing PerformanceLimited|ReferencePerformanceCounter|" + "DeliveredPerformanceCounter field in _CPC object\n" + )); + } + if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && @@ -3539,13 +3554,19 @@ AmlCreateCpcNode ( (CpcInfo->LowestNonlinearPerformanceInteger =3D=3D 0)) || (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) && (CpcInfo->LowestPerformanceInteger =3D=3D 0)) || - IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) || - IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister)= || - IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister)= || - IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister)) + IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister)) { ASSERT (0); return EFI_INVALID_PARAMETER; + } else if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && + (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || + (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && + (CpcInfo->NominalPerformanceInteger =3D=3D 0))) + { + DEBUG (( + DEBUG_WARN, + "Missing Reference|Delivered performance field in _CPC object\n" + )); } =20 CpcPackage =3D NULL; --=20 2.25.1 -=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 (#111578): https://edk2.groups.io/g/devel/message/111578 Mute This Topic: https://groups.io/mt/102732035/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-