Module Name:    src
Committed By:   aymeric
Date:           Sun Oct 28 15:06:10 UTC 2018

Modified Files:
        src/sys/dev/fdt: dwcwdt_fdt.c

Log Message:
Deactivate the watchdog timer during attach.

Recent u-boot starts up the watchdog timer, and we don't detect this so
e.g. my DE0 nanosoc reboots after about 20 seconds. Applying a reset to
the watchdog circuit is the only way to stop it according to the
documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/dwcwdt_fdt.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/dev/fdt/dwcwdt_fdt.c
diff -u src/sys/dev/fdt/dwcwdt_fdt.c:1.2 src/sys/dev/fdt/dwcwdt_fdt.c:1.3
--- src/sys/dev/fdt/dwcwdt_fdt.c:1.2	Sun Oct 14 18:28:55 2018
+++ src/sys/dev/fdt/dwcwdt_fdt.c	Sun Oct 28 15:06:10 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dwcwdt_fdt.c,v 1.2 2018/10/14 18:28:55 aymeric Exp $ */
+/* $NetBSD: dwcwdt_fdt.c,v 1.3 2018/10/28 15:06:10 aymeric Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.2 2018/10/14 18:28:55 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.3 2018/10/28 15:06:10 aymeric Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -191,6 +191,10 @@ dwcwdt_attach(device_t parent, device_t 
 		return;
 	}
 	rst = fdtbus_reset_get_index(phandle, 0);
+	if (rst && fdtbus_reset_assert(rst) != 0) {
+		aprint_error(": couldn't assert reset\n");
+		return;
+	}
 	if (rst && fdtbus_reset_deassert(rst) != 0) {
 		aprint_error(": couldn't de-assert reset\n");
 		return;

Reply via email to