public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "levi.yun" <yeoreum.yun@arm.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	Prabin CA <Prabin.CA@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Sami Mujawar <Sami.Mujawar@arm.com>,
	Thomas Abraham <thomas.abraham@arm.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v4 8/8] Platform/Sgi: Add CPPC support for RD-Fremont platform
Date: Fri, 08 Mar 2024 05:16:47 -0800	[thread overview]
Message-ID: <AM0PR08MB42892B9296A67B65C69FEDE2FB272@AM0PR08MB4289.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20240301163231.2889922-9-prabin.ca@arm.com>

> +          CPPC_PACKAGE_INIT (0x200293000, 0x200293004, 20, 160, 160, 85, 85, 5)

In the FFH spec [1], section 'B.2.2 Performance Controls',
the 'Performance Ltd Register' is set to a certain memory location.

The ACPI spec. describes the following fields in the CPPC object
'Performance Limited Register':
Contains a resource descriptor with a single Register()
descriptor that describes the register to read to determine
if performance was limited. A nonzero value indicates
performance was limited. This register is sticky, and
will remain set until reset or OSPM clears it by writing 0.
See the section "Performance Limiting" for more
details.

'Minimum Performance Register' (similar for Maximum)
Optional. If supported, contains a resource descriptor
with a single Register() descriptor that describes the reg-
ister to write the minimum allowable performance level
to. The value 0 is equivalent to Lowest Performance (no
limit).

SCMI spec:
'4.5.2 FastChannels':
Only PERFORMANCE_LIMITS_SET, PERFORMANCE_LIMITS_GET,
PERFORMANCE_LEVEL_SET and PERFORMANCE_LEVEL_GET commands are supported
over FastChannels.

The value in the FFH spec seems to fall in the PERFORMANCE_LIMITS_SET
fastchannel (cf. SCP code [2]). This doesn't match the 'Performance Limited Register'
field, but more the 'Minimum Performance Register' (resp. Max) field.
it's also in other platforms (RDN1, RDV2, etc.. platforms follow the same pattern).
Does this seem correct to you ?

EVEN, Performance Limit Register (which in kernel - PERF_LIMITED) doesn't used right now.

I've already talked with this @Pierre and it seems to wrong.

I think it should fix CPPC_PACKAGE_INIT's macro's define....

________________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Prabin CA via groups.io <prabin.ca=arm.com@groups.io>
Sent: 01 March 2024 16:32
To: devel@edk2.groups.io
Cc: Ard Biesheuvel; Leif Lindholm; Sami Mujawar; Thomas Abraham
Subject: [edk2-devel] [edk2-platforms][PATCH v4 8/8] Platform/Sgi: Add CPPC support for RD-Fremont platform

Enable ACPI CPPC mechanism for RD-Fremont as defined by the ACPI
specification. The implementation uses AMU registers accessible as
Fixed-feature Hardware (FFixedHW) for monitoring the performance.
Non-secure SCMI fastchannels are used to communicate with LCP to set
the desired performance. RD-Fremont platform does not support CPPC
revision 1 and below. So update the _OSC method to let OSPM know about
this fact.

Signed-off-by: Prabin CA <prabin.ca@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf |   1 +
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl      | 162 ++++++++++++++++++++
 2 files changed, 163 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
index 7556c1239116..fcaa3299c4ea 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
@@ -48,6 +48,7 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt
   gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
+  gArmSgiTokenSpaceGuid.PcdOscCppcEnable
   gArmSgiTokenSpaceGuid.PcdOscLpiEnable
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
index f921eeb2d99e..b9aca8477ca4 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
@@ -11,6 +11,10 @@
 *   - ACPI 6.5, Chapter 8, Section 8.4.3, Lower Power Idle States
 *   - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Section 3.1,
 *     Idle management and Low Power Idle states
+*   - ACPI 6.5, Chapter 8, Section 8.4.6, Collaborative Processor Performance
+*     Control
+*   - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Section 3.2,
+*     Performance management and Collaborative Processor Performance Control
 *
 **/

@@ -43,6 +47,20 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
               Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
             }
           }
