From nobody Wed May 15 12:20:17 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+110037+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+110037+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233154; cv=none; d=zohomail.com; s=zohoarc; b=hijrFNP7ebCAWTGP4d8dR4r879jG/qEFKl2NnoCm8WaBukOvEFFn18uXnLAgOOQS4v/FuK1qXU9azeKlwCWT7FRcByGwYw7n7t6Sv0+DcqoXmUL2JFoqQXPvxaLriEaBTCSt1MI6NEhh2keiVXLsYG7KRZHzEopeGge79nsxAhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233154; 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=LLV9zZZb/7CiglOLVZG8MAJupkdtTh3IMbFqSr03wec=; b=NDucmVrrG7IOzBoIuDH12CzGXU4m3jRMv7waSIEk5Zhd9UlswCsCbEdYaz7dfeyrqYG9RMN5JM2mZ0S79SyJbKJjUnRpVwMzzpBHhclSXepvQ/uBYdtajMdnrh2oV7YQNPSXX5GVUlPeq8IkV9uciBzXQZzEttO9r9Z8ST0XNZc= 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+110037+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 1698233154783883.1198549008354; Wed, 25 Oct 2023 04:25:54 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+B0V7qTrLc51dWbyW6rtefamdIUFShQr8P9ZuwDBzJs=; 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=1698233154; v=1; b=tzf2ad6GV3+aAdr6fbRcchsDdKyJPmo1+Oeu0Fq1/emjqoOgWqUyXk2dxJvTDsTbK8nCGSHJ vbia6N4EoQripd9HTJBwgH+0vHdDeGpap7ip+Hy9GdTxoSD9tONRx5aN59cQKHDSQPup76H9Y6v Hy7hqoLxnPd21N5vGifgI21Q= X-Received: by 127.0.0.2 with SMTP id dL4CYY1788612xUUM94X0wlY; Wed, 25 Oct 2023 04:25:54 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41097.1698233153729617083 for ; Wed, 25 Oct 2023 04:25:53 -0700 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 E5BF9C15; Wed, 25 Oct 2023 04:26:34 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6D8013F738; Wed, 25 Oct 2023 04:25:52 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION Date: Wed, 25 Oct 2023 13:25:30 +0200 Message-Id: <20231025112540.1654844-2-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: UO8qnzhHDadoVn14dw3jn8lbx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233155656100002 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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 --- ArmPkg/Include/Library/ArmLib.h | 1 + .../Include/Protocol/ArmScmiPerformanceProtocol.h | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index 0169dbc1092c..7b2b2238fed9 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -780,6 +780,7 @@ EFIAPI ArmHasVhe ( VOID ); + #endif // MDE_CPU_AARCH64 =20 #ifdef MDE_CPU_ARM diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/= Include/Protocol/ArmScmiPerformanceProtocol.h index 7e548e4765c2..8e8e05d5a5f6 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, latest version: + - 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 (#110037): https://edk2.groups.io/g/devel/message/110037 Mute This Topic: https://groups.io/mt/102175810/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 Wed May 15 12:20:17 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+110038+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+110038+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233156; cv=none; d=zohomail.com; s=zohoarc; b=g4BaFP2Lf/d42jInyBnoHSxLefu2MtxkxB8BJgs3m7s7I9Mr+/XJUGhVhsMcOSZ7CkRicJnE3kk/s3XCttrgzM04gRsXrIiGjA+98nHslC1jsEiyZ79ZcZHhQ8osAVLu08kNaU2otQW2fSJVS2L++Wjh9LKK93DCUHFZ+k4hI4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233156; 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=G0Ovy072MKjqmK/Q7fzPCdISr3n8x4zGJww9BkySoHQ=; b=mIBpAlSgxPxQBF0BtZVCGuBghQW8f1lXq2j5UqTbi21hqBTMfoomLtXVvdc6i9lDZuU/xWjp7nFduO0ktKUnrWLSCrPvprnPt+/1MiIU94DbQYExQ7HiCC53qclPpBp7e4cL1+MsSvUxcxGSHlstsvzkxM4ClzbS6e7rVHEYqcM= 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+110038+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 1698233156377917.882691991936; Wed, 25 Oct 2023 04:25:56 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=fXaA8P9PHUe1XgP6N2eM0HNVb1S+SQhehCJPsZWUbfA=; 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=1698233156; v=1; b=ga7EwNUOKURd3Nlwuy3q23Y5f7SJeDlMe02JuTPfp9+koa5upIUqdCuy7OO9KZWtMw/Asn+5 cYaavqstdwLOdMCno/mQTxmcOGAOD7FdFRu583X0YpzNWCwGG4QsX8ygQI2aQrc8pAwZM4hbYOk aPLAq/9r473WbHkZ1vxHLqGk= X-Received: by 127.0.0.2 with SMTP id arudYY1788612xUQrCrCwO4z; Wed, 25 Oct 2023 04:25:56 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170922.1698233155204636935 for ; Wed, 25 Oct 2023 04:25:55 -0700 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 4ECAC139F; Wed, 25 Oct 2023 04:26:36 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A3EDB3F738; Wed, 25 Oct 2023 04:25:53 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support Date: Wed, 25 Oct 2023 13:25:31 +0200 Message-Id: <20231025112540.1654844-3-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: XjyWsYQq5ZZh6jQBxvbz3pjbx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233157531100009 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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. Signed-off-by: Pierre Gondois --- .../ArmScmiDxe/ScmiPerformanceProtocol.c | 80 +++++++++++++++-- .../Protocol/ArmScmiPerformanceProtocol.h | 90 ++++++++++++++++--- 2 files changed, 155 insertions(+), 15 deletions(-) diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c b/ArmPkg/D= rivers/ArmScmiDxe/ScmiPerformanceProtocol.c index 0f89808fbdf9..1d87339209fd 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, latest version: + - 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 8e8e05d5a5f6..088182945a06 100644 --- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h +++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h @@ -14,7 +14,7 @@ =20 #include =20 -/// Arm Scmi performance protocol versions. +/// Arm SCMI performance protocol versions. #define PERFORMANCE_PROTOCOL_VERSION_V1 0x10000 #define PERFORMANCE_PROTOCOL_VERSION_V2 0x20000 #define PERFORMANCE_PROTOCOL_VERSION_V3 0x30000 @@ -79,6 +79,56 @@ 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; + +/// 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; + #pragma pack() =20 /** Return version of the performance management protocol supported by SCP. @@ -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 (#110038): https://edk2.groups.io/g/devel/message/110038 Mute This Topic: https://groups.io/mt/102175812/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 Wed May 15 12:20:17 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+110039+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+110039+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233157; cv=none; d=zohomail.com; s=zohoarc; b=awu4X3kegtPJqFsl2MtkEEZN6QL3Z0RWkKucnMQ08T56zqFAoFIUcb0c8ZqKRoi5MQOk5L8vh2aUHwEDUheTx8lTYxieGqHgSemwriwwGYUWdilGLg4POIJxscm8aJo3O25L8sAvSQe12MJO87pEPNY6bUuQCff8fdsZ4cU6rPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233157; 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=WXljyukuMscGC8FfFvrO9M1UBDKstmYf0xnwa2XbvtY=; b=jBB2X5A87PhO0Lh1KYAdt0IgVN5Sg+g+0y69L+6uY3cMdQX45ezfH7fp4Bd4DXeqWg2+A+/gcOUUxsEguMNS9QXmohHPangjryR18Lc8d8knF8JMshiKb9XtGN5mljPAW3rNEYfYEVFdh1Py6KPnB6fnbfwOK4lBPPHPaadvmLc= 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+110039+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 1698233157711906.3186123437338; Wed, 25 Oct 2023 04:25:57 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=xtzSD6fpSycUk5ezrSPtjb6yYzid0HPk7iKV93hppCQ=; 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=1698233157; v=1; b=KA0judaCOqa5jE4GlDEHJxxrEEHf4QkmDkpaaliHainI4y9Cq7bmdelCnvk2yepco3zVBP4u jErK3cV+DR7A4NK9oW1h8U/owMf4kiayseoscp5sRrq2YPIWQWmr3XWD4vONPj5To8tB4NcYDYC tgm40Eug40QhKtg8Wwo0sqxM= X-Received: by 127.0.0.2 with SMTP id ypO2YY1788612xxPINpZrkGK; Wed, 25 Oct 2023 04:25:57 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170923.1698233156902747924 for ; Wed, 25 Oct 2023 04:25:57 -0700 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 5F0CE1474; Wed, 25 Oct 2023 04:26:37 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DA9E93F7F4; Wed, 25 Oct 2023 04:25:54 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 03/11] MdePkg/Acpi64: Add _PSD/_CPC/State Coordination Types macros Date: Wed, 25 Oct 2023 13:25:32 +0200 Message-Id: <20231025112540.1654844-4-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: wyaXj9yJ6ySH0PdK4H2BI2Dpx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233159484100014 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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.4). Signed-off-by: Pierre Gondois --- MdePkg/Include/IndustryStandard/Acpi64.h | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h b/MdePkg/Include/Indu= stryStandard/Acpi64.h index 575ca0430c13..e3c128d7548d 100644 --- a/MdePkg/Include/IndustryStandard/Acpi64.h +++ b/MdePkg/Include/IndustryStandard/Acpi64.h @@ -2,7 +2,7 @@ ACPI 6.4 definitions from the ACPI Specification Revision 6.4 Jan, 2021. =20 Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
- Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.
+ Copyright (c) 2019 - 2023, Arm Ltd. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -17,6 +17,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_4_AML_STATE_COORD_TYPE_SW_ALL 0xFC +#define EFI_ACPI_6_4_AML_STATE_COORD_TYPE_SW_ANY 0xFD +#define EFI_ACPI_6_4_AML_STATE_COORD_TYPE_HW_ALL 0xFE + +/// +/// _PSD Revision +/// Cf. s8.4.6.5 _PSD (P-State Dependency) +/// +#define EFI_ACPI_6_4_AML_PSD_REVISION_V0 0 + +/// +/// _CPC Revision +/// Cf. s8.4.7.1 _CPC (Continuous Performance Control) +/// +#define EFI_ACPI_6_4_AML_CPC_REVISION_V0 0 +#define EFI_ACPI_6_4_AML_CPC_REVISION_V1 1 +#define EFI_ACPI_6_4_AML_CPC_REVISION_V2 2 +#define EFI_ACPI_6_4_AML_CPC_REVISION_V3 3 + /// /// ACPI 6.4 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 (#110039): https://edk2.groups.io/g/devel/message/110039 Mute This Topic: https://groups.io/mt/102175813/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 Wed May 15 12:20:17 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+110040+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+110040+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233158; cv=none; d=zohomail.com; s=zohoarc; b=VEtGV5crAKa+tVtq5kvEX+k/97l7SetlnHJHc/so/TJXyC4hEmDgC2kGlZZJAHiB9iT7qDRjppZKsSqy/gcpLGUfPBoDFwclovoBML1cdgPo/2oJO+xhDdjDS8RO30XYPuBU3O4UIg7Yr3+P0Dj8EMcvS4UfaTASxXUIul4yLBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233158; 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=THmYxofXxLugdCvFXv53BE6GtexY8+aWwHZ6fxnMI3Y=; b=ApHYgYX33dEAeppZ+F3Erbx2Co/sSxCGcvY1VWR6OctVwSvV4LKx6pGK+5yzwtuI9oOZKhQjJA/dHec37BHK6Wgs6+x/vBzodr2DBHTaGn/Up43PwgaLbU0EqNrcFceDLzUySC3RDI34GS5+f7ZE+V+qA6yPV9K/suE3nmNaUtE= 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+110040+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 1698233158301136.2600083990178; Wed, 25 Oct 2023 04:25:58 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=v5hx8Bbh0ts1HqnMpuO6u8w7GYPDX+D07QQOYFr8Aao=; 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=1698233157; v=1; b=vjMW9tGrgyOrbocL3ASqusVzp7insSgi/EpBe4pC7bH/2aeK2xMynq2OGmztBpMWQNWDBBsm nB/I6FeHXA4AbwFNpD5O9z+fDsDvBBfkOPesjVh+yaCf1m6UU4B35XUU6CDAs96lA2c+ZY8Zsw9 5HeJrGw5UduW/NF8xf2STyxU= X-Received: by 127.0.0.2 with SMTP id Uo6IYY1788612xt11hmPcv8a; Wed, 25 Oct 2023 04:25:57 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41099.1698233157424674874 for ; Wed, 25 Oct 2023 04:25:57 -0700 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 9E53A1476; Wed, 25 Oct 2023 04:26:38 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1D6BC3F738; Wed, 25 Oct 2023 04:25:55 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 04/11] DynamicTablesPkg: Use new CPC revision macro Date: Wed, 25 Oct 2023 13:25:33 +0200 Message-Id: <20231025112540.1654844-5-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: XeQtwGTL3N8RcTaRY7i74ZdDx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233159465100013 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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..c90f23c53f0e 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_4_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 (#110040): https://edk2.groups.io/g/devel/message/110040 Mute This Topic: https://groups.io/mt/102175814/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 Wed May 15 12:20:17 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+110041+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+110041+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233159; cv=none; d=zohomail.com; s=zohoarc; b=kWeb2Dripk8KvaDekNGhvJ0AOg2Bfh5gv7HLsDRMHA8QyB4/0S/V7i99Reh6TUouLGTV8IcIf/EKOK2DQEW0gglKpFGUjhB+P/mhR11nLzHNeXIDvH27sK9bphD4UxLNLLQIkagkI3Oq4yb2jI2Y2CfqOmRb4qzt+xtE+1L4QfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233159; 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=RS8L1S5tOdgm1s8P7ec0S0flHiOD59DKmbxbgOqU4tY=; b=kB/JP+CGp4+GgwZ4ZDRP5Xm63udmLuOCqvJ1IO9b1wfHGos4xMcv5jQFdlgpF2q9eWpU4eIefVTnT2FSPWdlZDXEsZOXIYaxScnAGE+mejAYOLqFzCWdnFgE1t8heP2rPFmjhs9jdK49FIItXMQ0SZrZCxmaPo09WC++rG5Jz5o= 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+110041+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 16982331596141023.0488338004801; Wed, 25 Oct 2023 04:25:59 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=qJPIfjlD2jLCbQ2r1Py0FJz0pNXHkrRk3bjpsxorTWs=; 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=1698233159; v=1; b=rJ1x8e+wfloZ7XNtHiK147+DSwB1sfUUEeb4ZCT/KmxWBef05QeXho2iUffEPNKgx8sWNQf6 4ev2ag+rx3yc9NIxsU9rSDLjaJXszpyKtqWowmxaJRqZ1oMiGPBaA2y/wpAB6qV2++L0oQpRUdz IcWW6Yeb+uW9DXCTGE6k5a3w= X-Received: by 127.0.0.2 with SMTP id 0nfoYY1788612xMymP3bneV7; Wed, 25 Oct 2023 04:25:59 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41100.1698233158709105709 for ; Wed, 25 Oct 2023 04:25:58 -0700 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 D48461477; Wed, 25 Oct 2023 04:26:39 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5C1343F738; Wed, 25 Oct 2023 04:25:57 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 05/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h Date: Wed, 25 Oct 2023 13:25:34 +0200 Message-Id: <20231025112540.1654844-6-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: Wc7UO6cibHjjLxYroCoXCsv6x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233161599100024 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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 19098609de4b..8199882f69fe 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 c90f23c53f0e..f63d9fee8c11 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 (#110041): https://edk2.groups.io/g/devel/message/110041 Mute This Topic: https://groups.io/mt/102175815/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 Wed May 15 12:20:17 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+110042+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+110042+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233160; cv=none; d=zohomail.com; s=zohoarc; b=ARwTWeyG2fqnR3JXYCI1sHLCDeoL101r/Ma/vHhnGG/WLC5HNOFBQCZsHNZu2bFB1hks2zBeNiLa1J03098Rn213aGM6cjiJP46rghQ9kCw+UkRynE1HrRdir/ROa/m4dZ1iIOYE1aDx6HpBsek1am1s5mwzmhd7urm3NuHksoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233160; 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=t2HYuyo0M36yLzKlrV9woBDiw1IA9tDDMRcvb6W6bWA=; b=Y6dLPSDp3x1ULvx3JvfchF1Q69lCI60dmzQyKtnsoALSVrRpcfe4C1kX/GqiObD+FXY8zTqOcXBcyw0/n6rm9iux7j56LinOPuYOQdQ0UU8CaZ9FBQlbyoE1KPsLfh4/JGYpytvT0/uDgTNPWIZ4j4ySWxVoMuZLvrnnQThSwMU= 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+110042+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 1698233160931555.8416542329272; Wed, 25 Oct 2023 04:26:00 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=XAAbfyKoB2swoeuVUHhP2szgjEUMB2Ldyg8u6gWHdnk=; 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=1698233160; v=1; b=ojnH8aA5B8jVf4wT7hR9Z+Blmgmca3uyvnXZCgIYwBwJ90hLUWJTULkCHFVfGPctQSEVNfR2 RktTjEF3H8spjCBDedcO1/R/MiR0zRtpaZT0CiknKSZo2fM2qqGnwikMvBzauUfXrOWot916JmP i/0KCiGMMDrEzcg0oQ9qmx9A= X-Received: by 127.0.0.2 with SMTP id 6rWqYY1788612xnR9XCq83Lr; Wed, 25 Oct 2023 04:26:00 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170925.1698233159915751643 for ; Wed, 25 Oct 2023 04:26:00 -0700 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 174C01480; Wed, 25 Oct 2023 04:26:41 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 92CDC3F738; Wed, 25 Oct 2023 04:25:58 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 06/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object Date: Wed, 25 Oct 2023 13:25:35 +0200 Message-Id: <20231025112540.1654844-7-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: GRAcdHvN3Usw6YL0GNnYMnDFx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233161510100023 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois Add an object describing _PSD information, cf. ACPI 6.4, 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 | 12 ++++++++++- .../ConfigurationManagerObjectParser.c | 11 ++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Include/AcpiObjects.h b/DynamicTablesPkg/Incl= ude/AcpiObjects.h index 8981c229544a..d3c23d8d4f2b 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.4, 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 8199882f69fe..ddd17fa45b1e 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
+ Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -71,6 +71,7 @@ typedef enum ArmObjectID { EArmObjPccSubspaceType3Info, ///< 46 - P= cc Subspace Type 3 Info EArmObjPccSubspaceType4Info, ///< 47 - P= cc Subspace Type 4 Info EArmObjPccSubspaceType5Info, ///< 48 - P= cc Subspace Type 5 Info + EArmObjPsdInfo, ///< 49 - P= -State Dependency (PSD) Info EArmObjMax } EARM_OBJECT_ID; =20 @@ -1297,6 +1298,15 @@ typedef struct CmArmPccSubspaceType5Info { PCC_MAILBOX_REGISTER_INFO ErrorStatusReg; } CM_ARM_PCC_SUBSPACE_TYPE5_INFO; =20 +/** A structure that describes a + P-State Dependency (PSD) Info. + + Cf. ACPI 6.4, 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 22b8fdb90606..b3ee12da8c4f 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -661,6 +661,15 @@ STATIC CONST CM_OBJ_PARSER CmArmPccSubspaceType5InfoP= arser[] =3D { ARRAY_SIZE (CmArmMailboxRegisterInfoParser) }, }; =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 { @@ -757,6 +766,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectPar= ser[] =3D { ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) }, { "EArmObjPccSubspaceType5Info", CmArmPccSubspaceType5InfoParser, ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) }, + { "EArmObjCpcInfo", 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 (#110042): https://edk2.groups.io/g/devel/message/110042 Mute This Topic: https://groups.io/mt/102175816/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 Wed May 15 12:20:17 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+110043+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+110043+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233161; cv=none; d=zohomail.com; s=zohoarc; b=XS8kDh03o71+veoX7nEBXO4lgPcnfDEuP5iLgMQ3H1Wnob+UNH5rCB/BuVnm8AAOZ+yxnesqHu/IKGUu37nAMGitQpOw4ro2xogIwm8kANBLifHdAfgEY2okHkhlBW4twWYZj/oWIWnYkzEPVBlF2xyt+OI44Mv8Bw/FjSfMIFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233161; 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=S1m2FhdXmgT6+jeI01YzwnPhAMtLVO9os4oq6TnOyEs=; b=bgIN5usOlafgScyDT0aAvJsCKRJ15KbZYRwOmc7V+mRWOsvKsfOEDRqY1pkK1YZL2ok76Vpzeez3Yo3Ecq9E0x4MAmn7rDmh1HZ21ltb0khnTpwtfpS37tFLlr5940zWzD1jrDOISq7dUwWlkMAWDDK5h4tvstbV7ZzKKSiKe4k= 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+110043+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 169823316198029.357323167458162; Wed, 25 Oct 2023 04:26:01 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=lZBWl0zBv+8rRYl5tNF6pdtBoH4wdzgYvo+0aKgNfzw=; 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=1698233161; v=1; b=SRtLvZJVJmSb9vZ1/wKGRdGL0HeywAQckdY5vdfq03KyyQBGk/M1aqAPHu4roQFa45Sn9y58 XHNE2A7wu+1B7Jei6aA8X8/qhJuxR1QBIQBVsn2QTrVf3kmOc2TvnDJFm+PV910SVoXhnrJC9q0 7Fhm05wc2MmAqZtjmVsTrhjs= X-Received: by 127.0.0.2 with SMTP id lViwYY1788612xAP12JquSlF; Wed, 25 Oct 2023 04:26:01 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41101.1698233161092840593 for ; Wed, 25 Oct 2023 04:26:01 -0700 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 4C65A2F4; Wed, 25 Oct 2023 04:26:42 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C91293F738; Wed, 25 Oct 2023 04:25:59 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 07/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object Date: Wed, 25 Oct 2023 13:25:36 +0200 Message-Id: <20231025112540.1654844-8-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: YiYtUYxpPiGGG8A6WxReMnY2x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233163493100030 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The _PSD object (cf. ACPI 6.4, 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 | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index ddd17fa45b1e..2a0ebe24bd04 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -204,6 +204,11 @@ typedef struct CmArmGicCInfo { i.e. a token referencing a CM_ARM_CPC_INFO object. */ CM_OBJECT_TOKEN CpcToken; + + /** 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 b3ee12da8c4f..a9f5c95c1039 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -83,7 +83,8 @@ STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser[] =3D { { "ProximityDomain", 4, "0x%x", N= ULL }, { "ClockDomain", 4, "0x%x", N= ULL }, { "AffinityFlags", 4, "0x%x", N= ULL }, - { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL } + { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL }, + { "PsdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", N= ULL }, }; =20 /** A parser for EArmObjGicDInfo. @@ -766,7 +767,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectPar= ser[] =3D { ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) }, { "EArmObjPccSubspaceType5Info", CmArmPccSubspaceType5InfoParser, ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) }, - { "EArmObjCpcInfo", CmArmPsdInfoParser, + { "EArmObjPsdInfo", CmArmPsdInfoParser, ARRAY_SIZE (CmArmPsdInfoParser) }, { "EArmObjMax", NULL, = 0 }, }; --=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 (#110043): https://edk2.groups.io/g/devel/message/110043 Mute This Topic: https://groups.io/mt/102175817/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 Wed May 15 12:20:17 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+110044+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+110044+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233163; cv=none; d=zohomail.com; s=zohoarc; b=cfNWP79vhDt2TqElD9fwNN7u8Gd4mFPxeHwZwCcYNUeQbl/uRQXIMFpnwtUTCwaPu1nCGvqhAEgX2BSFfdmvg4x79Uuih1A6QAO02yZWlE6n4pZ8FnwelQH7iUmsEw17DjhCDNhhO3pV+kaI8UNiCEeuPAxyP1negE6B688cIV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233163; 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=jbGhiLyKlYLhq6XTV9NKpdTkihIDGSAXixVQ5MtbBWk=; b=LB227a1d8las+Vqc27Nvpt5wjQLhgI+lnGUHyvyEnb3GTXRc0ig0hFuGbxHYk8j2JvbsRJKx2lCcFJiTwrXbzRybWc0deCux2l5XHzu9mUoIezp4/N/Gb7BSoRwCuSChNFuXlnqwnyC7d+oUvpAWkIjCOfYbpaYttBEey/AnhfI= 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+110044+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 169823316321869.6709301874929; Wed, 25 Oct 2023 04:26:03 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=15dHgEtE5pwIKSiflb/aMej20Vd4TVNnm6T6mAO+Rx0=; 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=1698233162; v=1; b=cxKtZ5gJxbB7N1yHqr/2SJnOUj+Sz4+nMgob77VeGmnSTqnIFturNsrgwjt/k2fDWS+Essam Gwqo/+C3pjDiHPOynTTKZaTkYoynyhnSOiOQ4u11mJrUP79/kOvELN9EQ7Mw3dyQV1FHwUU567u DhccZoPruHW+jiw47Ik0rTG4= X-Received: by 127.0.0.2 with SMTP id HD2iYY1788612xAA47spyIlS; Wed, 25 Oct 2023 04:26:02 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170927.1698233162355364593 for ; Wed, 25 Oct 2023 04:26:02 -0700 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 815F3C15; Wed, 25 Oct 2023 04:26:43 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0956E3F738; Wed, 25 Oct 2023 04:26:00 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 08/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD Date: Wed, 25 Oct 2023 13:25:37 +0200 Message-Id: <20231025112540.1654844-9-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: ydNltDCLecBRQFvqou195LSpx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233163482100029 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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.4, 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..8145ab70fa69 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.4, s8.4.6.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 f63d9fee8c11..f350083b148c 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.4, s8.4.6.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.4 specification + if (PsdInfo->Revision =3D=3D EFI_ACPI_6_4_AML_PSD_REVISION_V0) { + // NumEntries 5 per ACPI 6.4 specification + NumberOfEntries =3D 5; + } else { + Status =3D EFI_INVALID_PARAMETER; + ASSERT_EFI_ERROR (Status); + return Status; + } + + if (((PsdInfo->CoordType !=3D EFI_ACPI_6_4_AML_STATE_COORD_TYPE_SW_ALL) = && + (PsdInfo->CoordType !=3D EFI_ACPI_6_4_AML_STATE_COORD_TYPE_SW_ANY) = && + (PsdInfo->CoordType !=3D EFI_ACPI_6_4_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 (#110044): https://edk2.groups.io/g/devel/message/110044 Mute This Topic: https://groups.io/mt/102175818/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 Wed May 15 12:20:17 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+110045+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+110045+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233164; cv=none; d=zohomail.com; s=zohoarc; b=Rw54bMmLTth8wmIiy/5WUdWybJ88QZn04CWAIKCS9XtUkpKesfaRu4dfekwR36wLoIeuAHDxL+VGS8rCyOZv/szxua862ZdcOLR3M9WcN0aZW/rJuq1LIN4RkxMwq8nxBmC3gxHt+YjDQrTQnXmGbb3JxtYxFKyr0w6JbAKDh6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233164; 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=rwrsTit+EknNDBmXiOAbcVw3E6cmiFGE7NkYzCfd/gI=; b=fKlT40fM90OTWVCj06OPZ9Epooxt9vJi4D5I+JPNPfKaqJziUaqymKWEKyDRD7wcts4FltRdyQyxchIj2Z4deQMnopMV/Ia8gF5JqQM/PgEixR7mPt3p8ao3BZb/Y8kzs8AKvr1XbGupxeM146m2G4+cRqH0k7eri6eyx9eL7SA= 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+110045+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 169823316465050.94232379827349; Wed, 25 Oct 2023 04:26:04 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=gd7HnfypYoFII/B6WUBKm2nFbLnOJbd50FLm/DBHL6M=; 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=1698233164; v=1; b=sL8f7Xz8UgCmriNIBV23VEDvwzPKHNtLov2raIL2ciy58vnp2iVx3BpOT8smdCgRVqDv3kZ1 8+AtIPsnATYCKSLKkRIZBbo31F5hdb6oMLVgBC0nKes8rtbxQ0oUjK1zvUkTa1H/iNYIWREJtSZ +JS6k8kBReIe1ribe+Tq4i1g= X-Received: by 127.0.0.2 with SMTP id NLn5YY1788612xibtOI1eexY; Wed, 25 Oct 2023 04:26:04 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41106.1698233163613350245 for ; Wed, 25 Oct 2023 04:26:03 -0700 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 B88B9139F; Wed, 25 Oct 2023 04:26:44 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3FEF93F738; Wed, 25 Oct 2023 04:26:02 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 09/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator Date: Wed, 25 Oct 2023 13:25:38 +0200 Message-Id: <20231025112540.1654844-10-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: uuc9shYJOzReaE4xpAQzsdi8x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233165502100037 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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 | 98 ++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c index 6fb131b66482..9cebf57e8a46 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c @@ -1,7 +1,7 @@ /** @file SSDT Cpu Topology Table Generator. =20 - Copyright (c) 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -35,6 +35,7 @@ Requirements: - EArmObjProcHierarchyInfo (OPTIONAL) along with - EArmObjCmRef (OPTIONAL) - EArmObjLpiInfo (OPTIONAL) + - EArmObjPsdInfo (OPTIONAL) */ =20 /** This macro expands to a function that retrieves the GIC @@ -86,6 +87,16 @@ GET_OBJECT_LIST ( CM_ARM_CPC_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 @@ -239,6 +250,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: @@ -684,6 +764,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) { @@ -1126,6 +1214,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->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 (#110045): https://edk2.groups.io/g/devel/message/110045 Mute This Topic: https://groups.io/mt/102175820/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 Wed May 15 12:20:17 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+110046+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+110046+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233165; cv=none; d=zohomail.com; s=zohoarc; b=geCs/qmZjmdrBjIraqkykbzcrRRNLF/O0kulJxD+xhsO1W+DFcgZM7WPPPKRmwIcX7GLCwEzs9JwZnqlsw0njbzJ/V2l4GNITcR805oB7otcetSnvfoR/1BTuMbmJ2pLPrVfZUdNoaZXSF+3VyNHA/2/Xb7X1W61hiQfxgpP3vY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233165; 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=z9J01bvYLh6ZrO/+73KHupgOAU4HFVE73SX1it+gfZw=; b=HcCPeLfYq0tVHwU57YVBc8iwLMic804vv/IQDFpWuyoghhRv4kUjoScgFF5dIEhP0+16WdT93mavXj/i+/tteu6CreyLuJ667OXvvJmTB6hMUhW53bW4xNRt/HSoR32UmAiNefjEsSDHUABfDd53wuJtn20DcZb3eeeqFYpQcnQ= 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+110046+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 1698233165830460.508872053916; Wed, 25 Oct 2023 04:26:05 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Bpui4n336TUDE5+l6r3NmhrKatAVRBCnWzZfA4l9dfI=; 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=1698233165; v=1; b=IE0Dezw+0znjYzE1kjLjxt5WpEFP23Inxbs9bsq/2YKkk6b6Ov8OD66s4NmcbcwZ64T8l71G tf+7Pi/iGOvZa5uyQ9oFiTNgPn2DBw0VFtdbDo+s8jpM5y2RTap7YsowcHVSqUlxNmRlrsMJNzS XJ6VRz3ryHWPMmM49h2kiJns= X-Received: by 127.0.0.2 with SMTP id JUdRYY1788612xcWCwRaAeeJ; Wed, 25 Oct 2023 04:26:05 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170929.1698233164841915554 for ; Wed, 25 Oct 2023 04:26:04 -0700 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 187621474; Wed, 25 Oct 2023 04:26:46 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7708A3F738; Wed, 25 Oct 2023 04:26:03 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 10/11] DynamicTablesPkg: Add ArmScmiInfoLib Date: Wed, 25 Oct 2023 13:25:39 +0200 Message-Id: <20231025112540.1654844-11-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: 2fXF4zUAAHHzkjpwoku5DlHqx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233167573100043 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois 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 --- DynamicTablesPkg/DynamicTables.dsc.inc | 1 + DynamicTablesPkg/DynamicTablesPkg.dec | 3 + DynamicTablesPkg/DynamicTablesPkg.dsc | 1 + .../Include/Library/ArmScmiInfoLib.h | 33 ++ .../Library/ArmScmiInfoLib/ArmScmiInfoLib.c | 294 ++++++++++++++++++ .../Library/ArmScmiInfoLib/ArmScmiInfoLib.inf | 31 ++ 6 files changed, 363 insertions(+) create mode 100644 DynamicTablesPkg/Include/Library/ArmScmiInfoLib.h create mode 100644 DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.c create mode 100644 DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.= inf diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/Dyna= micTables.dsc.inc index 9d4312c4e87d..be40ebc4b472 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 + ArmScmiInfoLib|DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.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..26498e5fec53 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. + ArmScmiInfoLib|Include/Library/ArmScmiInfoLib.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..6ea86c9efdb0 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/ArmScmiInfoLib/ArmScmiInfoLib.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/ArmScmiInfoLib.h b/DynamicTab= lesPkg/Include/Library/ArmScmiInfoLib.h new file mode 100644 index 000000000000..8d3fb31df13c --- /dev/null +++ b/DynamicTablesPkg/Include/Library/ArmScmiInfoLib.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 +ArmScmiInfoGetFastChannel ( + IN UINT32 DomainId, + OUT AML_CPC_INFO *CpcInfo + ); + +#endif // ARM_SCMI_INFO_LIB_H_ diff --git a/DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.c b/Dyn= amicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.c new file mode 100644 index 000000000000..c23bff63bb6f --- /dev/null +++ b/DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.c @@ -0,0 +1,294 @@ +/** @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 +ArmScmiInfoLibConstructor ( + 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, "ArmScmiInfoLib 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 +ArmScmiInfoDescribeLevels ( + 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 +ArmScmiInfoGetFastChannel ( + 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 ArmScmiInfoDescribeLevels (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_4_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_4_S= YSTEM_MEMORY; + CpcInfo->DesiredPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->DesiredPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->DesiredPerformanceRegister.AccessSize =3D EFI_ACPI_6_4_D= WORD; + CpcInfo->DesiredPerformanceRegister.Address =3D FcLevelGetAddr; + + CpcInfo->MinimumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6_4_S= YSTEM_MEMORY; + CpcInfo->MinimumPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->MinimumPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->MinimumPerformanceRegister.AccessSize =3D EFI_ACPI_6_4_D= WORD; + CpcInfo->MinimumPerformanceRegister.Address =3D FcLimitsMinSet= Addr; + + CpcInfo->MaximumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6_4_S= YSTEM_MEMORY; + CpcInfo->MaximumPerformanceRegister.RegisterBitWidth =3D 32; + CpcInfo->MaximumPerformanceRegister.RegisterBitOffset =3D 0; + CpcInfo->MaximumPerformanceRegister.AccessSize =3D EFI_ACPI_6_4_D= WORD; + CpcInfo->MaximumPerformanceRegister.Address =3D FcLimitsMaxSet= Addr; + + CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId =3D EFI_A= CPI_6_4_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_4_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/ArmScmiInfoLib/ArmScmiInfoLib.inf b/D= ynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.inf new file mode 100644 index 000000000000..aad3f0fa7b83 --- /dev/null +++ b/DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.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 ArmScmiInfoLib + FILE_GUID =3D 1A7CDB04-9FFC-40DA-A87C-A5ACADAF8136 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D DXE_DRIVER + LIBRARY_CLASS =3D ArmScmiInfoLib + CONSTRUCTOR =3D ArmScmiInfoLibConstructor + +[Sources] + ArmScmiInfoLib.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 (#110046): https://edk2.groups.io/g/devel/message/110046 Mute This Topic: https://groups.io/mt/102175821/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 Wed May 15 12:20:17 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+110047+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+110047+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1698233166; cv=none; d=zohomail.com; s=zohoarc; b=id6wcMbK/lA9xmnBmIt1YdFh8rxmGm4ePbr+e0wTQmnbtmmRc0cw/fPlRilZwfnXKK35Dy3aRyL4TB6doS99jLHD0Ttj4rhHsPwvcP20GUlHmh7xIAv35nzEyj9p9xXLHiUxUCRVMgkxDmf2ITJAyOPcCBeLE4EfzZ71A5qJHOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698233166; 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=JbNqOC5KqQCguOdzVx3BDeYqFdQrS67aGs50vfj4f9I=; b=B+zvJvZnCAqQE+7ZgyZY0qpCMOf8RL0/cBZ5Zh4Ga3x/rgHNPByb5hc1drlRxz4vVZTQnYoL6hDKYRn9TTtD75EHNRudM8Xpm9ACtq0HYZ4dKSz9uo3Dbje754jU/NyPKWji+yT3gpGRd2Ly02ksdyO80u0iQxPLNJLiLXywiDI= 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+110047+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 1698233166910435.93092206699214; Wed, 25 Oct 2023 04:26:06 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=xHP0JmLhvohK6etuT3w8ZzLWW5PoaKejPYP5TGqJ6+8=; 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=1698233166; v=1; b=LyfkxllLbMAa0+gea9C+wxGt1TBCeEtXpoSl3ycLMREzqHMbT5R5PqlBBHDCaPY1mgM/e05w znuCsf3xjFixws197x/rCFliRsLPrNw2zGL4qovZ1SYv2N+zc69+/y6GlrMWOVJlcNs9t+t4H5f IR6uOmmQEe7ZF4DIBn8oc6Og= X-Received: by 127.0.0.2 with SMTP id tWtIYY1788612xK9yW98BjLC; Wed, 25 Oct 2023 04:26:06 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.170930.1698233166060262654 for ; Wed, 25 Oct 2023 04:26:06 -0700 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 4DDAD2F4; Wed, 25 Oct 2023 04:26:47 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA6573F738; Wed, 25 Oct 2023 04:26:04 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 11/11] DynamicTablesPkg: Remove check for _CPC field Date: Wed, 25 Oct 2023 13:25:40 +0200 Message-Id: <20231025112540.1654844-12-pierre.gondois@arm.com> In-Reply-To: <20231025112540.1654844-1-pierre.gondois@arm.com> References: <20231025112540.1654844-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: bAM2ZwHKpnl4W0tPPEW17Jexx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698233167499100041 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois When generating _CPC objects, some fields are mandatory. Some fields cannot be supported by a the Juno platform, which is used to test the _CPC generation. Therefore, don't prevent from generating _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 Signed-off-by: Pierre Gondois --- .../Common/AmlLib/CodeGen/AmlCodeGen.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index f350083b148c..423e64f12606 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3531,6 +3531,11 @@ AmlCreateCpcNode ( return EFI_INVALID_PARAMETER; } =20 + // The following fields are theoretically mandatory, but not supported + // by some platforms. Don't check them: + // - PerformanceLimitedRegister + // - ReferencePerformanceCounterRegister + // - DeliveredPerformanceCounterRegister if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) && (CpcInfo->HighestPerformanceInteger =3D=3D 0)) || (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) && @@ -3539,13 +3544,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 (#110047): https://edk2.groups.io/g/devel/message/110047 Mute This Topic: https://groups.io/mt/102175822/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-