summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2019-04-11 15:58:47 +0200
committerStefan Roese <sr@denx.de>2019-04-26 09:16:32 +0200
commitc2ff69a444bdc209eecf1bba0685edd7eb5957c3 (patch)
tree4a86e331cabf0bfabeab4e1ddf927300eb33711e /arch
parentf3729ba6e7b2dff9a6f6e72e8839d99c2e3dbb03 (diff)
watchdog: at91sam9_wdt: Remove now superfluous wdt start and reset
With the new generic function, the scattered other functions are now removed to be replaced by the generic one. The new version also enables the configuration of the watchdog timeout via the DT "timeout-sec" property (if enabled via CONFIG_OF_CONTROL). The watchdog servicing is enabled via CONFIG_WATCHDOG. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Eugen Hristev <eugen.hristev@microchip.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-at91/clock.c45
-rw-r--r--arch/arm/mach-at91/include/mach/at91_wdt.h2
2 files changed, 0 insertions, 47 deletions
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 1d3df2c09d..8344daeb39 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -14,8 +14,6 @@
#define EN_UPLL_TIMEOUT 500
-static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
-
void at91_periph_clk_enable(int id)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
@@ -123,46 +121,3 @@ void at91_pllicpr_init(u32 icpr)
writel(icpr, &pmc->pllicpr);
}
-
-/* Called by macro WATCHDOG_RESET */
-void watchdog_reset(void)
-{
- static ulong next_reset;
- ulong now;
-
- if (!watchdog_dev)
- return;
-
- now = get_timer(0);
-
- /* Do not reset the watchdog too often */
- if (now > next_reset) {
- next_reset = now + 1000; /* reset every 1000ms */
- wdt_reset(watchdog_dev);
- }
-}
-
-int arch_early_init_r(void)
-{
- struct at91_wdt_priv *priv;
-
- /* Init watchdog */
- if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
- debug("Watchdog: Not found by seq!\n");
- if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
- puts("Watchdog: Not found!\n");
- return 0;
- }
- }
-
- priv = dev_get_priv(watchdog_dev);
- if (!priv) {
- printf("Watchdog: priv not available!\n");
- return 0;
- }
-
- wdt_start(watchdog_dev, priv->timeout * 1000, 0);
- printf("Watchdog: Started\n");
-
- return 0;
-}
diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h
index a8fc73b3d1..8ef8e007d7 100644
--- a/arch/arm/mach-at91/include/mach/at91_wdt.h
+++ b/arch/arm/mach-at91/include/mach/at91_wdt.h
@@ -28,7 +28,6 @@ typedef struct at91_wdt {
struct at91_wdt_priv {
void __iomem *regs;
u32 regval;
- u32 timeout;
};
#endif
@@ -51,6 +50,5 @@ struct at91_wdt_priv {
/* Hardware timeout in seconds */
#define WDT_MAX_TIMEOUT 16
-#define WDT_DEFAULT_TIMEOUT 2
#endif