- pre3:
[davej-history.git] / include / asm-arm / arch-ebsa110 / time.h
blobee620371ceb826cbfb9e92231cc978809c08a992
1 /*
2 * linux/include/asm-arm/arch-ebsa110/time.h
4 * Copyright (c) 1996,1997,1998 Russell King.
6 * No real time clock on the evalulation board!
8 * Changelog:
9 * 10-Oct-1996 RMK Created
10 * 04-Dec-1997 RMK Updated for new arch/arm/kernel/time.c
11 * 07-Aug-1998 RMK Updated for arch/arm/kernel/leds.c
12 * 28-Dec-1998 APH Made leds code optional
15 #include <asm/leds.h>
17 #define MCLK_47_8
19 #if defined(MCLK_42_3)
20 #define PIT1_COUNT 0xecbe
21 #elif defined(MCLK_47_8)
23 * This should be 0x10B43, but that doesn't exactly fit.
24 * We run the timer interrupt at 5ms, and then divide it by
25 * two in software... This is so that the user processes
26 * see exactly the same model whichever ARM processor they're
27 * running on.
29 #define PIT1_COUNT 0x85A1
30 #define DIVISOR 2
31 #endif
33 static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
35 *PIT_T1 = (PIT1_COUNT) & 0xff;
36 *PIT_T1 = (PIT1_COUNT) >> 8;
38 #ifdef DIVISOR
40 static unsigned int divisor;
42 if (divisor--)
43 return;
44 divisor = DIVISOR - 1;
46 #endif
47 do_leds();
48 do_timer(regs);
49 do_profile(regs);
53 * Set up timer interrupt.
55 extern __inline__ void setup_timer(void)
58 * Timer 1, mode 0, 16-bit, autoreload
60 *PIT_CTRL = 0x70;
63 * Refresh counter clocked at 47.8MHz/7 = 146.4ns
64 * We want centi-second interrupts
66 *PIT_T1 = (PIT1_COUNT) & 0xff;
67 *PIT_T1 = (PIT1_COUNT) >> 8;
69 timer_irq.handler = timer_interrupt;
71 setup_arm_irq(IRQ_EBSA110_TIMER0, &timer_irq);