From: Stefano Babic <sbabic@denx.de>
Date: Wed, 2 Feb 2011 00:49:37 +0000 (+0000)
Subject: MX31: qong: add watchdog
X-Git-Tag: v2025.01-rc5-pxa1908~19535^2~67
X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20.RelPermalink%20%7D%7D?a=commitdiff_plain;h=8640c984633de10f6d15211077496b3705df32d0;p=u-boot.git

MX31: qong: add watchdog

Signed-off-by: Stefano Babic <sbabic@denx.de>
---

diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c
index 8a81cfc686..3ace6cdfff 100644
--- a/board/davedenx/qong/qong.c
+++ b/board/davedenx/qong/qong.c
@@ -30,9 +30,17 @@
 #include <fsl_pmic.h>
 #include <mxc_gpio.h>
 #include "qong_fpga.h"
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_HW_WATCHDOG
+void hw_watchdog_reset(void)
+{
+	mxc_hw_watchdog_reset();
+}
+#endif
+
 int dram_init (void)
 {
 	/* dram_init must store complete ramsize in gd->ram_size */
@@ -202,6 +210,10 @@ int board_late_init(void)
 	pmic_reg_write(REG_POWER_CTL0, val | COINCHEN);
 	pmic_reg_write(REG_INT_STATUS1, RTCRSTI);
 
+#ifdef CONFIG_HW_WATCHDOG
+	mxc_hw_watchdog_enable();
+#endif
+
 	return 0;
 }
 
diff --git a/include/configs/qong.h b/include/configs/qong.h
index e2f7a5e9f9..299db5eef9 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -52,6 +52,7 @@
 #define CONFIG_SYS_MX31_UART1	1
 
 #define CONFIG_MXC_GPIO
+#define CONFIG_HW_WATCHDOG
 
 #define CONFIG_MXC_SPI
 #define CONFIG_DEFAULT_SPI_BUS	1