Attention is currently required from: Felix Held. Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59524 )
Change subject: superio/smsc/sch5545: Fix KBD and Runtime Registers init ......................................................................
superio/smsc/sch5545: Fix KBD and Runtime Registers init
Disable PS/2 data and clock isolation in order to properly initialize the PS/2 keyboard and mouse in payload/OS. Also disable PMEs and clear global PME status to avoid undesired wakeups or hangs. 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 and PS/2 keyboard can be always initialized in SeaBIOS
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: I790cac3ce1101565b64ed54d9c6b50f5e9aa4cf6 --- M src/superio/smsc/sch5545/sch5545_early_init.c M src/superio/smsc/sch5545/superio.c 2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/59524/1
diff --git a/src/superio/smsc/sch5545/sch5545_early_init.c b/src/superio/smsc/sch5545/sch5545_early_init.c index ed4fa53..d77ed0d 100644 --- a/src/superio/smsc/sch5545/sch5545_early_init.c +++ b/src/superio/smsc/sch5545/sch5545_early_init.c @@ -100,6 +100,13 @@ 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); diff --git a/src/superio/smsc/sch5545/superio.c b/src/superio/smsc/sch5545/superio.c index b6e5308..a819ae7 100644 --- a/src/superio/smsc/sch5545/superio.c +++ b/src/superio/smsc/sch5545/superio.c @@ -62,6 +62,11 @@
switch (dev->path.pnp.device) { case SCH5545_LDN_KBC: + pnp_enter_conf_mode(dev); + pnp_set_logical_device(dev); + /* Disable PS/2 clock and data isolation */ + pnp_write_config(dev, 0xf0, pnp_read_config(dev, 0xf0) & 0x9f); + pnp_exit_conf_mode(dev); pc_keyboard_init(NO_AUX_DEVICE); break; case SCH5545_LDN_LPC: