From 648ff9268fdcdef0045d75c66dddd84be60690f7 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Thu, 13 Apr 2023 13:25:14 +0100 Subject: [PATCH] soc/intel/common/rtd3: Use D3COLD_SUPPORT to set max sleep state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use D3COLD_SUPPORT Kconfig option to set the maximum support sleep state. Report `4` in `_S0W` only when D3COLD_SUPPORT is enabled, as if it is not, it will break S3 exit. When D3COLD_SUPPORT is not enabled, return `3` (D3Hot). This fixed S3 exit on both TGL and ADL. Tested on StarBook Mk V and Mk VI. Signed-off-by: Sean Rhodes Change-Id: I578d4933b6144aec79fe0b2eb168338ef82c0b9d Reviewed-on: https://review.coreboot.org/c/coreboot/+/74406 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) Reviewed-by: Michael Niewöhner --- src/soc/intel/common/block/pcie/rtd3/rtd3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/block/pcie/rtd3/rtd3.c b/src/soc/intel/common/block/pcie/rtd3/rtd3.c index 5067ac3f4e..8b372ed839 100644 --- a/src/soc/intel/common/block/pcie/rtd3/rtd3.c +++ b/src/soc/intel/common/block/pcie/rtd3/rtd3.c @@ -511,7 +511,10 @@ static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev) acpigen_write_device(acpi_device_name(dev)); acpigen_write_ADR(0); acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON); - acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_COLD); + if (CONFIG(D3COLD_SUPPORT)) + acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_COLD); + else + acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_HOT); acpi_device_add_storage_d3_enable(NULL);