summaryrefslogtreecommitdiff
path: root/src/superio/smsc
diff options
context:
space:
mode:
authorMichał Żygowski <michal.zygowski@3mdeb.com>2021-11-21 17:00:02 +0100
committerMichał Żygowski <michal.zygowski@3mdeb.com>2021-11-27 14:22:43 +0000
commit3b1d1ce1af684f5a94376a023980d6d94cb7972a (patch)
tree241945d7107fd2f7d258c30c8ab6d2bdf9d08b47 /src/superio/smsc
parent257094ac1ad5ee63c9b98cecbc3f5437eeefcc79 (diff)
superio/smsc/sch5545: Clear PMEs in the early init
Disable PMEs and clear global PME status to avoid undesired wakeups or hangs in later stages. These bits are set by OS via ACPI can survive S5 state so it is necessary to set them back to defaults after an ungraceful shutdown. TEST=Dell OptiPlex 9010 does not hang anymore after ungraceful shutdown when configuring GPE0_EN register in southbridge LPC init Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I790cac3ce1101565b64ed54d9c6b50f5e9aa4cf6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59524 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/superio/smsc')
-rw-r--r--src/superio/smsc/sch5545/sch5545_early_init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/superio/smsc/sch5545/sch5545_early_init.c b/src/superio/smsc/sch5545/sch5545_early_init.c
index ed4fa5337b..d77ed0d750 100644
--- a/src/superio/smsc/sch5545/sch5545_early_init.c
+++ b/src/superio/smsc/sch5545/sch5545_early_init.c
@@ -100,6 +100,13 @@ void sch5545_early_init(unsigned int port)
sch5545_set_led(SCH5545_RUNTIME_REG_BASE, SCH5545_LED_COLOR_GREEN,
SCH5545_LED_BLINK_ON);
+ /*
+ * Clear global PME status and disable PME generation to avoid
+ * unexpected wakeups or hangs. OS will re-enable it via ACPI.
+ */
+ outb(0, SCH5545_RUNTIME_REG_BASE + SCH5545_RR_PME_EN);
+ outb(1, SCH5545_RUNTIME_REG_BASE + SCH5545_RR_PME_STS);
+
/* Configure EMI */
dev = PNP_DEV(port, SCH5545_LDN_LPC);
pnp_set_logical_device(dev);