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>
This commit is contained in:
Michał Żygowski 2021-11-21 17:00:02 +01:00
parent 257094ac1a
commit 3b1d1ce1af
1 changed files with 7 additions and 0 deletions

View File

@ -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);