Skip to contentSkip to conversation

Hardware watchdog support for AT91SAM9260 CPU

PATCH New Sergey Lapin 2 participants 2 messages Aug 14, 2008 – Oct 12, 2008 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Hardware watchdog support for AT91SAM9260 CPU

---
 cpu/arm926ejs/at91/Makefile   |    1 +
 cpu/arm926ejs/at91/watchdog.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm926ejs/at91/watchdog.c
cpu/arm926ejs/at91/Makefile +1 -0
index 44cde1a..7befcd7 100644
@@ -29,6 +29,7 @@ COBJS-y	+= ether.o
 COBJS-y	+= timer.o
 COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o
 COBJS-y	+= usb.o
+COBJS-$(CONFIG_HW_WATCHDOG) +=watchdog.o
 SOBJS	= lowlevel_init.o
 
 SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
cpu/arm926ejs/at91/watchdog.c new file +38 -0
new file mode 100644
index 0000000..502cc8a
@@ -0,0 +1,38 @@
+/*
+ * watchdog.c - driver for at91sam9260 watchdog
+ *
+ * Copyright (c) 2008 Sergey Lapin
+ *
+ * Based on Blackfin watchdog driver
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/io.h>
+
+#ifdef CONFIG_HW_WATCHDOG
+#define AT91_WDT_CR		(AT91_WDT+0x00)
+#define AT91_WDT_MR		(AT91_WDT+0x04)
+#define AT91_WDT_SR		(AT91_WDT+0x08)
+
+void hw_watchdog_reset(void)
+{
+	at91_sys_write(AT91_WDT_CR, 0xa5000001);
+}
+
+void hw_watchdog_init(void)
+{
+	/* 16 seconds timer, resets enabled */
+	at91_sys_write(AT91_WDT_MR, 0x3FFF2FFF);
+}
+
+void hw_watchdog_disable(void)
+{
+	/* Can't reenable per documentation */
+	at91_sys_write(AT91_WDT_MR, 0x8000);
+}
+#endif
+
Signature · 1 line
1.5.4.1
#1 lore raw

PATCH 1/1 Hardware watchdog support for AT91SAM9260 CPU

Dear Sergey Lapin,

Quoted 7 lines · In message <[email protected]> you wrote:
---
 cpu/arm926ejs/at91/Makefile   |    1 +
 cpu/arm926ejs/at91/watchdog.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm926ejs/at91/watchdog.c

This patch was sumbitted while the merge window was open.

Is there any special reason it was not added, and the submitter received no feedback?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If something is different, it's either better or worse,  and  usually
both.                                                    - Larry Wall