diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2017-09-17 10:43:27 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-09-17 10:43:27 +0000 |
| commit | e7747560ce36a0f0327343c7571c69c5ebcaacc9 (patch) | |
| tree | ddb34062da74df31f2c365e77dc12bd79585bd30 /sys/dev/ichwd | |
| parent | c3fcd5703fde687fc5799a496c817f83a7060325 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ichwd')
| -rw-r--r-- | sys/dev/ichwd/ichwd.c | 8 | ||||
| -rw-r--r-- | sys/dev/ichwd/ichwd.h | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 2e85f63dc49a..9cb77254f637 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -512,7 +512,13 @@ ichwd_event(void *arg, unsigned int cmd, int *error) /* convert from power-of-two-ns to WDT ticks */ cmd &= WD_INTERVAL; - timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; + + if (sc->tco_version == 3) { + timeout = ((uint64_t)1 << cmd) / ICHWD_TCO_V3_TICK; + } else { + timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; + } + if (cmd) { if (!sc->active) ichwd_tmr_enable(sc); diff --git a/sys/dev/ichwd/ichwd.h b/sys/dev/ichwd/ichwd.h index dc24a9d605ce..33ae66c7bc8a 100644 --- a/sys/dev/ichwd/ichwd.h +++ b/sys/dev/ichwd/ichwd.h @@ -345,7 +345,9 @@ struct ichwd_softc { #define TCO_RLD1_TMR_MAX 0x003f #define TCO_RLD2_TMR_MAX 0x03ff -/* approximate length in nanoseconds of one WDT tick (about 0.6 sec) */ +/* approximate length in nanoseconds of one WDT tick (about 0.6 sec) for TCO v1/v2 */ #define ICHWD_TICK 600000000 +/* approximate length in nanoseconds of one WDT tick (about 1.0 sec) for TCO v3 */ +#define ICHWD_TCO_V3_TICK 1000000000 #endif |
