aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/pmc.c
diff options
context:
space:
mode:
authorShaunak Saha <shaunak.saha@intel.com>2016-07-24 20:50:12 -0700
committerMartin Roth <martinroth@google.com>2016-08-10 21:10:59 +0200
commit09115a92f6ac6123a6f1ed435c05fe60dc01d58c (patch)
tree9c6b16087c872cb140c5b447c33ebae3a78e2e23 /src/soc/intel/apollolake/pmc.c
parenta46ee4d34d6b7ce7d47882779c7fb36270ccbda1 (diff)
soc/apollolake: add GPIO SMI support
GPIOs which trigger SMIs set the GPIO_SMI_STS status bits in SMI_STS register. This patch also sets the SMI_EN bit in enable register for each community based on GPIOROUTSMI bit in gpio pad. When SMI on a gpio happens status needs to be gathered on gpio number which is done by reading the GPI_SMI_STS and GPI_SMI_EN registers. BUG=chrome-os-partner:54977 TEST=When system is in firmware mode executing the command lidclose from ec console shuts down the system. Change-Id: Id89a526106d1989c2bd3416ab81913e6cf743d17 Signed-off-by: Shaunak Saha <shaunak.saha@intel.com> Reviewed-on: https://review.coreboot.org/15833 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/intel/apollolake/pmc.c')
-rw-r--r--src/soc/intel/apollolake/pmc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/pmc.c b/src/soc/intel/apollolake/pmc.c
index f303632cb2..92a150ddf4 100644
--- a/src/soc/intel/apollolake/pmc.c
+++ b/src/soc/intel/apollolake/pmc.c
@@ -19,6 +19,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <console/console.h>
+#include <cpu/x86/smm.h>
#include <soc/iomap.h>
#include <soc/pci_ids.h>
#include <soc/gpio.h>
@@ -122,10 +123,20 @@ static void pmc_gpe_init(void)
fixup_power_state();
}
+static void pch_set_acpi_mode(void)
+{
+ if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER) && !acpi_is_wakeup_s3()) {
+ printk(BIOS_DEBUG, "Disabling ACPI via APMC:");
+ outb(APM_CNT_ACPI_DISABLE, APM_CNT);
+ printk(BIOS_DEBUG, "Done.\n");
+ }
+}
+
static void pmc_init(struct device *dev)
{
/* Set up GPE configuration */
pmc_gpe_init();
+ pch_set_acpi_mode();
}
static const struct device_operations device_ops = {