[U-Boot] [PATCH v2 13/16] watchdog: Handle TPL build with watchdog disabled

Jagan Teki jagan at amarulasolutions.com
Mon Aug 26 18:21:08 UTC 2019


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 at amarulasolutions.com>
---
 include/watchdog.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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);
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list