summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2007-06-02 10:48:24 +0000
committertsutsui <tsutsui@NetBSD.org>2007-06-02 10:48:24 +0000
commita2d77b96dc10103abeb7cf9d10edacbb835b8f8e (patch)
tree3643fc8ab9113dbafd2b785c00942d41a1a3f733 /sys/dev/ic
parente12ac31b5251e03d1ef680837864230d4414d06c (diff)
In sonic_reset(), make sure to stop TX, RX and timer
and clear and disable all interrupts. Required by mac68k obio sonic cards, and no bad side effect on arc jazzio sonic.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/dp83932.c14
-rw-r--r--sys/dev/ic/dp83932reg.h4
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/ic/dp83932.c b/sys/dev/ic/dp83932.c
index 43a634e1142..51abf31c27a 100644
--- a/sys/dev/ic/dp83932.c
+++ b/sys/dev/ic/dp83932.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dp83932.c,v 1.15 2007/06/02 06:41:34 tsutsui Exp $ */
+/* $NetBSD: dp83932.c,v 1.16 2007/06/02 10:48:24 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.15 2007/06/02 06:41:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.16 2007/06/02 10:48:24 tsutsui Exp $");
#include "bpfilter.h"
@@ -868,9 +868,17 @@ void
sonic_reset(struct sonic_softc *sc)
{
- CSR_WRITE(sc, SONIC_CR, 0); /* ensure RST is clear */
+ /* stop TX, RX and timer, and ensure RST is clear */
+ CSR_WRITE(sc, SONIC_CR, CR_STP | CR_RXDIS | CR_HTX);
+ delay(1000);
+
CSR_WRITE(sc, SONIC_CR, CR_RST);
delay(1000);
+
+ /* clear all interrupts */
+ CSR_WRITE(sc, SONIC_IMR, 0);
+ CSR_WRITE(sc, SONIC_ISR, IMR_ALL);
+
CSR_WRITE(sc, SONIC_CR, 0);
delay(1000);
}
diff --git a/sys/dev/ic/dp83932reg.h b/sys/dev/ic/dp83932reg.h
index 91b4b2507cf..2c468e2aebe 100644
--- a/sys/dev/ic/dp83932reg.h
+++ b/sys/dev/ic/dp83932reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dp83932reg.h,v 1.4 2005/12/11 12:21:26 christos Exp $ */
+/* $NetBSD: dp83932reg.h,v 1.5 2007/06/02 10:48:24 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -247,6 +247,8 @@ struct sonic_cda32 {
#define IMR_HBL (1U << 13) /* Heartbeat Lost */
#define IMR_BR (1U << 14) /* Bus Retry Occurred */
+#define IMR_ALL 0x7fff
+
#define SONIC_ISR 0x05 /* Interrupt Status Register */
/* See IMR bits. */