mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-13 21:36:57 +00:00
watchdog: Allow to use CONFIG_WDT without starting watchdog
In some cases it is useful to compile support for U-Boot command 'wdt' without starting HW watchdog in early U-Boot phase. For example when the user want to start the watchdog only on demand by some boot script. This change adds a new compile option WATCHDOG_AUTOSTART to control whether U-Boot should automatically start the watchdog during init phase or not. This option is enabled by default as it was the default behavior prior introducing this new change. When compiling U-Boot users can decide to turn this option off. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
25e20e347e
commit
830d29ac37
2 changed files with 18 additions and 0 deletions
|
@ -9,6 +9,19 @@ config WATCHDOG
|
|||
this option if you want to service enabled watchdog by U-Boot. Disable
|
||||
this option if you want U-Boot to start watchdog but never service it.
|
||||
|
||||
config WATCHDOG_AUTOSTART
|
||||
bool "Automatically start watchdog timer"
|
||||
depends on WDT
|
||||
default y
|
||||
help
|
||||
Automatically start watchdog timer and start servicing it during
|
||||
init phase. Enabled by default. Disable this option if you want
|
||||
to compile U-Boot with CONFIG_WDT support but do not want to
|
||||
activate watchdog, like when CONFIG_WDT option is disabled. You
|
||||
would be able to start watchdog manually by 'wdt' command. Useful
|
||||
when you want to have support for 'wdt' command but do not want
|
||||
to have watchdog enabled by default.
|
||||
|
||||
config WATCHDOG_TIMEOUT_MSECS
|
||||
int "Watchdog timeout in msec"
|
||||
default 128000 if ARCH_MX25 || ARCH_MX31 || ARCH_MX5 || ARCH_MX6
|
||||
|
|
|
@ -51,6 +51,11 @@ int initr_watchdog(void)
|
|||
4 * reset_period) / 4;
|
||||
}
|
||||
|
||||
if (!CONFIG_IS_ENABLED(WATCHDOG_AUTOSTART)) {
|
||||
printf("WDT: Not starting\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = wdt_start(gd->watchdog_dev, timeout * 1000, 0);
|
||||
if (ret != 0) {
|
||||
printf("WDT: Failed to start\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue