# SPDX-License-Identifier: GPL-2.0-only

#
# Watchdog device configuration
#

menuconfig WATCHDOG
	bool "Watchdog Timer Support"
	help
	  If you say Y here (and to one of the following options) and create a
	  character special file /dev/watchdog with major number 10 and minor
	  number 130 using mknod ("man mknod"), you will get a watchdog, i.e.:
	  subsequently opening the file and then failing to write to it for
	  longer than 1 minute will result in rebooting the machine. This
	  could be useful for a networked machine that needs to come back
	  on-line as fast as possible after a lock-up. There's both a watchdog
	  implementation entirely in software (which can sometimes fail to
	  reboot the machine) and a driver for hardware watchdog boards, which
	  are more robust and can also keep track of the temperature inside
	  your computer. For details, read
	  <file:Documentation/watchdog/watchdog-api.rst> in the kernel source.

	  The watchdog is usually used together with the watchdog daemon
	  which is available from
	  <https://ibiblio.org/pub/Linux/system/daemons/watchdog/>. This daemon
	  can also monitor NFS connections and can reboot the machine when the
	  process table is full.

	  If unsure, say N.

if WATCHDOG

config WATCHDOG_CORE
	tristate "WatchDog Timer Driver Core"
	help
	  Say Y here if you want to use the new watchdog timer driver core.
	  This driver provides a framework for all watchdog timer drivers
	  and gives them the /dev/watchdog interface (and later also the
	  sysfs interface).

config WATCHDOG_NOWAYOUT
	bool "Disable watchdog shutdown on close"
	help
	  The default watchdog behaviour (which you get if you say N here) is
	  to stop the timer if the process managing it closes the file
	  /dev/watchdog. It's always remotely possible that this process might
	  get killed. If you say Y here, the watchdog cannot be stopped once
	  it has been started.

config WATCHDOG_HANDLE_BOOT_ENABLED
	bool "Update boot-enabled watchdog until userspace takes over"
	default y
	help
	  The default watchdog behaviour (which you get if you say Y here) is
	  to ping watchdog devices that were enabled before the driver has
	  been loaded until control is taken over from userspace using the
	  /dev/watchdog file. If you say N here, the kernel will not update
	  the watchdog on its own. Thus if your userspace does not start fast
	  enough your device will reboot.

config WATCHDOG_OPEN_TIMEOUT
	int "Timeout value for opening watchdog device"
	default 0
	help
	  The maximum time, in seconds, for which the watchdog framework takes
	  care of pinging a hardware watchdog.  A value of 0 means infinite. The
	  value set here can be overridden by the commandline parameter
	  "watchdog.open_timeout".

config WATCHDOG_SYSFS
	bool "Read different watchdog information through sysfs"
	help
	  Say Y here if you want to enable watchdog device status read through
	  sysfs attributes.

config WATCHDOG_HRTIMER_PRETIMEOUT
	bool "Enable watchdog hrtimer-based pretimeouts"
	help
	  Enable this if you want to use a hrtimer timer based pretimeout for
	  watchdogs that do not natively support pretimeout support. Be aware
	  that because this pretimeout functionality uses hrtimers, it may not
	  be able to fire before the actual watchdog fires in some situations.

comment "Watchdog Pretimeout Governors"

config WATCHDOG_PRETIMEOUT_GOV
	bool "Enable watchdog pretimeout governors"
	depends on WATCHDOG_CORE
	help
	  The option allows to select watchdog pretimeout governors.

config WATCHDOG_PRETIMEOUT_GOV_SEL
	tristate
	depends on WATCHDOG_PRETIMEOUT_GOV
	default m
	select WATCHDOG_PRETIMEOUT_GOV_PANIC if WATCHDOG_PRETIMEOUT_GOV_NOOP=n

if WATCHDOG_PRETIMEOUT_GOV

config WATCHDOG_PRETIMEOUT_GOV_NOOP
	tristate "Noop watchdog pretimeout governor"
	depends on WATCHDOG_CORE
	default WATCHDOG_CORE
	help
	  Noop watchdog pretimeout governor, only an informational
	  message is added to kernel log buffer.

config WATCHDOG_PRETIMEOUT_GOV_PANIC
	tristate "Panic watchdog pretimeout governor"
	depends on WATCHDOG_CORE
	default WATCHDOG_CORE
	help
	  Panic watchdog pretimeout governor, on watchdog pretimeout
	  event put the kernel into panic.

