summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/include/asm/arch/wdt.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/include/asm/arch/wdt.h b/common/include/asm/arch/wdt.h
index bd79d0fdd7..ff4d29114b 100644
--- a/common/include/asm/arch/wdt.h
+++ b/common/include/asm/arch/wdt.h
@@ -27,6 +27,12 @@
#define WDT_MAX_TIME 21 //seconds
#define WDT_UNCOMPRESS_TIME 4 //seconds
+#ifdef UBOOT_COMPILE
+# define WDT_CLK get_master_clock()
+#else
+# define WDT_CLK PCLK
+#endif
+
#ifndef __ASSEMBLY__
/** Addressing space. */
@@ -70,7 +76,7 @@ static int spc300_wdt_start_(uint timeout_s,
{
uint32_t cnt_value, top, reg;
- //Timeout period = (2^(16+ TOP_reg)) / PCLK
+ //Timeout period = (2^(16+ TOP_reg)) / WDT_CLK
// Configure timeout?
if(timeout_s)
@@ -78,7 +84,7 @@ static int spc300_wdt_start_(uint timeout_s,
if(timeout_s > WDT_MAX_TIME)
return -EINVAL;
- cnt_value = timeout_s * PCLK;
+ cnt_value = timeout_s * WDT_CLK;
for(top=15 ; top>0 ; top--)
{