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>
This commit is contained in:
Karthikeyan Ramasubramanian 2021-10-11 23:31:02 -06:00 committed by Felix Held
parent 71b227d6eb
commit e7f43502b5
1 changed files with 28 additions and 6 deletions

View File

@ -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 {