void openrisc_clockevent_init()

in kernel/time.c [66:89]


void openrisc_clockevent_init(void)
{
	unsigned int cpu = smp_processor_id();
	struct clock_event_device *evt =
		&per_cpu(clockevent_openrisc_timer, cpu);
	struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[cpu];

	mtspr(SPR_TTMR, SPR_TTMR_CR);

#ifdef CONFIG_SMP
	evt->broadcast = tick_broadcast;
#endif
	evt->name = "openrisc_timer_clockevent",
	evt->features = CLOCK_EVT_FEAT_ONESHOT,
	evt->rating = 300,
	evt->set_next_event = openrisc_timer_set_next_event,

	evt->cpumask = cpumask_of(cpu);

	/* We only have 28 bits */
	clockevents_config_and_register(evt, cpuinfo->clock_frequency,
					100, 0x0fffffff);

}