diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-10-29 10:23:43 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-29 15:35:36 -0400 |
commit | 38760d40ca61b18b2809e9c28df8b3ff9af8a02b (patch) | |
tree | dd65b99f1ae919498808506121a2b75217997713 /arch/mips/mips-boards/generic/time.c | |
parent | 1238d5d868a56dcbc743d3ffc9bd3c920258b4cb (diff) |
[MIPS] time: Replace plat_timer_setup with modern APIs.
plat_timer_setup is no longer getting called.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards/generic/time.c')
-rw-r--r-- | arch/mips/mips-boards/generic/time.c | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index 9d6243a8c15a..f02ce6308e51 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c | |||
@@ -127,26 +127,6 @@ unsigned long read_persistent_clock(void) | |||
127 | return mc146818_get_cmos_time(); | 127 | return mc146818_get_cmos_time(); |
128 | } | 128 | } |
129 | 129 | ||
130 | void __init plat_time_init(void) | ||
131 | { | ||
132 | unsigned int est_freq; | ||
133 | |||
134 | /* Set Data mode - binary. */ | ||
135 | CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); | ||
136 | |||
137 | est_freq = estimate_cpu_frequency(); | ||
138 | |||
139 | printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, | ||
140 | (est_freq%1000000)*100/1000000); | ||
141 | |||
142 | cpu_khz = est_freq / 1000; | ||
143 | |||
144 | mips_scroll_message(); | ||
145 | #ifdef CONFIG_I8253 /* Only Malta has a PIT */ | ||
146 | setup_pit_timer(); | ||
147 | #endif | ||
148 | } | ||
149 | |||
150 | void __init plat_perf_setup(void) | 130 | void __init plat_perf_setup(void) |
151 | { | 131 | { |
152 | cp0_perfcount_irq = -1; | 132 | cp0_perfcount_irq = -1; |
@@ -166,14 +146,13 @@ void __init plat_perf_setup(void) | |||
166 | } | 146 | } |
167 | } | 147 | } |
168 | 148 | ||
169 | void __init plat_timer_setup(struct irqaction *irq) | 149 | unsigned int __init get_c0_compare_int(void) |
170 | { | 150 | { |
171 | #ifdef MSC01E_INT_BASE | 151 | #ifdef MSC01E_INT_BASE |
172 | if (cpu_has_veic) { | 152 | if (cpu_has_veic) { |
173 | set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); | 153 | set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); |
174 | mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; | 154 | mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; |
175 | } | 155 | } else |
176 | else | ||
177 | #endif | 156 | #endif |
178 | { | 157 | { |
179 | if (cpu_has_vint) | 158 | if (cpu_has_vint) |
@@ -181,13 +160,26 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
181 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; | 160 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; |
182 | } | 161 | } |
183 | 162 | ||
184 | #ifdef CONFIG_MIPS_MT_SMTC | 163 | return mips_cpu_timer_irq; |
185 | setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << cp0_compare_irq); | 164 | } |
186 | #else | 165 | |
187 | setup_irq(mips_cpu_timer_irq, irq); | 166 | void __init plat_time_init(void) |
188 | #endif /* CONFIG_MIPS_MT_SMTC */ | 167 | { |
189 | #ifdef CONFIG_SMP | 168 | unsigned int est_freq; |
190 | set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq); | 169 | |
170 | /* Set Data mode - binary. */ | ||
171 | CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); | ||
172 | |||
173 | est_freq = estimate_cpu_frequency(); | ||
174 | |||
175 | printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, | ||
176 | (est_freq%1000000)*100/1000000); | ||
177 | |||
178 | cpu_khz = est_freq / 1000; | ||
179 | |||
180 | mips_scroll_message(); | ||
181 | #ifdef CONFIG_I8253 /* Only Malta has a PIT */ | ||
182 | setup_pit_timer(); | ||
191 | #endif | 183 | #endif |
192 | 184 | ||
193 | plat_perf_setup(); | 185 | plat_perf_setup(); |