intel/i82801ix: Refactor lock_smm()

Move the SMM lock outside the function as it is renamed.
Replace conditional !PARALLEL_MP with SMM_ASEG to better
reflect the use.

Change-Id: I93bf0d2f711f94a5bb741bdcd92c1e0fec228684
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34302
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki 2019-07-13 17:28:37 +03:00
parent 83d6a8a30c
commit 6feb4dadd8
1 changed files with 8 additions and 7 deletions

View File

@ -366,7 +366,7 @@ static void enable_clock_gating(void)
RCBA32(0x38c0) |= 7;
}
static void i82801ix_lock_smm(struct device *dev)
static void i82801ix_set_acpi_mode(struct device *dev)
{
if (!acpi_is_wakeup_s3()) {
#if ENABLE_ACPI_MODE_IN_COREBOOT
@ -382,11 +382,6 @@ static void i82801ix_lock_smm(struct device *dev)
printk(BIOS_DEBUG, "S3 wakeup, enabling ACPI via APMC\n");
outb(APM_CNT_ACPI_ENABLE, APM_CNT);
}
/* Don't allow evil boot loaders, kernels, or
* userspace applications to deceive us:
*/
if (!CONFIG(PARALLEL_MP))
aseg_smm_lock();
}
static void lpc_init(struct device *dev)
@ -430,7 +425,13 @@ static void lpc_init(struct device *dev)
i8259_configure_irq_trigger(9, 1);
if (CONFIG(HAVE_SMI_HANDLER))
i82801ix_lock_smm(dev);
i82801ix_set_acpi_mode(dev);
/* Don't allow evil boot loaders, kernels, or
* userspace applications to deceive us:
*/
if (CONFIG(HAVE_SMI_HANDLER) && CONFIG(SMM_ASEG))
aseg_smm_lock();
}
static void i82801ix_lpc_read_resources(struct device *dev)