aboutsummaryrefslogtreecommitdiff
path: root/include/watchdog.h
diff options
context:
space:
mode:
authorStefan Roese2019-04-02 10:57:18 +0200
committerEugen Hristev2019-04-09 09:28:50 +0300
commit7fbd42f5afc4425ac137b06f46062483f9809327 (patch)
tree3e28c46857cad16c1f45a825f58e1430fc7915a9 /include/watchdog.h
parente567dfb213f8e7af953645630e96450e128a986b (diff)
watchdog: Handle SPL build with watchdog disabled
This patch adds some checks, so that the watchdog can be enabled in main U-Boot proper but can be disabled in SPL. This will be used by some AT91SAM based boards, which might enable the watchdog in the main U-Boot proper and not in SPL. It will be enabled in SPL by default there, so no need to configure it there. This approach saves some space in SPL. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Andreas Bießmann <andreas@biessmann.org> Cc: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Heiko Schocher <hs@denx.de> Tested on the taurus board: Tested-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include/watchdog.h')
-rw-r--r--include/watchdog.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/watchdog.h b/include/watchdog.h
index 14073cfdd2f..3a357de903f 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -51,9 +51,15 @@ int init_func_watchdog_reset(void);
#if defined(__ASSEMBLY__)
#define WATCHDOG_RESET bl watchdog_reset
#else
- extern void watchdog_reset(void);
+ /* Don't require the watchdog to be enabled in SPL */
+ #if defined(CONFIG_SPL_BUILD) && \
+ !defined(CONFIG_SPL_WATCHDOG_SUPPORT)
+ #define WATCHDOG_RESET() {}
+ #else
+ extern void watchdog_reset(void);
- #define WATCHDOG_RESET watchdog_reset
+ #define WATCHDOG_RESET watchdog_reset
+ #endif
#endif
#else
/*