Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/62598 )
Change subject: soc/amd/common/block: Add mainboard_handle_smi ......................................................................
soc/amd/common/block: Add mainboard_handle_smi
The current SMM framework only allows the mainboard code to handle GPEs. i.e., Events 0 - 23. This change allows the mainboard code to handle any SMI events not handled by the SoC code. This will allow the mainboard code to handle `SMITYPE_ESPI_SMI`.
BUG=b:222694093 TEST=Build guybrush
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I81943e8cb31e998f29cc60b565d3ca0a8dfe9cb2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62598 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Karthik Ramasubramanian kramasub@google.com Reviewed-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/common/block/cpu/smm/smi_handler.c M src/soc/amd/common/block/include/amdblocks/smm.h 2 files changed, 9 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, but someone else must approve Karthik Ramasubramanian: Looks good to me, approved
diff --git a/src/soc/amd/common/block/cpu/smm/smi_handler.c b/src/soc/amd/common/block/cpu/smm/smi_handler.c index e535cb0..ee8423a 100644 --- a/src/soc/amd/common/block/cpu/smm/smi_handler.c +++ b/src/soc/amd/common/block/cpu/smm/smi_handler.c @@ -7,6 +7,11 @@ #include <cpu/x86/smm.h> #include <soc/smi.h>
+__weak void mainboard_handle_smi(int event) +{ + printk(BIOS_WARNING, "SMI event %d is missing handler\n", event); +} + static void process_smi_sources(uint32_t reg) { const uint32_t status = smi_read32(reg); @@ -19,6 +24,8 @@ source_handler = get_smi_source_handler(i + bit_zero); if (source_handler) source_handler(); + else if (reg != SMI_REG_SMISTS0 || (status & GEVENT_MASK) == 0) + mainboard_handle_smi(i + bit_zero); } }
diff --git a/src/soc/amd/common/block/include/amdblocks/smm.h b/src/soc/amd/common/block/include/amdblocks/smm.h index 187eddf..46008fa 100644 --- a/src/soc/amd/common/block/include/amdblocks/smm.h +++ b/src/soc/amd/common/block/include/amdblocks/smm.h @@ -14,3 +14,5 @@ void handle_smi_gsmi(void); void handle_smi_store(void); void clear_tvalid(void); +/* See SMITYPE_* for list possible of events. GEVENTS are handled with mainboard_smi_gpi. */ +void mainboard_handle_smi(int event);