From nobody Tue May 21 08:25:57 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+104116+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+104116+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292657; cv=none; d=zohomail.com; s=zohoarc; b=M/98MaQhsgoCI3lnfPFMelSPEBCBi1q/w14C5t2Ry5qEpb/hFeUHlg4rbPAHCWh6N9vEM1qAdNPxG/CEpyVvnEy1hGIcfNcnlxe/XMEb5y2cC+9tHX8wEjs3AQcIjobohL4cdYgxtzrX3kMLw5rH3iR0gn4U3V5f7ZRsb6d3GXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292657; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qe7I7CeSF9d6LWRdEWx+94gpA17BZ3pCcqhbfmWJ17E=; b=QgIQ+0UKUr7mFwkTmhvz7Xlp6Lt23qoLJzoJ/e74iQRFDAPrDX+9txrrnoAGSrmG1lNtBsDYOUqgvg5RObsBw90BJbA0K2lBoUOX/OpYMO1OQN/6wlwMEGIlTgO8+AEmo3VL/7gm9GxHX8k+z6JcR+8TVrJ2uji/zdYtt7Hj8vE= 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+104116+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 1683292657719902.7178967571092; Fri, 5 May 2023 06:17:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8sAPYY1788612x5IZ9GSxwDn; Fri, 05 May 2023 06:17:37 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.26789.1683292656445721877 for ; Fri, 05 May 2023 06:17:36 -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 4CC912F4; Fri, 5 May 2023 06:18:20 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D12933F64C; Fri, 5 May 2023 06:17:34 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION Date: Fri, 5 May 2023 15:17:11 +0200 Message-Id: <20230505131721.1310590-2-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: 15RM1RlnRuj7jNQJQgTL4ItPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292657; bh=FojXipnETyMGJDzO6sZHRR0Z281Vh5fjlrHAlXdyLvA=; h=Cc:Date:From:Reply-To:Subject:To; b=bngezT6nLmayQaijYT9R6lMJnlibK0spFi3CSs1uqZ9RQHnSpDWhA/vxsxAtfACAJq1 zKR2B2Xzk7I6O+dhanh0+/yuED1/cU9dCkKwObcxLUPGV0EM9SMsbDELeVC2flwzWL3yB o0p9xYyhcJ7OHaJX5xJtB0mgNz5wGU29MG4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292659057100002 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 --- .../Include/Protocol/ArmScmiPerformanceProtocol.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/= Include/Protocol/ArmScmiPerformanceProtocol.h index 7e548e4765c2..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 (#104116): https://edk2.groups.io/g/devel/message/104116 Mute This Topic: https://groups.io/mt/98705050/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 Tue May 21 08:25:57 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+104117+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+104117+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292658; cv=none; d=zohomail.com; s=zohoarc; b=Vxu/4Ld/yIe535nmcvzRauilOewZOoaSlBlz/QITxpoYAXtaTAvg9MCTPJqdDUcxd2Sg5PsjkoE2jVRcvhGYIQUUTInl3D59WIlLquAWZ+yM8HoHJ8Zt+HtGxi61sEdN/W1r8a28GGrEk27xI/uz89Mrg8kqVsfENs37YijEjkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292658; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=0So0lq2pl8EI+BG03zfybjZsFglKxHc7Y+aQRLFCqlE=; b=J0UWn4NyXcu0rihw9juwvILhKP8xgzilt8IGJELPOYMutsQBpCgdFBpsPKMQ43YHVhB8bp8+4Iuhmur4XI03w6rwNw/qM/2JfRf3A2TcEOyXxxYQCEZ3+Ym46b1FUdsZEC10QseQdMgU0OGW1LVkPUsWdGmiSIRmBV6tHeaqbjs= 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+104117+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 1683292658584160.3850077128618; Fri, 5 May 2023 06:17:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8EZlYY1788612xmweBYTIhst; Fri, 05 May 2023 06:17:38 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26914.1683292657721743273 for ; Fri, 05 May 2023 06:17:37 -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 AE190113E; Fri, 5 May 2023 06:18:21 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3E2EE3F64C; Fri, 5 May 2023 06:17:36 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support Date: Fri, 5 May 2023 15:17:12 +0200 Message-Id: <20230505131721.1310590-3-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: 2ZQIXLoykGQS2udaFywMntRhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292658; bh=jKuLVb6cfJR+LqAsGuWpLcQg2q5iIwiVq9u7yLjl094=; h=Cc:Date:From:Reply-To:Subject:To; b=hl9/7flaHOF65dIzH3RZhcbgjoPGroKkXMuawpz/m/3HMEmsxAbWk/i44PSM0arpm5G S2+cjhiL+tI+mdOiPWXy924BL0Cfm9AYRck5Dz7NBUe2VDj+iiFt024PRGwwylVLrkSV/ or3f09WVz8nuzvNemwU3Bo2KdOt4bhzYas4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292660194100010 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 (#104117): https://edk2.groups.io/g/devel/message/104117 Mute This Topic: https://groups.io/mt/98705051/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 Tue May 21 08:25:57 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+104118+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+104118+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292660; cv=none; d=zohomail.com; s=zohoarc; b=dgh/MY76rNzn+PDgBTc0/I0OIs8jHTomGdeFeLcAVj5IvMtgb9oMyG+JlrimF3TnT19FdJVV1L7TVHaFnJz7FdRRrpGMC3tJbjjcLnN18Hd9kUonEL3SC80xOjwiMhUUQDDYwKvg0XrIOtuspV/seQdEqwCzjWXYhhvOqLgyIZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292660; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Q6EMBaIa/64kTCHvgVEKNj/Z+FAeoOUiOK07jS1sWFU=; b=Ze6M2UQy0NWlj7tE6dW6ONv/W9zwpRAIpGj3uP1NDq+vd9014RbtTvGM29lb9edn9eE+2bCXnYs5v6IfCxK6PCCIUQWVhePLrBCMsJrieA8/hEQAKLofe9gqwAMiaE/wAbaARihcuIEPbWxTJi7jksyOfyti+kKMT1dM1wtwDt4= 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+104118+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 1683292660083424.5210874447441; Fri, 5 May 2023 06:17:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fQNoYY1788612xHBFmjfpqZZ; Fri, 05 May 2023 06:17:39 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26915.1683292659130447067 for ; Fri, 05 May 2023 06:17:39 -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 1B1C71477; Fri, 5 May 2023 06:18:23 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9F7823F64C; Fri, 5 May 2023 06:17:37 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 03/11] MdePkg/Acpi64: Add _PSD/_CPC/State Coordination Types macros Date: Fri, 5 May 2023 15:17:13 +0200 Message-Id: <20230505131721.1310590-4-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: ij7uKg0KhULTpVW4NGqbdaVux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292659; bh=NvgLrL0Jn7FkaSq+uzePCNstlwBZY+XwCz1GekVuniI=; h=Cc:Date:From:Reply-To:Subject:To; b=skjN1VUibHn8ygiR6nL5Zdab1/T7o/o61zuWGFtPuXANfVC9SQhyq+txLzmib3PEmyn b+/9DNkTwPgpkJVroxIH8IVVQE1vEVdn9f9Vdlu62CicTXM9TsWskJFfZoqd7WFWo5/d9 VqRJLa6VAL7mB+YrZBu3yyOayxFRHFLPl4k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292661422100013 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 (#104118): https://edk2.groups.io/g/devel/message/104118 Mute This Topic: https://groups.io/mt/98705052/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 Tue May 21 08:25:57 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+104119+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+104119+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292661; cv=none; d=zohomail.com; s=zohoarc; b=hZrE825HmQi9aWf0L2gPcTqqpUtK/NMZOJwxYlS2QFC78IsGPRlPqjOo+mmDy4eI8WoZj7n5RrfeCcsI8TKEEayws4O1P/Waz1W0Iwr8xoXZQ4GdL89W0/IpInSbu7B661mH+pfT8WsNXvqvuj4nBZum/D2n+gC0tRqrt+yfhDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292661; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aewEGqytYICop2vG98TesJnuOzFQIsxRGrZVWF7OVGQ=; b=fgUO/AnOjDnLWMePiolNKCz012wzPEzxMPIuxofe96aMXtrZOF1HlfwThRDCLxRq/vhmSRJX1tuI0pqNmyZfsRCNEStmKL2+inJV6+tg70abZcaRLUUDfOJxo5/NDEPK5zUyY2yr0DM1L9aq+yIqIS1uxyJI4SSM8nBvkWYxvhY= 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+104119+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 1683292661377764.8842593415692; Fri, 5 May 2023 06:17:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cttzYY1788612xc46HwdQJVv; Fri, 05 May 2023 06:17:41 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.26793.1683292660554991433 for ; Fri, 05 May 2023 06:17:40 -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 84BFE1480; Fri, 5 May 2023 06:18:24 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0BD403F64C; Fri, 5 May 2023 06:17:38 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 04/11] DynamicTablesPkg: Use new CPC revision macro Date: Fri, 5 May 2023 15:17:14 +0200 Message-Id: <20230505131721.1310590-5-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: fc9mDJlSATh7lIsSKIdpPgUUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292661; bh=DofU2aGwqqyqwnIIAVYHDkm9PChujOYRvypnWe6yZCE=; h=Cc:Date:From:Reply-To:Subject:To; b=MWZp8TSHxupboTjwNoxsZW7msBEYIWZ6hqZSuyEPnH0EODxQTnSX1QHzsUDzwkiyzL1 CEONBrpMprK+ipJ9NokSRG/r4uqdswjn7bHdpGw+hYAU9BgzPeDZ4psvWGc0o0IugYSR8 bnTPZYk+x1nfBnKhDtq+1QwxoOVmEPfQOHs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292663054100016 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 0b223379fa4b..0d1b959b74a5 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3083,7 +3083,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 (#104119): https://edk2.groups.io/g/devel/message/104119 Mute This Topic: https://groups.io/mt/98705053/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 Tue May 21 08:25:57 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+104120+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+104120+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292663; cv=none; d=zohomail.com; s=zohoarc; b=VUohrn89oBfRJtrlpG4dCv5OVNLgRJng2/bceKWgVwykRd0z4gU/FLKAyGJDIO+phDrxnMQvT6F0lk8iCqJTuKFt3/o+y0vZpQlq3bHEFKU/izBF/N0SsYrZgZL6FAvXQ+E12QTP+cpAiIpIRQaV3AG3o84w03JRRPqi/NGvFTs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292663; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4mvwQpOA+ZfH8VWCB5UU4ZB6/TqllEoIuNS2cjk+1Fc=; b=EV863Ze1zwiA0Gb04AGnLilujQ7EXjCq4I34rf/xXt0BHcXWZmYW7p33zH3S+lCTqPxuhm8IGe2iqZLudQsChZsZEBw59eshL24Mp9mhzO6fhRtJpazLlNKgEm6wueVwOGzGK3jlEJAJlZYQ+JoVY2BlSx3DANqDXgeiIU0PkSs= 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+104120+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 1683292663245521.4470204061523; Fri, 5 May 2023 06:17:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PrHpYY1788612xqpTu9tTOGr; Fri, 05 May 2023 06:17:42 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26919.1683292661874453618 for ; Fri, 05 May 2023 06:17:41 -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 E5AB814BF; Fri, 5 May 2023 06:18:25 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 759FE3F64C; Fri, 5 May 2023 06:17:40 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 05/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h Date: Fri, 5 May 2023 15:17:15 +0200 Message-Id: <20230505131721.1310590-6-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: EsefvoTfQp9F7yJz5PnWiIsIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292662; bh=sHmZH+9/6uKNXwr7kq8jYBxzQXmah2XdPlKv3NgO10I=; h=Cc:Date:From:Reply-To:Subject:To; b=oAIOuO1IQ5y5f5Lz6qUhzBhUosB701cf8T+QbJqkYuo43SnDIV8sQ0N4ufH8+lVKHmk bqPRhNq2+wHpssFzc5QXt50shTw7//oJVwE4FJOSCdbWjdRFvieWetIir4j9+DW0itelm mASNSTqUfU8b3kVf9p0SSmi9LxIqwZ2fxUs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292663515100020 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 9210c5091548..d1426b43fad3 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 0d1b959b74a5..2147c152f484 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 (#104120): https://edk2.groups.io/g/devel/message/104120 Mute This Topic: https://groups.io/mt/98705055/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 Tue May 21 08:25:57 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+104121+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+104121+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292664; cv=none; d=zohomail.com; s=zohoarc; b=KxEHsjreccy2O0CrRKA8CXGajW/8VZCwyVF/enBYWsUpHxdhQOdHX8QKa5VyCJPU5e7e/qHVL3XkEsOcToYfxeCMgea6G2tznusks4YbVyGXLneLukgZ+ynORef5S6xzRfJUwZCx93ZVNQv74F97B3ltZUiORrLOLivR1dZVtfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292664; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=XyNCJLuPee7mGY2o2Ez0DhsMm7hQyQ+gpc5L2L5M/xg=; b=eXc31GUddMKz5aN/zRNYBQHryi/sqhspqbTVUo6+gFxCDZ5JDHcIqLYSDMb5fT3wNrIlxEC0Q0KRwS5NszSbs5HCePOA8GMmPPLbfo0/C4OZvY+WbhLVYa6wlED/9nE/Ryv17x/Z00rna1HMVWzOIIYq7LZl7jHe6VPUiJQtJD8= 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+104121+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 1683292664289756.8383467304947; Fri, 5 May 2023 06:17:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9LfbYY1788612xmx9nsWl1HT; Fri, 05 May 2023 06:17:44 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26920.1683292663422761073 for ; Fri, 05 May 2023 06:17:43 -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 52F641FB; Fri, 5 May 2023 06:18:27 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D72A63F64C; Fri, 5 May 2023 06:17:41 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 06/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object Date: Fri, 5 May 2023 15:17:16 +0200 Message-Id: <20230505131721.1310590-7-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: MCZUskJThqlc0ZAf6Diwzm5cx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292664; bh=Wgch7c1RyB+4p6xXdDb4xCCXNkkhEW63hz3S0AiXEaQ=; h=Cc:Date:From:Reply-To:Subject:To; b=b8L9BXg5zjMEOJ8p4i8aUah7tZ8sOpWj5RxV/4Ov+V9QbPvwOW/rE0Pqobgstp2VLy1 T2ayGCVwK4DQ8Wh2dwN0LrVSqUBQcbuY9/y0Tcxdktget1XEE5ZGAG3nYkfZtqj+9amJu 972fCMJzUXgvYF8kQg9PWtvPH/zGAd/yB2I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292665529100027 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 99d6032510a5..c8c2554a9f44 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -637,6 +637,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 { @@ -733,6 +742,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 (#104121): https://edk2.groups.io/g/devel/message/104121 Mute This Topic: https://groups.io/mt/98705056/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 Tue May 21 08:25:57 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+104122+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+104122+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292665; cv=none; d=zohomail.com; s=zohoarc; b=WZ4IEd1Uh6uc90ZN7RKWalZ0wkbz5HizH5lrz81Sy+vOH5Rj159+CV6u4hG+k39OUBhY0vmt348Sxa63nuyLh2mRc7q+EMvsB2Or5tzpJZn/n+sGSxQFL8lFUbAv3mvR1xRxNUlEMFr1YcWff/EX/VHLNoziqcnhwHxPylMMDQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292665; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=1FhzA/A2jk8yJUStqQfy8OBml5CkE6ZP+gfcU0Zw6kc=; b=bLUYO6xbyhNj+pnOIDZZIlLGyzEZdYv6cRaKZtwEjwLUxaMwpbArC9XM1aFQRdCxpTRQTQBijN91dW3z4CqCntkX8oJVPfDPauoDUtWsyw/h4jLXz3XkMUwOoOvNJQO2wL/veWazPgsRNk/KTYciGEOi/P6uDwlxeP88YCOCv9g= 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+104122+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 1683292665753921.7053691818634; Fri, 5 May 2023 06:17:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rrGYYY1788612xY8Gq9JI6gi; Fri, 05 May 2023 06:17:45 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26924.1683292664734958993 for ; Fri, 05 May 2023 06:17:44 -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 B46A0113E; Fri, 5 May 2023 06:18:28 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 448403F64C; Fri, 5 May 2023 06:17:43 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 07/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object Date: Fri, 5 May 2023 15:17:17 +0200 Message-Id: <20230505131721.1310590-8-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: OpmEMgI7vwPYfFK3GXKhbCUFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292665; bh=33CpIyyp0i02wM+ByHBugi1z83csOQCHRI+vQvJRNF0=; h=Cc:Date:From:Reply-To:Subject:To; b=gbFTtYPUFUgJsBqhX04H9RQBnE3J5BUYoFmKGa/dGbsOH6lsfl5RmWAFBSGoWJv0EQb YEmrt8v0v6nyR3NFUC3z8aIs1DfD6DNW6u9aR8nKZnyymBnzzyzoIJnrswj677S2LsFUM f1s+ClNZHImbZaNJ1UBgsAoPDuxLu7BCjFg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292667484100032 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 c8c2554a9f44..05c49dffc6f6 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -59,7 +59,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. @@ -742,7 +743,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 (#104122): https://edk2.groups.io/g/devel/message/104122 Mute This Topic: https://groups.io/mt/98705058/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 Tue May 21 08:25:57 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+104123+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+104123+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292667; cv=none; d=zohomail.com; s=zohoarc; b=D5eg2BJLfFvOWTL7ew1hkzO5lBEDv2dwxm4gxja+POw+PHYSJ3PJ2VcNpApXQ7y8R37y1P53eQjc6PFP+3V5ebrMPKa2kXeCtq+jkqJ3ePJsuxCLQkP04vONJiajZOXjPIyihkawQHwV51Z35cNi4iNpMOh3MYzQP6ZJl2RbdGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292667; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=T7ywfzBQIC8jlLOj5m5tUMQ0nbMSax1nyvBDqHIEWwY=; b=dsJ8kKEMK2O3aY5eO4hk40/WtcI+9nT/3q6hp/7MNZV7Oeqniq09c9sDgOOZKHIg+IfpqXvSfAFHYZWGV5hICED5B06Fh6hThdRzGmNwquZY3NQGwGJZLPIVGO46OZrJVQlEgs1v67PztSnKKWs67HJDaZfof2m96SxSBohYa6s= 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+104123+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 1683292667215541.1333990123223; Fri, 5 May 2023 06:17:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Zc1lYY1788612xjPA4WgO7mX; Fri, 05 May 2023 06:17:46 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.26797.1683292666067639133 for ; Fri, 05 May 2023 06:17:46 -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 1FEED2F4; Fri, 5 May 2023 06:18:30 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A3E1D3F64C; Fri, 5 May 2023 06:17:44 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 08/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD Date: Fri, 5 May 2023 15:17:18 +0200 Message-Id: <20230505131721.1310590-9-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: rw4TSYWOf1e6PGxaEPgaoC2Lx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292666; bh=rxjSGEPGpAcAQkyiDqYMhSDbwYP7NxHtuXX939rPGi0=; h=Cc:Date:From:Reply-To:Subject:To; b=KXbHZWillqygBI9k4vC/mRAc71BUu4GD75/ph0mE6JLFecRcucobXCSIqpe2FHZTy/3 86cyZL6z/MjR4MZKDP1T+bAL+9T2w6NtRwtI+tKb+F2dmyim/hdKfFWFSuDrFTAy4zYkR nldNZaeD3zC6zHS3pguBz+8q3cVU3ibhoHM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292667458100031 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 d1426b43fad3..bbb9e965468c 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 **/ @@ -1390,4 +1390,37 @@ AmlCreateCpcNode ( OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL ); =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 2147c152f484..a82edab35647 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 **/ @@ -3325,3 +3325,189 @@ error_handler: AmlDeleteTree ((AML_NODE_HANDLE)CpcNode); 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 (#104123): https://edk2.groups.io/g/devel/message/104123 Mute This Topic: https://groups.io/mt/98705060/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 Tue May 21 08:25:57 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+104124+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+104124+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292668; cv=none; d=zohomail.com; s=zohoarc; b=nTBxYCHbz8V8iOyO+x0sa46ZdfqTjtV9k2R+OuZo8Eh5CsGAEPlVHxPe6n2Xkh82AuTc5ZqVnrnqoCBxT6ByrZb4Qz0RY5+3qawf1eQd/2Evntoj/CoOpRQiW3FqxkMZXiY06tAgJtDxpaRgeCFbRW6fqJ4lUVOCp+NXIxT8wqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292668; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=J1vyBct7k4lJzwuBVhn2qHZArFU9+2QGHPRYFf9SGzs=; b=lYd6VV6MCln356Tjjbmj4o0zzYdXgKi4UvM7I86NbN24qGgGuwRn3iIwmzElIdLRf6kRpNS2Ic92QQQKWiaJGMoeEvA0H6PKOcaw14RChUTy7OOcB6jsSS80x2KtPKj5NyGVevN71wS5b7NvnFbEPFEaSajndn6c4hZ+kN9i2K0= 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+104124+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 1683292668534327.0577834506454; Fri, 5 May 2023 06:17:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jb8SYY1788612xcOqEH5cFyF; Fri, 05 May 2023 06:17:48 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26930.1683292667507844474 for ; Fri, 05 May 2023 06:17:47 -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 7FF611477; Fri, 5 May 2023 06:18:31 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0FD063F64C; Fri, 5 May 2023 06:17:45 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 09/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator Date: Fri, 5 May 2023 15:17:19 +0200 Message-Id: <20230505131721.1310590-10-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: sLmTISIE7IFVFGVUpvSutdIgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292668; bh=RJTE++ttNLbUYN6r5WLfMgNst2RGLYMkpJm7Q3xcGSE=; h=Cc:Date:From:Reply-To:Subject:To; b=Ztt04axd1tSs/+Er5vvhKCM3UF6/kyyUBdIcia3GS25DJ6fOWzrlfTRuIEANDgKwMYc FRbLchJQA90wXPhK52oVW7qNkwJT+2JDuHDxKxViOXDWAiFmRRKHdjrM/89EhZBw+Bp9n TspfTptPsqsnKtFzTPkebSc+xbdW6TCOrSA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292669484100037 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 (#104124): https://edk2.groups.io/g/devel/message/104124 Mute This Topic: https://groups.io/mt/98705063/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 Tue May 21 08:25:57 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+104125+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+104125+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292669; cv=none; d=zohomail.com; s=zohoarc; b=ClQ38RIb2Dafw7ptJxo89WTfhnT8Kv5xsyGZYSwvzK9wtGQEgjOHnC8gJmoDQVfWAATK7ayZLMvwDpduxs22k6MPbvQs5U54HIDaDWhTNnruvlxJR/NOfE1mB27EZAWY9w7zbIc/6uJZZPkA59k6efmy03xAc9jMOzbrcsFWkDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292669; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=LI0AUImpF3oc4Kys4uMIxpwmv/xUJ1aveAyZWniC/Uc=; b=NOZhj3F0N5QrP0IfN7T/Kqpkw2y6dy3+fJDGCrgORA9fM+6wx7iJ0ASlmcUEmty0f+BMjEGgbb0h9ZK+oFKiiQ3NODqPppeeliyXSXI8pUbb+6IXmEw0+UmbQb5ikeE/i236w14Nl8CqZYg2Cj7U8Pyt23ZsHRf/9gW9+UHWK9c= 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+104125+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 1683292669954669.832445906502; Fri, 5 May 2023 06:17:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YFBaYY1788612xvl1eI6EQZB; Fri, 05 May 2023 06:17:49 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26932.1683292669050400795 for ; Fri, 05 May 2023 06:17:49 -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 0ABF31480; Fri, 5 May 2023 06:18:33 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6FBE53F64C; Fri, 5 May 2023 06:17:47 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 10/11] DynamicTablesPkg: Add ArmScmiInfoLib Date: Fri, 5 May 2023 15:17:20 +0200 Message-Id: <20230505131721.1310590-11-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: 2CHVLhjrHmUMUlSuUDQ8nsj8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292669; bh=Z6OvWiRw8ZLveOCr3RwlTPV0nBuuVcSWIdcV+9lpAkM=; h=Cc:Date:From:Reply-To:Subject:To; b=qjxPnj4UTWfDjZp93EAw93QAKmaBU7OJXgKMkIFG6fLLE+Jabp21xlV+yjih+HLTDJ1 GkY1ASOlMxUHSRxPR6e4pR51cybpildC8mcaZ9qrdjntdey4XWQX4sfwSBZ1C3Weq0f+e foK8wXWm/FZqV7+0cKmPNHuayBnbDj3N6u0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292671105100041 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 (#104125): https://edk2.groups.io/g/devel/message/104125 Mute This Topic: https://groups.io/mt/98705064/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 Tue May 21 08:25:57 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+104126+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+104126+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1683292671; cv=none; d=zohomail.com; s=zohoarc; b=YbkNi5UVJmYpjxsWyyYBtXkZnXzDGAGT2RUBsTd4DYA4dL0Y62Yr/N037uY0MGvs2rNENh6ftm+WTLOE09x1tmwQTbHthEMORVxFupmJmxO8qbSMWj964OJbMdWqloWZbKodOmnuvVExJh/ztFSPzeNX9XtSoy6R5xpeiUH0ufI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683292671; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PMD4RQ4x/tWulWlSMpREJSDqMVumSvlrainpki3cF5U=; b=DU375skjAYTBQ63b6ncofPis6+Khyx4oPYCkNaovj2KtEM91ZIV61cAqaw5AiSXmXBGtLc+TcFOnNHSZycot66FG6Yuyt6oAGcYy+aAUmc9PjFm+rxJ0kONh8+Hl8Z7L0CBpH2gOVVA4c25MEFhHPbo+hf2T8PvqjXN+sZcNqr4= 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+104126+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 1683292671531840.7480722288659; Fri, 5 May 2023 06:17:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VwhsYY1788612xyappP8VqjI; Fri, 05 May 2023 06:17:51 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.26933.1683292670376578457 for ; Fri, 05 May 2023 06:17:50 -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 6B1141FB; Fri, 5 May 2023 06:18:34 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.110]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EED273F64C; Fri, 5 May 2023 06:17:48 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v1 11/11] DynamicTablesPkg: Remove check for _CPC field Date: Fri, 5 May 2023 15:17:21 +0200 Message-Id: <20230505131721.1310590-12-pierre.gondois@arm.com> In-Reply-To: <20230505131721.1310590-1-pierre.gondois@arm.com> References: <20230505131721.1310590-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: vnz2pOXTk0esh5iVzYBrsicfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683292671; bh=cfDRLapn45bURQ0Ceyoba9ndjpHNlV9F6oTWKiKGKNA=; h=Cc:Date:From:Reply-To:Subject:To; b=TJOLX+j3tOP9q4tGbsWpPAJNfv5YMwji8Eg17FYgWgtHgEzlLgdS6entkw3eOWqV0Fd gVgsmlc5wG74dXWyiUm/Ppx67eBjOLocz36fjJcW0aXWKWbUYiJvJYocZvW13vcZDu+me 3Ynd7jC2GI0VB1V/7eM0BM9aBFcdHtabQ84= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683292673487100047 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 a82edab35647..c585784b095b 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3091,6 +3091,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) && @@ -3099,13 +3104,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 (#104126): https://edk2.groups.io/g/devel/message/104126 Mute This Topic: https://groups.io/mt/98705066/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-