Patrick Georgi merged this change.

View Change

Approvals: build bot (Jenkins): Verified Philipp Deppenwiese: Looks good to me, approved
src/soc/intel/fsp_baytrail/smm.c: add bootstate entry for locking SMI

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: Ia296a680217a38136c063cae6ed619df0c497795
Reviewed-on: https://review.coreboot.org/c/coreboot/+/30753
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M src/soc/intel/fsp_baytrail/smm.c
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/soc/intel/fsp_baytrail/smm.c b/src/soc/intel/fsp_baytrail/smm.c
index 94b0944..df55433 100644
--- a/src/soc/intel/fsp_baytrail/smm.c
+++ b/src/soc/intel/fsp_baytrail/smm.c
@@ -20,6 +20,7 @@
#include <arch/io.h>
#include <device/mmio.h>
#include <cpu/x86/smm.h>
+#include <bootstate.h>
#include <soc/iomap.h>
#include <soc/pmc.h>
#include <soc/smm.h>
@@ -123,3 +124,16 @@
"d" (APM_CNT)
);
}
+
+static void finalize_chipset(void *unused)
+{
+ printk(BIOS_DEBUG, "Finalizing SMM.\n");
+ /* Lock sleep stretching policy and set SMI lock. */
+ write32((void *)(PMC_BASE_ADDRESS + GEN_PMCON2),
+ read32((void *)(PMC_BASE_ADDRESS + GEN_PMCON2))
+ | SLPSX_STR_POL_LOCK | SMI_LOCK);
+ outb(APM_CNT_FINALIZE, APM_CNT);
+}
+
+BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL);
+BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, finalize_chipset, NULL);

To view, visit change 30753. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia296a680217a38136c063cae6ed619df0c497795
Gerrit-Change-Number: 30753
Gerrit-PatchSet: 3
Gerrit-Owner: Michał Żygowski <michal.zygowski@3mdeb.com>
Gerrit-Reviewer: Huang Jin <huang.jin@intel.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski@3mdeb.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Gerrit-Reviewer: York Yang <yyang024@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Piotr Król <piotr.krol@3mdeb.com>
Gerrit-MessageType: merged