From fe4b7ffe11328177a80083ae5540b5dd689f686b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Lewi=C5=84ski?= Date: Thu, 22 Aug 2024 18:31:55 +0200 Subject: [PATCH] additional SMI handling & disable option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip LewiƄski --- src/soc/intel/baytrail/lockdown.c | 4 +++- src/soc/intel/baytrail/smihandler.c | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/soc/intel/baytrail/lockdown.c b/src/soc/intel/baytrail/lockdown.c index c702b32624e..b88b830f97c 100644 --- a/src/soc/intel/baytrail/lockdown.c +++ b/src/soc/intel/baytrail/lockdown.c @@ -20,6 +20,7 @@ #include #include #include +#include // huge overkill with the includes // let's worry about that later, when it works @@ -64,7 +65,8 @@ bool wpd_status(void) } void platform_lockdown_config(void *unused){ - if(CONFIG(BOOTMEDIA_SMM_BWP)){ + if(CONFIG(BOOTMEDIA_SMM_BWP) && is_smm_bwp_permitted()){ + printk(BIOS_DEBUG, "Enabling SMM BWP\n"); enable_smm_bwp(); } } diff --git a/src/soc/intel/baytrail/smihandler.c b/src/soc/intel/baytrail/smihandler.c index cc86de4bc62..2de57517788 100644 --- a/src/soc/intel/baytrail/smihandler.c +++ b/src/soc/intel/baytrail/smihandler.c @@ -21,6 +21,7 @@ #include #include #include +#include void southbridge_smi_set_eos(void) { @@ -268,12 +269,11 @@ static void southbridge_smi_store(void) ret = smmstore_exec(sub_command, (void *)reg_ebx); io_smi->rax = ret; - if (!wpd_status()) { -// set_insmm_sts(true); - //disable smm_bwp - //clear the smi + printk(BIOS_DEBUG, "flash SMI triggered\n"); + + if (!wpd_status() && is_smm_bwp_permitted()) { + printk(BIOS_DEBUG, "enabling smm bwp again\n"); enable_smm_bwp(); -// set_insmm_sts(false); } }