diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-02-19 18:29:58 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-02-24 11:35:05 +0000 |
commit | 1b8e65dee16c083849a0cf0dc61b0e6ecf64c118 (patch) | |
tree | 2b6e3f3d6c7ddeb729f2ebf8549ae577c9fbe5e6 /src/soc/intel/skylake/cpu.c | |
parent | 9a1853a98c6760ec42c8850487eb90cc6def6d3f (diff) |
soc/intel/{skl,cnl}: Move smm_lock() to cpu.c
Looks like smmrelocate.c is nearly identical across multiple platforms.
This is done to be able to deduplicate smmrelocate.c in the follow-ups.
Change-Id: I2edc64c9eabc3815b12a2e3cffb03cba2228eea0
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50933
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/skylake/cpu.c')
-rw-r--r-- | src/soc/intel/skylake/cpu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index 4cadb7f9ee..19f2e3a0bf 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -138,6 +138,18 @@ static void per_cpu_smm_trigger(void) smm_relocate(); } +void smm_lock(void) +{ + struct device *sa_dev = pcidev_path_on_root(SA_DEVFN_ROOT); + /* + * LOCK the SMM memory window and enable normal SMM. + * After running this function, only a full reset can + * make the SMM registers writable again. + */ + printk(BIOS_DEBUG, "Locking SMM.\n"); + pci_write_config8(sa_dev, SMRAM, D_LCK | G_SMRAME | C_BASE_SEG); +} + static void vmx_configure(void *unused) { set_feature_ctrl_vmx(); |