aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/kernel/time.c')
-rw-r--r--arch/mn10300/kernel/time.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c
index 5b955000626d..67c6416a58f8 100644
--- a/arch/mn10300/kernel/time.c
+++ b/arch/mn10300/kernel/time.c
@@ -93,79 +93,6 @@ irqreturn_t local_timer_interrupt(void)
93 return IRQ_HANDLED; 93 return IRQ_HANDLED;
94} 94}
95 95
96#ifndef CONFIG_GENERIC_TIME
97/*
98 * advance the kernel's time keeping clocks (xtime and jiffies)
99 * - we use Timer 0 & 1 cascaded as a clock to nudge us the next time
100 * there's a need to update
101 */
102static irqreturn_t timer_interrupt(int irq, void *dev_id)
103{
104 unsigned tsc, elapse;
105 irqreturn_t ret;
106
107 while (tsc = get_cycles(),
108 elapse = tsc - mn10300_last_tsc, /* time elapsed since last
109 * tick */
110 elapse > MN10300_TSC_PER_HZ
111 ) {
112 mn10300_last_tsc += MN10300_TSC_PER_HZ;
113
114 /* advance the kernel's time tracking system */
115 xtime_update(1);
116 }
117
118 ret = local_timer_interrupt();
119#ifdef CONFIG_SMP
120 send_IPI_allbutself(LOCAL_TIMER_IPI);
121#endif
122 return ret;
123}
124
125static struct irqaction timer_irq = {
126 .handler = timer_interrupt,
127 .flags = IRQF_DISABLED | IRQF_SHARED | IRQF_TIMER,
128 .name = "timer",
129};
130#endif /* CONFIG_GENERIC_TIME */
131
132#ifdef CONFIG_CSRC_MN10300
133void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
134{
135 u64 temp;
136 u32 shift;
137
138 /* Find a shift value */
139 for (shift = 32; shift > 0; shift--) {
140 temp = (u64) NSEC_PER_SEC << shift;
141 do_div(temp, clock);
142 if ((temp >> 32) == 0)
143 break;
144 }
145 cs->shift = shift;
146 cs->mult = (u32) temp;
147}
148#endif
149
150#if CONFIG_CEVT_MN10300
151void __cpuinit clockevent_set_clock(struct clock_event_device *cd,
152 unsigned int clock)
153{
154 u64 temp;
155 u32 shift;
156
157 /* Find a shift value */
158 for (shift = 32; shift > 0; shift--) {
159 temp = (u64) clock << shift;
160 do_div(temp, NSEC_PER_SEC);
161 if ((temp >> 32) == 0)
162 break;
163 }
164 cd->shift = shift;
165 cd->mult = (u32) temp;
166}
167#endif
168
169/* 96/*
170 * initialise the various timers used by the main part of the kernel 97 * initialise the various timers used by the main part of the kernel
171 */ 98 */
@@ -177,11 +104,7 @@ void __init time_init(void)
177 */ 104 */
178 TMPSCNT |= TMPSCNT_ENABLE; 105 TMPSCNT |= TMPSCNT_ENABLE;
179 106
180#ifdef CONFIG_GENERIC_TIME
181 init_clocksource(); 107 init_clocksource();
182#else
183 startup_timestamp_counter();
184#endif
185 108
186 printk(KERN_INFO 109 printk(KERN_INFO
187 "timestamp counter I/O clock running at %lu.%02lu" 110 "timestamp counter I/O clock running at %lu.%02lu"
@@ -190,12 +113,7 @@ void __init time_init(void)
190 113
191 mn10300_last_tsc = read_timestamp_counter(); 114 mn10300_last_tsc = read_timestamp_counter();
192 115
193#ifdef CONFIG_GENERIC_CLOCKEVENTS
194 init_clockevents(); 116 init_clockevents();
195#else
196 reload_jiffies_counter(MN10300_JC_PER_HZ - 1);
197 setup_jiffies_interrupt(TMJCIRQ, &timer_irq, CONFIG_TIMER_IRQ_LEVEL);
198#endif
199 117
200#ifdef CONFIG_MN10300_WD_TIMER 118#ifdef CONFIG_MN10300_WD_TIMER
201 /* start the watchdog timer */ 119 /* start the watchdog timer */