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 F331C740035 for ; Fri, 1 Mar 2024 16:33:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4gN/0quCXJVnBrUnDa88diPomRy9HgsUKdiAqZCCyQA=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1709310783; v=1; b=ApXJclT3C6RpqgKiQEWDTmt/TsROFL9l8TP+Q3IKshMjCKaBc2TgVVmWVU/TfbCoAIDu5UiU /82k3p4rrDWs2SmN5SOW6PrPC2vxLt7QTDhZEIzAAUeJM5PNBoIBTkL8r58LgF2HUthZhS1JseM AIZRjeU6aCU8KodO8IjGLZKQ= X-Received: by 127.0.0.2 with SMTP id gLrjYY7687511xZRI2WM4VD5; Fri, 01 Mar 2024 08:33:03 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.27893.1709310783050519616 for ; Fri, 01 Mar 2024 08:33:03 -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 D16F31FB; Fri, 1 Mar 2024 08:33:40 -0800 (PST) X-Received: from usa.arm.com (a079755.arm.com [10.162.46.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0F1153F73F; Fri, 1 Mar 2024 08:33:00 -0800 (PST) From: "Prabin CA" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Thomas Abraham Subject: [edk2-devel] [edk2-platforms][PATCH v4 7/8] Platform/Sgi: Low Power Idle States for RD-Fremont Date: Fri, 1 Mar 2024 22:02:30 +0530 Message-Id: <20240301163231.2889922-8-prabin.ca@arm.com> In-Reply-To: <20240301163231.2889922-1-prabin.ca@arm.com> References: <20240301163231.2889922-1-prabin.ca@arm.com> MIME-Version: 1.0 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,prabin.ca@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 68pYBcDfCU5xXroEGsydcMMqx7686176AA= 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=ApXJclT3; 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 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 --- 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/Pla= tform/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 Descr= iption * Table (DSDT) +* - ACPI 6.5, Chapter 8, Section 8.4.3, Lower Power Idle States +* - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Secti= on 3.1, +* Idle management and Low Power Idle states * **/ =20 @@ -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 l= ost) + 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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) + } } } =20 @@ -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) --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116276): https://edk2.groups.io/g/devel/message/116276 Mute This Topic: https://groups.io/mt/104668522/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-