From 83faa5d804d183a26b0fa66b5d55bbe5f3b72c89 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki 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/braswell/pmutil.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/soc/intel/braswell') diff --git a/src/soc/intel/braswell/pmutil.c b/src/soc/intel/braswell/pmutil.c index a880183b82..3efcc7b6de 100644 --- a/src/soc/intel/braswell/pmutil.c +++ b/src/soc/intel/braswell/pmutil.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -356,3 +357,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