summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/acpi
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2021-10-11 23:31:02 -0600
committerFelix Held <felix-coreboot@felixheld.de>2021-10-14 13:09:46 +0000
commite7f43502b540a42f23a967b6206370050ef75f23 (patch)
treebe8fadb6c009414e2afd29b2779d071af2aa53ce /src/soc/amd/common/acpi
parent71b227d6ebddd1236473c62c2d7f340ebd9981b5 (diff)
soc/amd/common/acpi/upep: Add Low Power State Entry Notifications
Add support to handle S0ix entry and exit notifications by adding the corresponding _DSM functions. The function indices are chosen based on the Modern Standby BIOS Implementation Guide 56358 Rev. 1.04. Inside the notification functions perform any mainboard specific S0ix entry and exit actions. BUG=b:195748540 TEST=Build and boot to OS in Guybrush. Ensure that the notification functions are invoked on S0ix entry and exit. Perform suspend/resume cycles for multiple iterations. Change-Id: I3014551f6e281d466628559453a0141a3dd6abad Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58274 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common/acpi')
-rw-r--r--src/soc/amd/common/acpi/upep.asl34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/soc/amd/common/acpi/upep.asl b/src/soc/amd/common/acpi/upep.asl
index ef068452f8..b44ed43b23 100644
--- a/src/soc/amd/common/acpi/upep.asl
+++ b/src/soc/amd/common/acpi/upep.asl
@@ -5,8 +5,13 @@
#define PEPD_DSM_LPI_ADDITIONAL_FUNCTIONS 1
#define PEPD_DSM_LPI_GET_DEVICE_CONSTRAINTS 1
-#define PEPD_DSM_NOTIFICATIONS_UUID "11e00d56-ce64-47ce-837b-1f898f9aa461"
-#define PEPD_DSM_NOTIFICATION_ENUM_FUNCTIONS 0
+#define PEPD_DSM_NOTIFICATIONS_UUID "11e00d56-ce64-47ce-837b-1f898f9aa461"
+#define PEPD_DSM_NOTIFICATION_ENUM_FUNCTIONS 0
+#define PEPD_DSM_NOTIFICATION_ADDITIONAL_FUNCTIONS 1
+#define PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY 5
+#define PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT 6
+
+External(\_SB.MS0X, MethodObj)
/*
* Power Engine Plug-in Device
@@ -89,10 +94,27 @@ Scope (\_SB) {
* this UUID.
*/
Case (PEPD_DSM_NOTIFICATION_ENUM_FUNCTIONS) {
- /*
- * TODO(b/185586290): Add additional functions when
- * linux kernel driver is fixed.
- */
+ Local0 = Buffer { 0x00 }
+ CreateByteField(Local0, 0x00, SUPP)
+
+ SUPP = PEPD_DSM_NOTIFICATION_ADDITIONAL_FUNCTIONS
+ SUPP |= 1 << PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY
+ SUPP |= 1 << PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT
+
+ Return (Local0)
+ }
+ Case (PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY) {
+ /* provide board level S0ix hook */
+ If (CondRefOf (\_SB.MS0X)) {
+ \_SB.MS0X(1)
+ }
+ Return (Buffer() { 0x00 })
+ }
+ Case (PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT) {
+ /* provide board level S0ix hook */
+ If (CondRefOf (\_SB.MS0X)) {
+ \_SB.MS0X(0)
+ }
Return (Buffer() { 0x00 })
}
Default {