aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/smbus
diff options
context:
space:
mode:
authorMichael Niewöhner <foss@mniewoehner.de>2020-03-03 20:47:01 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-03-11 14:28:53 +0000
commit2bd2be545f39db24b6174d57b503d42eddab9371 (patch)
treef3678716bd5ff18e7fcf2c27fa87b87c0c7ee51e /src/soc/intel/common/block/smbus
parentfc59f0860b3b5d4a75927571a907141ec85a7e2f (diff)
soc/intel/common/block: tco: enable intruder SMI if selected
Set TCO to issue an SMI when the case instrusion switch gets pressed. The SMI is controlled along with the general TCO SMI Kconfig. Tested on X11SSM-F. Change-Id: I3bc62c79ca3dc9e8896d9e2b9abdc14cfa46a9e7 Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39264 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/common/block/smbus')
-rw-r--r--src/soc/intel/common/block/smbus/tco.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/smbus/tco.c b/src/soc/intel/common/block/smbus/tco.c
index bd8790aa6e..2c0b760481 100644
--- a/src/soc/intel/common/block/smbus/tco.c
+++ b/src/soc/intel/common/block/smbus/tco.c
@@ -19,6 +19,7 @@
#include <device/pci.h>
#include <device/pci_def.h>
#include <intelblocks/pcr.h>
+#include <intelblocks/pmclib.h>
#include <intelblocks/tco.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
@@ -96,6 +97,18 @@ static void tco_timer_disable(void)
tco_write_reg(TCO1_CNT, tcocnt);
}
+/* Enable and initialize TCO intruder SMI */
+static void tco_intruder_smi_enable(void)
+{
+ uint16_t tcocnt;
+
+ /* Make TCO issue an SMI on INTRD_DET assertion */
+ tcocnt = tco_read_reg(TCO2_CNT);
+ tcocnt &= ~TCO_INTRD_SEL_MASK;
+ tcocnt |= TCO_INTRD_SEL_SMI;
+ tco_write_reg(TCO2_CNT, tcocnt);
+}
+
/* Enable TCO BAR using SMBUS TCO base to access TCO related register */
static void tco_enable_bar(void)
{
@@ -137,4 +150,8 @@ void tco_configure(void)
tco_enable_bar();
tco_timer_disable();
+
+ /* Enable intruder interrupt if TCO interrupts are enabled*/
+ if (CONFIG(SOC_INTEL_COMMON_BLOCK_SMM_TCO_ENABLE))
+ tco_intruder_smi_enable();
}