diff options
author | attilio <attilio@FreeBSD.org> | 2010-11-26 15:35:08 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2010-11-26 15:35:08 +0000 |
commit | ed99de310cdfe5c10e78419f94ca812947b1fe29 (patch) | |
tree | aeae88d67d88791d7e2c676e0f015569cf40d343 | |
parent | 60c89c994a97c0fb5628378c9b8b98b4b6f96d32 (diff) | |
download | FreeBSD-src-ed99de310cdfe5c10e78419f94ca812947b1fe29.zip FreeBSD-src-ed99de310cdfe5c10e78419f94ca812947b1fe29.tar.gz |
- Advertise when the reboot came from a watchdog-induced reset.
- Fix a bug where TCO_BOOT_STS was supposed to be cleared after
TCO_SECOND_TO_STS and not before.
Sponsored by: Sandvine Incorporated
Submitted by: Mark Johnston <mjohnston at sandvine dot com>
Reviewed by: des
MFC after: 10 days
-rw-r--r-- | sys/dev/ichwd/ichwd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 727b96d..30f2f49 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -225,12 +225,12 @@ ichwd_sts_reset(struct ichwd_softc *sc) * by writing a 1, not a 0. */ ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT); - /* - * XXX The datasheet says that TCO_SECOND_TO_STS must be cleared - * before TCO_BOOT_STS, not the other way around. + /* + * According to Intel's docs, clearing SECOND_TO_STS and BOOT_STS must + * be done in two separate operations. */ - ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); + ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); } /* @@ -520,11 +520,12 @@ ichwd_attach(device_t dev) device_get_desc(dev), sc->ich_version); /* - * XXX we should check the status registers (specifically, the - * TCO_SECOND_TO_STS bit in the TCO2_STS register) to see if we - * just came back from a watchdog-induced reset, and let the user - * know. + * Determine if we are coming up after a watchdog-induced reset. + * This bit is cleared in ichwd_sts_reset(). */ + if ((ich_read_tco_2(sc, TCO2_STS) & TCO_SECOND_TO_STS) != 0) + device_printf(dev, + "resuming after hardware watchdog timeout\n"); /* reset the watchdog status registers */ ichwd_sts_reset(sc); |