15 #include <linux/errno.h>
16 #include <linux/sched.h>
17 #include <linux/time.h>
20 #include <linux/module.h>
26 #include <asm/timex.h>
29 #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
30 unsigned long ccount_per_jiffy;
31 unsigned long nsec_per_ccount;
34 static cycle_t ccount_read(
void)
55 #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
56 printk(
"Calibrating CPU frequency ");
58 printk(
"%d.%02d MHz\n", (
int)ccount_per_jiffy/(1000000/
HZ),
59 (
int)(ccount_per_jiffy/(10000/
HZ))%100);
61 clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY *
HZ);
65 setup_irq(LINUX_TIMER_INT, &timer_irqaction);
66 set_linux_timer(get_ccount() + CCOUNT_PER_JIFFY);
78 next = get_linux_timer();
81 while ((
signed long)(get_ccount() - next) > 0) {
92 next += CCOUNT_PER_JIFFY;
93 set_linux_timer(next);
102 if ((
signed long)(get_ccount() - next) > 0)
108 #ifndef CONFIG_GENERIC_CALIBRATE_DELAY
112 printk(
"Calibrating delay loop (skipped)... "
113 "%lu.%02lu BogoMIPS preset\n",