aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-10-23 11:21:27 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-10-31 15:13:23 -0500
commit16b7b2ac0148e839da86af8747b6fa4aad43a9b7 (patch)
tree93912ae2e9c64f71a8cca028677fd918b9edf0fa /Documentation
parent70e46f48cb5933119712ee27945309a4bfc98282 (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 'Documentation')
-rw-r--r--Documentation/mips/time.README39
1 files changed, 8 insertions, 31 deletions
diff --git a/Documentation/mips/time.README b/Documentation/mips/time.README
index e1304b6bc483..a4ce603ed3b3 100644
--- a/Documentation/mips/time.README
+++ b/Documentation/mips/time.README
@@ -38,19 +38,14 @@ The new time code provide the following services:
38 38
39 a) Implements functions required by Linux common code: 39 a) Implements functions required by Linux common code:
40 time_init 40 time_init
41 do_gettimeofday
42 do_settimeofday
43 41
44 b) provides an abstraction of RTC and null RTC implementation as default. 42 b) provides an abstraction of RTC and null RTC implementation as default.
45 extern unsigned long (*rtc_get_time)(void); 43 extern unsigned long (*rtc_get_time)(void);
46 extern int (*rtc_set_time)(unsigned long); 44 extern int (*rtc_set_time)(unsigned long);
47 45
48 c) a set of gettimeoffset functions for different CPUs and different 46 c) high-level and low-level timer interrupt routines where the timer
49 needs. 47 interrupt source may or may not be the CPU timer. The high-level
50 48 routine is dispatched through do_IRQ() while the low-level is
51 d) high-level and low-level timer interrupt routines where the timer
52 interrupt source may or may not be the CPU timer. The high-level
53 routine is dispatched through do_IRQ() while the low-level is
54 dispatched in assemably code (usually int-handler.S) 49 dispatched in assemably code (usually int-handler.S)
55 50
56 51
@@ -73,8 +68,7 @@ the following functions or values:
73 c) (optional) board-specific RTC routines. 68 c) (optional) board-specific RTC routines.
74 69
75 d) (optional) mips_hpt_frequency - It must be definied if the board 70 d) (optional) mips_hpt_frequency - It must be definied if the board
76 is using CPU counter for timer interrupt or it is using fixed rate 71 is using CPU counter for timer interrupt.
77 gettimeoffset().
78 72
79 73
80PORTING GUIDE 74PORTING GUIDE
@@ -89,16 +83,6 @@ Step 1: decide how you like to implement the time services.
89 If the answer is no, you need a timer to provide the timer interrupt 83 If the answer is no, you need a timer to provide the timer interrupt
90 at 100 HZ speed. 84 at 100 HZ speed.
91 85
92 You cannot use the fast gettimeoffset functions, i.e.,
93
94 unsigned long fixed_rate_gettimeoffset(void);
95 unsigned long calibrate_div32_gettimeoffset(void);
96 unsigned long calibrate_div64_gettimeoffset(void);
97
98 You can use null_gettimeoffset() will gives the same time resolution as
99 jiffy. Or you can implement your own gettimeoffset (probably based on
100 some ad hoc hardware on your machine.)
101
102 c) The following sub steps assume your CPU has counter register. 86 c) The following sub steps assume your CPU has counter register.
103 Do you plan to use the CPU counter register as the timer interrupt 87 Do you plan to use the CPU counter register as the timer interrupt
104 or use an exnternal timer? 88 or use an exnternal timer?
@@ -123,8 +107,8 @@ Step 3: implement rtc routines, board_time_init() and plat_timer_setup()
123 board_time_init() - 107 board_time_init() -
124 a) (optional) set up RTC routines, 108 a) (optional) set up RTC routines,
125 b) (optional) calibrate and set the mips_hpt_frequency 109 b) (optional) calibrate and set the mips_hpt_frequency
126 (only needed if you intended to use fixed_rate_gettimeoffset 110 (only needed if you intended to use cpu counter as timer interrupt
127 or use cpu counter as timer interrupt source) 111 source)
128 112
129 plat_timer_setup() - 113 plat_timer_setup() -
130 a) (optional) over-write any choices made above by time_init(). 114 a) (optional) over-write any choices made above by time_init().
@@ -154,8 +138,8 @@ for some of the functions in time.c.
154For example, you may define your own timer interrupt routine, which does 138For example, you may define your own timer interrupt routine, which does
155some of its own processing and then calls timer_interrupt(). 139some of its own processing and then calls timer_interrupt().
156 140
157You can also over-ride any of the built-in functions (gettimeoffset, 141You can also over-ride any of the built-in functions (RTC routines
158RTC routines and/or timer interrupt routine). 142and/or timer interrupt routine).
159 143
160 144
161PORTING NOTES FOR SMP 145PORTING NOTES FOR SMP
@@ -187,10 +171,3 @@ You need to decide on your timer interrupt sources.
187 171
188 You can also do the low-level version of those interrupt routines, 172 You can also do the low-level version of those interrupt routines,
189 following similar dispatching routes described above. 173 following similar dispatching routes described above.
190
191Note about do_gettimeoffset():
192
193 It is very likely the CPU counter registers are not sync'ed up in a SMP box.
194 Therefore you cannot really use the many of the existing routines that
195 are based on CPU counter. You should wirte your own gettimeoffset rouinte
196 if you want intra-jiffy resolution.