From 83faa5d804d183a26b0fa66b5d55bbe5f3b72c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 5 Jan 2023 15:39:16 +0200 Subject: mb/google,intel: Use common ChromeEC code for lid shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4d34e5c094440dad4a6ab9adc67d3da6b71ac2bf Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/74514 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/soc/intel/baytrail/pmutil.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/soc/intel/baytrail') diff --git a/src/soc/intel/baytrail/pmutil.c b/src/soc/intel/baytrail/pmutil.c index 93024d9fba..79f95bbf03 100644 --- a/src/soc/intel/baytrail/pmutil.c +++ b/src/soc/intel/baytrail/pmutil.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -357,3 +358,13 @@ int platform_is_resuming(void) return acpi_sleep_from_pm1(inl(ACPI_BASE_ADDRESS + PM1_CNT)) == ACPI_S3; } + +void poweroff(void) +{ + uint32_t pm1_cnt; + + /* Go to S5 */ + pm1_cnt = inl(ACPI_BASE_ADDRESS + PM1_CNT); + pm1_cnt |= (0xf << 10); + outl(pm1_cnt, ACPI_BASE_ADDRESS + PM1_CNT); +} -- cgit v1.2.3