Lines Matching +full:wdt +full:- +full:interval
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
88 /* Real-time clock specific */
102 #define FEAON_LOCK(sc) mtx_lock(&(sc)->mtx)
103 #define FEAON_UNLOCK(sc) mtx_unlock(&(sc)->mtx)
104 #define FEAON_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED)
105 #define FEAON_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED)
107 #define FEAON_READ_4(sc, reg) bus_read_4(sc->reg_res, reg)
108 #define FEAON_WRITE_4(sc, reg, val) bus_write_4(sc->reg_res, reg, val)
123 /* WDT */
137 /* First feed WDT */ in feaon_wdt_event()
141 /* Disable WDT */ in feaon_wdt_event()
148 /* Calculate time in WDT frequency */ in feaon_wdt_event()
160 device_printf(sc->dev, "Time interval too large for WDT\n"); in feaon_wdt_event()
165 /* Program WDT */ in feaon_wdt_event()
193 time = ts->tv_sec * FEAON_RTC_TIMEBASE_FREQ; in feaon_rtc_settime()
201 device_printf(sc->dev, "Time value too large for RTC\n"); in feaon_rtc_settime()
233 ts->tv_sec = time / FEAON_RTC_TIMEBASE_FREQ; in feaon_rtc_gettime()
234 ts->tv_nsec = (time % FEAON_RTC_TIMEBASE_FREQ) * in feaon_rtc_gettime()
251 sc->dev = dev; in feaon_attach()
254 mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); in feaon_attach()
257 sc->reg_rid = 0; in feaon_attach()
258 if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in feaon_attach()
259 &sc->reg_rid, RF_ACTIVE)) == NULL) { in feaon_attach()
271 /* Register WDT */ in feaon_attach()
272 sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, feaon_wdt_event, sc, 0); in feaon_attach()
277 bus_release_resource(dev, SYS_RES_MEMORY, sc->reg_rid, sc->reg_res); in feaon_attach()
278 mtx_destroy(&sc->mtx); in feaon_attach()
292 device_set_desc(dev, "SiFive FE310 Always-On Controller"); in feaon_probe()