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 EBFB17803DF for ; Thu, 9 Nov 2023 11:26:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cWCt4Bt/XM+o1qLp3N+dUCmBxJ6Rd/b1KtFGdPQqVVI=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1699529202; v=1; b=U9GA5wPG54pP6jriYZx1exAHzE+zHPF69Y8zHaZzL6NmnX1RFbKro7Naan1AhiUmu7eezDIy KoGo0UM8/B1W374vyDY/hFHissw+2QT4Ms4E3/ctu0R3Pn3n2syXTWcQ+RV3l9h9Z64+zCplxDP yN7UY1/Q0SRWr8mJ0XUL0zQg= X-Received: by 127.0.0.2 with SMTP id waAoYY7687511x3QMxytVqcK; Thu, 09 Nov 2023 03:26:42 -0800 X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.119464.1699529201873544687 for ; Thu, 09 Nov 2023 03:26:42 -0800 X-Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A96STCY032226; Thu, 9 Nov 2023 11:26:31 GMT X-Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u8ka19qxr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 11:26:30 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3A9BQTdr025246 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 Nov 2023 11:26:29 GMT X-Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Thu, 9 Nov 2023 03:26:27 -0800 Date: Thu, 9 Nov 2023 11:26:23 +0000 From: "Leif Lindholm" To: Pierre Gondois CC: , Sami Mujawar , Ard Biesheuvel , Michael D Kinney , Liming Gao Subject: Re: [edk2-devel] [PATCH v2 10/11] DynamicTablesPkg: Add ArmScmiInfoLib Message-ID: References: <20231025112540.1654844-1-pierre.gondois@arm.com> <20231025112540.1654844-11-pierre.gondois@arm.com> <9b023970-ea98-4c7b-b7e3-98b44f391d97@arm.com> MIME-Version: 1.0 In-Reply-To: <9b023970-ea98-4c7b-b7e3-98b44f391d97@arm.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: 8WYb88q0VYdYaSYlthyBmekDfGcMdbAv X-Proofpoint-GUID: 8WYb88q0VYdYaSYlthyBmekDfGcMdbAv 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ghTyoeaCXQeGRQAx02mvFXg3x7686176AA= Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=U9GA5wPG; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.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 On Thu, Nov 09, 2023 at 10:58:58 +0100, Pierre Gondois wrote: > Hello Leif, > > On 11/2/23 11:20, Pierre Gondois wrote: > > > > > > 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? > > > > The library is tight to the DynamicTablesPkg as it produces DynamicTablesPkg > > specific objects. It uses the SCMI interface to fetch information from the SCP. > > The ScmiProtocol resides in the ArmPkg, thus the name. > > Does the name 'ScmiInfoLib' sound better ? > > Should I keep ArmScmiInfoLib / ScmiInfoLib ? I know it gets tedious with the long names, but if it's fully integrated with DynamicTablesPkg, then it's kind of important that the name does not imply it's generic; i.e., the name should be DynamicTable*. If it helps clarify my thinking, my litmus test for this is I don't want to have to go searching through code to determine whether #include imports an Arm-specification header or a package-local helper. > 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/110515 I'm not sure I follow? A change in what way? I agree the name is too generic. I didn't flag it because it replaces a non-ideal thing with something that isn't any worse, and I'm trying to cut down on asking people to fix existing quirks when adding new features. If you're happy to rename it while you're at it, I'm happy to take it. Regards, Leif > Regards > Pierre > > > > > > > > > / > > > 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/ArmScmiInfoLib.c > > > > create mode 100644 DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.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/AcpiHelperLib.inf > > > > AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf > > > > + ArmScmiInfoLib|DynamicTablesPkg/Library/ArmScmiInfoLib/ArmScmiInfoLib.inf > > > > SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf > > > > SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf > > > > TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf > > > > diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.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 > > > > + ## @libraryclass Defines a set of APIs to populate CmObj using SCMI. > > > > + ArmScmiInfoLib|Include/Library/ArmScmiInfoLib.h > > > > + > > > > [Protocols] > > > > # Configuration Manager Protocol GUID > > > > gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } } > > > > diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.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 > > > > [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/DynamicTablesPkg/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/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 = gBS->LocateProtocol ( > > > > + &gArmScmiPerformanceProtocolGuid, > > > > + NULL, > > > > + (VOID **)&ScmiPerfProtocol > > > > + ); > > > > + if (EFI_ERROR (Status)) { > > > > + return Status; > > > > + } > > > > + > > > > + Status = 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 == NULL) || > > > > + (LevelArray == NULL) || > > > > + (LevelArrayCount == NULL)) > > > > + { > > > > + return EFI_INVALID_PARAMETER; > > > > + } > > > > + > > > > + // First call to get the number of levels. > > > > + Size = 0; > > > > + Status = ScmiPerfProtocol->DescribeLevels ( > > > > + ScmiPerfProtocol, > > > > + DomainId, > > > > + &Count, > > > > + &Size, > > > > + NULL > > > > + ); > > > > + if (Status != EFI_BUFFER_TOO_SMALL) { > > > > + // EFI_SUCCESS is not a valid option. > > > > + if (Status == EFI_SUCCESS) { > > > > + return EFI_INVALID_PARAMETER; > > > > + } else { > > > > + return Status; > > > > + } > > > > + } > > > > + > > > > + Array = AllocateZeroPool (Size); > > > > + if (Array == NULL) { > > > > + return EFI_OUT_OF_RESOURCES; > > > > + } > > > > + > > > > + // Second call to get the descriptions of the levels. > > > > + Status = ScmiPerfProtocol->DescribeLevels ( > > > > + ScmiPerfProtocol, > > > > + DomainId, > > > > + &Count, > > > > + &Size, > > > > + Array > > > > + ); > > > > + if (EFI_ERROR (Status)) { > > > > + return Status; > > > > + } > > > > + > > > > + *LevelArray = Array; > > > > + *LevelArrayCount = 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 == NULL) || > > > > + (CpcInfo == NULL)) > > > > + { > > > > + return EFI_INVALID_PARAMETER; > > > > + } > > > > + > > > > + Status = ScmiPerfProtocol->DescribeFastchannel ( > > > > + ScmiPerfProtocol, > > > > + DomainId, > > > > + ScmiMessageIdPerformanceLevelSet, > > > > + &FcLevelGet > > > > + ); > > > > + if (EFI_ERROR (Status)) { > > > > + return Status; > > > > + } > > > > + > > > > + Status = ScmiPerfProtocol->DescribeFastchannel ( > > > > + ScmiPerfProtocol, > > > > + DomainId, > > > > + ScmiMessageIdPerformanceLimitsSet, > > > > + &FcLimitsSet > > > > + ); > > > > + if (EFI_ERROR (Status)) { > > > > + return Status; > > > > + } > > > > + > > > > + Status = ScmiPerfProtocol->GetDomainAttributes ( > > > > + ScmiPerfProtocol, > > > > + DomainId, > > > > + &DomainAttributes > > > > + ); > > > > + if (EFI_ERROR (Status)) { > > > > + return Status; > > > > + } > > > > + > > > > + Status = 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 != sizeof (UINT32)) || > > > > + ((FcLevelGet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) == > > > > + SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) || > > > > + (FcLimitsSet.ChanSize != 2 * sizeof (UINT32)) || > > > > + ((FcLimitsSet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) == > > > > + SCMI_PERF_FC_ATTRIB_HAS_DOORBELL)) > > > > + { > > > > + Status = EFI_INVALID_PARAMETER; > > > > + goto exit_handler; > > > > + } > > > > + > > > > + FcLevelGetAddr = ((UINT64)FcLevelGet.ChanAddrHigh << 32) | > > > > + FcLevelGet.ChanAddrLow; > > > > + FcLimitsMaxSetAddr = ((UINT64)FcLimitsSet.ChanAddrHigh << 32) | > > > > + FcLimitsSet.ChanAddrLow; > > > > + FcLimitsMinSetAddr = FcLimitsMaxSetAddr + 0x4; > > > > + > > > > + CpcInfo->Revision = EFI_ACPI_6_4_AML_CPC_REVISION_V3; > > > > + CpcInfo->HighestPerformanceInteger = LevelArray[LevelCount - 1].Level; > > > > + CpcInfo->NominalPerformanceInteger = DomainAttributes.SustainedPerfLevel; > > > > + CpcInfo->LowestNonlinearPerformanceInteger = LevelArray[0].Level; > > > > + CpcInfo->LowestPerformanceInteger = LevelArray[0].Level; > > > > + > > > > + CpcInfo->DesiredPerformanceRegister.AddressSpaceId = EFI_ACPI_6_4_SYSTEM_MEMORY; > > > > + CpcInfo->DesiredPerformanceRegister.RegisterBitWidth = 32; > > > > + CpcInfo->DesiredPerformanceRegister.RegisterBitOffset = 0; > > > > + CpcInfo->DesiredPerformanceRegister.AccessSize = EFI_ACPI_6_4_DWORD; > > > > + CpcInfo->DesiredPerformanceRegister.Address = FcLevelGetAddr; > > > > + > > > > + CpcInfo->MinimumPerformanceRegister.AddressSpaceId = EFI_ACPI_6_4_SYSTEM_MEMORY; > > > > + CpcInfo->MinimumPerformanceRegister.RegisterBitWidth = 32; > > > > + CpcInfo->MinimumPerformanceRegister.RegisterBitOffset = 0; > > > > + CpcInfo->MinimumPerformanceRegister.AccessSize = EFI_ACPI_6_4_DWORD; > > > > + CpcInfo->MinimumPerformanceRegister.Address = FcLimitsMinSetAddr; > > > > + > > > > + CpcInfo->MaximumPerformanceRegister.AddressSpaceId = EFI_ACPI_6_4_SYSTEM_MEMORY; > > > > + CpcInfo->MaximumPerformanceRegister.RegisterBitWidth = 32; > > > > + CpcInfo->MaximumPerformanceRegister.RegisterBitOffset = 0; > > > > + CpcInfo->MaximumPerformanceRegister.AccessSize = EFI_ACPI_6_4_DWORD; > > > > + CpcInfo->MaximumPerformanceRegister.Address = FcLimitsMaxSetAddr; > > > > + > > > > + CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId = EFI_ACPI_6_4_FUNCTIONAL_FIXED_HARDWARE; > > > > + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitWidth = 0x40; > > > > + CpcInfo->ReferencePerformanceCounterRegister.RegisterBitOffset = 0; > > > > + CpcInfo->ReferencePerformanceCounterRegister.AccessSize = ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER; > > > > + CpcInfo->ReferencePerformanceCounterRegister.Address = 0x4; > > > > + > > > > + CpcInfo->DeliveredPerformanceCounterRegister.AddressSpaceId = EFI_ACPI_6_4_FUNCTIONAL_FIXED_HARDWARE; > > > > + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitWidth = 0x40; > > > > + CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitOffset = 0; > > > > + CpcInfo->DeliveredPerformanceCounterRegister.AccessSize = ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER; > > > > + CpcInfo->DeliveredPerformanceCounterRegister.Address = 0x4; > > > > + > > > > + // SCMI should advertise performance values on a unified scale. So frequency > > > > + // 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 = 0x0001001B > > > > + BASE_NAME = ArmScmiInfoLib > > > > + FILE_GUID = 1A7CDB04-9FFC-40DA-A87C-A5ACADAF8136 > > > > + VERSION_STRING = 1.0 > > > > + MODULE_TYPE = DXE_DRIVER > > > > + LIBRARY_CLASS = ArmScmiInfoLib > > > > + CONSTRUCTOR = ArmScmiInfoLibConstructor > > > > + > > > > +[Sources] > > > > + ArmScmiInfoLib.c > > > > + > > > > +[Packages] > > > > + ArmPkg/ArmPkg.dec > > > > + DynamicTablesPkg/DynamicTablesPkg.dec > > > > + EmbeddedPkg/EmbeddedPkg.dec > > > > + MdePkg/MdePkg.dec > > > > + > > > > +[Protocols] > > > > + gArmScmiPerformanceProtocolGuid ## CONSUMES > > > > + > > > > +[Depex] > > > > + gArmScmiPerformanceProtocolGuid > > > > -- > > > > 2.25.1 > > > > > > > > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110966): https://edk2.groups.io/g/devel/message/110966 Mute This Topic: https://groups.io/mt/102175821/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-