sb/intel/i82801gx,ix,jx: Move HAVE_SMI_HANDLER conditional

Make these more consistent with later platforms. Followups will
do a more complete refactoring of set_acpi_mode() implementations.

Change-Id: I6a05b7600ebdc49915157eaff229459a1eea754c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36790
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Kyösti Mälkki 2019-10-09 12:32:16 +03:00
parent cd0b67b30a
commit 44da9e73c7
3 changed files with 30 additions and 27 deletions

View File

@ -335,6 +335,7 @@ static void enable_clock_gating(void)
static void i82801gx_set_acpi_mode(struct device *dev)
{
if (CONFIG(HAVE_SMI_HANDLER)) {
if (!acpi_is_wakeup_s3()) {
printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n");
outb(APM_CNT_ACPI_DISABLE, APM_CNT); // Disable ACPI mode
@ -343,6 +344,7 @@ static void i82801gx_set_acpi_mode(struct device *dev)
printk(BIOS_DEBUG, "S3 wakeup, enabling ACPI via APMC\n");
outb(APM_CNT_ACPI_ENABLE, APM_CNT);
}
}
}
#define SPIBASE 0x3020
@ -409,7 +411,6 @@ static void lpc_init(struct device *dev)
/* Interrupt 9 should be level triggered (SCI) */
i8259_configure_irq_trigger(9, 1);
if (CONFIG(HAVE_SMI_HANDLER))
i82801gx_set_acpi_mode(dev);
i82801gx_spi_init();

View File

@ -367,6 +367,7 @@ static void enable_clock_gating(void)
static void i82801ix_set_acpi_mode(struct device *dev)
{
if (CONFIG(HAVE_SMI_HANDLER)) {
if (!acpi_is_wakeup_s3()) {
printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n");
outb(APM_CNT_ACPI_DISABLE, APM_CNT); // Disable ACPI mode
@ -375,6 +376,7 @@ static void i82801ix_set_acpi_mode(struct device *dev)
printk(BIOS_DEBUG, "S3 wakeup, enabling ACPI via APMC\n");
outb(APM_CNT_ACPI_ENABLE, APM_CNT);
}
}
}
static void lpc_init(struct device *dev)
@ -417,7 +419,6 @@ static void lpc_init(struct device *dev)
/* Interrupt 9 should be level triggered (SCI) */
i8259_configure_irq_trigger(9, 1);
if (CONFIG(HAVE_SMI_HANDLER))
i82801ix_set_acpi_mode(dev);
/* Don't allow evil boot loaders, kernels, or

View File

@ -372,6 +372,7 @@ static void enable_clock_gating(void)
static void i82801jx_set_acpi_mode(struct device *dev)
{
if (CONFIG(HAVE_SMI_HANDLER)) {
if (!acpi_is_wakeup_s3()) {
printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n");
outb(APM_CNT_ACPI_DISABLE, APM_CNT); // Disable ACPI mode
@ -380,6 +381,7 @@ static void i82801jx_set_acpi_mode(struct device *dev)
printk(BIOS_DEBUG, "S3 wakeup, enabling ACPI via APMC\n");
outb(APM_CNT_ACPI_ENABLE, APM_CNT);
}
}
}
static void lpc_init(struct device *dev)
@ -422,7 +424,6 @@ static void lpc_init(struct device *dev)
/* Interrupt 9 should be level triggered (SCI) */
i8259_configure_irq_trigger(9, 1);
if (CONFIG(HAVE_SMI_HANDLER))
i82801jx_set_acpi_mode(dev);
}