aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v32/kernel/time.c')
-rw-r--r--arch/cris/arch-v32/kernel/time.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index b1920d8de403..1ee0e1010228 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -44,7 +44,6 @@ unsigned long timer_regs[NR_CPUS] =
44#endif 44#endif
45}; 45};
46 46
47extern void update_xtime_from_cmos(void);
48extern int set_rtc_mmss(unsigned long nowtime); 47extern int set_rtc_mmss(unsigned long nowtime);
49extern int have_rtc; 48extern int have_rtc;
50 49
@@ -198,9 +197,6 @@ handle_watchdog_bite(struct pt_regs* regs)
198#endif 197#endif
199} 198}
200 199
201/* Last time the cmos clock got updated. */
202static long last_rtc_update = 0;
203
204/* 200/*
205 * timer_interrupt() needs to keep up the real-time clock, 201 * timer_interrupt() needs to keep up the real-time clock,
206 * as well as call the "do_timer()" routine every clocktick. 202 * as well as call the "do_timer()" routine every clocktick.
@@ -238,25 +234,6 @@ timer_interrupt(int irq, void *dev_id)
238 234
239 /* Call the real timer interrupt handler */ 235 /* Call the real timer interrupt handler */
240 do_timer(1); 236 do_timer(1);
241
242 /*
243 * If we have an externally synchronized Linux clock, then update
244 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
245 * called as close as possible to 500 ms before the new second starts.
246 *
247 * The division here is not time critical since it will run once in
248 * 11 minutes
249 */
250 if ((time_status & STA_UNSYNC) == 0 &&
251 xtime.tv_sec > last_rtc_update + 660 &&
252 (xtime.tv_nsec / 1000) >= 500000 - (tick_nsec / 1000) / 2 &&
253 (xtime.tv_nsec / 1000) <= 500000 + (tick_nsec / 1000) / 2) {
254 if (set_rtc_mmss(xtime.tv_sec) == 0)
255 last_rtc_update = xtime.tv_sec;
256 else
257 /* Do it again in 60 s */
258 last_rtc_update = xtime.tv_sec - 600;
259 }
260 return IRQ_HANDLED; 237 return IRQ_HANDLED;
261} 238}
262 239
@@ -309,23 +286,10 @@ time_init(void)
309 */ 286 */
310 loops_per_usec = 50; 287 loops_per_usec = 50;
311 288
312 if(RTC_INIT() < 0) { 289 if(RTC_INIT() < 0)
313 /* No RTC, start at 1980 */
314 xtime.tv_sec = 0;
315 xtime.tv_nsec = 0;
316 have_rtc = 0; 290 have_rtc = 0;
317 } else { 291 else
318 /* Get the current time */
319 have_rtc = 1; 292 have_rtc = 1;
320 update_xtime_from_cmos();
321 }
322
323 /*
324 * Initialize wall_to_monotonic such that adding it to
325 * xtime will yield zero, the tv_nsec field must be normalized
326 * (i.e., 0 <= nsec < NSEC_PER_SEC).
327 */
328 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
329 293
330 /* Start CPU local timer. */ 294 /* Start CPU local timer. */
331 cris_timer_init(); 295 cris_timer_init();