21 #include <mach/hardware.h>
23 #define RATE_32K 32768
25 #define TIMER_MODE_CONTINOUS 0x1
26 #define TIMER_DOWNCOUNT_VAL 0xffffffff
28 #define PRCMU_TIMER_REF 0
29 #define PRCMU_TIMER_DOWNCOUNT 0x4
30 #define PRCMU_TIMER_MODE 0x8
32 #define SCHED_CLOCK_MIN_WRAP 131072
34 static void __iomem *clksrc_dbx500_timer_base;
41 count =
readl(clksrc_dbx500_timer_base +
43 count2 =
readl(clksrc_dbx500_timer_base +
45 }
while (count2 != count);
51 static struct clocksource clocksource_dbx500_prcmu = {
52 .name =
"dbx500-prcmu-timer",
54 .read = clksrc_dbx500_prcmu_read,
59 #ifdef CONFIG_CLKSRC_DBX500_PRCMU_SCHED_CLOCK
61 static u32 notrace dbx500_prcmu_sched_clock_read(
void)
63 if (
unlikely(!clksrc_dbx500_timer_base))
66 return clksrc_dbx500_prcmu_read(&clocksource_dbx500_prcmu);
73 clksrc_dbx500_timer_base = base;
88 #ifdef CONFIG_CLKSRC_DBX500_PRCMU_SCHED_CLOCK
92 clocksource_register_hz(&clocksource_dbx500_prcmu,
RATE_32K);