From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.11289.1619613392026841187 for ; Wed, 28 Apr 2021 05:36:32 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pranav.madhu@arm.com) 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 AC24B1042; Wed, 28 Apr 2021 05:36:31 -0700 (PDT) Received: from usa.arm.com (a074742.blr.arm.com [10.162.16.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 80E493F694; Wed, 28 Apr 2021 05:36:30 -0700 (PDT) From: "Pranav Madhu" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-platforms][PATCH V1 10/17] Platform/Sgi: Macro definitions for ACPI CPPC Date: Wed, 28 Apr 2021 18:05:53 +0530 Message-Id: <20210428123600.2385-11-pranav.madhu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210428123600.2385-1-pranav.madhu@arm.com> References: <20210428123600.2385-1-pranav.madhu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Add helper macros required for use with ACPI collaborative processor performance control (CPPC). This patch adds macros for initializing ACPI _CPC and _PSD control method. The CPC initializer macro initializes _CPC control method with revision 3 as specified in Arm FFH specification 1.1. The CPC initilizer exposes the reference performance counter and delivered perfrmance counter (AMU registers) as FFixedHW registers. The initilizer also expose the fastchannel memories for performance level set performance limit set protocols as desired performance register and performance limited register respectively. Signed-off-by: Pranav Madhu --- Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/S= giPkg/Include/SgiAcpiHeader.h index 4977d4d898aa..1b5305f15fb8 100644 --- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h +++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h @@ -423,4 +423,57 @@ typedef struct { LineSize /* Line size in by= tes */ \ } =20 +// CPPC _CPC object initialization +#define CPPC_PACKAGE_INIT(DesiredPerfReg, PerfLimitedReg, GranularityMHz= , \ + HighestPerf, NominalPerf, LowestNonlinearPerf, LowestPerf, RefPerf) = \ + { = \ + 23, /* NumEntries */ = \ + 3, /* Revision */ = \ + HighestPerf, /* Highest Performance */ = \ + NominalPerf, /* Nominal Performance */ = \ + LowestNonlinearPerf, /* Lowest Nonlinear Performance = */ \ + LowestPerf, /* Lowest Performance */ = \ + /* Guaranteed Performance Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Desired Performance Register */ = \ + ResourceTemplate () { Register (SystemMemory, 32, 0, DesiredPerfReg,= 3) }, \ + /* Minimum Performance Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Maximum Performance Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Performance Reduction Tolerance Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Time Window Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Counter Wraparound Time */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Reference Performance Counter Register */ = \ + ResourceTemplate () { Register (FFixedHW, 64, 0, 1, 4) }, = \ + /* Delivered Performance Counter Register */ = \ + ResourceTemplate () { Register (FFixedHW, 64, 0, 0, 4) }, = \ + /* Performance Limited Register */ = \ + ResourceTemplate () { Register (SystemMemory, 32, 0, PerfLimitedReg,= 3) }, \ + /* CPPC Enable Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Autonomous Selection Enable Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Autonomous Activity Window Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + /* Energy Performance Preference Register */ = \ + ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, = \ + RefPerf, /* Reference Performance */ = \ + (LowestPerf * GranularityMHz), /* Lowest Frequency */ = \ + (NominalPerf * GranularityMHz), /* Nominal Frequency */ = \ + } + +// Power state dependancy (_PSD) for CPPC +#define PSD_INIT(Domain) = \ + { = \ + 5, /* Entries */ = \ + 0, /* Revision */ = \ + Domain, /* Domain */ = \ + 0xFD, /* Coord Type- SW_ANY */ = \ + 1 /* Processors */ = \ + } + #endif /* __SGI_ACPI_HEADER__ */ --=20 2.17.1