summaryrefslogtreecommitdiff
path: root/src/mainboard/google/parrot/smihandler.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-12-02 15:30:10 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2023-08-16 17:55:02 +0000
commit027f86e6af023b338a0f1d8a999a8f33eeacb010 (patch)
tree691450089ec0116cba1ec04b1b73ca3dea39aaf5 /src/mainboard/google/parrot/smihandler.c
parent4a9de553c5307595f396b47aaa108bf1dc34638d (diff)
ACPI: Add usb_charge_mode_from_gnvs()
Early Chromebook generations stored the information about USB port power control for S3/S5 sleepstates in GNVS, although the configuration is static. Reduce code duplication and react to ACPI S4 as if it was ACPI S5 request. Change-Id: I7e6f37a023b0e9317dcf0355dfa70e28d51cdad9 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74524 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src/mainboard/google/parrot/smihandler.c')
-rw-r--r--src/mainboard/google/parrot/smihandler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mainboard/google/parrot/smihandler.c b/src/mainboard/google/parrot/smihandler.c
index 7d519e39a6..10341fba9e 100644
--- a/src/mainboard/google/parrot/smihandler.c
+++ b/src/mainboard/google/parrot/smihandler.c
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <acpi/acpi_gnvs.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <halt.h>
-#include <soc/nvs.h>
#include <southbridge/intel/bd82x6x/pch.h>
#include <southbridge/intel/bd82x6x/me.h>
#include <southbridge/intel/common/pmutil.h>
@@ -48,6 +48,8 @@ void mainboard_smi_gpi(u32 gpi_sts)
void mainboard_smi_sleep(u8 slp_typ)
{
+ bool usb0_disable = 0, usb1_disable = 0;
+
/* Disable SCI and SMI events */
/* Clear pending events that may trigger immediate wake */
@@ -55,7 +57,8 @@ void mainboard_smi_sleep(u8 slp_typ)
/* Enable wake events */
/* Tell the EC to Disable USB power */
- if (gnvs->s3u0 == 0 && gnvs->s3u1 == 0) {
+ usb_charge_mode_from_gnvs(3, &usb0_disable, &usb1_disable);
+ if (usb0_disable && usb1_disable) {
ec_kbc_write_cmd(0x45);
ec_kbc_write_ib(0xF2);
}