public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Prabin CA <prabin.ca@arm.com>, devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Thomas Abraham <thomas.abraham@arm.com>,
	"nd@arm.com" <nd@arm.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v5 8/9] Platform/Sgi: Low Power Idle States for RD-Fremont
Date: Sun, 31 Mar 2024 13:03:35 +0100	[thread overview]
Message-ID: <6d076bbb-b3e4-4b19-844c-434e088b0654@arm.com> (raw)
In-Reply-To: <20240311131416.823580-9-prabin.ca@arm.com>

Hi Prabin,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 11/03/2024 01:14 pm, Prabin CA wrote:
> RD-Fremont platform supports two LPI states, LPI1 (Standby WFI) and LPI3
> (Power-down). The cluster supports LPI2 (Power-down) state. The LPI
> implementation also supports combined power state for core and cluster.
>
> Signed-off-by: Prabin CA <prabin.ca@arm.com>
> ---
>   Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf |   1 +
>   Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl      | 154 ++++++++++++++++++++
>   2 files changed, 155 insertions(+)
>
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
> index 9d07001dec96..7556c1239116 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.PcdOscLpiEnable
>     gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
>     gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
>     gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
> index 8812ea877f7a..f921eeb2d99e 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
> +++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
> @@ -8,6 +8,9 @@
>   * @par Specification Reference:
>   *   - ACPI 6.5, Chapter 5, Section 5.2.11.1, Differentiated System Description
>   *     Table (DSDT)
> +*   - 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
>   *
>   **/
>   
> @@ -17,6 +20,93 @@
>   DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>                    EFI_ACPI_ARM_OEM_REVISION) {
>     Scope (_SB) {
> +    /* _OSC: Operating System Capabilities */
> +    Method (_OSC, 4, Serialized) {
> +      CreateDWordField (Arg3, 0x00, STS0)
> +      CreateDWordField (Arg3, 0x04, CAP0)
> +
> +      /* Platform-wide Capabilities */
> +      If (LEqual (Arg0, ToUUID("0811b06e-4a27-44f9-8d60-3cbbc22e7b48"))) {
> +        /* OSC rev 1 supported, for other version, return failure */
> +        If (LEqual (Arg1, One)) {
> +          And (STS0, Not (OSC_STS_MASK), STS0)
> +
> +          If (And (CAP0, OSC_CAP_OS_INITIATED_LPI)) {
> +            /* OS initiated LPI not supported */
> +            And (CAP0, Not (OSC_CAP_OS_INITIATED_LPI), CAP0)
> +            Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
> +          }
> +
> +          If (And (CAP0, OSC_CAP_PLAT_COORDINATED_LPI)) {
> +            if (LEqual (FixedPcdGet32 (PcdOscLpiEnable), Zero)) {
> +              And (CAP0, Not (OSC_CAP_PLAT_COORDINATED_LPI), 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)
> +        }
> +      } Else {
> +        And (STS0, Not (OSC_STS_MASK), STS0)
> +        Or (STS0, Or (OSC_STS_FAILURE, OSC_STS_UNRECOGNIZED_UUID), STS0)
> +      }
> +
> +      Return (Arg3)
> +    }
> +
> +    Name (PLPI, Package () {  /* LPI for Processor, support 2 LPI states */
> +      0,                      // Version
> +      0,                      // Level Index
> +      2,                      // Count
> +      Package () {            // WFI for CPU
> +        1,                    // Min residency (uS)
> +        1,                    // Wake latency (uS)
> +        1,                    // Flags
> +        0,                    // Arch Context lost Flags (no loss)
> +        0,                    // Residency Counter Frequency
> +        0,                    // No parent state
> +        ResourceTemplate () { // Register Entry method
> +          Register (FFixedHW,
> +            32,               // Bit Width
> +            0,                // Bit Offset
> +            0xFFFFFFFF,       // Address
> +            3,                // Access Size
> +          )
> +        },
> +        ResourceTemplate () { // Null Residency Counter
> +          Register (SystemMemory, 0, 0, 0, 0)
> +        },
> +        ResourceTemplate () { // Null Usage Counter
> +          Register (SystemMemory, 0, 0, 0, 0)
> +        },
> +        "LPI1-Core"
> +      },
> +      Package () {            // Power Gating state for CPU
> +        150,                  // Min residency (uS)
> +        350,                  // Wake latency (uS)
> +        1,                    // Flags
> +        1,                    // Arch Context lost Flags (Core context lost)
> +        0,                    // Residency Counter Frequency
> +        0,                    // No parent state
> +        ResourceTemplate () { // Register Entry method
> +          Register (FFixedHW,
> +            32,               // Bit Width
> +            0,                // Bit Offset
> +            0x40000002,       // Address (PwrLvl:core, StateTyp:PwrDn)
> +            3,                // Access Size
> +          )
> +        },
> +        ResourceTemplate () { // Null Residency Counter
> +          Register (SystemMemory, 0, 0, 0, 0)
> +        },
> +        ResourceTemplate () { // Null Usage Counter
> +          Register (SystemMemory, 0, 0, 0, 0)
> +        },
> +        "LPI3-Core"
> +      },
> +    })
> +
>       Device (CL00) {   // Cluster 0
>         Name (_HID, "ACPI0010")
>         Name (_UID, 0)
> @@ -25,6 +115,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 0)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -36,6 +130,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 1)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -47,6 +145,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 2)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -58,6 +160,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 3)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -69,6 +175,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 4)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -80,6 +190,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 5)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -91,6 +205,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 6)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -102,6 +220,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 7)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -113,6 +235,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 8)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -124,6 +250,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 9)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -135,6 +265,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 10)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -146,6 +280,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 11)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -157,6 +295,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 12)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -168,6 +310,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 13)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -179,6 +325,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 14)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>   
> @@ -190,6 +340,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
>           Name (_HID, "ACPI0007")
>           Name (_UID, 15)
>           Name (_STA, 0xF)
> +
> +        Method (_LPI, 0, NotSerialized) {
> +          Return (\_SB.PLPI)
> +        }
>         }
>       }
>     } // Scope(_SB)


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



  parent reply	other threads:[~2024-03-31 12:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 13:14 [edk2-devel] [edk2-platforms][PATCH v5 0/9] Platform/Sgi: Add support for RD-Fremont platform Prabin CA
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 1/9] Platform/Sgi: Correct typo in defining CPPC performance limited register Prabin CA
2024-03-11 14:29   ` levi.yun
2024-03-31 11:58   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 2/9] Platform/Sgi: Update the datatype of PcdSmmuBase from u32 to u64 Prabin CA
2024-03-11 14:29   ` levi.yun
2024-03-31 12:01   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 3/9] Platform/Sgi: Refactor system memory base and size definitions Prabin CA
2024-03-11 14:29   ` levi.yun
2024-03-31 12:01   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 4/9] Platform/Sgi: Introduce a flag to enable PCIe support for RD Platforms Prabin CA
2024-03-11 14:33   ` levi.yun
2024-03-31 10:31   ` Sami Mujawar
2024-03-31 11:57     ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 5/9] Platform/Sgi: Add ACPI tables for RD-Fremont platform Prabin CA
2024-03-11 14:34   ` levi.yun
2024-03-31 12:02   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 6/9] Platform/Sgi: Add initial support " Prabin CA
2024-03-11 14:34   ` levi.yun
2024-03-31 12:03   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 7/9] Platform/Sgi: Extend SMBIOS support for RD-Fremont Prabin CA
2024-03-11 14:35   ` levi.yun
2024-03-31 11:55   ` Sami Mujawar
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 8/9] Platform/Sgi: Low Power Idle States " Prabin CA
2024-03-11 14:35   ` levi.yun
2024-03-31 12:03   ` Sami Mujawar [this message]
2024-03-11 13:14 ` [edk2-devel] [edk2-platforms][PATCH v5 9/9] Platform/Sgi: Add CPPC support for RD-Fremont platform Prabin CA
2024-03-11 14:35   ` levi.yun
2024-03-31 12:03   ` Sami Mujawar
2024-03-31 12:06 ` [edk2-devel] [edk2-platforms][PATCH v5 0/9] Platform/Sgi: Add " Sami Mujawar
2024-04-03 17:40   ` Prabin CA
2024-03-31 12:09 ` Sami Mujawar

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=6d076bbb-b3e4-4b19-844c-434e088b0654@arm.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