From 04326aabcdccabf83064d585758c6d635b9f1a3b Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 28 May 2019 10:00:05 +0200 Subject: [PATCH] sb/intel/ibexpeak/smihandler: Move finalizing to a common location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO: There is no reason to do this in SMM. Change-Id: I8bbb2f65bbe674bd1bc4ae8a4086bd1f5e9a79fa Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/33139 Reviewed-by: Kyösti Mälkki Reviewed-by: HAOUAS Elyes Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/mainboard/lenovo/x201/smihandler.c | 19 ------------------- src/mainboard/packardbell/ms2290/smihandler.c | 19 ------------------- src/southbridge/intel/ibexpeak/smihandler.c | 7 +++++++ 3 files changed, 7 insertions(+), 38 deletions(-) diff --git a/src/mainboard/lenovo/x201/smihandler.c b/src/mainboard/lenovo/x201/smihandler.c index fc6a0e9670..9043f8e18c 100644 --- a/src/mainboard/lenovo/x201/smihandler.c +++ b/src/mainboard/lenovo/x201/smihandler.c @@ -20,10 +20,7 @@ #include #include #include -#include -#include #include -#include #include #include #include @@ -135,25 +132,9 @@ void mainboard_smi_gpi(u32 gpi_sts) mainboard_smi_handle_ec_sci(); } -static int mainboard_finalized = 0; - int mainboard_smi_apmc(u8 data) { switch (data) { - case APM_CNT_FINALIZE: - printk(BIOS_DEBUG, "APMC: FINALIZE\n"); - if (mainboard_finalized) { - printk(BIOS_DEBUG, "APMC#: Already finalized\n"); - return 0; - } - - intel_me_finalize_smm(); - intel_pch_finalize_smm(); - intel_nehalem_finalize_smm(); - intel_model_2065x_finalize_smm(); - - mainboard_finalized = 1; - break; case APM_CNT_ACPI_ENABLE: /* use 0x1600/0x1604 to prevent races with userspace */ ec_set_ports(0x1604, 0x1600); diff --git a/src/mainboard/packardbell/ms2290/smihandler.c b/src/mainboard/packardbell/ms2290/smihandler.c index 83562be921..dfc66f98cf 100644 --- a/src/mainboard/packardbell/ms2290/smihandler.c +++ b/src/mainboard/packardbell/ms2290/smihandler.c @@ -18,11 +18,8 @@ #include #include #include -#include -#include #include #include -#include #include static void mainboard_smm_init(void) @@ -54,26 +51,10 @@ void mainboard_smi_gpi(u32 gpi_sts) { } -static int mainboard_finalized = 0; - int mainboard_smi_apmc(u8 data) { u8 tmp; switch (data) { - case APM_CNT_FINALIZE: - printk(BIOS_DEBUG, "APMC: FINALIZE\n"); - if (mainboard_finalized) { - printk(BIOS_DEBUG, "APMC#: Already finalized\n"); - return 0; - } - - intel_me_finalize_smm(); - intel_pch_finalize_smm(); - intel_nehalem_finalize_smm(); - intel_model_2065x_finalize_smm(); - - mainboard_finalized = 1; - break; case APM_CNT_ACPI_ENABLE: tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb); tmp &= ~0x03; diff --git a/src/southbridge/intel/ibexpeak/smihandler.c b/src/southbridge/intel/ibexpeak/smihandler.c index dbc412c072..208075bbea 100644 --- a/src/southbridge/intel/ibexpeak/smihandler.c +++ b/src/southbridge/intel/ibexpeak/smihandler.c @@ -24,7 +24,10 @@ #include #include #include +#include +#include #include +#include #include "pch.h" #include "nvs.h" @@ -182,4 +185,8 @@ void southbridge_update_gnvs(u8 apm_cnt, int *smm_done) void southbridge_finalize_all(void) { + intel_me_finalize_smm(); + intel_pch_finalize_smm(); + intel_nehalem_finalize_smm(); + intel_model_2065x_finalize_smm(); }