Lines Matching +full:armada +full:- +full:xp +full:- +full:timer

1 /*-
3 * Copyright (C) 2007-2008 MARVELL INTERNATIONAL LTD.
103 { -1, 0 }
107 {"marvell,armada-380-wdt", (uintptr_t)&mv_wdt_armada_38x_config},
108 {"marvell,armada-xp-wdt", (uintptr_t)&mv_wdt_armada_xp_config},
109 {"marvell,orion-wdt", (uintptr_t)&mv_wdt_armv5_config},
146 if (!ofw_bus_search_compatible(dev, mv_wdt_compat)->ocd_data) in mv_wdt_probe()
149 device_set_desc(dev, "Marvell Watchdog Timer"); in mv_wdt_probe()
165 error = bus_alloc_resources(dev, mv_wdt_spec, &sc->wdt_res); in mv_wdt_attach()
171 mtx_init(&sc->wdt_mtx, "watchdog", NULL, MTX_DEF); in mv_wdt_attach()
173 sc->wdt_config = (struct mv_wdt_config *) in mv_wdt_attach()
174 ofw_bus_search_compatible(dev, mv_wdt_compat)->ocd_data; in mv_wdt_attach()
176 if (sc->wdt_config->wdt_clock_src == 0) in mv_wdt_attach()
177 sc->wdt_config->wdt_clock_src = get_tclk(); in mv_wdt_attach()
179 if (wdt_softc->wdt_config->wdt_disable != NULL) in mv_wdt_attach()
180 wdt_softc->wdt_config->wdt_disable(); in mv_wdt_attach()
190 return (bus_read_4(wdt_softc->wdt_res, CPU_TIMER_CONTROL)); in mv_get_timer_control()
197 bus_write_4(wdt_softc->wdt_res, CPU_TIMER_CONTROL, val); in mv_set_timer_control()
201 mv_set_timer(uint32_t timer, uint32_t val) in mv_set_timer() argument
204 bus_write_4(wdt_softc->wdt_res, CPU_TIMER0 + timer * 0x8, val); in mv_set_timer()
348 mtx_lock(&sc->wdt_mtx); in mv_watchdog_event()
350 if (wdt_softc->wdt_config->wdt_disable != NULL) in mv_watchdog_event()
351 wdt_softc->wdt_config->wdt_disable(); in mv_watchdog_event()
358 ticks = (uint64_t)(ns * sc->wdt_config->wdt_clock_src) / 1000000000; in mv_watchdog_event()
360 if (wdt_softc->wdt_config->wdt_disable != NULL) in mv_watchdog_event()
361 wdt_softc->wdt_config->wdt_disable(); in mv_watchdog_event()
364 mv_set_timer(wdt_softc->wdt_config->wdt_timer, ticks); in mv_watchdog_event()
365 if (wdt_softc->wdt_config->wdt_enable != NULL) in mv_watchdog_event()
366 wdt_softc->wdt_config->wdt_enable(); in mv_watchdog_event()
370 mtx_unlock(&sc->wdt_mtx); in mv_watchdog_event()