From e7f43502b540a42f23a967b6206370050ef75f23 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Mon, 11 Oct 2021 23:31:02 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58274 Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/soc/amd/common/acpi/upep.asl | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'src/soc/amd/common') 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 { -- cgit v1.2.3