From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chin Liang See Date: Wed, 1 Oct 2014 05:50:52 -0500 Subject: [U-Boot] [PATCH V2 10/51] arm: socfpga: Add watchdog disable for socfpga In-Reply-To: <1411304339-11348-11-git-send-email-marex@denx.de> References: <1411304339-11348-1-git-send-email-marex@denx.de> <1411304339-11348-11-git-send-email-marex@denx.de> Message-ID: <1412160652.11125.24.camel@clsee-VirtualBox.altera.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, 2014-09-21 at 14:58 +0200, marex at denx.de wrote: > From: Pavel Machek > > This adds watchdog disable. It is neccessary for running Linux kernel. > > Signed-off-by: Pavel Machek > Signed-off-by: Marek Vasut > Cc: Chin Liang See > Cc: Dinh Nguyen > Cc: Albert Aribaud > Cc: Tom Rini > Cc: Wolfgang Denk > Cc: Pavel Machek > --- > arch/arm/cpu/armv7/socfpga/misc.c | 10 ++++++++++ > arch/arm/cpu/armv7/socfpga/reset_manager.c | 12 ++++++++++++ > arch/arm/include/asm/arch-socfpga/reset_manager.h | 4 ++++ > 3 files changed, 26 insertions(+) > > V2: Move RSTMGR_PERMODRST_L4WD0_LSB to reset_manager.h > Reset watchdog only if CONFIG_HW_WATCHDOG is undefined (the default) > > diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c > index ecae393..71ee912 100644 > --- a/arch/arm/cpu/armv7/socfpga/misc.c > +++ b/arch/arm/cpu/armv7/socfpga/misc.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > > DECLARE_GLOBAL_DATA_PTR; > > @@ -38,6 +39,15 @@ int overwrite_console(void) > > int misc_init_r(void) > { > + /* > + * If the HW watchdog is NOT enabled, make sure it is not running, > + * for example because it was enabled in the preloader. This might > + * trigger a watchdog-triggered reboot of Linux kernel later. > + */ > +#ifndef CONFIG_HW_WATCHDOG > + socfpga_watchdog_reset(); > +#endif > + misc_init_r happens at some time after U-Boot entry. Afraid the watchdog might trigger prior its disabled. Suggest to call socfpga_watchdog_reset earlier. Thanks Chin Liang