aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/pmutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/apollolake/pmutil.c')
-rw-r--r--src/soc/intel/apollolake/pmutil.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c
index 2aef18c8e6..56bb33dc40 100644
--- a/src/soc/intel/apollolake/pmutil.c
+++ b/src/soc/intel/apollolake/pmutil.c
@@ -17,6 +17,7 @@
#define __SIMPLE_DEVICE__
+#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <cbmem.h>
@@ -301,6 +302,26 @@ uint32_t clear_gpe_status(void)
return print_gpe_sts(reset_gpe_status());
}
+/* Read and clear GPE status (defined in arch/acpi.h) */
+int acpi_get_gpe(int gpe)
+{
+ int bank;
+ uint32_t mask, sts;
+
+ if (gpe < 0 || gpe > GPE0_DW3_31)
+ return -1;
+
+ bank = gpe / 32;
+ mask = 1 << (gpe % 32);
+
+ sts = inl(ACPI_PMIO_BASE + GPE0_STS(bank));
+ if (sts & mask) {
+ outl(mask, ACPI_PMIO_BASE + GPE0_STS(bank));
+ return 1;
+ }
+ return 0;
+}
+
void clear_pmc_status(void)
{
uint32_t prsts;