Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sgimips/dev Assign memory controller-dependent watc...



details:   https://anonhg.NetBSD.org/src/rev/3bd93a881e1a
branches:  trunk
changeset: 557612:3bd93a881e1a
user:      sekiya <sekiya%NetBSD.org@localhost>
date:      Tue Jan 13 14:31:37 2004 +0000

description:
Assign memory controller-dependent watchdog reset functions to
platform.watchdog_reset.

diffstat:

 sys/arch/sgimips/dev/crime.c |  18 ++++++++++++++++--
 sys/arch/sgimips/dev/imc.c   |   5 +++--
 sys/arch/sgimips/dev/pic.c   |   3 ++-
 3 files changed, 21 insertions(+), 5 deletions(-)

diffs (100 lines):

diff -r 3158f5552e11 -r 3bd93a881e1a sys/arch/sgimips/dev/crime.c
--- a/sys/arch/sgimips/dev/crime.c      Tue Jan 13 14:30:43 2004 +0000
+++ b/sys/arch/sgimips/dev/crime.c      Tue Jan 13 14:31:37 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crime.c,v 1.15 2004/01/12 03:30:51 sekiya Exp $        */
+/*     $NetBSD: crime.c,v 1.16 2004/01/13 14:31:37 sekiya Exp $        */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crime.c,v 1.15 2004/01/12 03:30:51 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crime.c,v 1.16 2004/01/13 14:31:37 sekiya Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -49,6 +49,7 @@
 #include <machine/bus.h>
 #include <machine/intr.h>
 #include <machine/machtype.h>
+#include <machine/sysconf.h>
 
 #include <sgimips/dev/crimevar.h>
 #include <sgimips/dev/crimereg.h>
@@ -57,6 +58,7 @@
 
 static int     crime_match(struct device *, struct cfdata *, void *);
 static void    crime_attach(struct device *, struct device *, void *);
+void           crime_watchdog_tickle(void);
 
 struct crime_softc *crime_sc; /* only one per machine, okay to be global */
 
@@ -145,6 +147,8 @@
        bus_space_write_8(sc->iot, sc->ioh, CRIME_INTSTAT, 0);
        bus_space_write_8(sc->iot, sc->ioh, CRIME_SOFTINT, 0);
        bus_space_write_8(sc->iot, sc->ioh, CRIME_HARDINT, 0);
+
+       platform.watchdog_reset = crime_watchdog_tickle;
 }
 
 /*
@@ -191,3 +195,13 @@
        mask |= (1 << intr);
        bus_space_write_8(crime_sc->iot, crime_sc->ioh, CRIME_INTMASK, mask);
 }
+
+void
+crime_watchdog_tickle(void)
+{
+       /* enable watchdog timer, clear it */
+       bus_space_write_8(crime_sc->iot, crime_sc->ioh,
+               CRIME_CONTROL, CRIME_CONTROL_DOG_ENABLE);
+       bus_space_write_8(crime_sc->iot, crime_sc->ioh, CRIME_WATCHDOG, 0);
+}
+
diff -r 3158f5552e11 -r 3bd93a881e1a sys/arch/sgimips/dev/imc.c
--- a/sys/arch/sgimips/dev/imc.c        Tue Jan 13 14:30:43 2004 +0000
+++ b/sys/arch/sgimips/dev/imc.c        Tue Jan 13 14:31:37 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imc.c,v 1.12 2004/01/13 13:05:17 sekiya Exp $  */
+/*     $NetBSD: imc.c,v 1.13 2004/01/13 14:31:37 sekiya Exp $  */
 
 /*
  * Copyright (c) 2001 Rafal K. Boni
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.12 2004/01/13 13:05:17 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.13 2004/01/13 14:31:37 sekiya Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -110,6 +110,7 @@
                 panic("imc_attach: could not allocate memory\n");
 
        platform.bus_reset = imc_bus_reset;
+       platform.watchdog_reset = imc_watchdog_tickle;
 
        sysid = bus_space_read_4(isc.iot, isc.ioh, IMC_SYSID);
 
diff -r 3158f5552e11 -r 3bd93a881e1a sys/arch/sgimips/dev/pic.c
--- a/sys/arch/sgimips/dev/pic.c        Tue Jan 13 14:30:43 2004 +0000
+++ b/sys/arch/sgimips/dev/pic.c        Tue Jan 13 14:31:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pic.c,v 1.2 2004/01/13 13:05:17 sekiya Exp $        */
+/* $NetBSD: pic.c,v 1.3 2004/01/13 14:31:37 sekiya Exp $        */
 
 /*
  * Copyright (c) 2002 Steve Rumble
@@ -95,6 +95,7 @@
                panic("pic_attach: could not allocate memory\n");
 
        platform.bus_reset = pic_bus_reset;
+       platform.watchdog_reset = pic_watchdog_tickle;
 
        reg = bus_space_read_4(psc.iot, psc.ioh, PIC_SYSID);
        reg = (reg >> PIC_SYSID_REVSHIFT) & PIC_SYSID_REVMASK;



Home | Main Index | Thread Index | Old Index