From d125593b2e35032ace0ca60f662b97dd3a2013a5 Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Sun, 19 Jan 2020 10:22:43 -0700 Subject: soc/amd/picasso: Add SMMSTORE support Add SMMSTORE support for saving EFI NVRAM variables in conjuction with Tianocore payload. Test: none, as this duplicates tested functionality in amd/stoneyridge. Signed-off-by: Marshall Dawson Change-Id: Id05b33edf949611c3f9eac94e7b63a4266c6c4d0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38471 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Patrick Georgi --- src/soc/amd/picasso/smihandler.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/soc/amd/picasso/smihandler.c') diff --git a/src/soc/amd/picasso/smihandler.c b/src/soc/amd/picasso/smihandler.c index 39c2dfd09b..d987a5056e 100644 --- a/src/soc/amd/picasso/smihandler.c +++ b/src/soc/amd/picasso/smihandler.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +89,25 @@ static void southbridge_smi_gsmi(void) io_smi->rax = gsmi_exec(sub_command, ®_ebx); } +static void southbridge_smi_store(void) +{ + u8 sub_command; + amd64_smm_state_save_area_t *io_smi; + u32 reg_ebx; + + io_smi = find_save_state(APM_CNT_SMMSTORE); + if (!io_smi) + return; + /* Command and return value in EAX */ + sub_command = (io_smi->rax >> 8) & 0xff; + + /* Parameter buffer in EBX */ + reg_ebx = io_smi->rbx; + + /* drivers/smmstore/smi.c */ + io_smi->rax = smmstore_exec(sub_command, (void *)reg_ebx); +} + static void sb_apmc_smi_handler(void) { const uint8_t cmd = inb(pm_acpi_smi_cmd_port()); @@ -103,6 +123,10 @@ static void sb_apmc_smi_handler(void) if (CONFIG(ELOG_GSMI)) southbridge_smi_gsmi(); break; + case APM_CNT_SMMSTORE: + if (CONFIG(SMMSTORE)) + southbridge_smi_store(); + break; } mainboard_smi_apmc(cmd); -- cgit v1.2.3