diff options
author | Mathew King <mathewk@chromium.org> | 2021-03-04 15:34:37 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-03-10 00:38:23 +0000 |
commit | ee10ce6268fc2c605df96966158a11cf2b79ee3d (patch) | |
tree | 120a5b3ff589f7f527a18f7b5294657c17358aaa /src/mainboard/google/guybrush/smihandler.c | |
parent | ad830234251146d7538d4851f5a6b6eed3b40b37 (diff) |
mb/google/guybrush: Add smihandler
BUG=b:180507707
TEST=builds
Signed-off-by: Mathew King <mathewk@chromium.org>
Change-Id: I25ce0ca869ca854ff33242d2c416319e9688cc6f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51264
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/guybrush/smihandler.c')
-rw-r--r-- | src/mainboard/google/guybrush/smihandler.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mainboard/google/guybrush/smihandler.c b/src/mainboard/google/guybrush/smihandler.c new file mode 100644 index 0000000000..d61006a08e --- /dev/null +++ b/src/mainboard/google/guybrush/smihandler.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/variants.h> +#include <cpu/x86/smm.h> +#include <ec/google/chromeec/smm.h> +#include <variant/ec.h> + +void mainboard_smi_gpi(u32 gpi_sts) +{ + chromeec_smi_process_events(); +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + size_t num_gpios; + const struct soc_amd_gpio *gpios; + + chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); + + gpios = variant_sleep_gpio_table(&num_gpios); + program_gpios(gpios, num_gpios); +} + +int mainboard_smi_apmc(u8 apmc) +{ + chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, MAINBOARD_EC_SMI_EVENTS); + + return 0; +} |