struct irqaction *irq = &timer.ce_irq[cpu];
void __iomem *base = timer.ce_base[cpu];
+ if (!base)
+ return 0;
+
ce->name = timer.ce_name[cpu];
ce->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
ce->set_next_event = rk_timer_set_next_event;
init_fixed_sched_clock(&cd, rk_timer_update_sched_clock, 32, 24000000, MULT, SHIFT);
}
-#ifndef CONFIG_LOCAL_TIMERS
+#if !defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_HAVE_ARM_TWD)
static struct clock_event_device rk_timer_clockevent;
#endif
snprintf(timer.ce_name[cpu], sizeof(timer.ce_name[cpu]), TIMER_NAME "%d", cpu);
+ snprintf(name, sizeof(name), "ce_base%d", cpu);
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
+ if (!res)
+ continue;
+ timer.ce_base[cpu] = (void *)res->start;
+
snprintf(name, sizeof(name), "ce_clk%d", cpu);
timer.ce_clk[cpu] = clk_get(NULL, platform_get_string_byname(pdev, name));
snprintf(name, sizeof(name), "ce_pclk%d", cpu);
timer.ce_pclk[cpu] = clk_get(NULL, platform_get_string_byname(pdev, name));
- snprintf(name, sizeof(name), "ce_base%d", cpu);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
- timer.ce_base[cpu] = (void *)res->start;
-
snprintf(name, sizeof(name), "ce_irq%d", cpu);
irq->irq = platform_get_irq_byname(pdev, name);
irq->name = timer.ce_name[cpu];
}
rk_timer_init_clocksource();
-#ifndef CONFIG_LOCAL_TIMERS
- rk_timer_clockevent.rating = 200;
+#if !defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_HAVE_ARM_TWD)
+ rk_timer_clockevent.rating = 400;
rk_timer_init_clockevent(&rk_timer_clockevent, 0);
#endif
rk_timer_init_sched_clock();
- printk("rk_timer: version 1.2\n");
+ printk("rk_timer: version 1.3\n");
return 0;
}
early_platform_init(TIMER_NAME, &rk_timer_driver);
-#ifdef CONFIG_LOCAL_TIMERS
+#if defined(CONFIG_LOCAL_TIMERS) && !defined(CONFIG_HAVE_ARM_TWD)
/*
* Setup the local clock events for a CPU.
*/