summaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake/pmutil.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-08-17 18:28:41 -0700
committerFurquan Shaikh <furquan@google.com>2017-08-19 00:33:04 +0000
commitaeb2d64c85ca2c3a77f50d57e3a92f6fc0a5c2d3 (patch)
tree1b0e09b0ff072bfeb3d300c709b24d1037362a08 /src/soc/intel/skylake/pmutil.c
parentaef8542d810b737fe2653dcca1d9566292b3b65d (diff)
downloadcoreboot-aeb2d64c85ca2c3a77f50d57e3a92f6fc0a5c2d3.tar.xz
soc/intel/skylake: Enable power button SMI when jumping to payload
Instead of enabling power button SMI unconditionally, add a boot state handler to enable power button SMI just before jumping to payload. This ensures that: 1. We do not respond to power button SMI until we know that coreboot is done. 2. On resume, there is no need to enable power button SMI. This avoids any power button presses during resume path from triggering a shutdown. BUG=b:64811381 Change-Id: Icc52dc0103555602c23e09660bc38bb4bfddbc11 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/21082 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Diffstat (limited to 'src/soc/intel/skylake/pmutil.c')
-rw-r--r--src/soc/intel/skylake/pmutil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c
index 9b38531129..fa2dc2d039 100644
--- a/src/soc/intel/skylake/pmutil.c
+++ b/src/soc/intel/skylake/pmutil.c
@@ -142,6 +142,22 @@ void enable_pm1(u16 events)
outw(events, ACPI_BASE_ADDRESS + PM1_EN);
}
+/*
+ * Update supplied events in PM1_EN register. This does not disable any already
+ * set events.
+ */
+void update_pm1_enable(u16 events)
+{
+ u16 pm1_en = read_pm1_enable();
+ pm1_en |= events;
+ enable_pm1(pm1_en);
+}
+
+/* Read events set in PM1_EN register. */
+uint16_t read_pm1_enable(void)
+{
+ return inw(ACPI_BASE_ADDRESS + PM1_EN);
+}
/*
* SMI