choice
	prompt "Default Watchdog Pretimeout Governor"
	default WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
	help
	  This option selects a default watchdog pretimeout governor.
	  The governor takes its action, if a watchdog is capable
	  to report a pretimeout event.

config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
	bool "noop"
	depends on WATCHDOG_PRETIMEOUT_GOV_NOOP
	help
	  Use noop watchdog pretimeout governor by default. If noop
	  governor is selected by a user, write a short message to
	  the kernel log buffer and don't do any system changes.

config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
	bool "panic"
	depends on WATCHDOG_PRETIMEOUT_GOV_PANIC
	help
	  Use panic watchdog pretimeout governor by default, if
	  a watchdog pretimeout event happens, consider that
	  a watchdog feeder is dead and reboot is unavoidable.

endchoice

endif # WATCHDOG_PRETIMEOUT_GOV

#
# General Watchdog drivers
#

comment "Watchdog Device Drivers"

# Architecture Independent

config SOFT_WATCHDOG
	tristate "Software watchdog"
	select WATCHDOG_CORE
	help
	  A software monitoring watchdog. This will fail to reboot your system
	  from some situations that the hardware watchdog will recover
	  from. Equally it's a lot cheaper to install.

	  To compile this driver as a module, choose M here: the
	  module will be called softdog.

config SOFT_WATCHDOG_PRETIMEOUT
	bool "Software watchdog pretimeout governor support"
	depends on SOFT_WATCHDOG && WATCHDOG_PRETIMEOUT_GOV
	help
	  Enable this if you want to use pretimeout governors with the software
	  watchdog. Be aware that governors might affect the watchdog because it
	  is purely software, e.g. the panic governor will stall it!

config BD957XMUF_WATCHDOG
	tristate "ROHM BD9576MUF and BD9573MUF PMIC Watchdog"
	depends on MFD_ROHM_BD957XMUF
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the ROHM BD9576 and BD9573 PMICs.
	  These PMIC ICs contain watchdog block which can be configured
	  to toggle reset line if SoC fails to ping watchdog via GPIO.

	  Say Y here to include support for the ROHM BD9576 or BD9573
	  watchdog. Alternatively say M to compile the driver as a module,
	  which will be called bd9576_wdt.

config BD96801_WATCHDOG
	tristate "ROHM BD96801 PMIC Watchdog"
	depends on MFD_ROHM_BD96801
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the ROHM BD96801 PMIC. Watchdog can be
	  configured to only generate IRQ or to trigger system reset via reset
	  pin.

	  Say Y here to include support for the ROHM BD96801 watchdog.
	  Alternatively say M to compile the driver as a module,
	  which will be called bd96801_wdt.

config CROS_EC_WATCHDOG
	tristate "ChromeOS EC-based watchdog"
	select WATCHDOG_CORE
	depends on CROS_EC
	help
	  Watchdog driver for Chromebook devices equipped with embedded controller.
	  Trigger event is recorded in EC and checked on the subsequent boot.

	  To compile this driver as a module, choose M here: the
	  module will be called cros_ec_wdt.

config DA9052_WATCHDOG
	tristate "Dialog DA9052 Watchdog"
	depends on PMIC_DA9052 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9052 PMIC. Watchdog trigger
	  cause system reset.

	  Say Y here to include support for the DA9052 watchdog.
	  Alternatively say M to compile the driver as a module,
	  which will be called da9052_wdt.

config DA9055_WATCHDOG
	tristate "Dialog Semiconductor DA9055 Watchdog"
	depends on MFD_DA9055 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for watchdog on the Dialog
	  Semiconductor DA9055 PMIC.

	  This driver can also be built as a module.  If so, the module
	  will be called da9055_wdt.

config DA9063_WATCHDOG
	tristate "Dialog DA9063 Watchdog"
	depends on MFD_DA9063 || COMPILE_TEST
	depends on I2C
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9063 PMIC.

	  This driver can be built as a module. The module name is da9063_wdt.

config DA9062_WATCHDOG
	tristate "Dialog DA9062/61 Watchdog"
	depends on MFD_DA9062 || COMPILE_TEST
	depends on I2C
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9062 and DA9061 PMICs.

	  This driver can be built as a module. The module name is da9062_wdt.

config GPIO_WATCHDOG
	tristate "Watchdog device controlled through GPIO-line"
	depends on GPIOLIB && (ACPI || OF)
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for watchdog device
	  controlled through GPIO-line.

