diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2010-09-21 11:23:21 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2010-09-21 11:23:21 +0000 |
commit | 3cd6240e31eba076812afa03e7c3654781fb52a8 (patch) | |
tree | 13361458dda23a058c1236156ef19e7c800fbaba /sys/arch | |
parent | c2eb5e33cf05da2ec6e1a7d34a00be628893af23 (diff) |
Watchdog suspend/resume logic.
Okay miod@, deraadt@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/loongson/dev/glxpcib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/loongson/dev/glxpcib.c b/sys/arch/loongson/dev/glxpcib.c index ef89c1d10d8..5cd9d43d0e0 100644 --- a/sys/arch/loongson/dev/glxpcib.c +++ b/sys/arch/loongson/dev/glxpcib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxpcib.c,v 1.10 2010/09/20 00:49:00 deraadt Exp $ */ +/* $OpenBSD: glxpcib.c,v 1.11 2010/09/21 11:23:20 pirofti Exp $ */ /* * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org> @@ -148,6 +148,7 @@ struct glxpcib_softc { bus_space_handle_t sc_gpio_ioh; struct gpio_chipset_tag sc_gpio_gc; gpio_pin_t sc_gpio_pins[AMD5536_GPIO_NPINS]; + int sc_wdog_period; #endif }; @@ -293,8 +294,15 @@ glxpcib_activate(struct device *self, int act) rv = config_activate_children(self, act); for (i = 0; i < nitems(glxpcib_msrlist); i++) sc->sc_msrsave[i] = rdmsr(glxpcib_msrlist[i]); + + sc->sc_wdog_period = bus_space_read_2(sc->sc_iot, sc->sc_ioh, + AMD5536_MFGPT0_CMP2); + glxpcib_wdogctl_cb(sc, 0); + break; case DVACT_RESUME: + glxpcib_wdogctl_cb(sc, sc->sc_wdog_period); + for (i = 0; i < nitems(glxpcib_msrlist); i++) wrmsr(glxpcib_msrlist[i], sc->sc_msrsave[i]); rv = config_activate_children(self, act); |