diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2022-10-28 15:44:48 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-08-26 21:32:11 +0000 |
commit | d627f7b4f71414a3fe229f9ac69e6d94e3dff127 (patch) | |
tree | f611898c13b0d5e49d66b30eecb7712bc0b147eb /src/soc/intel/common/block/include | |
parent | ee15c2ead828ac0a07a2941e6ef99a69da34cb2e (diff) |
soc/intel/common/block/oc_wdt: Add OC watchdog common block
Add new block for handling overclocking watchdog. The watchdog is
present since Skylake or maybe even earlier so it is safe to use with
most of the microarchitectures utilizing intelblocks.
The patch adds the common block for initializing and feeding the
watchdog. Timeout is defined statically in Kconfig and should be set
high enough by the board or SoC Kconfig to let the board boot with
full memory training and avoid reset loops. Full training of 128GB
DDR5 DIMM memory on AlderLake takes about 5 minutes. Newer SoCs
with newer memory technologies and higher RAM capacity may take more.
The default has been set to 10 minutes.
The patch also adds support for feeding watchdog in driverless mode,
i.e. it utilizies periodic SMI to reload the timeout value and restart
the watchdog timer. This is optional and selectable by Kconfig option
as well. If the option is not enabled, payload and/or software must
ensure to keep feeding the watchdog, otherwise the platform will
reset.
TEST=Enable watchdog on MSI PRO Z690-A and see the platform resets
after some time. Enable the watchdog in driverless mode and see the
platform no longer resets and periodic SMI keeps feeding the watchdog.
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: Ib494aa0c7581351abca8b496fc5895b2c7cbc5bc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68944
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block/include')
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/oc_wdt.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/oc_wdt.h b/src/soc/intel/common/block/include/intelblocks/oc_wdt.h new file mode 100644 index 0000000000..8a03a18732 --- /dev/null +++ b/src/soc/intel/common/block/include/intelblocks/oc_wdt.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_INTEL_COMMON_OC_WDT_H +#define SOC_INTEL_COMMON_OC_WDT_H + +#include <stdbool.h> + +/* + * Starts and reloads the OC watchdog with given timeout. + * + * timeout - Time in seconds before OC watchdog times out. Supported range = 70 - 1024 + */ +void oc_wdt_start(unsigned int timeout); + +/* Reloads the OC watchdog (if enabled) preserving the current settings. */ +void oc_wdt_reload(void); + +/* Disables the OC WDT */ +void oc_wdt_disable(void); + +/* Checks if OC WDT is enabled and returns true if so, otherwise false */ +bool is_oc_wdt_enabled(void); + +/* Returns currently programmed OC watchdog timeout in seconds */ +unsigned int oc_wdt_get_current_timeout(void); + +#endif |