]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/watchdog/at91sam9_wdt.c
net: fec_mxc: move CONFIG_FEC_MXC_PHYADDR from Kconfig to include/configs/*.h
[karo-tx-uboot.git] / drivers / watchdog / at91sam9_wdt.c
index 25afae748d611cdb47123899ed2d693b1de279ad..03c786c53bd0db59b66aed4e0a6d4ecdde0bd2f2 100644 (file)
@@ -6,10 +6,7 @@
  * Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  * Copyright (C) 2008 Renaud CERRATO r.cerrato@til-technologies.fr
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -21,7 +18,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/io.h>
+#include <asm/io.h>
 #include <asm/arch/at91_wdt.h>
 
 /*
 #define ticks_to_ms(t) (((t + 1) * 1000) >> 8)
 
 /* Hardware timeout in seconds */
+#if !defined(CONFIG_AT91_HW_WDT_TIMEOUT)
 #define WDT_HW_TIMEOUT 2
+#else
+#define WDT_HW_TIMEOUT CONFIG_AT91_HW_WDT_TIMEOUT
+#endif
 
 /*
  * Set the watchdog time interval in 1/256Hz (write-once)
@@ -42,7 +43,7 @@
 static int at91_wdt_settimeout(unsigned int timeout)
 {
        unsigned int reg;
-       at91_wdt_t *wd  = (at91_wdt_t *) AT91_WDT_BASE;
+       at91_wdt_t *wd = (at91_wdt_t *) ATMEL_BASE_WDT;
 
        /* Check if disabled */
        if (readl(&wd->mr) & AT91_WDT_MR_WDDIS) {
@@ -69,7 +70,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
 
 void hw_watchdog_reset(void)
 {
-       at91_wdt_t *wd  = (at91_wdt_t *) AT91_WDT_BASE;
+       at91_wdt_t *wd = (at91_wdt_t *) ATMEL_BASE_WDT;
        writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, &wd->cr);
 }