diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2022-01-18 12:31:08 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-01-25 16:15:30 +0000 |
commit | 0099832cdab2337da5d3efc92fdd9b7a4f645cc1 (patch) | |
tree | 8091ab705e184415a9544167904a37a1027a0787 /src/soc/intel/elkhartlake | |
parent | 964055d74f6db71607e8fc36ca352fde05f4b6ee (diff) |
soc/intel/ehl: Add Kconfig option to disable reset on TCO expiration
The TCO timer is the default watchdog of an x86 host and can reset the
system once it has expired for the second time. There are applications
where this reset is not acceptable while the TCO is used. In these
applications the TCO expire event generates an interrupt and software
takes care. There is a bit in the TCO1_CNT register on Elkhart Lake to
prevent this reset on expiration (called NO_REBOOT, see doc #636722 ).
This bit can either be strapped on hardware or set in this register to
avoid the reset on expiration. While the hardware strap cannot be
overridden in software, the pure software solution is more flexible.
Unfortunately, the location for this bit differs among the different
platforms. This is why it has to be handled on soc level rather than on
TCO common code level.
This commit adds a Kconfig option where NO_REBOOT can be enabled. This
makes it easy to reach this feature over to the mainboard where it can
be selected if needed.
Change-Id: Iaa81bfbe688edd717aa02db86f0a93fecdfcd16b
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/soc/intel/elkhartlake')
-rw-r--r-- | src/soc/intel/elkhartlake/Kconfig | 10 | ||||
-rw-r--r-- | src/soc/intel/elkhartlake/bootblock/bootblock.c | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/intel/elkhartlake/Kconfig b/src/soc/intel/elkhartlake/Kconfig index 37807897aa..b8296021fc 100644 --- a/src/soc/intel/elkhartlake/Kconfig +++ b/src/soc/intel/elkhartlake/Kconfig @@ -251,4 +251,14 @@ config SOC_INTEL_ELKHARTLAKE_DEBUG_CONSENT config PRERAM_CBMEM_CONSOLE_SIZE hex default 0x1400 + +config SOC_INTEL_ELKHARTLAKE_TCO_NO_REBOOT_EN + bool "Disable reset on second TCO expiration" + depends on SOC_INTEL_COMMON_BLOCK_TCO + default n + help + Setting this option will prevent a host reset if the TCO timer expires + for the second time. Since this feature is not exposed to the OS in the + standard TCO interface, this setting can be enabled on firmware level. + This might be useful depending on the TCO policy. endif diff --git a/src/soc/intel/elkhartlake/bootblock/bootblock.c b/src/soc/intel/elkhartlake/bootblock/bootblock.c index b8086a42ab..cc0bb8f0c4 100644 --- a/src/soc/intel/elkhartlake/bootblock/bootblock.c +++ b/src/soc/intel/elkhartlake/bootblock/bootblock.c @@ -1,10 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <bootblock_common.h> +#include <console/console.h> #include <intelblocks/fast_spi.h> #include <intelblocks/systemagent.h> #include <intelblocks/tco.h> #include <intelblocks/uart.h> +#include <intelpch/smbus.h> #include <soc/bootblock.h> asmlinkage void bootblock_c_entry(uint64_t base_timestamp) @@ -30,4 +32,11 @@ void bootblock_soc_init(void) /* Programming TCO_BASE_ADDRESS and TCO Timer Halt */ tco_configure(); + if (CONFIG(SOC_INTEL_ELKHARTLAKE_TCO_NO_REBOOT_EN)) { + uint16_t reg = tco_read_reg(TCO1_CNT); + /* NO_REBOOT is enabled via bit 0 in TCO1_CNT. */ + reg |= 0x01; + tco_write_reg(TCO1_CNT, reg); + printk(BIOS_DEBUG, "TCO: Disable reset on second expiration.\n"); + } } |