summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2016-08-18 21:42:36 -0700
committerFurquan Shaikh <furquan@google.com>2016-08-20 10:48:47 +0200
commit97e0a65081fe8043550a46e38f86481619f49c74 (patch)
treef4cb942b0fd240daa8979c89e5c0cdc9048f10ba
parent63e424cec250374997bce1471d0c63dec0d71adc (diff)
intel/skylake: Do not halt in poweroff if in SMM
Calling halt in poweroff when in SMM prevents SLP_SMI to be triggered preventing the system from entering sleep state. Fix this by calling halt only if ENV_SMM is not true. BUG=chrome-os-partner:56395 Change-Id: I3addc1ea065346fbc5dbec9d1ad49bbd0ae05696 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/16259 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/soc/intel/skylake/pmutil.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c
index 807579d8e0..31de242752 100644
--- a/src/soc/intel/skylake/pmutil.c
+++ b/src/soc/intel/skylake/pmutil.c
@@ -25,6 +25,7 @@
#include <device/pci_def.h>
#include <console/console.h>
#include <halt.h>
+#include <rules.h>
#include <stdlib.h>
#include <soc/gpio.h>
#include <soc/iomap.h>
@@ -435,5 +436,12 @@ uint16_t smbus_tco_regs(void)
void poweroff(void)
{
enable_pm1_control(SLP_EN | (SLP_TYP_S5 << SLP_TYP_SHIFT));
- halt();
+
+ /*
+ * Setting SLP_TYP_S5 in PM1 triggers SLP_SMI, which is handled by SMM
+ * to transition to S5 state. If halt is called in SMM, then it prevents
+ * the SMI handler from being triggered and system never enters S5.
+ */
+ if (!ENV_SMM)
+ halt();
}