config GPIO_WATCHDOG_ARCH_INITCALL
	bool "Register the watchdog as early as possible"
	depends on GPIO_WATCHDOG=y
	help
	  In some situations, the default initcall level (module_init)
	  in not early enough in the boot process to avoid the watchdog
	  to be triggered.
	  If you say yes here, the initcall level would be raised to
	  arch_initcall.
	  If in doubt, say N.

config LENOVO_SE10_WDT
	tristate "Lenovo SE10 Watchdog"
	depends on (X86 && DMI) || COMPILE_TEST
	depends on HAS_IOPORT
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for the watchdog
	  functionality for the Lenovo SE10 platform.

	  This driver can also be built as a module. If so, the module
	  will be called lenovo-se10-wdt.

config LENOVO_SE30_WDT
	tristate "Lenovo SE30 Watchdog"
	depends on (X86 && DMI) || COMPILE_TEST
	depends on HAS_IOPORT
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for the watchdog
	  functionality for the Lenovo SE30 platform.

	  This driver can also be built as a module. If so, the module
	  will be called lenovo-se30-wdt.

config MENF21BMC_WATCHDOG
	tristate "MEN 14F021P00 BMC Watchdog"
	depends on MFD_MENF21BMC || COMPILE_TEST
	depends on I2C
	select WATCHDOG_CORE
	help
	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.

	  This driver can also be built as a module. If so the module
	  will be called menf21bmc_wdt.

config MENZ069_WATCHDOG
	tristate "MEN 16Z069 Watchdog"
	depends on MCB
	select WATCHDOG_CORE
	help
	  Say Y here to include support for the MEN 16Z069 Watchdog.

	  This driver can also be built as a module. If so the module
	  will be called menz069_wdt.

config WDAT_WDT
	tristate "ACPI Watchdog Action Table (WDAT)"
	depends on ACPI
	select WATCHDOG_CORE
	select ACPI_WATCHDOG
	help
	  This driver adds support for systems with ACPI Watchdog Action
	  Table (WDAT) table. Servers typically have this but it can be
	  found on some desktop machines as well. This driver will take
	  over the native iTCO watchdog driver found on many Intel CPUs.

	  To compile this driver as module, choose M here: the module will
	  be called wdat_wdt.

config WM831X_WATCHDOG
	tristate "WM831x watchdog"
	depends on MFD_WM831X
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the WM831x AudioPlus PMICs.  When
	  the watchdog triggers the system will be reset.

config WM8350_WATCHDOG
	tristate "WM8350 watchdog"
	depends on MFD_WM8350
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the WM8350 AudioPlus PMIC.  When
	  the watchdog triggers the system will be reset.

config XILINX_WATCHDOG
	tristate "Xilinx Watchdog timer"
	depends on HAS_IOMEM
	select WATCHDOG_CORE
	help
	  Watchdog driver for the xps_timebase_wdt IP core.

	  To compile this driver as a module, choose M here: the
	  module will be called of_xilinx_wdt.

config XILINX_WINDOW_WATCHDOG
	tristate "Xilinx window watchdog timer"
	depends on HAS_IOMEM
	depends on ARM64 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Window watchdog driver for the versal_wwdt IP core.
	  Window watchdog timer(WWDT) contains closed(first) and
	  open(second) window with 32 bit width. Write to the watchdog
	  timer within predefined window periods of time. This means
	  a period that is not too soon and a period that is not too
	  late. The WWDT has to be restarted within the open window time.
	  If software tries to restart WWDT outside of the open window
	  time period, it generates a reset.

	  To compile this driver as a module, choose M here: the
	  module will be called xilinx_wwdt.

config ZIIRAVE_WATCHDOG
	tristate "Zodiac RAVE Watchdog Timer"
	depends on I2C
	select WATCHDOG_CORE
	help
	  Watchdog driver for the Zodiac Aerospace RAVE Switch Watchdog
	  Processor.

	  To compile this driver as a module, choose M here: the
	  module will be called ziirave_wdt.

config RAVE_SP_WATCHDOG
	tristate "RAVE SP Watchdog timer"
	depends on RAVE_SP_CORE
	depends on NVMEM || !NVMEM
	select WATCHDOG_CORE
	help
	  Support for the watchdog on RAVE SP device.

config MLX_WDT
	tristate "Mellanox Watchdog"
	depends on MELLANOX_PLATFORM || COMPILE_TEST
	select WATCHDOG_CORE
	select REGMAP
	help
	  This is t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   