From 225b03534c81e2beb696f51175f14fd352f3090b Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Tue, 24 Apr 2018 18:07:14 -0600 Subject: soc/amd/stoneyridge: Fix smi_write32 arg order in disable_all_smi_status The argument order for smi_write32() is offset, value. Current code had it backwards. So, when disable_all_smi_status() was called by sb_slp_typ_handler(), instead of clearing pending flag SlpTypeEvent65 (0x2) in SMIx88 SmiStatus2 by writing 0x00000002 to 0xfed80288, it would instead write 0x00000088 to 0xfed80202 - clearing the lower 2 bytes of SMIx04 Event_Enable, which disabled the lower 16 GPEs from waking the system from S3. Thus, the EC events (Keyboard / lid switch) [GPE15] and touchpad [GPE7] did not work as wake up sources. BUG=b:78461678 TEST=powerd_dbus_suspend, tapping any key on keyboard wakes from S3. Change-Id: Ie4fbe6db1bb73f603dcf409117fcce93479a1f46 Fixes:081851a9e4 ("amd/stoneyridge: Add SlpTyp SMI handler") Signed-off-by: Daniel Kurtz Reviewed-on: https://review.coreboot.org/25815 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Marshall Dawson Reviewed-by: Paul Menzel --- src/soc/amd/stoneyridge/smihandler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c index 606378966e..ef24baaac4 100644 --- a/src/soc/amd/stoneyridge/smihandler.c +++ b/src/soc/amd/stoneyridge/smihandler.c @@ -112,12 +112,12 @@ static void sb_apmc_smi_handler(void) static void disable_all_smi_status(void) { - smi_write32(smi_read32(SMI_SCI_STATUS), SMI_SCI_STATUS); - smi_write32(smi_read32(SMI_REG_SMISTS0), SMI_REG_SMISTS0); - smi_write32(smi_read32(SMI_REG_SMISTS1), SMI_REG_SMISTS1); - smi_write32(smi_read32(SMI_REG_SMISTS2), SMI_REG_SMISTS2); - smi_write32(smi_read32(SMI_REG_SMISTS3), SMI_REG_SMISTS3); - smi_write32(smi_read32(SMI_REG_SMISTS4), SMI_REG_SMISTS4); + smi_write32(SMI_SCI_STATUS, smi_read32(SMI_SCI_STATUS)); + smi_write32(SMI_REG_SMISTS0, smi_read32(SMI_REG_SMISTS0)); + smi_write32(SMI_REG_SMISTS1, smi_read32(SMI_REG_SMISTS1)); + smi_write32(SMI_REG_SMISTS2, smi_read32(SMI_REG_SMISTS2)); + smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3)); + smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4)); } static void sb_slp_typ_handler(void) -- cgit v1.2.3