From 9a1620f4ed5a17bde351142d3ca5489f3c95c61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 8 Jan 2021 13:27:33 +0200 Subject: cpu/x86/smm: Use common APMC logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify the debug messages on raised SMIs. Change-Id: I34eeb41d929bfb18730ac821a63bde95ef9a0b3e Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/49248 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/soc/intel/baytrail/smihandler.c | 8 +------- src/soc/intel/braswell/smihandler.c | 8 +------- src/soc/intel/broadwell/pch/smihandler.c | 8 +------- src/soc/intel/common/block/smm/smihandler.c | 8 +------- src/soc/intel/denverton_ns/smihandler.c | 8 +------- 5 files changed, 5 insertions(+), 35 deletions(-) (limited to 'src/soc') diff --git a/src/soc/intel/baytrail/smihandler.c b/src/soc/intel/baytrail/smihandler.c index 6fedba7f69..1a33444ca4 100644 --- a/src/soc/intel/baytrail/smihandler.c +++ b/src/soc/intel/baytrail/smihandler.c @@ -281,9 +281,7 @@ static void southbridge_smi_apmc(void) { uint8_t reg8; - /* Emulate B2 register as the FADT / Linux expects it */ - - reg8 = inb(APM_CNT); + reg8 = apm_get_apmc(); switch (reg8) { case APM_CNT_CST_CONTROL: /* @@ -291,7 +289,6 @@ static void southbridge_smi_apmc(void) * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "C-state control\n"); break; case APM_CNT_PST_CONTROL: /* @@ -299,15 +296,12 @@ static void southbridge_smi_apmc(void) * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "P-state control\n"); break; case APM_CNT_ACPI_DISABLE: disable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); break; case APM_CNT_ACPI_ENABLE: enable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); break; case APM_CNT_ELOG_GSMI: if (CONFIG(ELOG_GSMI)) diff --git a/src/soc/intel/braswell/smihandler.c b/src/soc/intel/braswell/smihandler.c index a4fdb013cb..7343d47933 100644 --- a/src/soc/intel/braswell/smihandler.c +++ b/src/soc/intel/braswell/smihandler.c @@ -260,9 +260,7 @@ static void southbridge_smi_apmc(void) { uint8_t reg8; - /* Emulate B2 register as the FADT / Linux expects it */ - - reg8 = inb(APM_CNT); + reg8 = apm_get_apmc(); switch (reg8) { case APM_CNT_CST_CONTROL: /* @@ -270,7 +268,6 @@ static void southbridge_smi_apmc(void) * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "C-state control\n"); break; case APM_CNT_PST_CONTROL: /* @@ -278,15 +275,12 @@ static void southbridge_smi_apmc(void) * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "P-state control\n"); break; case APM_CNT_ACPI_DISABLE: disable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); break; case APM_CNT_ACPI_ENABLE: enable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); break; case APM_CNT_ELOG_GSMI: if (CONFIG(ELOG_GSMI)) diff --git a/src/soc/intel/broadwell/pch/smihandler.c b/src/soc/intel/broadwell/pch/smihandler.c index 5ed52d8fbd..02c795e411 100644 --- a/src/soc/intel/broadwell/pch/smihandler.c +++ b/src/soc/intel/broadwell/pch/smihandler.c @@ -312,23 +312,17 @@ static void southbridge_smi_apmc(void) { u8 reg8; - /* Emulate B2 register as the FADT / Linux expects it */ - - reg8 = inb(APM_CNT); + reg8 = apm_get_apmc(); switch (reg8) { case APM_CNT_CST_CONTROL: - printk(BIOS_DEBUG, "C-state control\n"); break; case APM_CNT_PST_CONTROL: - printk(BIOS_DEBUG, "P-state control\n"); break; case APM_CNT_ACPI_DISABLE: disable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); break; case APM_CNT_ACPI_ENABLE: enable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); break; case APM_CNT_ELOG_GSMI: if (CONFIG(ELOG_GSMI)) diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c index 51a3003195..4aed3f8848 100644 --- a/src/soc/intel/common/block/smm/smihandler.c +++ b/src/soc/intel/common/block/smm/smihandler.c @@ -331,9 +331,7 @@ void smihandler_southbridge_apmc( { uint8_t reg8; - /* Emulate B2 register as the FADT / Linux expects it */ - - reg8 = inb(APM_CNT); + reg8 = apm_get_apmc(); switch (reg8) { case APM_CNT_CST_CONTROL: /* @@ -341,7 +339,6 @@ void smihandler_southbridge_apmc( * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "C-state control\n"); break; case APM_CNT_PST_CONTROL: /* @@ -349,15 +346,12 @@ void smihandler_southbridge_apmc( * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "P-state control\n"); break; case APM_CNT_ACPI_DISABLE: pmc_disable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); break; case APM_CNT_ACPI_ENABLE: pmc_enable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); break; case APM_CNT_ELOG_GSMI: if (CONFIG(ELOG_GSMI)) diff --git a/src/soc/intel/denverton_ns/smihandler.c b/src/soc/intel/denverton_ns/smihandler.c index ae15795db9..f00d9216ec 100644 --- a/src/soc/intel/denverton_ns/smihandler.c +++ b/src/soc/intel/denverton_ns/smihandler.c @@ -220,31 +220,25 @@ static void southbridge_smi_apmc(void) { uint8_t reg8; - /* Emulate B2 register as the FADT / Linux expects it */ - - reg8 = inb(APM_CNT); + reg8 = apm_get_apmc(); switch (reg8) { case APM_CNT_CST_CONTROL: /* Calling this function seems to cause * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "C-state control\n"); break; case APM_CNT_PST_CONTROL: /* Calling this function seems to cause * some kind of race condition in Linux * and causes a kernel oops */ - printk(BIOS_DEBUG, "P-state control\n"); break; case APM_CNT_ACPI_DISABLE: disable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI disabled.\n"); break; case APM_CNT_ACPI_ENABLE: enable_pm1_control(SCI_EN); - printk(BIOS_DEBUG, "SMI#: ACPI enabled.\n"); break; case APM_CNT_FINALIZE: finalize(); -- cgit v1.2.3