soc/intel/cmn/block/smbus: Keep TCO WDT timeout flag if ACPI_WDAT_WDT=y

The TCO SMI handler clears the watchdog timeout flag unconditionally.
Since the system is only rebooted if the flag is already set and the
watchdog timer expires again, this means that the reboot never occurs.
This change preserves the timeout flag if CONFIG_ACPI_WDAT_WDT is
enabled, otherwise the behavior remains unchanged.

TEST=Build CB with CONFIG_ACPI_WDAT_WDT=y and
CONFIG_USE_PM_ACPI_TIMER=y, trigger the watchdog under Linux
with "wdctl -s 5 && cat > /dev/watchdog" and wait approximately 10
seconds (two watchdog periods) for the watchdog to reboot the system.

Change-Id: I2d35a8f8bcbcc3aaaadcc936fab028641dfd6e2c
Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84875
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
Filip Brozovic 2024-10-26 19:26:41 +02:00 committed by Matt DeVillier
commit b4d311df6d

View file

@ -70,6 +70,15 @@ uint32_t tco_reset_status(void)
/* TCO Status 1 register */
tco1_sts = tco_read_reg(TCO1_STS);
/*
* Don't reset the TIMEOUT status bit in case the WDAT
* table is enabled, otherwise the watchdog will never
* reboot the system.
*/
if (CONFIG(ACPI_WDAT_WDT))
tco1_sts &= ~TCO1_STS_TIMEOUT;
tco_write_reg(TCO1_STS, tco1_sts);
/* TCO Status 2 register */