diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-06-10 18:04:21 -0500 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-06-12 12:52:28 +0200 |
commit | a554b71e3207556dd563c5253e79ff15a601dc0e (patch) | |
tree | ddf4291b96d5241fa2e0a4c1d16acef66add85b2 /src/soc/intel/apollolake/pmutil.c | |
parent | 7929dd02e68ba52a41c5a8a48b6b7bf8b918677d (diff) | |
download | coreboot-a554b71e3207556dd563c5253e79ff15a601dc0e.tar.xz |
soc/intel/apollolake: provide fake PM1 SMI status bit
It appears that PM1 is not wired up to the SMI status register, but
it does definitely cause SMIs to trigger. Therefore, provide a fake
PM1 status bit by checking the power button status when SMI status
is indicating no status as well as the PM1 control indicating that
SCI mode is not enabled.
BUG=chrome-os-partner:54262
TEST=Smashed power button on reef to cause SMI in firmware. No longer
loops infinitely with constant SMIs firing.
Change-Id: I9aa1b5f79b651cbc19a2d3353d9ef65429386889
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/15155
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/apollolake/pmutil.c')
-rw-r--r-- | src/soc/intel/apollolake/pmutil.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c index bebc1c7178..6e47911fcd 100644 --- a/src/soc/intel/apollolake/pmutil.c +++ b/src/soc/intel/apollolake/pmutil.c @@ -60,6 +60,7 @@ static uint32_t print_smi_status(uint32_t smi_sts) [SLP_SMI_STS] = "SLP_SMI", [APM_SMI_STS] = "APM", [SWSMI_TMR_SMI_STS] = "SWSMI_TMR", + [FAKE_PM1_SMI_STS] = "PM1", [GPIO_SMI_STS]= "GPIO_SMI", [GPIO_UNLOCK_SMI_STS]= "GPIO_UNLOCK_SSMI", [MC_SMI_STS] = "MCSMI", @@ -96,7 +97,23 @@ static uint32_t reset_smi_status(void) uint32_t clear_smi_status(void) { - return print_smi_status(reset_smi_status()); + uint32_t sts = reset_smi_status(); + + /* + * Check for power button status if nothing else is indicating an SMI + * and SMIs aren't turned into SCIs. Apparently, there is no PM1 status + * bit in the SMI status register. That makes things difficult for + * determining if the power button caused an SMI. + */ + if (sts == 0 && !(inl(ACPI_PMIO_BASE + PM1_CNT) & SCI_EN)) { + uint16_t pm1_sts = inw(ACPI_PMIO_BASE + PM1_STS); + + /* Fake PM1 status bit if power button pressed. */ + if (pm1_sts & PWRBTN_STS) + sts |= (1 << FAKE_PM1_SMI_STS); + } + + return print_smi_status(sts); } uint32_t get_smi_en(void) |