Lines Matching refs:timer_softc
103 static struct mv_timer_softc *timer_softc = NULL; variable
174 if (timer_softc != NULL) in mv_timer_attach()
178 timer_softc = sc; in mv_timer_attach()
197 mtx_init(&timer_softc->timer_mtx, "watchdog", NULL, MTX_DEF); in mv_timer_attach()
260 irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); in mv_hardclock()
261 irq_cause &= timer_softc->config->irq_timer0_clr; in mv_hardclock()
262 write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); in mv_hardclock()
299 nticks = ((timer_softc->config->clock_src / 1000000 + 1) * usec); in mv_delay()
334 return (bus_space_read_4(timer_softc->timer_bst, in mv_get_timer_control()
335 timer_softc->timer_bsh, CPU_TIMER_CONTROL)); in mv_get_timer_control()
342 bus_space_write_4(timer_softc->timer_bst, in mv_set_timer_control()
343 timer_softc->timer_bsh, CPU_TIMER_CONTROL, val); in mv_set_timer_control()
350 return (bus_space_read_4(timer_softc->timer_bst, in mv_get_timer()
351 timer_softc->timer_bsh, CPU_TIMER0 + timer * 0x8)); in mv_get_timer()
358 bus_space_write_4(timer_softc->timer_bst, in mv_set_timer()
359 timer_softc->timer_bsh, CPU_TIMER0 + timer * 0x8, val); in mv_set_timer()
366 bus_space_write_4(timer_softc->timer_bst, in mv_set_timer_rel()
367 timer_softc->timer_bsh, CPU_TIMER0_REL + timer * 0x8, val); in mv_set_timer_rel()
375 irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); in mv_watchdog_enable_armadaxp()
376 irq_cause &= timer_softc->config->irq_timer_wd_clr; in mv_watchdog_enable_armadaxp()
377 write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); in mv_watchdog_enable_armadaxp()
405 irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); in mv_watchdog_disable_armadaxp()
406 irq_cause &= timer_softc->config->irq_timer_wd_clr; in mv_watchdog_disable_armadaxp()
407 write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); in mv_watchdog_disable_armadaxp()
423 mtx_lock(&timer_softc->timer_mtx); in mv_watchdog_event()
425 if (timer_softc->config->watchdog_disable != NULL) in mv_watchdog_event()
426 timer_softc->config->watchdog_disable(); in mv_watchdog_event()
433 ticks = (uint64_t)(ns * timer_softc->config->clock_src) / 1000000000; in mv_watchdog_event()
435 if (timer_softc->config->watchdog_disable != NULL) in mv_watchdog_event()
436 timer_softc->config->watchdog_disable(); in mv_watchdog_event()
439 if (timer_softc->config->watchdog_enable != NULL) in mv_watchdog_event()
440 timer_softc->config->watchdog_enable(); in mv_watchdog_event()
444 mtx_unlock(&timer_softc->timer_mtx); in mv_watchdog_event()
499 if (timer_softc->config->soc_family == MV_SOC_ARMADA_XP) { in mv_setup_timers()