* [U-Boot] [PATCH v2] arm: socfpga: Change watchdog timeout
@ 2014-12-19 12:49 Stefan Roese
2014-12-21 13:39 ` Marek Vasut
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roese @ 2014-12-19 12:49 UTC (permalink / raw)
To: u-boot
The current current watchdog timeout of 12 seconds is a bit small for
booting into Linux, especially when using a NFS based rootfs. So lets
change this timeout to a more defensive value of 30 seconds.
Also we now call the hw_watchdog_init() function so that we override
the value already configured from the Preloader.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Vince Bridgers <vbridger@opensource.altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Chin Liang See <clsee@altera.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Pavel Machek <pavel@denx.de>
---
v2:
- Invert logic so that we can use #ifdef instead of #ifndef
as suggested by Marek (thanks)
arch/arm/cpu/armv7/socfpga/misc.c | 12 +++++++++++-
include/configs/socfpga_common.h | 2 +-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c
index 73cffd3..7873c38 100644
--- a/arch/arm/cpu/armv7/socfpga/misc.c
+++ b/arch/arm/cpu/armv7/socfpga/misc.c
@@ -9,6 +9,7 @@
#include <altera.h>
#include <miiphy.h>
#include <netdev.h>
+#include <watchdog.h>
#include <asm/arch/reset_manager.h>
#include <asm/arch/system_manager.h>
#include <asm/arch/dwmmc.h>
@@ -150,14 +151,23 @@ static inline void socfpga_fpga_add(void) {}
int arch_cpu_init(void)
{
+#ifdef CONFIG_HW_WATCHDOG
+ /*
+ * In case the watchdog is enabled, make sure to (re-)configure it
+ * so that the defined timeout is valid. Otherwise the SPL (Perloader)
+ * timeout value is still active which might too short for Linux
+ * booting.
+ */
+ hw_watchdog_init();
+#else
/*
* 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
+
return 0;
}
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 6bb9473..6b1f967 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -139,7 +139,7 @@
#define CONFIG_DESIGNWARE_WATCHDOG
#define CONFIG_DW_WDT_BASE SOCFPGA_L4WD0_ADDRESS
#define CONFIG_DW_WDT_CLOCK_KHZ 25000
-#define CONFIG_HW_WATCHDOG_TIMEOUT_MS 12000
+#define CONFIG_HW_WATCHDOG_TIMEOUT_MS 30000
#endif
/*
--
2.2.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH v2] arm: socfpga: Change watchdog timeout
2014-12-19 12:49 [U-Boot] [PATCH v2] arm: socfpga: Change watchdog timeout Stefan Roese
@ 2014-12-21 13:39 ` Marek Vasut
0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2014-12-21 13:39 UTC (permalink / raw)
To: u-boot
On Friday, December 19, 2014 at 01:49:10 PM, Stefan Roese wrote:
> The current current watchdog timeout of 12 seconds is a bit small for
> booting into Linux, especially when using a NFS based rootfs. So lets
> change this timeout to a more defensive value of 30 seconds.
>
> Also we now call the hw_watchdog_init() function so that we override
> the value already configured from the Preloader.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Vince Bridgers <vbridger@opensource.altera.com>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: Chin Liang See <clsee@altera.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Pavel Machek <pavel@denx.de>
Applied, thank you!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-21 13:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 12:49 [U-Boot] [PATCH v2] arm: socfpga: Change watchdog timeout Stefan Roese
2014-12-21 13:39 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox