Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62599 )
Change subject: mb/google/guybrush: Enable EC SMI handler ......................................................................
mb/google/guybrush: Enable EC SMI handler
This change allows the EC to send SMM interrupts to the AP. SMM interrupts are only enabled during boot, and are disabled once ACPI is enabled. The only event that is currently handled by `chromeec_process_one_event` is EC_HOST_EVENT_LID_CLOSED. This is used to power off the system in case the OS never loaded and the lid was closed.
BUG=b:222694093 TEST=Boot guybrush, run `lpc smi` on EC console. Verify SMM handler runs.
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I52b96b1b7c3c25a8355eaba4e84dbce49451b7f8 --- M src/mainboard/google/guybrush/ec.c M src/mainboard/google/guybrush/smihandler.c 2 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/62599/1
diff --git a/src/mainboard/google/guybrush/ec.c b/src/mainboard/google/guybrush/ec.c index f62ca20..da3f420 100644 --- a/src/mainboard/google/guybrush/ec.c +++ b/src/mainboard/google/guybrush/ec.c @@ -21,6 +21,7 @@ const struct google_chromeec_event_info info = { .log_events = MAINBOARD_EC_LOG_EVENTS, .sci_events = MAINBOARD_EC_SCI_EVENTS, + .smi_events = MAINBOARD_EC_SMI_EVENTS, .s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS, .s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS, .s0ix_wake_events = MAINBOARD_EC_S0IX_WAKE_EVENTS, @@ -30,4 +31,6 @@
/* Configure eSPI VW SCI events */ gpe_configure_sci(espi_sci_sources, ARRAY_SIZE(espi_sci_sources)); + + configure_smi(SMITYPE_ESPI_SMI, SMI_MODE_SMI); } diff --git a/src/mainboard/google/guybrush/smihandler.c b/src/mainboard/google/guybrush/smihandler.c index f67ff31..bcf883a 100644 --- a/src/mainboard/google/guybrush/smihandler.c +++ b/src/mainboard/google/guybrush/smihandler.c @@ -1,11 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <amdblocks/smm.h> #include <baseboard/variants.h> #include <console/console.h> #include <cpu/x86/smm.h> #include <ec/google/chromeec/ec.h> #include <ec/google/chromeec/smm.h> #include <elog.h> +#include <soc/smi.h> #include <variant/ec.h>
void mainboard_smi_gpi(u32 gpi_sts) @@ -36,3 +38,17 @@ { google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS | MAINBOARD_EC_S0IX_WAKE_EVENTS); } + +void mainboard_handle_smi(int event) +{ + switch (event) { + case SMITYPE_ESPI_SMI: + printk(BIOS_DEBUG, "Processing EC SMI\n"); + + chromeec_smi_process_events(); + break; + default: + printk(BIOS_WARNING, "SMI event %d is missing handler\n", event); + return; + } +}