summaryrefslogtreecommitdiff
path: root/include/wdt.h
diff options
context:
space:
mode:
authorWalter Lozano <walter.lozano@collabora.com>2020-01-23 22:05:05 +0300
committerStefan Roese <sr@denx.de>2020-03-16 13:25:12 +0300
commited666fb12910f46cff73a3869058ea59aef4261b (patch)
treeaed96dd9ab513b8d07917842bcb71a8ea1bcf783 /include/wdt.h
parent50be9f0e1ccc0909e65132cff216743a49046f97 (diff)
downloadu-boot-ed666fb12910f46cff73a3869058ea59aef4261b.tar.xz
watchdog: Use dev_read only if OF_PLATDATA is not enabled
Currently watchdog tries to use dev_read_u32_default to get timeout configuration in case OF_CONTROL is enabled. However, if SPL is built with OF_PLATDATA this has no sense as there is no device tree. This patch fixes this issue by only use dev_read_u32_default if OF_CONTROL is enabled but OF_PLATDATA is not. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/wdt.h')
-rw-r--r--include/wdt.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/wdt.h b/include/wdt.h
index 5bcff24ab3..dd83dfdd32 100644
--- a/include/wdt.h
+++ b/include/wdt.h
@@ -130,11 +130,10 @@ static inline int initr_watchdog(void)
}
}
- if (CONFIG_IS_ENABLED(OF_CONTROL)) {
+ if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
timeout = dev_read_u32_default(gd->watchdog_dev, "timeout-sec",
WATCHDOG_TIMEOUT_SECS);
}
-
wdt_start(gd->watchdog_dev, timeout * 1000, 0);
gd->flags |= GD_FLG_WDT_READY;
printf("WDT: Started with%s servicing (%ds timeout)\n",