1# Software watchdog configuration
2
3# Copyright (c) 2020 Libre Solar Technologies GmbH
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig TASK_WDT
7	bool "Task-level software watchdog"
8	select REBOOT
9	help
10	  Enable task watchdog
11
12	  The task watchdog allows to have individual watchdog channels
13	  per thread, even if the hardware supports only a single watchdog.
14
15if TASK_WDT
16
17config TASK_WDT_DUMMY
18	bool "Dummy implementation for testing"
19	help
20	  Allows the code to use all Task Watchdog APIs, but does nothing.
21	  This can be useful to temporarily disable the Task Watchdog while
22	  debugging.
23
24config TASK_WDT_CHANNELS
25	int "Maximum number of task watchdog channels"
26	default 5
27	range 2 100
28	help
29	  The timeouts for each channel are stored in an array. Allocate only
30	  the required amount of channels to reduce memory footprint.
31
32config TASK_WDT_HW_FALLBACK
33	bool "Use hardware watchdog as a fallback"
34	default y
35	help
36	  This option allows to specify a hardware watchdog device in the
37	  application that is used as an additional safety layer if the task
38	  watchdog itself gets stuck.
39
40config TASK_WDT_MIN_TIMEOUT
41	int "Minimum timeout for task watchdog (ms)"
42	depends on TASK_WDT_HW_FALLBACK
43	default 100
44	range 1 10000
45	help
46	  The task watchdog uses a continuously restarted k_timer as its
47	  backend. This value specifies the minimum timeout in milliseconds
48	  among all task watchdogs used in the application.
49
50	  If a hardware watchdog is configured as a fallback for the task
51	  watchdog, its timeout is set to this value plus
52	  TASK_WDT_HW_FALLBACK_DELAY.
53
54config TASK_WDT_HW_FALLBACK_DELAY
55	int "Additional delay for hardware watchdog (ms)"
56	depends on TASK_WDT_HW_FALLBACK
57	default 20
58	range 1 10000
59	help
60	  The timeout of the hardware watchdog fallback will be increased by
61	  this value to provide sufficient time for corrective actions in the
62	  callback function.
63
64	  In addition to that, the delay allows to compensate deviations
65	  between different clock sources for the hardware watchdog and the
66	  kernel timer. This is especially important if the hardware watchdog
67	  is clocked by an inaccurate low-speed RC oscillator.
68
69config TASK_WDT_HW_FALLBACK_PAUSE_IN_SLEEP
70	bool "Pause the hardware watchdog in system sleep"
71	depends on TASK_WDT_HW_FALLBACK
72	help
73	  Configure the hardware watchdog to automatically pause when the
74	  system reaches a sleep power state. When the system is resumed, the
75	  watchdog is also automatically resumed.
76	  Note that this feature is supported only by a subset of hardware
77	  watchdogs.
78
79config TASK_WDT_SHELL
80	bool "Task watchdog shell utilities"
81	depends on SHELL
82	help
83	  Activate shell module that provides Task watchdog commands.
84
85endif
86