Lines Matching +full:otto +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include "timer-of.h"
27 * The Otto platform provides multiple 28 bit timers/counters with the following
28 * operating logic. If enabled the timer counts up. Per timer one can set a
29 * maximum counter value as an end marker. If end marker is reached the timer
30 * fires an interrupt. If the timer "overflows" by reaching the end marker or
32 * the timer is in operating mode COUNTER it stops. In mode TIMER it will
100 pr_debug("------------- %d %p\n", \
108 rttm_ack_irq(to->of_base.base); in rttm_timer_interrupt()
109 RTTM_DEBUG(to->of_base.base); in rttm_timer_interrupt()
110 clkevt->event_handler(clkevt); in rttm_timer_interrupt()
123 rttm_set_counter(to->of_base.base, 0); in rttm_start_timer()
124 rttm_enable_timer(to->of_base.base, mode, to->of_clk.rate / RTTM_TICKS_PER_SEC); in rttm_start_timer()
131 RTTM_DEBUG(to->of_base.base); in rttm_next_event()
132 rttm_stop_timer(to->of_base.base); in rttm_next_event()
133 rttm_set_period(to->of_base.base, delta); in rttm_next_event()
143 RTTM_DEBUG(to->of_base.base); in rttm_state_oneshot()
144 rttm_stop_timer(to->of_base.base); in rttm_state_oneshot()
145 rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ); in rttm_state_oneshot()
155 RTTM_DEBUG(to->of_base.base); in rttm_state_periodic()
156 rttm_stop_timer(to->of_base.base); in rttm_state_periodic()
157 rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ); in rttm_state_periodic()
167 RTTM_DEBUG(to->of_base.base); in rttm_state_shutdown()
168 rttm_stop_timer(to->of_base.base); in rttm_state_shutdown()
184 return rttm_get_counter(rcs->to.of_base.base); in rttm_read_clocksource()
208 rttm_disable_irq(rcs->to.of_base.base); in rttm_enable_clocksource()
209 rttm_setup_timer(rcs->to.of_base.base); in rttm_enable_clocksource()
210 rttm_enable_timer(rcs->to.of_base.base, RTTM_CTRL_TIMER, in rttm_enable_clocksource()
211 rcs->to.of_clk.rate / RTTM_TICKS_PER_SEC); in rttm_enable_clocksource()
238 RTTM_DEBUG(to->of_base.base); in rttm_cpu_starting()
239 to->clkevt.cpumask = cpumask_of(cpu); in rttm_cpu_starting()
240 irq_force_affinity(to->of_irq.irq, to->clkevt.cpumask); in rttm_cpu_starting()
241 clockevents_config_and_register(&to->clkevt, RTTM_TICKS_PER_SEC, in rttm_cpu_starting()
243 rttm_enable_irq(to->of_base.base); in rttm_cpu_starting()
257 to->of_irq.index = to->of_base.index = cpu; in rttm_probe()
259 pr_err("setup of timer %d failed\n", cpu); in rttm_probe()
262 rttm_setup_timer(to->of_base.base); in rttm_probe()
265 /* Activate the n'th + 1 timer as a stable CPU clocksource. */ in rttm_probe()
267 to->of_base.index = clkidx; in rttm_probe()
274 pr_err(" setup of timer %d as clocksource failed", clkidx); in rttm_probe()
277 "timer/realtek:online", in rttm_probe()
280 pr_err("timer registration failed\n"); in rttm_probe()
288 return -EINVAL; in rttm_probe()
291 TIMER_OF_DECLARE(otto_timer, "realtek,otto-timer", rttm_probe);