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 #include #include +#include #include #include #include @@ -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(); }