diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-10-23 11:21:27 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-10-31 15:13:23 -0500 |
commit | 16b7b2ac0148e839da86af8747b6fa4aad43a9b7 (patch) | |
tree | 93912ae2e9c64f71a8cca028677fd918b9edf0fa /arch/mips/sgi-ip27/ip27-timer.c | |
parent | 70e46f48cb5933119712ee27945309a4bfc98282 (diff) |
[MIPS] Fixup migration to GENERIC_TIME
Since we already moved to GENERIC_TIME, we should implement alternatives
of old do_gettimeoffset routines to get sub-jiffies resolution from
gettimeofday(). This patch includes:
* MIPS clocksource support (based on works by Manish Lachwani).
* remove unused gettimeoffset routines and related codes.
* remove unised 64bit do_div64_32().
* simplify mips_hpt_init. (no argument needed, __init tag)
* simplify c0_hpt_timer_init. (no need to write to c0_count)
* remove some hpt_init routines.
* mips_hpt_mask variable to specify bitmask of hpt value.
* convert jmr3927_do_gettimeoffset to jmr3927_hpt_read.
* convert ip27_do_gettimeoffset to ip27_hpt_read.
* convert bcm1480_do_gettimeoffset to bcm1480_hpt_read.
* simplify sb1250 hpt functions. (no need to subtract and shift)
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sgi-ip27/ip27-timer.c')
-rw-r--r-- | arch/mips/sgi-ip27/ip27-timer.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 4e870fc4469b..c965705f3427 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c | |||
@@ -134,13 +134,6 @@ again: | |||
134 | irq_exit(); | 134 | irq_exit(); |
135 | } | 135 | } |
136 | 136 | ||
137 | unsigned long ip27_do_gettimeoffset(void) | ||
138 | { | ||
139 | unsigned long ct_cur1; | ||
140 | ct_cur1 = REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT) + CYCLES_PER_JIFFY; | ||
141 | return (ct_cur1 - ct_cur[0]) * NSEC_PER_CYCLE / 1000; | ||
142 | } | ||
143 | |||
144 | /* Includes for ioc3_init(). */ | 137 | /* Includes for ioc3_init(). */ |
145 | #include <asm/sn/types.h> | 138 | #include <asm/sn/types.h> |
146 | #include <asm/sn/sn0/addrs.h> | 139 | #include <asm/sn/sn0/addrs.h> |
@@ -248,12 +241,17 @@ void __init plat_timer_setup(struct irqaction *irq) | |||
248 | setup_irq(irqno, &rt_irqaction); | 241 | setup_irq(irqno, &rt_irqaction); |
249 | } | 242 | } |
250 | 243 | ||
244 | static unsigned int ip27_hpt_read(void) | ||
245 | { | ||
246 | return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT); | ||
247 | } | ||
248 | |||
251 | void __init ip27_time_init(void) | 249 | void __init ip27_time_init(void) |
252 | { | 250 | { |
251 | mips_hpt_read = ip27_hpt_read; | ||
252 | mips_hpt_frequency = CYCLES_PER_SEC; | ||
253 | xtime.tv_sec = get_m48t35_time(); | 253 | xtime.tv_sec = get_m48t35_time(); |
254 | xtime.tv_nsec = 0; | 254 | xtime.tv_nsec = 0; |
255 | |||
256 | do_gettimeoffset = ip27_do_gettimeoffset; | ||
257 | } | 255 | } |
258 | 256 | ||
259 | void __init cpu_time_init(void) | 257 | void __init cpu_time_init(void) |