aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/amiga/config.c10
-rw-r--r--arch/m68k/apollo/config.c9
-rw-r--r--arch/m68k/atari/config.c4
-rw-r--r--arch/m68k/atari/time.c6
-rw-r--r--arch/m68k/bvme6000/config.c10
-rw-r--r--arch/m68k/hp300/config.c2
-rw-r--r--arch/m68k/hp300/time.c4
-rw-r--r--arch/m68k/hp300/time.h2
-rw-r--r--arch/m68k/include/asm/machdep.h2
-rw-r--r--arch/m68k/kernel/setup_mm.c1
-rw-r--r--arch/m68k/kernel/time.c15
-rw-r--r--arch/m68k/mac/config.c4
-rw-r--r--arch/m68k/mac/via.c4
-rw-r--r--arch/m68k/mvme147/config.c8
-rw-r--r--arch/m68k/mvme16x/config.c8
-rw-r--r--arch/m68k/q40/config.c8
-rw-r--r--arch/m68k/sun3/config.c4
-rw-r--r--arch/m68k/sun3/intersil.c4
-rw-r--r--arch/m68k/sun3x/config.c2
-rw-r--r--arch/m68k/sun3x/time.c2
-rw-r--r--arch/m68k/sun3x/time.h2
21 files changed, 52 insertions, 59 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index ee01b7a38e58..b819390e29cd 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler);
95static void amiga_get_model(char *model); 95static void amiga_get_model(char *model);
96static void amiga_get_hardware_list(struct seq_file *m); 96static void amiga_get_hardware_list(struct seq_file *m);
97/* amiga specific timer functions */ 97/* amiga specific timer functions */
98static unsigned long amiga_gettimeoffset(void); 98static u32 amiga_gettimeoffset(void);
99extern void amiga_mksound(unsigned int count, unsigned int ticks); 99extern void amiga_mksound(unsigned int count, unsigned int ticks);
100static void amiga_reset(void); 100static void amiga_reset(void);
101extern void amiga_init_sound(void); 101extern void amiga_init_sound(void);
@@ -377,7 +377,7 @@ void __init config_amiga(void)
377 mach_init_IRQ = amiga_init_IRQ; 377 mach_init_IRQ = amiga_init_IRQ;
378 mach_get_model = amiga_get_model; 378 mach_get_model = amiga_get_model;
379 mach_get_hardware_list = amiga_get_hardware_list; 379 mach_get_hardware_list = amiga_get_hardware_list;
380 mach_gettimeoffset = amiga_gettimeoffset; 380 arch_gettimeoffset = amiga_gettimeoffset;
381 381
382 /* 382 /*
383 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI 383 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
@@ -482,10 +482,10 @@ static void __init amiga_sched_init(irq_handler_t timer_routine)
482#define TICK_SIZE 10000 482#define TICK_SIZE 10000
483 483
484/* This is always executed with interrupts disabled. */ 484/* This is always executed with interrupts disabled. */
485static unsigned long amiga_gettimeoffset(void) 485static u32 amiga_gettimeoffset(void)
486{ 486{
487 unsigned short hi, lo, hi2; 487 unsigned short hi, lo, hi2;
488 unsigned long ticks, offset = 0; 488 u32 ticks, offset = 0;
489 489
490 /* read CIA B timer A current value */ 490 /* read CIA B timer A current value */
491 hi = ciab.tahi; 491 hi = ciab.tahi;
@@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void)
507 ticks = jiffy_ticks - ticks; 507 ticks = jiffy_ticks - ticks;
508 ticks = (10000 * ticks) / jiffy_ticks; 508 ticks = (10000 * ticks) / jiffy_ticks;
509 509
510 return ticks + offset; 510 return (ticks + offset) * 1000;
511} 511}
512 512
513static void amiga_reset(void) __noreturn; 513static void amiga_reset(void) __noreturn;
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index f5565d6eeb8e..3ea56b90e718 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -26,7 +26,7 @@ u_long apollo_model;
26 26
27extern void dn_sched_init(irq_handler_t handler); 27extern void dn_sched_init(irq_handler_t handler);
28extern void dn_init_IRQ(void); 28extern void dn_init_IRQ(void);
29extern unsigned long dn_gettimeoffset(void); 29extern u32 dn_gettimeoffset(void);
30extern int dn_dummy_hwclk(int, struct rtc_time *); 30extern int dn_dummy_hwclk(int, struct rtc_time *);
31extern int dn_dummy_set_clock_mmss(unsigned long); 31extern int dn_dummy_set_clock_mmss(unsigned long);
32extern void dn_dummy_reset(void); 32extern void dn_dummy_reset(void);
@@ -151,7 +151,7 @@ void __init config_apollo(void)
151 151
152 mach_sched_init=dn_sched_init; /* */ 152 mach_sched_init=dn_sched_init; /* */
153 mach_init_IRQ=dn_init_IRQ; 153 mach_init_IRQ=dn_init_IRQ;
154 mach_gettimeoffset = dn_gettimeoffset; 154 arch_gettimeoffset = dn_gettimeoffset;
155 mach_max_dma_address = 0xffffffff; 155 mach_max_dma_address = 0xffffffff;
156 mach_hwclk = dn_dummy_hwclk; /* */ 156 mach_hwclk = dn_dummy_hwclk; /* */
157 mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ 157 mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */
@@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine)
203 pr_err("Couldn't register timer interrupt\n"); 203 pr_err("Couldn't register timer interrupt\n");
204} 204}
205 205
206unsigned long dn_gettimeoffset(void) { 206u32 dn_gettimeoffset(void)
207 207{
208 return 0xdeadbeef; 208 return 0xdeadbeef;
209
210} 209}
211 210
212int dn_dummy_hwclk(int op, struct rtc_time *t) { 211int dn_dummy_hwclk(int op, struct rtc_time *t) {
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index d8eb32747ac5..037c11c99331 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -74,7 +74,7 @@ static void atari_heartbeat(int on);
74 74
75/* atari specific timer functions (in time.c) */ 75/* atari specific timer functions (in time.c) */
76extern void atari_sched_init(irq_handler_t); 76extern void atari_sched_init(irq_handler_t);
77extern unsigned long atari_gettimeoffset (void); 77extern u32 atari_gettimeoffset(void);
78extern int atari_mste_hwclk (int, struct rtc_time *); 78extern int atari_mste_hwclk (int, struct rtc_time *);
79extern int atari_tt_hwclk (int, struct rtc_time *); 79extern int atari_tt_hwclk (int, struct rtc_time *);
80extern int atari_mste_set_clock_mmss (unsigned long); 80extern int atari_mste_set_clock_mmss (unsigned long);
@@ -204,7 +204,7 @@ void __init config_atari(void)
204 mach_init_IRQ = atari_init_IRQ; 204 mach_init_IRQ = atari_init_IRQ;
205 mach_get_model = atari_get_model; 205 mach_get_model = atari_get_model;
206 mach_get_hardware_list = atari_get_hardware_list; 206 mach_get_hardware_list = atari_get_hardware_list;
207 mach_gettimeoffset = atari_gettimeoffset; 207 arch_gettimeoffset = atari_gettimeoffset;
208 mach_reset = atari_reset; 208 mach_reset = atari_reset;
209 mach_max_dma_address = 0xffffff; 209 mach_max_dma_address = 0xffffff;
210#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) 210#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index c0cc68a2c829..da8f981c36d6 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine)
42#define TICK_SIZE 10000 42#define TICK_SIZE 10000
43 43
44/* This is always executed with interrupts disabled. */ 44/* This is always executed with interrupts disabled. */
45unsigned long atari_gettimeoffset (void) 45u32 atari_gettimeoffset(void)
46{ 46{
47 unsigned long ticks, offset = 0; 47 u32 ticks, offset = 0;
48 48
49 /* read MFP timer C current value */ 49 /* read MFP timer C current value */
50 ticks = st_mfp.tim_dt_c; 50 ticks = st_mfp.tim_dt_c;
@@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void)
57 ticks = INT_TICKS - ticks; 57 ticks = INT_TICKS - ticks;
58 ticks = ticks * 10000L / INT_TICKS; 58 ticks = ticks * 10000L / INT_TICKS;
59 59
60 return ticks + offset; 60 return (ticks + offset) * 1000;
61} 61}
62 62
63 63
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 0bf850a20ea2..8943aa4c18e6 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -38,7 +38,7 @@
38 38
39static void bvme6000_get_model(char *model); 39static void bvme6000_get_model(char *model);
40extern void bvme6000_sched_init(irq_handler_t handler); 40extern void bvme6000_sched_init(irq_handler_t handler);
41extern unsigned long bvme6000_gettimeoffset (void); 41extern u32 bvme6000_gettimeoffset(void);
42extern int bvme6000_hwclk (int, struct rtc_time *); 42extern int bvme6000_hwclk (int, struct rtc_time *);
43extern int bvme6000_set_clock_mmss (unsigned long); 43extern int bvme6000_set_clock_mmss (unsigned long);
44extern void bvme6000_reset (void); 44extern void bvme6000_reset (void);
@@ -110,7 +110,7 @@ void __init config_bvme6000(void)
110 mach_max_dma_address = 0xffffffff; 110 mach_max_dma_address = 0xffffffff;
111 mach_sched_init = bvme6000_sched_init; 111 mach_sched_init = bvme6000_sched_init;
112 mach_init_IRQ = bvme6000_init_IRQ; 112 mach_init_IRQ = bvme6000_init_IRQ;
113 mach_gettimeoffset = bvme6000_gettimeoffset; 113 arch_gettimeoffset = bvme6000_gettimeoffset;
114 mach_hwclk = bvme6000_hwclk; 114 mach_hwclk = bvme6000_hwclk;
115 mach_set_clock_mmss = bvme6000_set_clock_mmss; 115 mach_set_clock_mmss = bvme6000_set_clock_mmss;
116 mach_reset = bvme6000_reset; 116 mach_reset = bvme6000_reset;
@@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine)
216 * results... 216 * results...
217 */ 217 */
218 218
219unsigned long bvme6000_gettimeoffset (void) 219u32 bvme6000_gettimeoffset(void)
220{ 220{
221 volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; 221 volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
222 volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; 222 volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
223 unsigned char msr = rtc->msr & 0xc0; 223 unsigned char msr = rtc->msr & 0xc0;
224 unsigned char t1int, t1op; 224 unsigned char t1int, t1op;
225 unsigned long v = 800000, ov; 225 u32 v = 800000, ov;
226 226
227 rtc->msr = 0; /* Ensure timer registers accessible */ 227 rtc->msr = 0; /* Ensure timer registers accessible */
228 228
@@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void)
246 v += 10000; /* Int pending, + 10ms */ 246 v += 10000; /* Int pending, + 10ms */
247 rtc->msr = msr; 247 rtc->msr = msr;
248 248
249 return v; 249 return v * 1000;
250} 250}
251 251
252/* 252/*
diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c
index bf16af1edacf..b7609f791522 100644
--- a/arch/m68k/hp300/config.c
+++ b/arch/m68k/hp300/config.c
@@ -251,7 +251,7 @@ void __init config_hp300(void)
251 mach_sched_init = hp300_sched_init; 251 mach_sched_init = hp300_sched_init;
252 mach_init_IRQ = hp300_init_IRQ; 252 mach_init_IRQ = hp300_init_IRQ;
253 mach_get_model = hp300_get_model; 253 mach_get_model = hp300_get_model;
254 mach_gettimeoffset = hp300_gettimeoffset; 254 arch_gettimeoffset = hp300_gettimeoffset;
255 mach_hwclk = hp300_hwclk; 255 mach_hwclk = hp300_hwclk;
256 mach_get_ss = hp300_get_ss; 256 mach_get_ss = hp300_get_ss;
257 mach_reset = hp300_reset; 257 mach_reset = hp300_reset;
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c
index 29a71be9fa5b..749543b425a4 100644
--- a/arch/m68k/hp300/time.c
+++ b/arch/m68k/hp300/time.c
@@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id)
46 return vector(irq, NULL); 46 return vector(irq, NULL);
47} 47}
48 48
49unsigned long hp300_gettimeoffset(void) 49u32 hp300_gettimeoffset(void)
50{ 50{
51 /* Read current timer 1 value */ 51 /* Read current timer 1 value */
52 unsigned char lsb, msb1, msb2; 52 unsigned char lsb, msb1, msb2;
@@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void)
59 /* A carry happened while we were reading. Read it again */ 59 /* A carry happened while we were reading. Read it again */
60 lsb = in_8(CLOCKBASE + 7); 60 lsb = in_8(CLOCKBASE + 7);
61 ticks = INTVAL - ((msb2 << 8) | lsb); 61 ticks = INTVAL - ((msb2 << 8) | lsb);
62 return (USECS_PER_JIFFY * ticks) / INTVAL; 62 return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000;
63} 63}
64 64
65void __init hp300_sched_init(irq_handler_t vector) 65void __init hp300_sched_init(irq_handler_t vector)
diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h
index 7b98242960de..f5583ec4033d 100644
--- a/arch/m68k/hp300/time.h
+++ b/arch/m68k/hp300/time.h
@@ -1,2 +1,2 @@
1extern void hp300_sched_init(irq_handler_t vector); 1extern void hp300_sched_init(irq_handler_t vector);
2extern unsigned long hp300_gettimeoffset(void); 2extern u32 hp300_gettimeoffset(void);
diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h
index 825c1c813196..953ca21da8ee 100644
--- a/arch/m68k/include/asm/machdep.h
+++ b/arch/m68k/include/asm/machdep.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/seq_file.h> 4#include <linux/seq_file.h>
5#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/time.h>
6 7
7struct pt_regs; 8struct pt_regs;
8struct mktime; 9struct mktime;
@@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void);
16extern void (*mach_get_model) (char *model); 17extern void (*mach_get_model) (char *model);
17extern void (*mach_get_hardware_list) (struct seq_file *m); 18extern void (*mach_get_hardware_list) (struct seq_file *m);
18/* machine dependent timer functions */ 19/* machine dependent timer functions */
19extern unsigned long (*mach_gettimeoffset)(void);
20extern int (*mach_hwclk)(int, struct rtc_time*); 20extern int (*mach_hwclk)(int, struct rtc_time*);
21extern unsigned int (*mach_get_ss)(void); 21extern unsigned int (*mach_get_ss)(void);
22extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); 22extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index d872ce4807c9..80cfbe56ea32 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL;
84void (*mach_get_model) (char *model); 84void (*mach_get_model) (char *model);
85void (*mach_get_hardware_list) (struct seq_file *m); 85void (*mach_get_hardware_list) (struct seq_file *m);
86/* machine dependent timer functions */ 86/* machine dependent timer functions */
87unsigned long (*mach_gettimeoffset) (void);
88int (*mach_hwclk) (int, struct rtc_time*); 87int (*mach_hwclk) (int, struct rtc_time*);
89EXPORT_SYMBOL(mach_hwclk); 88EXPORT_SYMBOL(mach_hwclk);
90int (*mach_set_clock_mmss) (unsigned long); 89int (*mach_set_clock_mmss) (unsigned long);
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 5d0bcaad2e55..bea6bcf8f9b8 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -80,18 +80,8 @@ void read_persistent_clock(struct timespec *ts)
80 } 80 }
81} 81}
82 82
83void __init time_init(void)
84{
85 mach_sched_init(timer_interrupt);
86}
87
88#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET 83#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
89 84
90u32 arch_gettimeoffset(void)
91{
92 return mach_gettimeoffset() * 1000;
93}
94
95static int __init rtc_init(void) 85static int __init rtc_init(void)
96{ 86{
97 struct platform_device *pdev; 87 struct platform_device *pdev;
@@ -106,3 +96,8 @@ static int __init rtc_init(void)
106module_init(rtc_init); 96module_init(rtc_init);
107 97
108#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ 98#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
99
100void __init time_init(void)
101{
102 mach_sched_init(timer_interrupt);
103}
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index d9f62e0f46c0..afb95d5fb26b 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -52,7 +52,7 @@ struct mac_booter_data mac_bi_data;
52static unsigned long mac_orig_videoaddr; 52static unsigned long mac_orig_videoaddr;
53 53
54/* Mac specific timer functions */ 54/* Mac specific timer functions */
55extern unsigned long mac_gettimeoffset(void); 55extern u32 mac_gettimeoffset(void);
56extern int mac_hwclk(int, struct rtc_time *); 56extern int mac_hwclk(int, struct rtc_time *);
57extern int mac_set_clock_mmss(unsigned long); 57extern int mac_set_clock_mmss(unsigned long);
58extern void iop_preinit(void); 58extern void iop_preinit(void);
@@ -177,7 +177,7 @@ void __init config_mac(void)
177 mach_sched_init = mac_sched_init; 177 mach_sched_init = mac_sched_init;
178 mach_init_IRQ = mac_init_IRQ; 178 mach_init_IRQ = mac_init_IRQ;
179 mach_get_model = mac_get_model; 179 mach_get_model = mac_get_model;
180 mach_gettimeoffset = mac_gettimeoffset; 180 arch_gettimeoffset = mac_gettimeoffset;
181 mach_hwclk = mac_hwclk; 181 mach_hwclk = mac_hwclk;
182 mach_set_clock_mmss = mac_set_clock_mmss; 182 mach_set_clock_mmss = mac_set_clock_mmss;
183 mach_reset = mac_reset; 183 mach_reset = mac_reset;
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 2d85662715fb..5d1458bb871b 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -327,7 +327,7 @@ void via_debug_dump(void)
327 * TBI: get time offset between scheduling timer ticks 327 * TBI: get time offset between scheduling timer ticks
328 */ 328 */
329 329
330unsigned long mac_gettimeoffset (void) 330u32 mac_gettimeoffset(void)
331{ 331{
332 unsigned long ticks, offset = 0; 332 unsigned long ticks, offset = 0;
333 333
@@ -341,7 +341,7 @@ unsigned long mac_gettimeoffset (void)
341 ticks = MAC_CLOCK_TICK - ticks; 341 ticks = MAC_CLOCK_TICK - ticks;
342 ticks = ticks * 10000L / MAC_CLOCK_TICK; 342 ticks = ticks * 10000L / MAC_CLOCK_TICK;
343 343
344 return ticks + offset; 344 return (ticks + offset) * 1000;
345} 345}
346 346
347/* 347/*
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index a41c09149e23..1c6262803b94 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -37,7 +37,7 @@
37 37
38static void mvme147_get_model(char *model); 38static void mvme147_get_model(char *model);
39extern void mvme147_sched_init(irq_handler_t handler); 39extern void mvme147_sched_init(irq_handler_t handler);
40extern unsigned long mvme147_gettimeoffset (void); 40extern u32 mvme147_gettimeoffset(void);
41extern int mvme147_hwclk (int, struct rtc_time *); 41extern int mvme147_hwclk (int, struct rtc_time *);
42extern int mvme147_set_clock_mmss (unsigned long); 42extern int mvme147_set_clock_mmss (unsigned long);
43extern void mvme147_reset (void); 43extern void mvme147_reset (void);
@@ -88,7 +88,7 @@ void __init config_mvme147(void)
88 mach_max_dma_address = 0x01000000; 88 mach_max_dma_address = 0x01000000;
89 mach_sched_init = mvme147_sched_init; 89 mach_sched_init = mvme147_sched_init;
90 mach_init_IRQ = mvme147_init_IRQ; 90 mach_init_IRQ = mvme147_init_IRQ;
91 mach_gettimeoffset = mvme147_gettimeoffset; 91 arch_gettimeoffset = mvme147_gettimeoffset;
92 mach_hwclk = mvme147_hwclk; 92 mach_hwclk = mvme147_hwclk;
93 mach_set_clock_mmss = mvme147_set_clock_mmss; 93 mach_set_clock_mmss = mvme147_set_clock_mmss;
94 mach_reset = mvme147_reset; 94 mach_reset = mvme147_reset;
@@ -127,7 +127,7 @@ void mvme147_sched_init (irq_handler_t timer_routine)
127 127
128/* This is always executed with interrupts disabled. */ 128/* This is always executed with interrupts disabled. */
129/* XXX There are race hazards in this code XXX */ 129/* XXX There are race hazards in this code XXX */
130unsigned long mvme147_gettimeoffset (void) 130u32 mvme147_gettimeoffset(void)
131{ 131{
132 volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; 132 volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012;
133 unsigned short n; 133 unsigned short n;
@@ -137,7 +137,7 @@ unsigned long mvme147_gettimeoffset (void)
137 n = *cp; 137 n = *cp;
138 138
139 n -= PCC_TIMER_PRELOAD; 139 n -= PCC_TIMER_PRELOAD;
140 return (unsigned long)n * 25 / 4; 140 return ((unsigned long)n * 25 / 4) * 1000;
141} 141}
142 142
143static int bcd2int (unsigned char b) 143static int bcd2int (unsigned char b)
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index b6d7d8a7a3dd..080a342458a1 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -43,7 +43,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
43 43
44static void mvme16x_get_model(char *model); 44static void mvme16x_get_model(char *model);
45extern void mvme16x_sched_init(irq_handler_t handler); 45extern void mvme16x_sched_init(irq_handler_t handler);
46extern unsigned long mvme16x_gettimeoffset (void); 46extern u32 mvme16x_gettimeoffset(void);
47extern int mvme16x_hwclk (int, struct rtc_time *); 47extern int mvme16x_hwclk (int, struct rtc_time *);
48extern int mvme16x_set_clock_mmss (unsigned long); 48extern int mvme16x_set_clock_mmss (unsigned long);
49extern void mvme16x_reset (void); 49extern void mvme16x_reset (void);
@@ -289,7 +289,7 @@ void __init config_mvme16x(void)
289 mach_max_dma_address = 0xffffffff; 289 mach_max_dma_address = 0xffffffff;
290 mach_sched_init = mvme16x_sched_init; 290 mach_sched_init = mvme16x_sched_init;
291 mach_init_IRQ = mvme16x_init_IRQ; 291 mach_init_IRQ = mvme16x_init_IRQ;
292 mach_gettimeoffset = mvme16x_gettimeoffset; 292 arch_gettimeoffset = mvme16x_gettimeoffset;
293 mach_hwclk = mvme16x_hwclk; 293 mach_hwclk = mvme16x_hwclk;
294 mach_set_clock_mmss = mvme16x_set_clock_mmss; 294 mach_set_clock_mmss = mvme16x_set_clock_mmss;
295 mach_reset = mvme16x_reset; 295 mach_reset = mvme16x_reset;
@@ -405,9 +405,9 @@ void mvme16x_sched_init (irq_handler_t timer_routine)
405 405
406 406
407/* This is always executed with interrupts disabled. */ 407/* This is always executed with interrupts disabled. */
408unsigned long mvme16x_gettimeoffset (void) 408u32 mvme16x_gettimeoffset(void)
409{ 409{
410 return (*(volatile unsigned long *)0xfff42008); 410 return (*(volatile u32 *)0xfff42008) * 1000;
411} 411}
412 412
413int bcd2int (unsigned char b) 413int bcd2int (unsigned char b)
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 1adb5b7b0d1a..658542b914fc 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -40,7 +40,7 @@ extern void q40_init_IRQ(void);
40static void q40_get_model(char *model); 40static void q40_get_model(char *model);
41extern void q40_sched_init(irq_handler_t handler); 41extern void q40_sched_init(irq_handler_t handler);
42 42
43static unsigned long q40_gettimeoffset(void); 43static u32 q40_gettimeoffset(void);
44static int q40_hwclk(int, struct rtc_time *); 44static int q40_hwclk(int, struct rtc_time *);
45static unsigned int q40_get_ss(void); 45static unsigned int q40_get_ss(void);
46static int q40_set_clock_mmss(unsigned long); 46static int q40_set_clock_mmss(unsigned long);
@@ -170,7 +170,7 @@ void __init config_q40(void)
170 mach_sched_init = q40_sched_init; 170 mach_sched_init = q40_sched_init;
171 171
172 mach_init_IRQ = q40_init_IRQ; 172 mach_init_IRQ = q40_init_IRQ;
173 mach_gettimeoffset = q40_gettimeoffset; 173 arch_gettimeoffset = q40_gettimeoffset;
174 mach_hwclk = q40_hwclk; 174 mach_hwclk = q40_hwclk;
175 mach_get_ss = q40_get_ss; 175 mach_get_ss = q40_get_ss;
176 mach_get_rtc_pll = q40_get_rtc_pll; 176 mach_get_rtc_pll = q40_get_rtc_pll;
@@ -204,9 +204,9 @@ int q40_parse_bootinfo(const struct bi_record *rec)
204} 204}
205 205
206 206
207static unsigned long q40_gettimeoffset(void) 207static u32 q40_gettimeoffset(void)
208{ 208{
209 return 5000 * (ql_ticks != 0); 209 return 5000 * (ql_ticks != 0) * 1000;
210} 210}
211 211
212 212
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 2ca25bd01a96..f59ec58083f8 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -36,7 +36,7 @@
36 36
37char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; 37char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
38 38
39extern unsigned long sun3_gettimeoffset(void); 39extern u32 sun3_gettimeoffset(void);
40static void sun3_sched_init(irq_handler_t handler); 40static void sun3_sched_init(irq_handler_t handler);
41extern void sun3_get_model (char* model); 41extern void sun3_get_model (char* model);
42extern int sun3_hwclk(int set, struct rtc_time *t); 42extern int sun3_hwclk(int set, struct rtc_time *t);
@@ -141,7 +141,7 @@ void __init config_sun3(void)
141 mach_sched_init = sun3_sched_init; 141 mach_sched_init = sun3_sched_init;
142 mach_init_IRQ = sun3_init_IRQ; 142 mach_init_IRQ = sun3_init_IRQ;
143 mach_reset = sun3_reboot; 143 mach_reset = sun3_reboot;
144 mach_gettimeoffset = sun3_gettimeoffset; 144 arch_gettimeoffset = sun3_gettimeoffset;
145 mach_get_model = sun3_get_model; 145 mach_get_model = sun3_get_model;
146 mach_hwclk = sun3_hwclk; 146 mach_hwclk = sun3_hwclk;
147 mach_halt = sun3_halt; 147 mach_halt = sun3_halt;
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c
index 94fe8016f1f0..889829e11f1d 100644
--- a/arch/m68k/sun3/intersil.c
+++ b/arch/m68k/sun3/intersil.c
@@ -23,9 +23,9 @@
23#define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) 23#define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
24 24
25/* does this need to be implemented? */ 25/* does this need to be implemented? */
26unsigned long sun3_gettimeoffset(void) 26u32 sun3_gettimeoffset(void)
27{ 27{
28 return 1; 28 return 1000;
29} 29}
30 30
31 31
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index dd306c84d36d..0532d64d191e 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -48,7 +48,7 @@ void __init config_sun3x(void)
48 mach_sched_init = sun3x_sched_init; 48 mach_sched_init = sun3x_sched_init;
49 mach_init_IRQ = sun3_init_IRQ; 49 mach_init_IRQ = sun3_init_IRQ;
50 50
51 mach_gettimeoffset = sun3x_gettimeoffset; 51 arch_gettimeoffset = sun3x_gettimeoffset;
52 mach_reset = sun3x_reboot; 52 mach_reset = sun3x_reboot;
53 53
54 mach_hwclk = sun3x_hwclk; 54 mach_hwclk = sun3x_hwclk;
diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c
index 1d0a72480409..c8eb08add6b0 100644
--- a/arch/m68k/sun3x/time.c
+++ b/arch/m68k/sun3x/time.c
@@ -71,7 +71,7 @@ int sun3x_hwclk(int set, struct rtc_time *t)
71 return 0; 71 return 0;
72} 72}
73/* Not much we can do here */ 73/* Not much we can do here */
74unsigned long sun3x_gettimeoffset (void) 74u32 sun3x_gettimeoffset(void)
75{ 75{
76 return 0L; 76 return 0L;
77} 77}
diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h
index 6909e1297534..a4f9126be7e2 100644
--- a/arch/m68k/sun3x/time.h
+++ b/arch/m68k/sun3x/time.h
@@ -2,7 +2,7 @@
2#define SUN3X_TIME_H 2#define SUN3X_TIME_H
3 3
4extern int sun3x_hwclk(int set, struct rtc_time *t); 4extern int sun3x_hwclk(int set, struct rtc_time *t);
5unsigned long sun3x_gettimeoffset (void); 5u32 sun3x_gettimeoffset(void);
6void sun3x_sched_init(irq_handler_t vector); 6void sun3x_sched_init(irq_handler_t vector);
7 7
8struct mostek_dt { 8struct mostek_dt {