X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fat91sam9_wdt.c;h=fca2849918f8fc24986bb24a8537ef179858730d;hb=984df7add1fe6e5a25854eae81f51940806456bc;hp=25afae748d611cdb47123899ed2d693b1de279ad;hpb=6a1f7e54c2dd8888dbc118e8de372dec29a0a9c5;p=u-boot diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 25afae748d..fca2849918 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * [origin: Linux kernel drivers/watchdog/at91sam9_wdt.c] * @@ -5,11 +6,6 @@ * * Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD * 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. */ /* @@ -21,7 +17,7 @@ #include #include #include -#include +#include #include /* @@ -33,7 +29,11 @@ #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 +42,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 +69,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); }