Module Name: src
Committed By: jakllsch
Date: Sat Apr 23 17:05:30 UTC 2016
Modified Files:
src/sys/arch/arm/omap: obio_wdt.c
Log Message:
Put omapwdt32k(4) in known state (disarmed) on attach.
Some newer U-Boot builds for am335x_evm (BeagleBone) hand us the hardware
with an armed watchdog.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/obio_wdt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/omap/obio_wdt.c
diff -u src/sys/arch/arm/omap/obio_wdt.c:1.6 src/sys/arch/arm/omap/obio_wdt.c:1.7
--- src/sys/arch/arm/omap/obio_wdt.c:1.6 Wed Sep 5 00:19:59 2012
+++ src/sys/arch/arm/omap/obio_wdt.c Sat Apr 23 17:05:30 2016
@@ -33,7 +33,7 @@
#include "opt_omap.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio_wdt.c,v 1.6 2012/09/05 00:19:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_wdt.c,v 1.7 2016/04/23 17:05:30 jakllsch Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -101,4 +101,17 @@ obiowdt32k_attach(device_t parent, devic
(1 << WD_SYSCONFIG_AUTOIDLE);
bus_space_write_4(omapwdt32k_sc->sc_iot, omapwdt32k_sc->sc_ioh,
WD_SYSCONFIG, omapwdt_sysconfig);
+
+ /*
+ * Put watchdog in known (disarmed) state.
+ *
+ * Some U-Boot versions on BeagleBone will leave the watchdog
+ * armed at boot.
+ *
+ * XXX Revisit this, perhaps we should just start tickling an
+ * armed watchdog.
+ */
+
+ sc->sc_armed = -1;
+ omapwdt32k_enable(0);
}