summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/skylake/chip.h9
-rw-r--r--src/soc/intel/skylake/include/soc/pmc.h5
-rw-r--r--src/soc/intel/skylake/pmc.c12
3 files changed, 26 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h
index d397c4e488..c04e9f80d9 100644
--- a/src/soc/intel/skylake/chip.h
+++ b/src/soc/intel/skylake/chip.h
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <soc/pci_devs.h>
+#include <soc/pmc.h>
#include <soc/serialio.h>
#ifndef _SOC_CHIP_H_
@@ -112,6 +113,14 @@ struct soc_intel_skylake_config {
int deep_s3_enable;
int deep_s5_enable;
+ /*
+ * Deep Sx Configuration
+ * DSX_EN_WAKE_PIN - Enable WAKE# pin
+ * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
+ * DSX_EN_AC_PRESENT_PIN - Enable AC_PRESENT pin
+ */
+ uint32_t deep_sx_config;
+
/* TCC activation offset */
int tcc_offset;
diff --git a/src/soc/intel/skylake/include/soc/pmc.h b/src/soc/intel/skylake/include/soc/pmc.h
index 699e795dca..5b5d663dac 100644
--- a/src/soc/intel/skylake/include/soc/pmc.h
+++ b/src/soc/intel/skylake/include/soc/pmc.h
@@ -55,6 +55,11 @@
#define S5_PWRGATE_POL 0x30
#define S5DC_GATE_SUS (1 << 15)
#define S5AC_GATE_SUS (1 << 14)
+#define DSX_CFG 0x34
+#define DSX_CFG_MASK 0x7
+#define DSX_EN_WAKE_PIN (1 << 2)
+#define DSX_EN_AC_PRESENT_PIN (1 << 1)
+#define DSX_EN_LAN_WAKE_PIN (1 << 0)
#define PMSYNC_TPR_CFG 0xc4
#define PMSYNC_LOCK (1 << 31)
#define GBLRST_CAUSE0 0x124
diff --git a/src/soc/intel/skylake/pmc.c b/src/soc/intel/skylake/pmc.c
index 934c1300af..b95441cc14 100644
--- a/src/soc/intel/skylake/pmc.c
+++ b/src/soc/intel/skylake/pmc.c
@@ -217,6 +217,17 @@ static void config_deep_s3(int on)
config_deep_sX(S3_PWRGATE_POL, S3DC_GATE_SUS | S3AC_GATE_SUS, 3, on);
}
+static void config_deep_sx(uint32_t deepsx_config)
+{
+ uint32_t reg;
+ uint8_t *pmcbase = pmc_mmio_regs();
+
+ reg = read32(pmcbase + DSX_CFG);
+ reg &= ~DSX_CFG_MASK;
+ reg |= deepsx_config;
+ write32(pmcbase + DSX_CFG, reg);
+}
+
static void pmc_init(struct device *dev)
{
config_t *config = dev->chip_info;
@@ -231,6 +242,7 @@ static void pmc_init(struct device *dev)
config_deep_s3(config->deep_s3_enable);
config_deep_s5(config->deep_s5_enable);
+ config_deep_sx(config->deep_sx_config);
}
static struct device_operations device_ops = {