From b1c1996b1c89f621103a1d2e0c9db103ea19f0f7 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 13 Apr 2023 16:04:48 +0200 Subject: [PATCH] mb/prodrive/atlas: Enable/disable sleep states based on EC With the profile ATLAS_PROF_REALTIME_PERFORMANCE it is desired to not have the option to be able to enter sleep. The reason is that Microsoft Windows goes to sleep after 30min of inactivity by default. TEST: See that Microsoft Windows 11 has no 'Sleep' option in the start menu. Change-Id: I424db7e712a705c628aa3a10a486d3313404987a Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/74421 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) Reviewed-by: Lean Sheng Tan --- src/mainboard/prodrive/atlas/mainboard.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mainboard/prodrive/atlas/mainboard.c b/src/mainboard/prodrive/atlas/mainboard.c index db808ce45a..0128670d9c 100644 --- a/src/mainboard/prodrive/atlas/mainboard.c +++ b/src/mainboard/prodrive/atlas/mainboard.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include #include @@ -66,9 +67,19 @@ static void mainboard_smbios_strings(struct device *dev, struct smbios_type11 *t t->count = smbios_add_string(t->eos, get_formatted_pn()); } +static void mainboard_fill_ssdt(const struct device *dev) +{ + const struct emi_eeprom_vpd *eeprom = get_emi_eeprom_vpd(); + const bool sleep_enable = eeprom->profile != ATLAS_PROF_REALTIME_PERFORMANCE ? 1 : 0; + acpigen_ssdt_override_sleep_states(false, false, + CONFIG(HAVE_ACPI_RESUME) && sleep_enable, + sleep_enable); +} + static void mainboard_enable(struct device *dev) { dev->ops->get_smbios_strings = mainboard_smbios_strings; + dev->ops->acpi_fill_ssdt = mainboard_fill_ssdt; } struct chip_operations mainboard_ops = {