strip the kernel version suffix from target directories, except for brcm-2.4 (the...
[openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / time.c
1 /*
2  *  $Id$
3  *
4  *  ADM5120 specific hooks for MIPS CPU Counter/Compare timer
5  *
6  *  Copyright (C) 2007 OpenWrt.org
7  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8  *
9  *  This file was based on: arch/mips/gt64120/wrppmc/time.c
10  *      Original author: Mark.Zhan
11  *      Copyright (C) 1996, 1997, 2004 by Ralf Baechle
12  *      Copyright (C) 2006, Wind River System Inc.
13  *
14  *  This program is free software; you can redistribute it and/or
15  *  modify it under the terms of the GNU General Public License
16  *  as published by the Free Software Foundation; either version 2
17  *  of the License, or (at your option) any later version.
18  *
19  *  This program is distributed in the hope that it will be useful,
20  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *  GNU General Public License for more details.
23  *
24  *  You should have received a copy of the GNU General Public License
25  *  along with this program; if not, write to the
26  *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27  *  Boston, MA  02110-1301, USA.
28  *
29  */
30
31 #include <linux/types.h>
32 #include <linux/init.h>
33 #include <linux/interrupt.h>
34 #include <linux/timex.h>
35
36 #include <asm/irq.h>
37 #include <asm/cpu.h>
38 #include <asm/time.h>
39
40 #include <asm/mach-adm5120/adm5120_info.h>
41 #include <asm/mach-adm5120/adm5120_irq.h>
42
43 void __init adm5120_time_init(void)
44 {
45         mips_hpt_frequency = adm5120_speed / 2;
46 }
47
48 void __init plat_timer_setup(struct irqaction *irq)
49 {
50         clear_c0_status(ST0_BEV);
51
52         /* Install ISR for CPU Counter interrupt */
53         setup_irq(ADM5120_IRQ_COUNTER, irq);
54 }