Lines Matching +full:bcm2835 +full:- +full:system +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0+
46 struct bcm2835_timer *timer = container_of(evt_dev, in bcm2835_time_set_next_event() local
49 timer->compare); in bcm2835_time_set_next_event()
55 struct bcm2835_timer *timer = dev_id; in bcm2835_time_interrupt() local
57 if (readl_relaxed(timer->control) & timer->match_mask) { in bcm2835_time_interrupt()
58 writel_relaxed(timer->match_mask, timer->control); in bcm2835_time_interrupt()
60 event_handler = READ_ONCE(timer->evt.event_handler); in bcm2835_time_interrupt()
62 event_handler(&timer->evt); in bcm2835_time_interrupt()
74 struct bcm2835_timer *timer; in bcm2835_timer_init() local
79 return -ENXIO; in bcm2835_timer_init()
82 ret = of_property_read_u32(node, "clock-frequency", &freq); in bcm2835_timer_init()
84 pr_err("Can't read clock-frequency\n"); in bcm2835_timer_init()
91 clocksource_mmio_init(base + REG_COUNTER_LO, node->name, in bcm2835_timer_init()
97 ret = -EINVAL; in bcm2835_timer_init()
101 timer = kzalloc(sizeof(*timer), GFP_KERNEL); in bcm2835_timer_init()
102 if (!timer) { in bcm2835_timer_init()
103 ret = -ENOMEM; in bcm2835_timer_init()
107 timer->control = base + REG_CONTROL; in bcm2835_timer_init()
108 timer->compare = base + REG_COMPARE(DEFAULT_TIMER); in bcm2835_timer_init()
109 timer->match_mask = BIT(DEFAULT_TIMER); in bcm2835_timer_init()
110 timer->evt.name = node->name; in bcm2835_timer_init()
111 timer->evt.rating = 300; in bcm2835_timer_init()
112 timer->evt.features = CLOCK_EVT_FEAT_ONESHOT; in bcm2835_timer_init()
113 timer->evt.set_next_event = bcm2835_time_set_next_event; in bcm2835_timer_init()
114 timer->evt.cpumask = cpumask_of(0); in bcm2835_timer_init()
117 node->name, timer); in bcm2835_timer_init()
119 pr_err("Can't set up timer IRQ\n"); in bcm2835_timer_init()
123 clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff); in bcm2835_timer_init()
125 pr_info("bcm2835: system timer (irq = %d)\n", irq); in bcm2835_timer_init()
130 kfree(timer); in bcm2835_timer_init()
136 TIMER_OF_DECLARE(bcm2835, "brcm,bcm2835-system-timer",