soc/intel/common/rtd3: Use D3COLD_SUPPORT to set max sleep state

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 <sean@starlabs.systems>
Change-Id: I578d4933b6144aec79fe0b2eb168338ef82c0b9d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74406
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
This commit is contained in:
Sean Rhodes 2023-04-13 13:25:14 +01:00 committed by Lean Sheng Tan
parent 5f0cda7e91
commit 648ff9268f
1 changed files with 4 additions and 1 deletions

View File

@ -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);
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);