+
+          If (And (CAP0, OSC_CAP_CPPC_SUPPORT)) {
+            /* CPPC revision 1 and below not supported */
+            And (CAP0, Not (OSC_CAP_CPPC_SUPPORT), CAP0)
+            Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+          }
+
+          If (And (CAP0, OSC_CAP_CPPC2_SUPPORT)) {
+            if (LEqual (FixedPcdGet32 (PcdOscCppcEnable), Zero)) {
+              And (CAP0, Not (OSC_CAP_CPPC2_SUPPORT), CAP0)
+              Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+            }
+          }
+
         } Else {
           And (STS0, Not (OSC_STS_MASK), STS0)
           Or (STS0, Or (OSC_STS_FAILURE, OSC_STS_UNRECOGNIZED_REV), STS0)
@@ -116,6 +134,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 0)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200093000, 0x200093004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (0)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -131,6 +158,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 1)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200293000, 0x200293004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (1)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -146,6 +182,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 2)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200493000, 0x200493004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (2)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -161,6 +206,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 3)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200693000, 0x200693004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (3)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -176,6 +230,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 4)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200893000, 0x200893004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (4)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -191,6 +254,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 5)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200A93000, 0x200A93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (5)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -206,6 +278,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 6)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200C93000, 0x200C93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (6)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -221,6 +302,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 7)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x200E93000, 0x200E93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (7)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -236,6 +326,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 8)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201093000, 0x201093004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (8)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -251,6 +350,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 9)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201293000, 0x201293004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (9)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -266,6 +374,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 10)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201493000, 0x201493004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (10)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -281,6 +398,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 11)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201693000, 0x201693004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (11)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -296,6 +422,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 12)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201893000, 0x201893004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (12)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -311,6 +446,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 13)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201A93000, 0x201A93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (13)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -326,6 +470,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 14)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201C93000, 0x201C93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (14)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
@@ -341,6 +494,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
         Name (_UID, 15)
         Name (_STA, 0xF)

+        Name (_CPC, Package()
+          CPPC_PACKAGE_INIT (0x201E93000, 0x201E93004, 20, 160, 160, 85, 85, 5)
+        )
+
+        Name (_PSD, Package () {
+          Package ()
+            PSD_INIT (15)
+        })
+
         Method (_LPI, 0, NotSerialized) {
           Return (\_SB.PLPI)
         }
--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116277): https://edk2.groups.io/g/devel/message/116277
Mute This Topic: https://groups.io/mt/104668523/7717249
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [yeoreum.yun@arm.com]
-=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116519): https://edk2.groups.io/g/devel/message/116519
Mute This Topic: https://groups.io/mt/104668523/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-03-08 13:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 16:32 [edk2-devel] [edk2-platforms][PATCH v4 0/8] Platform/Sgi: Add support for RD-Fremont platform Prabin CA
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 1/8] Platform/Sgi: Update the datatype of PcdSmmuBase from u32 to u64 Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 2/8] Platform/Sgi: Refactor system memory base and size definitions Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 3/8] Platform/Sgi: Introduce a flag to enable PCIe support for RD Platforms Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 4/8] Platform/Sgi: Add ACPI tables for RD-Fremont platform Prabin CA
2024-03-08 13:04   ` levi.yun
2024-03-11 13:15     ` Prabin CA
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 5/8] Platform/Sgi: Add initial support " Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 6/8] Platform/Sgi: Extend SMBIOS support for RD-Fremont Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 7/8] Platform/Sgi: Low Power Idle States " Prabin CA
2024-03-08 13:05   ` levi.yun
2024-03-01 16:32 ` [edk2-devel] [edk2-platforms][PATCH v4 8/8] Platform/Sgi: Add CPPC support for RD-Fremont platform Prabin CA
2024-03-08 13:16   ` levi.yun [this message]
2024-03-11 13:16   ` Prabin CA
2024-03-04 10:59 ` [edk2-devel] [edk2-platforms][PATCH v4 0/8] Platform/Sgi: Add " Thomas Abraham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR08MB42892B9296A67B65C69FEDE2FB272@AM0PR08MB4289.eurprd08.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox