diff options
author | Oleg Safiullin <form@cvs.openbsd.org> | 2008-04-07 09:43:55 +0000 |
---|---|---|
committer | Oleg Safiullin <form@cvs.openbsd.org> | 2008-04-07 09:43:55 +0000 |
commit | f2bb49dbe8f7c2650595dd714ef6d93d536fd9cb (patch) | |
tree | 33ec493864a79f49c8b0d0b0a19bf5de567e9796 /sys/dev/isa | |
parent | 7f29828b50f8587ff3245ec02cda13e4a73fc171 (diff) |
more cosmetic changes
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/it.c | 14 | ||||
-rw-r--r-- | sys/dev/isa/itvar.h | 10 |
2 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/isa/it.c b/sys/dev/isa/it.c index 1389c0c61d5..0f2ccc47cb0 100644 --- a/sys/dev/isa/it.c +++ b/sys/dev/isa/it.c @@ -1,4 +1,4 @@ -/* $OpenBSD: it.c,v 1.29 2008/04/07 09:31:30 form Exp $ */ +/* $OpenBSD: it.c,v 1.30 2008/04/07 09:43:54 form Exp $ */ /* * Copyright (c) 2007-2008 Oleg Safiullin <form@pdp-11.org.ru> @@ -215,7 +215,8 @@ it_attach(struct device *parent, struct device *self, void *aux) if (sc->sc_chipid != IT_ID_8705) { it_writereg(sc->sc_iot, sc->sc_ioh, IT_LDN, IT_WDT_LDN); it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_CSR, 0x00); - it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, 0x80); + it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, + IT_WDT_TCR_SECS); wdog_register(sc, it_wdog_cb); } @@ -415,7 +416,7 @@ it_wdog_cb(void *arg, int period) it_writereg(sc->sc_iot, sc->sc_ioh, IT_LDN, IT_WDT_LDN); /* disable watchdog timeout */ - it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, 0x80); + it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, IT_WDT_TCR_SECS); /* 1000s should be enough for everyone */ if (period > 1000) @@ -424,12 +425,13 @@ it_wdog_cb(void *arg, int period) period = 0; /* set watchdog timeout */ - it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_MSB, period >> 8); - it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_LSB, period & 0xff); + it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TMO_MSB, period >> 8); + it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TMO_LSB, period & 0xff); if (period > 0) /* enable watchdog timeout */ - it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, 0xc0); + it_writereg(sc->sc_iot, sc->sc_ioh, IT_WDT_TCR, + IT_WDT_TCR_SECS | IT_WDT_TCR_KRST); /* exit MB PnP mode */ it_exit(sc->sc_iot, sc->sc_ioh); diff --git a/sys/dev/isa/itvar.h b/sys/dev/isa/itvar.h index b70cc3a409f..b15becd6420 100644 --- a/sys/dev/isa/itvar.h +++ b/sys/dev/isa/itvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: itvar.h,v 1.8 2008/04/03 20:28:05 form Exp $ */ +/* $OpenBSD: itvar.h,v 1.9 2008/04/07 09:43:54 form Exp $ */ /* * Copyright (c) 2007-2008 Oleg Safiullin <form@pdp-11.org.ru> @@ -71,8 +71,12 @@ #define IT_WDT_CSR 0x71 #define IT_WDT_TCR 0x72 -#define IT_WDT_LSB 0x73 -#define IT_WDT_MSB 0x74 +#define IT_WDT_TMO_LSB 0x73 +#define IT_WDT_TMO_MSB 0x74 + +#define IT_WDT_TCR_SECS 0x80 +#define IT_WDT_TCR_KRST 0x40 +#define IT_WDT_TCR_PWROK 0x10 struct it_softc { |