diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2020-06-01 15:11:14 +0300 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-16 08:02:18 +0000 |
commit | b6585481e8cb30ed04a1673b170af3df9e0e4320 (patch) | |
tree | 09d4fad217ffb0dd6fb33b4d8e4c8dc20bfd708f /src/soc/intel | |
parent | 94464474756f0cacdf04a70b95ec4a0462516a63 (diff) | |
download | coreboot-b6585481e8cb30ed04a1673b170af3df9e0e4320.tar.xz |
arch/x86: Create helper for APM_CNT SMI triggers
Attempts to write to APM_CNT IO port should always be guarded
with a test to verify SMI handler has been installed.
Immediate followup removes redundant HAVE_SMI_HANDLER tests.
Change-Id: If3fb0f1a8b32076f1d9f3fea9f817dd4b093ad98
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41971
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/broadwell/lpc.c | 4 | ||||
-rw-r--r-- | src/soc/intel/cannonlake/finalize.c | 4 | ||||
-rw-r--r-- | src/soc/intel/common/block/pmc/pmc.c | 4 | ||||
-rw-r--r-- | src/soc/intel/denverton_ns/lpc.c | 3 | ||||
-rw-r--r-- | src/soc/intel/denverton_ns/pmc.c | 4 | ||||
-rw-r--r-- | src/soc/intel/icelake/finalize.c | 4 | ||||
-rw-r--r-- | src/soc/intel/jasperlake/finalize.c | 4 | ||||
-rw-r--r-- | src/soc/intel/skylake/finalize.c | 4 | ||||
-rw-r--r-- | src/soc/intel/tigerlake/finalize.c | 4 |
9 files changed, 9 insertions, 26 deletions
diff --git a/src/soc/intel/broadwell/lpc.c b/src/soc/intel/broadwell/lpc.c index 5cfeb5fe22..d5f8451272 100644 --- a/src/soc/intel/broadwell/lpc.c +++ b/src/soc/intel/broadwell/lpc.c @@ -410,9 +410,7 @@ static void pch_cg_init(struct device *dev) static void pch_set_acpi_mode(void) { if (CONFIG(HAVE_SMI_HANDLER) && !acpi_is_wakeup_s3()) { - printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n"); - outb(APM_CNT_ACPI_DISABLE, APM_CNT); - printk(BIOS_DEBUG, "done.\n"); + apm_control(APM_CNT_ACPI_DISABLE); } } diff --git a/src/soc/intel/cannonlake/finalize.c b/src/soc/intel/cannonlake/finalize.c index a693735ac3..49e9d7f66a 100644 --- a/src/soc/intel/cannonlake/finalize.c +++ b/src/soc/intel/cannonlake/finalize.c @@ -101,9 +101,7 @@ static void soc_finalize(void *unused) printk(BIOS_DEBUG, "Finalizing chipset.\n"); pch_finalize(); - - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); /* Indicate finalize step with post code */ post_code(POST_OS_BOOT); diff --git a/src/soc/intel/common/block/pmc/pmc.c b/src/soc/intel/common/block/pmc/pmc.c index 524e36a554..cc004191ef 100644 --- a/src/soc/intel/common/block/pmc/pmc.c +++ b/src/soc/intel/common/block/pmc/pmc.c @@ -94,9 +94,7 @@ static void pch_pmc_read_resources(struct device *dev) void pmc_set_acpi_mode(void) { if (CONFIG(HAVE_SMI_HANDLER) && !acpi_is_wakeup_s3()) { - printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n"); - outb(APM_CNT_ACPI_DISABLE, APM_CNT); - printk(BIOS_DEBUG, "done.\n"); + apm_control(APM_CNT_ACPI_DISABLE); } } diff --git a/src/soc/intel/denverton_ns/lpc.c b/src/soc/intel/denverton_ns/lpc.c index 05c648438c..228e0f65ae 100644 --- a/src/soc/intel/denverton_ns/lpc.c +++ b/src/soc/intel/denverton_ns/lpc.c @@ -555,8 +555,7 @@ static const struct pci_driver lpc_driver __pci_driver = { static void finalize_chipset(void *unused) { - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); } BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL); diff --git a/src/soc/intel/denverton_ns/pmc.c b/src/soc/intel/denverton_ns/pmc.c index 25a0e59ba5..3c592fe05f 100644 --- a/src/soc/intel/denverton_ns/pmc.c +++ b/src/soc/intel/denverton_ns/pmc.c @@ -25,9 +25,7 @@ static void pch_power_options(struct device *dev) { /* TODO */ } static void pch_set_acpi_mode(void) { if (CONFIG(HAVE_SMI_HANDLER) && !acpi_is_wakeup_s3()) { - printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n"); - outb(APM_CNT_ACPI_DISABLE, APM_CNT); - printk(BIOS_DEBUG, "done.\n"); + apm_control(APM_CNT_ACPI_DISABLE); } } diff --git a/src/soc/intel/icelake/finalize.c b/src/soc/intel/icelake/finalize.c index 78a3108423..fdeaaaddde 100644 --- a/src/soc/intel/icelake/finalize.c +++ b/src/soc/intel/icelake/finalize.c @@ -94,9 +94,7 @@ static void soc_finalize(void *unused) printk(BIOS_DEBUG, "Finalizing chipset.\n"); pch_finalize(); - - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); /* Indicate finalize step with post code */ post_code(POST_OS_BOOT); diff --git a/src/soc/intel/jasperlake/finalize.c b/src/soc/intel/jasperlake/finalize.c index f801960a12..d16080fd50 100644 --- a/src/soc/intel/jasperlake/finalize.c +++ b/src/soc/intel/jasperlake/finalize.c @@ -87,9 +87,7 @@ static void soc_finalize(void *unused) printk(BIOS_DEBUG, "Finalizing chipset.\n"); pch_finalize(); - - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); /* Indicate finalize step with post code */ post_code(POST_OS_BOOT); diff --git a/src/soc/intel/skylake/finalize.c b/src/soc/intel/skylake/finalize.c index b20f391f8d..dbb451c6be 100644 --- a/src/soc/intel/skylake/finalize.c +++ b/src/soc/intel/skylake/finalize.c @@ -128,9 +128,7 @@ static void soc_finalize(void *unused) pch_finalize_script(dev); soc_lockdown(dev); - - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); /* Indicate finalize step with post code */ post_code(POST_OS_BOOT); diff --git a/src/soc/intel/tigerlake/finalize.c b/src/soc/intel/tigerlake/finalize.c index a402625799..d0dc30e056 100644 --- a/src/soc/intel/tigerlake/finalize.c +++ b/src/soc/intel/tigerlake/finalize.c @@ -73,9 +73,7 @@ static void soc_finalize(void *unused) printk(BIOS_DEBUG, "Finalizing chipset.\n"); pch_finalize(); - - printk(BIOS_DEBUG, "Finalizing SMM.\n"); - outb(APM_CNT_FINALIZE, APM_CNT); + apm_control(APM_CNT_FINALIZE); /* Indicate finalize step with post code */ post_code(POST_OS_BOOT); |