s5j: disable watchdog at boot
We should disable the watchdog as soon as possible before it barks. The
second stage bootloader of S5J sets up the watchdog in order to detect
boot failure.
extern uint32_t _vector_start;
extern uint32_t _vector_end;
+/****************************************************************************
+ * Name: s5j_watchdog_disable
+ *
+ * Description:
+ * Disable the watchdog timer. The S5J always boots with the watchdog
+ * timer enabled at timeout of 10 - 20 seconds by the second stage boot
+ * loader to detect any boot failure. So, the watchdog timer must be
+ * disabled as part of the start up logic.
+ *
+ ****************************************************************************/
+static inline void s5j_watchdog_disable(void)
+{
+ unsigned int wtcon = getreg32(0x80030000) & ~(1 << 5);
+ putreg32(wtcon, 0x80030000);
+}
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -179,6 +195,9 @@ void arm_boot(void)
up_copyvectorblock();
+ /* Disable the watchdog timer */
+ s5j_watchdog_disable();
+
#ifdef CONFIG_ARMV7R_MEMINIT
/* Initialize the .bss and .data sections as well as RAM functions
* now after RAM has been initialized.
