From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id DDF88740032 for ; Thu, 9 Nov 2023 09:59:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hx/blGLwWg6TW1KXEY8mU/4oE++4vGrQIP9uisDjry0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:From:To:Cc:References:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699523945; v=1; b=FT0tnSeK0CIf1c9+9LJ9v/L3FmQ/wlHtOMcdWGHimSJ39n+t+nMcE6zTd0K2X9ZMzFTUfvUT NDDUHCv/xG6vSIR1Du8EO5xltSgk1JzC8Qs2nlegMFO1UnhuGaFuNnmXXhI4GFbIzVUWIifFy9s gsapCCmNHPC9c0LLWkYZV31Y= X-Received: by 127.0.0.2 with SMTP id MSE2YY7687511xhUoB9ZbYy7; Thu, 09 Nov 2023 01:59:05 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.117969.1699523944769459289 for ; Thu, 09 Nov 2023 01:59:04 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D007412FC; Thu, 9 Nov 2023 01:59:48 -0800 (PST) X-Received: from [10.34.100.114] (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5679D3F703; Thu, 9 Nov 2023 01:59:03 -0800 (PST) Message-ID: <9b023970-ea98-4c7b-b7e3-98b44f391d97@arm.com> Date: Thu, 9 Nov 2023 10:58:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v2 10/11] DynamicTablesPkg: Add ArmScmiInfoLib From: "PierreGondois" To: Leif Lindholm , devel@edk2.groups.io Cc: Sami Mujawar , Ard Biesheuvel , Michael D Kinney , Liming Gao References: <20231025112540.1654844-1-pierre.gondois@arm.com> <20231025112540.1654844-11-pierre.gondois@arm.com> In-Reply-To: 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: G1gY2Ud6s4qGkHmgztjgjY90x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FT0tnSeK; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hello Leif, On 11/2/23 11:20, Pierre Gondois wrote: >=20 >=20 > On 10/26/23 13:03, Leif Lindholm wrote: >> On Wed, Oct 25, 2023 at 13:25:39 +0200, PierreGondois wrote: >>> 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. >> >> Couple of questions: >> With a generic name like ArmScmiInfoLib, does is belong in ArmPkg or >> MdeModulePkg? >> >> Or if it's more tightly integrated with DynamicTablesPkg (not >> blatantly obvious from a quick skim below), should that be reflected >> by the library name? >=20 > The library is tight to the DynamicTablesPkg as it produces DynamicTables= Pkg > specific objects. It uses the SCMI interface to fetch information from th= e SCP. > The ScmiProtocol resides in the ArmPkg, thus the name. > Does the name 'ScmiInfoLib' sound better ? Should I keep ArmScmiInfoLib / ScmiInfoLib ? Also I'm not sure if there is a change required to: [PATCH v2 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION regarding the spec. reference, cf. https://edk2.groups.io/g/devel/message/1= 10515 Regards Pierre >=20 >> >> / >> Leif >> >>> 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/ArmScmiIn= foLib.c >>> create mode 100644 DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiIn= foLib.inf >>> >>> diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/= DynamicTables.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/AcpiHe= lperLib.inf >>> AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf >>> + ArmScmiInfoLib|DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLi= b.inf >>> SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupport= Lib/SsdtPcieSupportLib.inf >>> SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialP= ortFixupLib/SsdtSerialPortFixupLib.inf >>> TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/Tabl= eHelperLib.inf >>> diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/D= ynamicTablesPkg.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 SCM= I. >>> + ArmScmiInfoLib|Include/Library/ArmScmiInfoLib.h >>> + >>> [Protocols] >>> # Configuration Manager Protocol GUID >>> gEdkiiConfigurationManagerProtocolGuid =3D { 0xd85a4835, 0x5a82, 0= x4894, { 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } } >>> diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/D= ynamicTablesPkg.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/SsdtPcieSupport= Lib.inf >>> diff --git a/DynamicTablesPkg/Include/Library/ArmScmiInfoLib.h b/Dynami= cTablesPkg/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 fro= m >>> + 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= /DynamicTablesPkg/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 = Control >>> +*/ >>> +#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_LEVE= LS >>> + command. The list of discrete performance states is returned in a bu= ffer >>> + 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 f= reed by >>> + the caller. >>> + @param[out] LevelArrayCount If success, contains the number of state= s 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 fro= m >>> + 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, &LevelC= ount); >>> + 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_= REVISION_V3; >>> + CpcInfo->HighestPerformanceInteger =3D LevelArray[LevelCount= - 1].Level; >>> + CpcInfo->NominalPerformanceInteger =3D DomainAttributes.Sust= ainedPerfLevel; >>> + CpcInfo->LowestNonlinearPerformanceInteger =3D LevelArray[0].Level; >>> + CpcInfo->LowestPerformanceInteger =3D LevelArray[0].Level; >>> + >>> + CpcInfo->DesiredPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6= _4_SYSTEM_MEMORY; >>> + CpcInfo->DesiredPerformanceRegister.RegisterBitWidth =3D 32; >>> + CpcInfo->DesiredPerformanceRegister.RegisterBitOffset =3D 0; >>> + CpcInfo->DesiredPerformanceRegister.AccessSize =3D EFI_ACPI_6= _4_DWORD; >>> + CpcInfo->DesiredPerformanceRegister.Address =3D FcLevelGet= Addr; >>> + >>> + CpcInfo->MinimumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6= _4_SYSTEM_MEMORY; >>> + CpcInfo->MinimumPerformanceRegister.RegisterBitWidth =3D 32; >>> + CpcInfo->MinimumPerformanceRegister.RegisterBitOffset =3D 0; >>> + CpcInfo->MinimumPerformanceRegister.AccessSize =3D EFI_ACPI_6= _4_DWORD; >>> + CpcInfo->MinimumPerformanceRegister.Address =3D FcLimitsMi= nSetAddr; >>> + >>> + CpcInfo->MaximumPerformanceRegister.AddressSpaceId =3D EFI_ACPI_6= _4_SYSTEM_MEMORY; >>> + CpcInfo->MaximumPerformanceRegister.RegisterBitWidth =3D 32; >>> + CpcInfo->MaximumPerformanceRegister.RegisterBitOffset =3D 0; >>> + CpcInfo->MaximumPerformanceRegister.AccessSize =3D EFI_ACPI_6= _4_DWORD; >>> + CpcInfo->MaximumPerformanceRegister.Address =3D FcLimitsMa= xSetAddr; >>> + >>> + CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId =3D E= FI_ACPI_6_4_FUNCTIONAL_FIXED_HARDWARE; >>> + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitWidth =3D 0= x40; >>> + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitOffset =3D 0= ; >>> + CpcInfo->ReferencePerformanceCounterRegister.AccessSize =3D A= RM_FFH_REFERENCE_PERF_COUNTER_REGISTER; >>> + CpcInfo->ReferencePerformanceCounterRegister.Address =3D 0= x4; >>> + >>> + CpcInfo->DeliveredPerformanceCounterRegister.AddressSpaceId =3D E= FI_ACPI_6_4_FUNCTIONAL_FIXED_HARDWARE; >>> + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitWidth =3D 0= x40; >>> + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitOffset =3D 0= ; >>> + CpcInfo->DeliveredPerformanceCounterRegister.AccessSize =3D A= RM_FFH_DELIVERED_PERF_COUNTER_REGISTER; >>> + CpcInfo->DeliveredPerformanceCounterRegister.Address =3D 0= x4; >>> + >>> + // SCMI should advertise performance values on a unified scale. So f= requency >>> + // 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/DynamicTablesPkg/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 >>> >>> >>> >>>=20 >>> >>> -=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 (#110962): https://edk2.groups.io/g/devel/message/110962 Mute This Topic: https://groups.io/mt/102175821/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-