From 6feb4dadd85518c5e4603cb7da48ac4bec484c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 13 Jul 2019 17:28:37 +0300 Subject: intel/i82801ix: Refactor lock_smm() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34302 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Angel Pons --- src/southbridge/intel/i82801ix/lpc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/southbridge/intel/i82801ix') diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c index 546fbced77..ba2b0282e5 100644 --- a/src/southbridge/intel/i82801ix/lpc.c +++ b/src/southbridge/intel/i82801ix/lpc.c @@ -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) -- cgit v1.2.3