Lines Matching +full:timeout +full:- +full:enable

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
34 * - AMD SB600 Register Reference Guide, Public Version, Rev. 3.03 (SB600 RRG)
35 …* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/46155_sb600_rrg_pub_3.…
36 * - AMD SB700/710/750 Register Reference Guide (RRG)
38 * - AMD SB700/710/750 Register Programming Requirements (RPR)
40 * - AMD SB800-Series Southbridges Register Reference Guide (RRG)
43 * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT)
101 unsigned int timeout; member
149 return (bus_read_4(sc->res_ctrl, 0)); in wdctrl_read()
155 bus_write_4(sc->res_ctrl, 0, val); in wdctrl_write()
161 return (bus_read_4(sc->res_count, 0)); in wdcount_read()
167 bus_write_4(sc->res_count, 0, val); in wdcount_write()
178 sc->active = 1; in amdsbwd_tmr_enable()
179 amdsbwd_verbose_printf(sc->dev, "timer enabled\n"); in amdsbwd_tmr_enable()
190 sc->active = 0; in amdsbwd_tmr_disable()
191 amdsbwd_verbose_printf(sc->dev, "timer disabled\n"); in amdsbwd_tmr_disable()
205 amdsbwd_tmr_set(struct amdsbwd_softc *sc, uint16_t timeout) in amdsbwd_tmr_set() argument
208 timeout &= AMDSB_WD_COUNT_MASK; in amdsbwd_tmr_set()
209 wdcount_write(sc, timeout); in amdsbwd_tmr_set()
210 sc->timeout = timeout; in amdsbwd_tmr_set()
211 amdsbwd_verbose_printf(sc->dev, "timeout set to %u ticks\n", timeout); in amdsbwd_tmr_set()
218 uint64_t timeout; in amdsbwd_event() local
221 timeout = 0; in amdsbwd_event()
224 timeout = (uint64_t)1 << (cmd - WD_TO_1MS); in amdsbwd_event()
225 timeout = timeout / sc->ms_per_tick; in amdsbwd_event()
227 /* For a too short timeout use 1 tick. */ in amdsbwd_event()
228 if (timeout == 0) in amdsbwd_event()
229 timeout = 1; in amdsbwd_event()
230 /* For a too long timeout stop the timer. */ in amdsbwd_event()
231 if (timeout > sc->max_ticks) in amdsbwd_event()
232 timeout = 0; in amdsbwd_event()
234 timeout = 0; in amdsbwd_event()
237 if (timeout != 0) { in amdsbwd_event()
238 if (timeout != sc->timeout) in amdsbwd_event()
239 amdsbwd_tmr_set(sc, timeout); in amdsbwd_event()
240 if (!sc->active) in amdsbwd_event()
245 if (sc->active) in amdsbwd_event()
299 *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); in amdsbwd_probe_sb7xx()
309 /* Enable watchdog device (in stopped state). */ in amdsbwd_probe_sb7xx()
335 for (i = 3; i >= 0; i--) { in amdsbwd_probe_sb8xx()
347 *addr |= pmio_read(pmres, AMDSB8_PM_WDT_EN + 3 - i); in amdsbwd_probe_sb8xx()
362 * Enable watchdog device (in stopped state) in amdsbwd_probe_sb8xx()
382 * Enable decoding of watchdog MMIO address. in amdsbwd_probe_fch41()
404 * enable the watchdog device (in stopped state). in amdsbwd_probe_fch41()
487 sc->max_ticks = UINT16_MAX; in amdsbwd_attach_sb()
488 sc->rid_ctrl = 0; in amdsbwd_attach_sb()
489 sc->rid_count = 1; in amdsbwd_attach_sb()
491 sc->ms_per_tick = 1000; in amdsbwd_attach_sb()
493 sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in amdsbwd_attach_sb()
494 &sc->rid_ctrl, RF_ACTIVE); in amdsbwd_attach_sb()
495 if (sc->res_ctrl == NULL) { in amdsbwd_attach_sb()
499 sc->res_count = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in amdsbwd_attach_sb()
500 &sc->rid_count, RF_ACTIVE); in amdsbwd_attach_sb()
501 if (sc->res_count == NULL) { in amdsbwd_attach_sb()
515 sc->dev = dev; in amdsbwd_attach()
534 sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, amdsbwd_event, sc, in amdsbwd_attach()
550 if (sc->ev_tag != NULL) in amdsbwd_detach()
551 EVENTHANDLER_DEREGISTER(watchdog_list, sc->ev_tag); in amdsbwd_detach()
553 if (sc->active) in amdsbwd_detach()
556 if (sc->res_ctrl != NULL) in amdsbwd_detach()
557 bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ctrl, in amdsbwd_detach()
558 sc->res_ctrl); in amdsbwd_detach()
560 if (sc->res_count != NULL) in amdsbwd_detach()
561 bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_count, in amdsbwd_detach()
562 sc->res_count); in amdsbwd_detach()
587 if (sc->active) { in amdsbwd_resume()
588 amdsbwd_tmr_set(sc, sc->timeout); in amdsbwd_resume()