[v2,13/16] watchdog: Handle TPL build with watchdog disabled

Message ID 20190826182111.30999-14-jagan@amarulasolutions.com
State New
Headers show
Series
  • rk3399: Add redundant boot support
Related show

Commit Message

Jagan Teki Aug. 26, 2019, 6:21 p.m. UTC
This patch handle a checks to not enable watchdog in TPL,
if TPL won't require to enable that.

This is useful, in rockchip platforms where watchdog would
require in SPL and U-Boot proper and optional to have it
in TPL. So, without this check, the TPL build failed to get
the watchdog_reset function even though the watchdog is not
enable for it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 include/watchdog.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/include/watchdog.h b/include/watchdog.h
index a4a4e8e614..f04e3e7c4d 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -51,9 +51,10 @@  int init_func_watchdog_reset(void);
 		#if defined(__ASSEMBLY__)
 			#define WATCHDOG_RESET bl watchdog_reset
 		#else
-			/* Don't require the watchdog to be enabled in SPL */
-			#if defined(CONFIG_SPL_BUILD) &&		\
-				!defined(CONFIG_SPL_WATCHDOG_SUPPORT)
+			/* Don't require the watchdog to be enabled in TPL/SPL */
+			#if ((defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_BUILD)) && \
+			      (!defined(CONFIG_TPL_WATCHDOG_SUPPORT) || \
+			       !defined(CONFIG_SPL_WATCHDOG_SUPPORT)))
 				#define WATCHDOG_RESET() {}
 			#else
 				extern void watchdog_reset(void);