summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2020-01-19 00:17:29 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-01-20 10:50:06 +0000
commit9cc16031730d8bb47971e18e564ba6343bd4b5cb (patch)
tree1524386480f7e580887490e4987278e767964375 /src/soc/amd/stoneyridge
parent05bc9b38a31bc6f3836a32a6ea9880f6a570f0f6 (diff)
downloadcoreboot-9cc16031730d8bb47971e18e564ba6343bd4b5cb.tar.xz
soc/amd/stoneyridge: Add SMMSTORE support
Add SMMSTORE support for saving EFI NVRAM variables in conjunction with Tianocore payload. Test: build/boot several google/kahlee variants, test manipulation and persistence of Tianocore bootorder variables. Change-Id: Ida604a44d1fa5288e96dbe05de1f847e597cc95d Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38468 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/amd/stoneyridge')
-rw-r--r--src/soc/amd/stoneyridge/smihandler.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c
index 2b883972c9..aa2a15bf14 100644
--- a/src/soc/amd/stoneyridge/smihandler.c
+++ b/src/soc/amd/stoneyridge/smihandler.c
@@ -23,6 +23,7 @@
#include <arch/acpi.h>
#include <arch/hlt.h>
#include <device/pci_def.h>
+#include <smmstore.h>
#include <soc/smi.h>
#include <soc/southbridge.h>
#include <amdblocks/acpimmio.h>
@@ -88,6 +89,25 @@ static void southbridge_smi_gsmi(void)
io_smi->rax = gsmi_exec(sub_command, &reg_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);