Lines Matching +full:local +full:- +full:timers
1 // SPDX-License-Identifier: GPL-2.0
32 static struct kona_bcm_timers timers; variable
37 * We use the peripheral timers for system tick, the cpu global timer for
65 * Read 64-bit free running counter in kona_timer_get_counter()
66 * 1. Read hi-word in kona_timer_get_counter()
67 * 2. Read low-word in kona_timer_get_counter()
68 * 3. Read hi-word again in kona_timer_get_counter()
70 * if new hi-word is not equal to previously read hi-word, then in kona_timer_get_counter()
73 * if new hi-word is equal to previously read hi-word then stop. in kona_timer_get_counter()
81 } while (--loop_limit); in kona_timer_get_counter()
85 return -ETIMEDOUT; in kona_timer_get_counter()
96 * so, here we reload the next event value and re-enable in kona_timer_set_next_event()
100 * timer-interrupt->set_next_event. CPU local timers, when in kona_timer_set_next_event()
108 ret = kona_timer_get_counter(timers.tmr_regs, &msw, &lsw); in kona_timer_set_next_event()
113 writel(lsw + clc, timers.tmr_regs + KONA_GPTIMER_STCM0_OFFSET); in kona_timer_set_next_event()
116 reg = readl(timers.tmr_regs + KONA_GPTIMER_STCS_OFFSET); in kona_timer_set_next_event()
118 writel(reg, timers.tmr_regs + KONA_GPTIMER_STCS_OFFSET); in kona_timer_set_next_event()
125 kona_timer_disable_and_clear(timers.tmr_regs); in kona_timer_shutdown()
148 kona_timer_disable_and_clear(timers.tmr_regs); in kona_timer_interrupt()
149 evt->event_handler(evt); in kona_timer_interrupt()
163 } else if (!of_property_read_u32(node, "clock-frequency", &freq)) { in kona_timer_init()
166 pr_err("Kona Timer v1 unable to determine clock-frequency\n"); in kona_timer_init()
167 return -EINVAL; in kona_timer_init()
171 timers.tmr_irq = irq_of_parse_and_map(node, 0); in kona_timer_init()
174 timers.tmr_regs = of_iomap(node, 0); in kona_timer_init()
176 kona_timer_disable_and_clear(timers.tmr_regs); in kona_timer_init()
179 if (request_irq(timers.tmr_irq, kona_timer_interrupt, IRQF_TIMER, in kona_timer_init()
187 TIMER_OF_DECLARE(brcm_kona, "brcm,kona-timer", kona_timer_init);
189 * bcm,kona-timer is deprecated by brcm,kona-timer
192 TIMER_OF_DECLARE(bcm_kona, "bcm,kona-timer", kona_timer_init);