soc/intel/rtd3: Hook up supported states to Kconfig

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: I3a4b89132b594ad568a5851137575f921f8e2a2e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72765
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Sean Rhodes 2023-02-03 16:38:10 +00:00 committed by Lean Sheng Tan
parent 1854500940
commit dbb97c3243
1 changed files with 4 additions and 1 deletions

View File

@ -490,7 +490,10 @@ static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev)
acpigen_write_device(acpi_device_name(dev)); acpigen_write_device(acpi_device_name(dev));
acpigen_write_ADR(0); acpigen_write_ADR(0);
acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON); acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON);
if (CONFIG(D3COLD_SUPPORT))
acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_COLD); 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); acpi_device_add_storage_d3_enable(NULL);