Esempio n. 1
0
static void __init pxa_timer_init(void)
{
	struct timespec tv;
	unsigned long flags;

	set_rtc = pxa_set_rtc;

	tv.tv_nsec = 0;
	tv.tv_sec = pxa_get_rtc_time();
	do_settimeofday(&tv);

	OIER = 0;		/* disable any timer interrupts */
	OSSR = 0xf;		/* clear status on all timers */
	setup_irq(IRQ_OST0, &pxa_timer_irq);
	local_irq_save(flags);
	OIER = OIER_E0;		/* enable match on timer 0 to cause interrupts */
	OSMR0 = OSCR + LATCH;	/* set initial match */
	local_irq_restore(flags);

	/*
	 * OSCR runs continuously on PXA and is not written to,
	 * so we can use it as clock source directly.
	 */
	clocksource_pxa.mult =
		clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_pxa.shift);
	clocksource_register(&clocksource_pxa);
}
Esempio n. 2
0
static void __init pxa_timer_init(void)
{
	struct timespec tv;

	set_rtc = pxa_set_rtc;

	tv.tv_nsec = 0;
	tv.tv_sec = pxa_get_rtc_time();
	do_settimeofday(&tv);

	OSMR0 = 0;		/* set initial match at 0 */
	OSSR = 0xf;		/* clear status on all timers */
	setup_irq(IRQ_OST0, &pxa_timer_irq);
	OIER |= OIER_E0;	/* enable match on timer 0 to cause interrupts */
	OSCR = 0;		/* initialize free-running timer, force first match */
}