diff options
Diffstat (limited to 'arch/mips/sni/time.c')
-rw-r--r-- | arch/mips/sni/time.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c index 20028fc7757e..b80877349d38 100644 --- a/arch/mips/sni/time.c +++ b/arch/mips/sni/time.c | |||
@@ -2,8 +2,10 @@ | |||
2 | #include <linux/interrupt.h> | 2 | #include <linux/interrupt.h> |
3 | #include <linux/time.h> | 3 | #include <linux/time.h> |
4 | 4 | ||
5 | #include <asm/i8253.h> | ||
5 | #include <asm/sni.h> | 6 | #include <asm/sni.h> |
6 | #include <asm/time.h> | 7 | #include <asm/time.h> |
8 | #include <asm-generic/rtc.h> | ||
7 | 9 | ||
8 | #define SNI_CLOCK_TICK_RATE 3686400 | 10 | #define SNI_CLOCK_TICK_RATE 3686400 |
9 | #define SNI_COUNTER2_DIV 64 | 11 | #define SNI_COUNTER2_DIV 64 |
@@ -42,23 +44,23 @@ static __init unsigned long dosample(void) | |||
42 | volatile u8 msb, lsb; | 44 | volatile u8 msb, lsb; |
43 | 45 | ||
44 | /* Start the counter. */ | 46 | /* Start the counter. */ |
45 | outb_p (0x34, 0x43); | 47 | outb_p(0x34, 0x43); |
46 | outb_p(SNI_8254_TCSAMP_COUNTER & 0xff, 0x40); | 48 | outb_p(SNI_8254_TCSAMP_COUNTER & 0xff, 0x40); |
47 | outb (SNI_8254_TCSAMP_COUNTER >> 8, 0x40); | 49 | outb(SNI_8254_TCSAMP_COUNTER >> 8, 0x40); |
48 | 50 | ||
49 | /* Get initial counter invariant */ | 51 | /* Get initial counter invariant */ |
50 | ct0 = read_c0_count(); | 52 | ct0 = read_c0_count(); |
51 | 53 | ||
52 | /* Latch and spin until top byte of counter0 is zero */ | 54 | /* Latch and spin until top byte of counter0 is zero */ |
53 | do { | 55 | do { |
54 | outb (0x00, 0x43); | 56 | outb(0x00, 0x43); |
55 | lsb = inb (0x40); | 57 | lsb = inb(0x40); |
56 | msb = inb (0x40); | 58 | msb = inb(0x40); |
57 | ct1 = read_c0_count(); | 59 | ct1 = read_c0_count(); |
58 | } while (msb); | 60 | } while (msb); |
59 | 61 | ||
60 | /* Stop the counter. */ | 62 | /* Stop the counter. */ |
61 | outb (0x38, 0x43); | 63 | outb(0x38, 0x43); |
62 | /* | 64 | /* |
63 | * Return the difference, this is how far the r4k counter increments | 65 | * Return the difference, this is how far the r4k counter increments |
64 | * for every 1/HZ seconds. We round off the nearest 1 MHz of master | 66 | * for every 1/HZ seconds. We round off the nearest 1 MHz of master |
@@ -71,7 +73,7 @@ static __init unsigned long dosample(void) | |||
71 | /* | 73 | /* |
72 | * Here we need to calibrate the cycle counter to at least be close. | 74 | * Here we need to calibrate the cycle counter to at least be close. |
73 | */ | 75 | */ |
74 | __init void sni_cpu_time_init(void) | 76 | void __init plat_time_init(void) |
75 | { | 77 | { |
76 | unsigned long r4k_ticks[3]; | 78 | unsigned long r4k_ticks[3]; |
77 | unsigned long r4k_tick; | 79 | unsigned long r4k_tick; |
@@ -115,6 +117,8 @@ __init void sni_cpu_time_init(void) | |||
115 | (int) (r4k_tick % (500000 / HZ))); | 117 | (int) (r4k_tick % (500000 / HZ))); |
116 | 118 | ||
117 | mips_hpt_frequency = r4k_tick * HZ; | 119 | mips_hpt_frequency = r4k_tick * HZ; |
120 | |||
121 | setup_pit_timer(); | ||
118 | } | 122 | } |
119 | 123 | ||
120 | /* | 124 | /* |
@@ -133,7 +137,7 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
133 | case SNI_BRD_10NEW: | 137 | case SNI_BRD_10NEW: |
134 | case SNI_BRD_TOWER_OASIC: | 138 | case SNI_BRD_TOWER_OASIC: |
135 | case SNI_BRD_MINITOWER: | 139 | case SNI_BRD_MINITOWER: |
136 | sni_a20r_timer_setup (irq); | 140 | sni_a20r_timer_setup(irq); |
137 | break; | 141 | break; |
138 | 142 | ||
139 | case SNI_BRD_PCI_TOWER: | 143 | case SNI_BRD_PCI_TOWER: |
@@ -142,7 +146,12 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
142 | case SNI_BRD_PCI_DESKTOP: | 146 | case SNI_BRD_PCI_DESKTOP: |
143 | case SNI_BRD_PCI_TOWER_CPLUS: | 147 | case SNI_BRD_PCI_TOWER_CPLUS: |
144 | case SNI_BRD_PCI_MTOWER_CPLUS: | 148 | case SNI_BRD_PCI_MTOWER_CPLUS: |
145 | sni_cpu_timer_setup (irq); | 149 | sni_cpu_timer_setup(irq); |
146 | break; | 150 | break; |
147 | } | 151 | } |
148 | } | 152 | } |
153 | |||
154 | unsigned long read_persistent_clock(void) | ||
155 | { | ||
156 | return -1; | ||
157 | } | ||