aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/pmc/pmclib.c
diff options
context:
space:
mode:
authorShaunak Saha <shaunak.saha@intel.com>2017-09-28 15:13:05 -0700
committerAaron Durbin <adurbin@chromium.org>2017-10-02 22:32:51 +0000
commit25cc76ff48d36f2718dbcce152424c60cda1ffc3 (patch)
treee5ce94848581221390b8626ce3e25b50f27821b9 /src/soc/intel/common/block/pmc/pmclib.c
parent1760cd3eb44ad123b6d3e3e295cdbf43f9465db1 (diff)
soc/intel/common/block: Move power button SMI functions to common PMC block
This patch moves the functions update_pm1_enable and read_pm1_enable to common block PMC. We rename the functions to pmc_update_pm1_enable and pmc_read_pm1_enable to keep semantics consistent. Change-Id: I9a73a6348fc22367ee2e68bf2c31823ebfefc525 Signed-off-by: Shaunak Saha <shaunak.saha@intel.com> Reviewed-on: https://review.coreboot.org/21755 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc/intel/common/block/pmc/pmclib.c')
-rw-r--r--src/soc/intel/common/block/pmc/pmclib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index e741332f88..78b43e44e9 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -72,6 +72,23 @@ static uint32_t print_smi_status(uint32_t smi_sts)
return smi_sts;
}
+/*
+ * Update supplied events in PM1_EN register. This does not disable any already
+ * set events.
+ */
+void pmc_update_pm1_enable(u16 events)
+{
+ u16 pm1_en = pmc_read_pm1_enable();
+ pm1_en |= events;
+ pmc_enable_pm1(pm1_en);
+}
+
+/* Read events set in PM1_EN register. */
+uint16_t pmc_read_pm1_enable(void)
+{
+ return inw(ACPI_BASE_ADDRESS + PM1_EN);
+}
+
uint32_t pmc_clear_smi_status(void)
{
uint32_t sts = pmc_reset_smi_status();