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 8B68A740038 for ; Mon, 11 Mar 2024 13:14:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nbjdABNynVVfSCLWKhZ2MAAO9+e9AMak4Thvy9LDMJw=; 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=20240206; t=1710162894; v=1; b=Vkhp8pGFzoeRQUpvoxjxJKbQJkNrYeAhASskU6VlOMkioMM2mhYgGPLGPffVxZNuxjQpNR6R qqpnWpE27e6AsoeG9KGnTC/wetWYqEcVV8f2qsmbhogkxwdpJi3qO9KksaJnDG+Akb2fUxZew2/ 1iUMo0/xZV6a5u+oAJxEn/sVsabpbml+/4AA74cAgMGYNxs2yRVUlMzy91rSq+mOIm7WgVpBZr8 lnNDD07ZZx+2mGrohxlRAOb10eYNi9a+JuckP7NmG3WH32ZU/go2J9hHqqTZ56YRw/ToNje6eEM YvstFxwJ/oeX+DZfk1rf62zg9u0QOqt9VXV0yJnnfrQ6A== X-Received: by 127.0.0.2 with SMTP id R1ZxYY7687511xgJG2355zTW; Mon, 11 Mar 2024 06:14:54 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.62584.1710162893689340849 for ; Mon, 11 Mar 2024 06:14:53 -0700 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 DC86AFEC; Mon, 11 Mar 2024 06:15:29 -0700 (PDT) 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 3331B3F64C; Mon, 11 Mar 2024 06:14:50 -0700 (PDT) From: "Prabin CA" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Thomas Abraham Subject: [edk2-devel] [edk2-platforms][PATCH v5 9/9] Platform/Sgi: Add CPPC support for RD-Fremont platform Date: Mon, 11 Mar 2024 06:14:53 -0700 Message-Id: <20240311131416.823580-10-prabin.ca@arm.com> In-Reply-To: <20240311131416.823580-1-prabin.ca@arm.com> References: <20240311131416.823580-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: 908zgXVmkpBZgxTlcN15s0oYx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=Vkhp8pGF; 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 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. In addition to this, 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 --- 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/Pla= tform/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..9c7266c79285 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, Secti= on 3.1, * Idle management and Low Power Idle states +* - ACPI 6.5, Chapter 8, Section 8.4.6, Collaborative Processor Perfor= mance +* Control +* - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Secti= on 3.2, +* Performance management and Collaborative Processor Performance Con= trol * **/ =20 @@ -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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200093000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200293000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200493000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200693000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200893000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200A93000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200C93000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x200E93000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201093000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201293000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201493000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201693000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201893000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201A93000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201C93000, 0x0, 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) =20 + Name (_CPC, Package() + CPPC_PACKAGE_INIT (0x201E93000, 0x0, 20, 160, 160, 85, 85, 5) + ) + + Name (_PSD, Package () { + Package () + PSD_INIT (15) + }) + Method (_LPI, 0, NotSerialized) { Return (\_SB.PLPI) } --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116621): https://edk2.groups.io/g/devel/message/116621 Mute This Topic: https://groups.io/mt/104862640/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-