From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eugen.Hristev at microchip.com Date: Wed, 20 Mar 2019 07:30:16 +0000 Subject: [U-Boot] [PATCH 04/11] watchdog: Handle SPL build with watchdog disabled In-Reply-To: <20190319155632.5680-4-sr@denx.de> References: <20190319155632.5680-1-sr@denx.de> <20190319155632.5680-4-sr@denx.de> Message-ID: <6c22122b-33fe-e4af-1ea2-df512fee359a@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 19.03.2019 17:56, Stefan Roese wrote: > External E-Mail >=20 >=20 > This patch adds some checks, so that the watchdog can be enabled in main > U-Boot proper but can be disabled in SPL. Hi Stefan, Actually your code looks at CONFIG_SPL_WATCHDOG_SUPPORT , so , if this=20 is disabled in the config, you say that the watchdog was still enabled?=20 (thus broken CONFIG_SPL_WATCHDOG_SUPPORT ?) Eugen >=20 > 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. >=20 > Signed-off-by: Stefan Roese > Cc: Heiko Schocher > Cc: Andreas Bie=C3=9Fmann > Cc: Eugen Hristev > --- > include/watchdog.h | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/include/watchdog.h b/include/watchdog.h > index 14073cfdd2..3a357de903 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); > =20 > - #define WATCHDOG_RESET watchdog_reset > + #define WATCHDOG_RESET watchdog_reset > + #endif > #endif > #else > /* >=20