Lines Matching +full:mps2 +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0-only
51 writel_relaxed(val, to_mps2_clkevt(c)->reg + offset); in clockevent_mps2_writel()
72 u32 clock_count_per_tick = to_mps2_clkevt(ce)->clock_count_per_tick; in mps2_timer_set_periodic()
84 u32 status = readl_relaxed(ce->reg + TIMER_INT); in mps2_timer_interrupt()
91 writel_relaxed(1, ce->reg + TIMER_INT); in mps2_timer_interrupt()
93 ce->clkevt.event_handler(&ce->clkevt); in mps2_timer_interrupt()
105 const char *name = "mps2-clkevt"; in mps2_clockevent_init()
107 ret = of_property_read_u32(np, "clock-frequency", &rate); in mps2_clockevent_init()
127 ret = -EADDRNOTAVAIL; in mps2_clockevent_init()
134 ret = -ENOENT; in mps2_clockevent_init()
141 ret = -ENOMEM; in mps2_clockevent_init()
145 ce->reg = base; in mps2_clockevent_init()
146 ce->clock_count_per_tick = DIV_ROUND_CLOSEST(rate, HZ); in mps2_clockevent_init()
147 ce->clkevt.irq = irq; in mps2_clockevent_init()
148 ce->clkevt.name = name; in mps2_clockevent_init()
149 ce->clkevt.rating = 200; in mps2_clockevent_init()
150 ce->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; in mps2_clockevent_init()
151 ce->clkevt.cpumask = cpu_possible_mask; in mps2_clockevent_init()
152 ce->clkevt.set_state_shutdown = mps2_timer_shutdown; in mps2_clockevent_init()
153 ce->clkevt.set_state_periodic = mps2_timer_set_periodic; in mps2_clockevent_init()
154 ce->clkevt.set_state_oneshot = mps2_timer_shutdown; in mps2_clockevent_init()
155 ce->clkevt.set_next_event = mps2_timer_set_next_event; in mps2_clockevent_init()
157 /* Ensure timer is disabled */ in mps2_clockevent_init()
166 clockevents_config_and_register(&ce->clkevt, rate, 0xf, 0xffffffff); in mps2_clockevent_init()
189 const char *name = "mps2-clksrc"; in mps2_clocksource_init()
191 ret = of_property_read_u32(np, "clock-frequency", &rate); in mps2_clocksource_init()
211 ret = -EADDRNOTAVAIL; in mps2_clocksource_init()
216 /* Ensure timer is disabled */ in mps2_clocksource_init()
219 /* ... and set it up as free-running clocksource */ in mps2_clocksource_init()
273 TIMER_OF_DECLARE(mps2_timer, "arm,mps2-timer", mps2_timer_init);